Hey guys, i'm stuck with some rly simple stuff but i just dont exactly know how the angles work in sc2. I have trigger for my AI with following logic:
While conditions do actions:
if AngleBetweenUnits(A ; B) > AngleBetweenUnits(A ; C)
then tell unit B to go Clockwise around unit A
else tell unit B to go Counter-clockwise around unit A
wait 0.0625sec
however i have some staggering happens when unit B reaches angle 0 180 or 360 (dont know rly what is this dead point value) i think i should add another condition with trigonometry function but i rly dont know what exactly i need to do cuz i dont know even how engine calculating angle between points A ; B. From what i've experienced Angle(A ; B) != Angle(B ; A). Feel rly confusing.
but it should work and if u 450 degrees = 90 so u can keep continuing up to the variable limit which is way out there.
you mentioned staggering?? that takes the change in the angle and stacks orders 1 at every 1 degreee or every 2ed (for efficiency) and order the unit around the other with a polar offset as the target point.
Hey guys, i'm stuck with some rly simple stuff but i just dont exactly know how the angles work in sc2. I have trigger for my AI with following logic:
While conditions do actions:
if AngleBetweenUnits(A ; B) > AngleBetweenUnits(A ; C)
then tell unit B to go Clockwise around unit A
else tell unit B to go Counter-clockwise around unit A
wait 0.0625sec
however i have some staggering happens when unit B reaches angle 0 180 or 360 (dont know rly what is this dead point value) i think i should add another condition with trigonometry function but i rly dont know what exactly i need to do cuz i dont know even how engine calculating angle between points A ; B. From what i've experienced Angle(A ; B) != Angle(B ; A). Feel rly confusing.
i didn't quite catch whats happening.
but it should work and if u 450 degrees = 90 so u can keep continuing up to the variable limit which is way out there.
you mentioned staggering?? that takes the change in the angle and stacks orders 1 at every 1 degreee or every 2ed (for efficiency) and order the unit around the other with a polar offset as the target point.
I imagine this problem is related to the problems experienced with unit facing detection. This might help you:
Link!!!
Kinda lazy to draw a picture to describe the idea. Anyway got it working by adding condition
if |angle(A ; B) - angle(A ; C)| > 180 => reverse movement