• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Snippet] Unit List

Then what is it used for? xD It seems just like a big group of units to me, but the only difference is that has order. (of ID's) And that it is ordered in a list. In big maps, this seems like it may grow concerns for the op-limit.

Unless I am still not following it, in which case I need an example to understand its purpose more. =P
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
oh, I made it for iterating through all indexed units in the map. When I made UnitRegen or w/e, I needed a way to iterate (actually, I made 2 scripts that needed iteration, so I abstracted the code to a separate resource).

I could add a group as well if you like. You might hit op limit if you loop over 6000 units 3x, lol, so yea, a group could be useful ^)^.
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
->Why is there a group for all units?

Multiple iterations

You should throw this into UnitIndexer because UnitIndexer already has a list for indexed units (the one that you appear to just "throw away" right after initialization).

I could make this an extension I guess, but that'd get so sloppy ;\. Oh well, give me a bit and I'll make it an extension library.

edit
Nah, the UnitIndexer list is optimized specifically for the adding to the list before game starts. Actually, nvm, give me a bit.

edit
updated
 
Using unit groups would be worse lol :p

ForGroup does the same thing that iteration does, but it's slower cause it has to create a new thread for each unit, run it, start the next thread, run it, etc..
Iteration is the same, but it doesn't have as much overhead as putting the units in a group and calling ForGroup.

Iteration = ForGroup() - (Overhead of function call + 1 thread per unit)
 
Top