RMRK is retiring.
Server is paid up for the rest of 2026, but the forum may go after that. See here for more information. Please archive or save anything you would like to keep before 2027.
Main Menu

[VX] Getting an error when setting an item-based variable

Started by Space, August 26, 2013, 05:26:29 PM

0 Members and 1 Guest are viewing this topic.

Space

I have an event that's supposed to change depending on how much <item name>s the player has in his inventory and it's causing an error in one of the main scripts.
I'm getting it no matter what I set the item to, whether it's an RTP item or a custom one.

[spoiler=Error details]
The Error:
QuoteScript 'Game Interpreter' line 750: NoMethodError occurred.
undefined method '[]' for nil:NilClass

The line referenced:
    when 3  # Item
      value = $game_party.item_number($data_items[@params[4]])
      actor = $game_actors[@parameters[1]]  #THIS ONE
      actor = $game_actors[@params[4]]



The event command causing the error:
@>Control Variables: [0015: Milk Possessed] = [Milk] in Inventory[/spoiler]

[spoiler=Scripts I'm using that affect items]
Jet's Percentage of Damage Snippet
KGC's Equipment Effects
Modern Algebra's Skill Teaching Equipment & Items
Modern Algebra's Cursed Equipment
KGC's Restored Combat Functions[/spoiler]

Any help solving this will be hugely appreciated :)
[spoiler=Current Project]
Chrononauts V: The Time Between Moments
[Working Title]
The first and final game in the epic Chrononauts series[/spoiler]

Survived the kraaken and weeaboos. No power at home. Back when I learn to fix the electricity.

&&&&&&&&&&&&&

Do you get the error when you try to store the variable, or when you try to pull it?
&&&&&&&&&&&&&&&&

Space

Storing it. I've tried an event that only has that one line in it, and it's giving me the same result D:
[spoiler=Current Project]
Chrononauts V: The Time Between Moments
[Working Title]
The first and final game in the epic Chrononauts series[/spoiler]

Survived the kraaken and weeaboos. No power at home. Back when I learn to fix the electricity.

Yeyinde

Replace that one line with "when 4".  The error is actually a bug with the default scripts in VX.  It should look like this:


    when 3  # Item
      value = $game_party.item_number($data_items[@params[4]])
    when 4  # Actor
      actor = $game_actors[@params[4]]