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!
How can I (in a periodic trigger) loop throught all unit's custom value (using a unit indexer) without costing too much performance ? I have a loop that goes throught 1 to 12, it's MPI and I want to make it MUI.
Which Unit indexer you use, bribes GUI Unit Indexer?
Edit: Bribes Unit Indexer saves used indexes in an double linked list, you might loop this linked list, not sure right now how to do.
I think UDexGen is the amount of generated indexes, hmm. might loop from 1 to udexgen or until you repeat first one.
Edit: LinkEDlists are not from - to
They are in worst case sperated indexes knowing the next/previous one, you can't simple move from first to last.
This should do the trick.
It Prints out the Unit Names, Index in the array, and its custom value.
Beaware that Bribes Unit indexer cleans off lost indexes only as soon 15 units entered the game.
Loop All Last to first
Ereignisse
Player - Player 1 (Rot) skips a cinematic sequence
Bedingungen
Aktionen
-------- This will enum the List starting with the lastest moving down to first --------
-------- Get Last --------
Set Current = UDexNext[0]
For each (Integer A) from 1 to UDexGen, do (Actions)
Schleifen - Aktionen
-------- Looped all? bribes list ends with 0 --------
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Current Equal 0
Then - Actions
Game - Display to (All players) for 30.00 seconds the text: -------------
Skip remaining actions
Else - Actions
-------- Print current Unit/Index/Custom Value --------
-------- If a unit was Removed; Index and Custom Value are not equal --------
Game - Display to (All players) for 30.00 seconds the text: ((Name of UDexUnits[Current]) + (( - + ((String(Current)) + - )) + (String((Custom value of UDexUnits[Current])))))
-------- Get Next --------
Set Current = UDexNext[Current]
Loop All First to last
Ereignisse
Player - Player 1 (Rot) skips a cinematic sequence
Bedingungen
Aktionen
-------- This will enum the units from first to Last index --------
-------- Get First and take allways prev in this trigger to find further units --------
Set Current = UDexPrev[0]
For each (Integer A) from 1 to UDexGen, do (Actions)
Schleifen - Aktionen
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Current Equal 0
Then - Actions
Game - Display to (All players) for 30.00 seconds the text: -------------
Skip remaining actions
Else - Actions
Game - Display to (All players) for 30.00 seconds the text: ((Name of UDexUnits[Current]) + (( - + ((String(Current)) + - )) + (String((Custom value of UDexUnits[Current])))))
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.