• 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 Walk in Circles

Status
Not open for further replies.
Level 3
Joined
Apr 7, 2012
Messages
25
This is the trigger I found over the internet someone did, if someone could break down this trigger step by step in detail how to recreate it or show me a much better one it would be most thankful.

circlewalking
events
time - Every 0.5 seconds of game time
conditions
actions
unit - Order YourUnit to move to middleOfCircle offset by RadiusOfCircle towards TempReal degrees)
Set TempReal = (TempReal + 1.00)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
'IF'-conditions
TempReal greater than 360.00
'THEN'-actions
Set TempReal = (TempReal mod 360.00)
'ELSE'-actions

This trigger is suppose to make unit walk in circles around a point I believe or say the least it is what i am trying to create my self with out having to create hundreds of points.

This is what I had wrote too creating this trigger...

Event- Timer - Every 0.5 seconds of Game Time

Actions -
Unit - Order Colony Ship [201.85, 35.17] to ( Move targeting (Point 001 offset by 360.0 towards TempReal degrees)) (Replace Existing Orders)
Variable - Set TempReal = TempReal
General - If (Conditions) then do (Actions) else do (Actions)
if- TempReal > 360.0
then- Variable - Set TempReal = 360.0

I tested, I got an error with the TempReal.
 
Last edited by a moderator:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
I tested, I got an error with the TempReal.
Well I have a solution to an error. Maybe you should explain what the error is?

What you are doing makes no sense.
You are meant to set TempReal (which is a global variable) to ((TempReal + 1) mod 360)
Set TempReal = ((TempReal + 1) mod 360)

The idea is that every execution of the trigger it increases the angle of the unit by 1 degree from a point. Every 360 degrees makes it go around a full circle. In theory the mod 360 is not even required due to the circular nature of angles just it is useful to have to avoid a bounds bug that could occur if the trigger was left to run for thousands or millions of years.
 
Level 3
Joined
Apr 7, 2012
Messages
25
Well I have a solution to an error. Maybe you should explain what the error is?

What you are doing makes no sense.
You are meant to set TempReal (which is a global variable) to ((TempReal + 1) mod 360)
Set TempReal = ((TempReal + 1) mod 360)

The idea is that every execution of the trigger it increases the angle of the unit by 1 degree from a point. Every 360 degrees makes it go around a full circle. In theory the mod 360 is not even required due to the circular nature of angles just it is useful to have to avoid a bounds bug that could occur if the trigger was left to run for thousands or millions of years.

Well, if fact everything in the trigger is required. I managed to fix the errors because I had my TempReal set to Real and not Interger.

After i changed that, the trigger worked perfectly but however it didnt work to how I need it too.

The unit did move in a circle but what the unit did was not good enough, the unit moved like this, move, stop, move stop, move, stop etc all in a circle.

it was annoying sadly enough.
 
Level 3
Joined
Apr 7, 2012
Messages
25
Are you moving it by issuing it a move order or by getting it to slide there? Move orders are not recommended for this kind of function as they are not completely accurate. Rather get the unit to slide there over the update period.

Well now, Hmmmmm

I didnt delete the trigger so I'll let you know what happens because yes its set to move not slide as you call it.

There is no "Slide" order

Unit - Order PlanetF Homeworld [133.61, 45.24] to ( Move targeting (Point 001 offset by 5.0 towards TempReal degrees)) (Replace Existing Orders)

I selected "Move" tried to find "Slide" there is no slide option.

Suppose you could hint me where to make it slide? lol
 
Last edited by a moderator:
Level 3
Joined
Apr 7, 2012
Messages
25
This will cause the unit to teleport to its new location. If you make it Blend it will then move smoothly to the new location over the next game loop. As long as you set your event to fire every 0.1 seconds it will create a very smooth rotation of the unit.

Correct me but your idea trigger is saying "Move triggering unit" okay so what is the triggering unit because now my TempReal does not apply.

lol, n/m

Uhmmm, yeah the unit moved instantly but it didnt create this smooth rotation.

Otherwords, the point to my trigger was to make it so the unit would orbit a Point on the map. Should you know a easier orbit I am all ears.

I did notice this, I was playing one of my other maps I had created, "Cloakers" and i had set my observer unit from protoss to patrol too more than 1 location on the map and back to my base but I notice it didn't return, thus i notice it was moving in circles at my first location I sent it.

This is what I wanted to recreate.
 
Last edited by a moderator:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
Like I said, you need to turn on Blending and decrease the trigger period. The blend only works for 1 game period.

In fact the massive 0.5 period is probably why your first approach was moving so badly (only 2 points per second and the unit would stop if it reached a point in that time).

I think there are 10 game periods per second. These are modified by speed (so usually it is more as people play on faster settings than normal) but if you use game time 0.1 should work fine.
 
Level 3
Joined
Apr 7, 2012
Messages
25
lol, wow I don't know what your aiming at but all this trigger is doing is moving the unit "Banshee" instantly to point.


Timer - Every 0.01 seconds of Game Time


Unit - Move Banshee [71.39, 67.25] instantly to Point 001 (Blend)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,259
I do not understand what you are doing... Where are you setting up Point 001 so that it orbits? I said modify your existing trigger so that it fires every 0.1 seconds and moves the unit instantly with blending instead of ordering the unit to move to the rotational point.
 
Status
Not open for further replies.
Top