• 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!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

How to get dummys to move towards the closest enemy

Status
Not open for further replies.
Level 5
Joined
Nov 14, 2007
Messages
161
i have some units out with locust ability on them and owned by a player. when the player casts a skill, i need these units to start moving from where they are toward the closest enemy. Then after 20 seconds, just to stand still again. jass would probably work better for me and the problem im getting, is figuring out which enemy is the closest to the units.

im guessing pick each unit in range then check really quick which is the closest unit by distance, and save that location then order the unit to move to that location, but my jass is of limited knowledge and im not sure how to efficiently code that.

any help would be great
YO_MA_MA
 
Status
Not open for further replies.
Top