- Joined
- Feb 13, 2009
- Messages
- 388
I'd like to get a sample of good not-lagging trigger which redirects unit of a special type (i.e. with a custom value of X) to move-attack to the nearest human player unit.
I wonder how to make it effective, because triggering multiple units to attack random targets starts to lag my map when there's a lot of units (or I am being dumb making some leaking).
Anyway even an algorythm how to do it would be great.
The 1st question: I want units to attack-move to the position of the nearest player-unit (so they attack creeps in the way); will the position of a targeted unit be auto-updated so they follow the unit or do they attack-move to the position which the attacked unit occupied in the moment the order was set, and if the unit moves away they just come to an empty position?
The 2nd question: how to actually effectively check for the closest one which belongs to any of the human players when you determine the target?
Any suggestions are welcome.
I wonder how to make it effective, because triggering multiple units to attack random targets starts to lag my map when there's a lot of units (or I am being dumb making some leaking).
Anyway even an algorythm how to do it would be great.
The 1st question: I want units to attack-move to the position of the nearest player-unit (so they attack creeps in the way); will the position of a targeted unit be auto-updated so they follow the unit or do they attack-move to the position which the attacked unit occupied in the moment the order was set, and if the unit moves away they just come to an empty position?
The 2nd question: how to actually effectively check for the closest one which belongs to any of the human players when you determine the target?
Any suggestions are welcome.
Last edited: