"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