HOw to make units move in formation

Status
Not open for further replies.
so, this is in cinematic section, so do you want this in cinematic or in in-game?

Becouse if in cinematic, it is not so complicated, (but it can take long time)

Play little bit with Unit-issue order to point
 
I used the trigger in the 7th installment of my Sect of the Holy Mother series.

Code:
Unit Group - Pick every unit in UNITGROUP and do (Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by (0.00, 4000.00)))

You obviously need to adjust your unit group and the "offset by(0.00, 4000.00)" part varies. If you want them to go south, or down, you'll use(0.00,-4000.00). If you want them to go north or up you'll use like it's already written and if you want them to go left or right you'll adjust the first coordinate and leave the second one at 0.00.

If you need to move them diagonally you'll need to adjust both coordinates and so on. The larger the number the farther they will go. Note that this will create minor leaks but if it's a cinematic than it won't matter.
 
Yeah well, it'd look something like this (unleakified):
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • Set Point = ((Position of (Picked unit)) offset by (-500.00, 0.00))
      • Unit - Order (Picked unit) to Move To Point
  • Custom script: call RemoveLocation(udg_Point)
 
Yeah well, it'd look something like this (unleakified):
  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • Set Point = ((Position of (Picked unit)) offset by (-500.00, 0.00))
      • Unit - Order (Picked unit) to Move To Point
  • Custom script: call RemoveLocation(udg_Point)

WRONG!

Should be like this:

  • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
    • Loop - Actions
      • Set Point = ((Position of (Picked unit)) offset by (-500.00, 0.00))
      • Unit - Order (Picked unit) to Move To Point
      • Custom script: call RemoveLocation(udg_Point)
Though I don't think it's necessary to call RemoveLocation, it's a cinematic after all, there won't be much to leak
 
rednek is right, it will multiple create the variable point, if you do rednek's way, it will only be one :p, but wont he need a loop? maybe the integer who says how many units there will be ? + Wouldnt Unit group leak..

  • Actions
    • Set UnitGroup Units in playable map area owned by your player(12?))
    • Unit Group, pick every units in your group
    • ------Rednek's Solution------
  • custom script call DestroyGroup( udg_ UnitGroup )
 
@ Dr.Supergood

Using the walk animation while moving units with triggers doesn't work.
Every time it is moved the move animation is interrupted.
For me anyways.
 
Last edited:
Read my post more clearly please...
Make it so the units can not move
Basically with 0 movement speed the walk animation will be playable.

If its still a problem, order them to walk infront of them, and move them at a fixed rate. As they will never be able to reach their desternation and so constantly walk. Oh for this you must use the SetUnitX and SetUnitY natives with the units having movement speed. This is because that one updates their location but does not inturrupt current orders. It however is unsuitable on buildings or units with 0 MS due to the actual target location moving but the interactable graphics being stationary.
 
Status
Not open for further replies.
Back
Top