Main Menu
  • Welcome to The RPG Maker Resource Kit.

TypeError at Line 20 of Game_Switches [VX]

Started by RionKatt, March 26, 2011, 08:37:40 AM

0 Members and 1 Guest are viewing this topic.

RionKatt

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. :\

pacdiggity

#==============================================================================
# ** 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.
it's like a metaphor or something i don't know

RionKatt

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.

pacdiggity

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.
it's like a metaphor or something i don't know