- Joined
- Aug 13, 2007
- Messages
- 309
Is it better to add/remove units to a unitgroup then to create and clear a unitgroup over and over?
Which is more efficient / less laggy?
EDIT: I have another question I thought I might as well ask... what function do you use to get the nearest unit within a certain range of a unit? If someone could make an example trigger that would help .
Which is more efficient / less laggy?
-
Hunger
-
Events
- Time - Every 2.00 seconds of game time
- Conditions
-
Actions
- Set HungerGroup = (Units in (Playable map area) matching ((((Matching unit) is A Hero) Equal to True) and (((Picked unit) has buff Sound asleep ) Equal to False)))
-
Unit Group - Pick every unit in HungerGroup and do (Actions)
-
Loop - Actions
- Unit - Set mana of (Picked unit) to ((Mana of (Picked unit)) - 1.00)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Mana of (Picked unit)) Less than or equal to 0.00
-
Then - Actions
- Unit - Set life of (Picked unit) to ((Life of (Picked unit)) - 5.00)
- If ((Life of (Picked unit)) Less than or equal to 15.00) then do (Cinematic - Ping minimap for (All players matching ((Matching player) Equal to (Owner of (Picked unit)))) at (Position of (Picked unit)) for 1.50 seconds, using a Warning ping of color (100.00%, 30.00%, 20.00%)) else do (Do nothing)
-
Else - Actions
- Do nothing
-
If - Conditions
-
Loop - Actions
- Custom script: call DestroyGroup(udg_HungerGroup)
-
Events
EDIT: I have another question I thought I might as well ask... what function do you use to get the nearest unit within a certain range of a unit? If someone could make an example trigger that would help .
Last edited: