• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 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!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗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 63
Joined
Jan 18, 2005
Messages
27,156
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