• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Unit group movement

Status
Not open for further replies.
Level 12
Joined
Nov 3, 2013
Messages
989
When you have a group of units and order them to move they will spread out but for what I'm making I'd want them to have the built in "formations" but stay closer too each other.

Think something like those Roman turtle formations with their phalthernax or w/e standing next to each other with shields raised forming human walls.

I thought that maybe I could use the thing that make air units separate but with a negative value to pull them closer, although that's only when they stand still i think.

Edit: Found something interesting, while looking aroundhttp://www.youtube.com/watch?v=vdX1x3RBd8I
 
If you want the units to move like in the video (which is quite cool) you need to trigger the whole thing.
When, what I assume is some kind of leader/commander, moves you need to order the rest of the units to move to points (set in triggers) according to the position of the move-order of the leader.

You need the point from where the leader is when the order is issued and the target point of that order.
Then calculate the angle.
When you have those numbers you can further calculate the positions of the rest of the units.
You might want to set all the units in the group/squad to a unit array for easy reference.
Fx. Issue Unit_Array [1] to move to position with XXXX offset...
And so on.
 
Status
Not open for further replies.
Top