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

Unit Indexers questios :S

Status
Not open for further replies.
Level 6
Joined
Jul 26, 2010
Messages
167
Duo to they are confusing I got to ask some stuff....

1. They replace the hashes? (I mean a way to use the same trigger for different units at the same time)

2. HOW THE HELL I USE THEM? (They are filled with lots of code a vars and that confuse me)

3. Whats the best one I can use?

4. if I've created hashables to use my triggered spells or give diferent orders for my units at the same time, I need to erase them to apply the indexer on them?

5(optional xD). If ure very kind, could you pls upload a map that makes two units move to diferent ways continuosly with the indexer?
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
1) not sure what u mean by replace the hashes ? unless u mean how to use them in the hashtable. u need to use there custom value instead of there Key when saving to a hashtable.

2)the GUI one by bribe uses there custom value. so to use it in an array or hashtable u use there custom value.

3) the best for GUI is the one Bribe made ( i believe)

4) umm not really sure what u mean. if u have old hashtables tho u will have to edit them all to use the indexer but if they are working already and u use key of the unit then u dont need to do this.

5) sry i never use the unit indexer i always index my spells manually.

in my tutorial there is a chapter that can help u with indexing. it is more efficient than hashtables and IMO easier to do.

http://www.hiveworkshop.com/forums/tutorial-submission-283/things-gui-user-should-know-233242/
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Indexers accomplish three things

#1: They can detect whenever a unit is made
#2: They can detect whenever a unit is removed or decays
#3: They assign each unit an index between 1 and 8191. Those ids can be used in arrays, so no hashtables required. They make use of unit user data, so they are faster than GetHandleId too.

The best one for GUI atm is Bribe's I believe. The best one for vJASS is mine.
 
Status
Not open for further replies.
Top