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

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 38
Chronically Spontaneous
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 for Error details:
The Error:
Quote
Script 'Game Interpreter' line 750: NoMethodError occurred.
undefined method '[]' for nil:NilClass

The line referenced:
Code: [Select]
    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:
Code: [Select]
@>Control Variables: [0015: Milk Possessed] = [Milk] in Inventory

Spoiler for 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

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

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

*
i am satin die lol
Rep:
Level 96
welcom to hel
GIAW 14: 2nd Place (Hard Mode)2013 Biggest Drama Whore2013 Zero to HeroParticipant - GIAW 11Secret Santa 2013 ParticipantFor taking arms in the name of your breakfast.
Do you get the error when you try to store the variable, or when you try to pull it?

**
Rep: +0/-0Level 38
Chronically Spontaneous
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 for Current Project:
Chrononauts V: The Time Between Moments
[Working Title]
The first and final game in the epic Chrononauts series

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

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

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