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

Help with Formation

Status
Not open for further replies.
Level 8
Joined
Oct 21, 2017
Messages
53
Hello everyone, a rather stupid question, perhaps, but how to make the units move in the same formation?
In the plan, 4 units are created, and so that they go with the relative speed of each other. (As is usually the case when you select units and when you A-click an area, they move at relative speed + ranged units stay behind).
But for some reason they run in disarray (although everything was fine before), as a result, 2 units simply run forward. Screenshots below:


111.png

  • Events
    • Unit - A unit enters REGION1
  • Conditions
    • (Owner of (Entering unit)) Equal to Player 7 (Green)
  • Actions
    • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in REGION1) and do (Actions)
        • Loop - Actions
          • Set TempMovementPoint = REGION2
          • Unit - Order (Picked unit) to Attack-Move to TempMovementPoint
          • Custom script: call RemoveLocations ( udg_TempMovementPoint )

There is another stack of units, where for some reason the archer generally runs ahead, although the foot soldiers are created first, and then the archer.
 
Last edited:
Level 23
Joined
Dec 4, 2007
Messages
1,558
I think you want to use:
Unit Group - Order (Units in (Playable map area)) to Move To (Center of (Playable map area))

A maximum of 12 units can be ordered this way, but they should take Stats - formation ranks into account.
 
Level 23
Joined
Dec 4, 2007
Messages
1,558
Btw, i think you should put the temporary point + customscript outside of the loop.
Also, would i be terribly wrong in assuming that you plan on using those attack points constantly in your map?
If so you don't have to set and remove them all the time, better to set them once - at least if they don't change.
It's not the using that leaves over a leak, it's the creation.
 
Level 8
Joined
Oct 21, 2017
Messages
53
Also, would i be terribly wrong in assuming that you plan on using those attack points constantly in your map?
Actually yes ;|

If so you don't have to set and remove them all the time, better to set them once - at least if they don't change.
They don't change. Its like spawn regions. And also regions for attack. You mean set them once on Map Initialization trigger? And dont removing them across Custom Script?

I just want to understand. I'm trying to optimize the map as best I can by removing leaks on the GUI
 
Level 23
Joined
Dec 4, 2007
Messages
1,558
You can use preset unitgroups and points for that, which can be used throughout the whole game.
No need to constantly delete and add new ones in that case.
Only when used temporarily, which is why they are generally named temp_point/temp_unitgroup.

For more understanding, check the tutorial section for 'leaks'.
 
Level 8
Joined
Oct 21, 2017
Messages
53
You can use preset unitgroups and points for that, which can be used throughout the whole game.
No need to constantly delete and add new ones in that case.
Only when used temporarily, which is why they are generally named temp_point/temp_unitgroup.

For more understanding, check the tutorial section for 'leaks'.
Got it. Thank you <3
 
Status
Not open for further replies.
Top