• 🏆 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!

[Trigger] A trigger to order spawned units to...

Status
Not open for further replies.
Level 12
Joined
Feb 13, 2009
Messages
386
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.
 
Last edited:
Status
Not open for further replies.
Top