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

Order units surrounding unit to move outward?

Status
Not open for further replies.
Level 8
Joined
Jul 17, 2004
Messages
283
So for example, there are 6 units surrounding a unit inside a circle. Unit in the middle casts spell, make surrounding units move outward. Can this be done with Polar Offset? How can I do this?
 
You want them order to move outwards?

PickUnits in range...
Get angle between point of picked unit and point of caster. (angle ; real)
Unit - Order PickedUnit "move" to Position of Picked Unit with Offset of <distance> towards <angle>

I'm not sure you want this. Maybe you want them to be knocked back. Then you should look for a knockback system.
 
Level 8
Joined
Jul 17, 2004
Messages
283
It's not so easy, because the units need to move outward. I don't want them to move toward the unit in center. And no to knockback, just want to order them to move there. How can I do this, more specifically?

Your method is fine, but the angle needs to be specified.
 
Level 29
Joined
Oct 24, 2012
Messages
6,543
Your method is fine, but the angle needs to be specified.

In Iceman's above example the angle is not specified. The distance is specified.

The above example by iceman will work exactly for what you want. It will move each unit in range around the unit to a point a set distance away from the center unit.

Also note that the angle should be angle between caster and picked unit - 180.
That will cause the units to move directly away from the casting unit.
 
Status
Not open for further replies.
Top