• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[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 25
Joined
Sep 26, 2009
Messages
2,391
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