- Joined
- Sep 27, 2011
- Messages
- 141
Is it possible to stop a unit from moving after it has traveled a certain distance from a point without ordering it to stop or moving it backward.
Custom script: call SetUnitPropWindow(*unit*, 0)
is the best way. If you set Movement Speed to 0, it will never allow your unit to go under you "Minimum Speed" you can change in the Gamplay Constants, however, UnitPropWindow = 0 works for what you want, and goes over the minimum movement speed, since it doesn't mess with Movement Speed, but with something else, I don't know what But prevents moving SetUnitX/Y
, which you do not find in GUI. These do not interrupt orders and such. Therefore it will look like your unit keeps running against an invisible wall.call SetUnitX(GetEnumUnit(), GetLocationX(udg_center) + udg_radius * Cos(Atan2(GetUnitY(GetEnumUnit()) - GetLocationY(udg_center), GetUnitX(GetEnumUnit()) - GetLocationX(udg_center))))
call SetUnitY(GetEnumUnit(), GetLocationY(udg_center) + udg_radius * Sin(Atan2(GetUnitY(GetEnumUnit()) - GetLocationY(udg_center), GetUnitX(GetEnumUnit()) - GetLocationX(udg_center))))