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!
as chobibo said, Unit indexer gives your units a values from 0 to 8191(maybe higher, but you will never have 8000 units in one map). This is made to maximize speed, therefore use arrays. GetHandleId returns handleid of given handle. It is also unique, but for agents(unit is agent) the returned value starts at 0x100000(roughly 1.4 million). You cant use 1,400,000 inside array
GetHandleId returns pretty big value, 0x100000++ (for agents), thus you can not operate with arrays since thier max index value is 8191. Arrays are fast, we like to use them.
Indexer manages and assigns unique index for every unit on the map ranging from 1 to 8191. You can use that to your advantage in numerous ways. They also provide _INDEX/ _DEINDEX event adding more convenient enter/leave events.
Basically, you do not need UnitIndexer if you don't want to. Unique handle id for each unit allows you to create MUI spells and systems anyway. Although, to gain some efficiency, it's good to have one within a map.
Look in jass section or spell section for examples of why and how you can use UI to your advantage.
Thanks for asking this question Geshishouhu, it helped me a lot in understanding the purpose behind a UnitIndexer, and I was thinking of creating a similar thread too.
So the gist is that unit indexer gives a performance boost to code that requires MUI, if I understand correctly.
Thanks for asking this question Geshishouhu, it helped me a lot in understanding the purpose behind a UnitIndexer, and I was thinking of creating a similar thread too.
So the gist is that unit indexer gives a performance boost to code that requires MUI, if I understand correctly.
You are welcome, sethmachine.
I think your understanding is correct. With Unit Indexer it comes with performance boost and maybe more convenient coding.
You may also find this post helpful http://www.hiveworkshop.com/forums/...x-unit-indexer-248209/index6.html#post2562752 because there are so many Unit Indexers systems around. Credit goes to Bannar.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.