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

Formation moving in a cinematic using triggers.

Status
Not open for further replies.
Level 8
Joined
May 31, 2009
Messages
103
Hi guys this seems fairly simple but I just can't seem to get it to work. I can group order units to move to a location using triggers but invariably they just become a disorganised mess rather than moving in a formation. Can someone give me a simple way to order a large number of troops to move in formation through triggers?

Any help would be appreciated!
 
Level 8
Joined
Oct 26, 2008
Messages
387
Hi guys this seems fairly simple but I just can't seem to get it to work. I can group order units to move to a location using triggers but invariably they just become a disorganised mess rather than moving in a formation. Can someone give me a simple way to order a large number of troops to move in formation through triggers?

Any help would be appreciated!

*recommended for cinematic uses only*


  • Unit Group - Pick every unit in *units you want to move* and do (Unit - Order (Picked unit) to Move To ((Position of (Picked unit)) offset by 1000.00 towards (Facing of (Picked unit)) degrees))
EDIT: However make sure that the units you want to move, have enough space between them (so they dont collide with each other) and that they wont find any obstacles in their path.
 
Level 9
Joined
Apr 19, 2011
Messages
447
StaRMaestroS, your solution has some leaks. This should be free of leaks:

  • Set Group_LEAK = [YOUR UNITS]
  • Unit Group - Pick every unit in Group_LEAK and do (Actions)
    • Loop - Actions
      • Set LEAK = (Position of (Picked unit))
      • Set LEAK_2 = (LEAK offset by [DISTANCE TO MOVE] towards [DIRECTION TO MOVE] degrees)
      • Unit - Order (Picked unit) to Move to LEAK_2
      • Custom script: call RemoveLocation(udg_LEAK)
      • Custom script: call RemoveLocation(udg_LEAK_2)
  • Custom script: call DestroyGroup(udg_Group_LEAK)
However, this would only work if the units have to move in a straigth line, and supposing that there aren't any obstacles in the way.

A possible solution if the formation has to move trough a curved path would be to create one region for each of the units, in the position they should be when they stop moving, move each of the units to its respective region, and then adjust their facing when they reach the region.

Right now, it's all I can say. I've never done this before, but I think that should work.

Regards
 
Status
Not open for further replies.
Top