• 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.

Custom Formation, Triangle.

Status
Not open for further replies.

noj

noj

Level 4
Joined
Jan 16, 2006
Messages
89
Im trying to make a triangular Formation, the players unit at the tip, four other units two on each side, one at half point of the triangle on each side and the other ones at the other tips of the triangle.

----Y
--X---X
X------X

But im having trouble on figuring out how to do this, i figure Polar offset was how i could do it but im not sure how it works. a hand on how i can do this would help.

All i need is the math/Explination to having units move to the correct location keeping a triangulare formation facing the degree of the tip "lead unit" (Y). you dont have to make a complete system or trigger because what im planning is alot bigger making any triggers you give me if no more use then the explination to how it works. (and no JASS please)

thanks alot. (+rep to all help)

going to sleep ill reply back to any posts tomorrow.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
What happens if you order them to move next to a cliff and the "formation" order-point lies on an unwalkable zone. Also if there are only 2 units, how will the triangle be formed? Or 4 units?
 

noj

noj

Level 4
Joined
Jan 16, 2006
Messages
89
What happens if you order them to move next to a cliff and the "formation" order-point lies on an unwalkable zone. Also if there are only 2 units, how will the triangle be formed? Or 4 units?

all five units have there own variable, so if any of the units die the formation will be the same with just a empty space, if the lead unit dies then the remaining units of the team will run away to a region. (which when they get to are removed from the game)

if its a formation point is in a unwalkable spot just like the game engine does they will try to get as close as possible, not like it matters but that matter on the map design if there going to go running around a mountain or not.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
But if the lead unit is wrapped around unwalkable terrain that could change his facing really easily, and cause the other members in formation to have to make serious changes in their position because of it. Once you figure out how you're going to define which way they face its a pretty simple problem, but you don't want the units to have to re-arrange themselves because the lead unit turns.

Are they going to be in formation while walking?
 

noj

noj

Level 4
Joined
Jan 16, 2006
Messages
89
But if the lead unit is wrapped around unwalkable terrain that could change his facing really easily, and cause the other members in formation to have to make serious changes in their position because of it. Once you figure out how you're going to define which way they face its a pretty simple problem, but you don't want the units to have to re-arrange themselves because the lead unit turns.

Are they going to be in formation while walking?

I was planning to use the lead units 'Target point of issued order' and angle when he is issued a order targeting a point, to decide where the 4 other units would move to. then when the lead unit completes the order it would re-check the formation, using the lead units new position and angle to decide where the formation will point. i got no triggers on it for a example because i still dont know how to make the formation.
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Okay well you would use the lead unit's facing-angle and subtract 180 from it (so that the offset is behind him, not in front). Now, with this angle you'll want to find the polar offset of the position of the "lead" unit by whatever amount you want, in one of two directions.

The angle of these two directions is dependent on how separated you want the units. Either way, you would add/subtract a certain value from that inversed facing angle to determine which angles to "offset" the non-lead units.

Let me try to draw you a picture.
 
  • Like
Reactions: noj
Status
Not open for further replies.
Top