• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

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