RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Script Error

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 84
Line 20 of Game_Switches

"Says: Type Error Occured
no implicit conversion from nil to interger"


Game Switches reads
Spoiler for:
#==============================================================================
# ** 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

I have never tampered with it.

The scripts I have in use:
Menu Bars
Menu Cursor
Ring Menu
Get Item window
Level up window
Message before Skill window
Equip item in battle

I deleted equip item in battle and tried again, but still got the same error so I put it back in. Help is greatly appreciated.

**
Rep:
Level 84
where are u when you get the error ?

**
Rep: +0/-0Level 84
I'll go into battle, and after the first round of action, the error pops up.

Or If I try to use a skill with my main character

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
That's a weird error. Did you copy it verbatim?

Also, it is likely a compatibility error or else an oversight in one of the scripts - if you can locate which script is causing the problem then I will look into it. To do that, try just adding scripts in to a new project one by one until the error occurs. Once it does, delete all the other scripts and repeat the process. If it is jsut the single script, the error will happen immediately, if it is compatibility, it will happen once you add in the other problem script. At that time, post links to the (or both of the) problem scripts and I will take a look and see if I can fix it.
« Last Edit: February 26, 2009, 06:08:50 AM by Modern Algebra »

**
Rep: +0/-0Level 84
Ok, ill get on that ASAP.

**
Rep: +0/-0Level 84
Ok, I made a new game and I copied all the scripts and everything worked fine. I changed the order around for the scripts and it worked perfectly.

Now from what I have observed, I only get the error when I try to use a skill that I have created with a battle animation I have created.


*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
And that error occurs no matter what scripts are in the project? It happens in a project with no custom scripts at all?

I guess you did copy it verbatim. Sorry about that; I think I expected a different error.

**
Rep: +0/-0Level 84
Now im getting another error, I think i'll just recreate the project and start from square 1, noting everything that I'm doing and seeing where the error occurs.