• 🏆 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!

Index of a sold unit from shop

Status
Not open for further replies.
Level 13
Joined
Mar 19, 2010
Messages
870
Hi hivers,

i have a shop where you can buy units and i want to know the index of the slot in the shop.

Ex:

A Shop with 10 Units. You buy the 3 one. So the index would be 2. Is there a function or workaround to get the index of a sold unit???

Reg.
 
Level 13
Joined
Mar 19, 2010
Messages
870
Do you know "arrays" ? An array starts with the index 0....
So if you pick something like a unit on the first position...it's position ONE for you but in the background the data is saved mb in an array and the first position is there the 0.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Sadly WC3 does not allow you to look up command card positions of various orders. This is possible in SC2 thanks to catalog natives.

The only implementation possible in WC3 is if you map the command card positions of each unit for each shop into some kind of data system. For example a hashtable where the parent index is the shop and the child index is the unit type and store the command card position in form of an integer range 0 to 11.
 
Status
Not open for further replies.
Top