• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

unit fly around point in a circle

Status
Not open for further replies.

007

007

Level 6
Joined
May 3, 2009
Messages
175
how can i make a unit flying around a point all the time?
 
Level 13
Joined
Jun 1, 2008
Messages
360
Is the unit a flying unit?
If so, you can use orders. First you have to store the center of the circle in a variable:
Set CircleCenter = ....
And you have to define the unit
Set CircleUnit = ....
And you need another variable so you know in the next trigger where the unit currently is in the circle.
Set CircleRadius = .... (e.g. 500 (real))
Set CircleIndex = 0
Set Anglespeed = 5 (5 degrees per timer intervall = 50 degrees per second)

Then make a trigger with event: time - periodic 0.1
actions:
Set CircleIndex = CircleIndex + 1
if CircleIndex>(360/Anglespeed) set CircleIndex = 0
Set Point1 = CircleCenter offset by CircleRadius with angle (Anglespeed*CircleIndex)
Order CircleUnit to move to Point1


edit: As GhostThruster mentioned u might prefer Unit - Move unit to Point1 in the last line, depending on how big the circle is.
If the radius is like 1000 or bigger you can leave it as it is to get a smooth movement without a faster timer.
If it is smaller use Move unit and set the timer to 0.03 or so.
 
Last edited:
It won't work. When you order that unit to move or something, it will keep going in circles. On top of that, it leaks, is not MUI, readable, and you should use Unit - Move Unit Instantly instead of Unit - Issue Order Targeting Point.
I doubt this can be made efficiently in GUI, but I know a vJASS person, Illidan(Evil)X with a map that uses that system. However, the map doesn't work for patch 1.24.
 
Level 13
Joined
Jun 1, 2008
Messages
360
Well then you need a second trigger turning the first one off.
I posted just the essential part.
And fixing leaks is a different problem, which I don't intend to regard every time.
You are right though, depending on what he wants to do move unit is probably the better/only way.
(But that's just a small modification in the trigger.)

I know it's not a model post. I just wanted to post the basic idea. He can figure out the rest on his own and if not ask again, that's better than copy&paste in my opinion.
 
Status
Not open for further replies.
Top