• 🏆 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!
  • ✅ Time to vote for the top 3 models! The POLL for Hive's 6th HD Modeling Contest: Mechanical is now open! 📅 Poll close on July 16, 2024! 🔗 Cast your vote now!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

"Guarding" or setting a default position for a unit to stand

Status
Not open for further replies.
Level 14
Joined
Jul 26, 2008
Messages
1,009
I was wondering if there was an easy, simple way to make a unit return to a spot when it has deviated from said spot.

It crossed my mind that issuing an order like "guard" could possibly do it, but I have my doubts. I know there's a few things like SetUnitCreepGuard() which I kinda planned on using anyways.

So what's a good, recommended way of doing this? The units are used by a colored computer controlled player. The problem is that they will not return to their normal position after being issued an order created with a trigger for the illusion of AI
 
Level 3
Joined
Feb 23, 2010
Messages
73
you could always just make a dummy local x and y variable, and script it to return when its distance is greater than xxx. Besides that, all i know about guarding positions is that it is designated when a unit stops at a point, and you can define the distance it uses under gameplay constants. if you are using jass, then set a local real _xGuard and local real _yGuard. That way you can use other abilities to set a guard postition, and you can nullify the default guard system by setting the constant to 0.
 
Status
Not open for further replies.
Top