The RPG Maker Resource Kit

RMRK RPG Maker Creation => Requests => Script Request => Topic started by: RionKatt on March 26, 2011, 08:37:40 AM

Title: TypeError at Line 20 of Game_Switches [VX]
Post by: RionKatt on March 26, 2011, 08:37:40 AM
exactly like the topic says it. I have another copy of my game before this and it works fine. The said line is not messed with.

I don't know what to do as I'm not a scripter. :\
Title: Re: TypeError at Line 20 of Game_Switches [VX]
Post by: pacdiggity on March 26, 2011, 09:03:54 AM
#==============================================================================
# ** Game_Switches
#------------------------------------------------------------------------------
#  This class handles switches. It's a wrapper for the built-in class "Array."
# The instance of this class is referenced by $game_switches.
#==============================================================================

class Game_Switches
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    @data = []
  end
  #--------------------------------------------------------------------------
  # * Get Switch
  #     switch_id : switch ID
  #--------------------------------------------------------------------------
  def [](switch_id)
    if @data[switch_id] == nil
      return false
    else
      return @data[switch_id]
    end
  end
  #--------------------------------------------------------------------------
  # * Set Switch
  #     switch_id : switch ID
  #     value     : ON (true) / OFF (false)
  #--------------------------------------------------------------------------
  def []=(switch_id, value)
    if switch_id <= 5000
      @data[switch_id] = value
    end
  end
end
This is exactly what the script is ingame. Make sure that it is this, with absolutely nothing changed.
If it isn't that, you're doing it wrong.
Title: Re: TypeError at Line 20 of Game_Switches [VX]
Post by: RionKatt on March 30, 2011, 08:52:13 AM
Yeah, it was exactly like that. I found out what was the problem. It was bulletxt's Autosave.

So I decided that my game will be without autosave.
Title: Re: TypeError at Line 20 of Game_Switches [VX]
Post by: pacdiggity on March 30, 2011, 09:48:37 AM
It doesn't need to be. What scripts are you using? The scripts could be made compatible. I need to test my scripting anyway.
If you want to keep autosave, post the script and say what other scripts you use, if any. If you don't care, don't.