• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

HOw to make units move in formation

Status
Not open for further replies.
Level 12
Joined
Mar 26, 2005
Messages
790
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
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
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.
 
Level 24
Joined
Feb 28, 2007
Messages
3,480
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)
 
Level 11
Joined
Dec 8, 2006
Messages
334
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
 
Level 20
Joined
Jan 6, 2008
Messages
2,627
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 Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
Try moving them manually. Make it so the units can not move, play their walk animation and make triggers move them. You can then make all 12 walk in formation via controling the offsets.
As this is a cinimatic no one would notice a thing if done right. (50 times a second)
 
Level 3
Joined
Sep 24, 2007
Messages
64
@ 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:

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,207
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.
Top