• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] Inventory System problem! Help me pls. >.<

Status
Not open for further replies.
Level 1
Joined
May 23, 2013
Messages
4
Help, help me! I'm having trouble with the trigger ''ItemPickup'' this system: http://www.hiveworkshop.com/forums/...6/?prev=search=system%20inventory&d=list&r=20

The error is in the image below:

socorro.png


someone help me please. x.x
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
that line seems to be custom code. If that is the case, the index number of "ItemRing" has to be integer, not a dynamic value (in your case variable)
To elaborate, it has to be
  • Custom script: set udg_IconType = udg_ItemRing[1]
This will work, because index is an integer number

  • Custom script: set udg_IconType = udg_ItemRing[IntegerA]
this will not work, because IntegerA is not definite number - it has dynamic value

also put the picture in [ hidden ] [ /hidden ] tags
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
that line seems to be custom code. If that is the case, the index number of "ItemRing" has to be integer, not a dynamic value (in your case variable)
That is not true: indices of variables can always be a variable.
Besides, that custom script is the only language Warcraft knows (GUI automatically converts to it when saving).

This error ("Expected array index") occurs because the variable "IconType" has an array in the variable editor, yet the script does not use an array.
To fix this, go to the variable editor, find "IconType" and disable its array. This may mess up any GUI-triggers. Be ready for that :p.
 
Level 1
Joined
May 23, 2013
Messages
4
Thank ap0calypse, the problem was the same. I had a lot of variable to create an array and just putting it unintentionally ...

Very Thank!! \o/
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Oh, in that case: go to File (upper-left corner of the world editor) --> Preferences.
In that screen, enable "Automatically create unknown variables while pasting trigger data".

If that is enabled, variables will be automatically created when copy/pasting triggers (there are some rare exceptions, but don't mind those).
 
Status
Not open for further replies.
Top