Creating Mass Send / Mass Attack Commands

Status
Not open for further replies.
Level 2
Joined
Jan 5, 2019
Messages
7
I am currently working on a map where several players will be in control of very large amounts of units, and it becomes very tedious to handle all of them at once. I would like to add a mass send/attack/retreat command, where I can send an order to every unit I own on the field all at once.

I know maps like Footmen vs Grunts have this command. The way they do it is, they have a building with the "attack", "move", "stop", and "hold position" icons, and when you use them, they will give that order to every unit you control. I would prefer this method over text commands, but have no clue where to begin. I haven't found any useful information after searching for a while online, and I'm still stumped after looking through triggers for a while. Does anybody know a good way to create mass commands?
 
Like you said with icons, the control center building needs an ability for each command. attack/move/...
"attack", for example, needs to a point- or target orientated ability, while if you want "stop" it needs to be an ability without having target anything.

You now have to catch the events when the control center casts one of these abilities, and also check of targeted location if needed. Then, depending on exactly which ability was casted, you pick all units from owner of casting unit, and order them to do wanted action.
 
Level 2
Joined
Jan 5, 2019
Messages
7
@IcemanBo Thanks for the response. I tried doing this and my method failed, with a weird result. I made a custom ability by copy pasting the "Reveal" ability, renamed it "Move", made the mana cost 0, 0 cooldown, made sure the range was 9999999 and area of effect was 0 (I don't want the spell to actually reveal the map every time a player wants to move their units to a location, afterall...) I then made this trigger:

MoveTrigger.PNG


It made my units all over the map move, but they didn't move to the location I cast Move on. Instead, they all started running down the map towards the bottom. Any idea what I did wrong here? It looks like they want to move to some other target point instead of where I clicked. Is it the ability I made that's screwing this up? And if so, any ideas for a better ability to use for this?

Edit: Tried again with a custom Reveal, Healing ward, and Earthquake ability (All of which had unlimited casting range, I tried with duration and area at 0 and then 0.1, just to see if that was the problem) and all 3 gave the same result. My units want to run to the center of the map if the trigger tells them to move or attack-move. I could target the upper right corner of the map with my ability and all my units take off in the opposite direction. A custom Roar ability triggered up with stop works, while hold position makes my units stop (But they still attack anything that comes near, defeating the purpose of having hold position...). Clearly some of what I have here works, I just can't figure out why it isn't fully working.
 
Last edited:
Level 2
Joined
Jan 5, 2019
Messages
7
Thanks so much, looks like that was the problem! Funny how you can be just one line away from your trigger working or doing the opposite of what you want.

As soon as I got this part fixed, something else went wrong though (In true WorldEditor fashion). I have a command for Attack-Move and Move. When I tell my units to move, I want it to be a way of retreating, so I don't want my units to attack anything (Thats what attack-move is for). However, when I use the move command and my units are near enemy units, they immediatly start attacking instead of just moving like I want. This will be bad if someone is trying to flee, uses the move command, and all their units run the opposite direction into enemy units to attack.

The first thing I thought of was adding an action of "Lower acquisition range of picked units to 0", but I'm not sure how Id reset those values (After all, I don't want to cripple the acquisition on my units permanently). Something similar happens with my hold position command, it's essentially just the same as my stop command even though the trigger action is telling my units to hold position, not move. They just attack anything nearby. Any thoughts?
(Edit: Even setting acquisition range to 0 doesn't prevent units from attacking anything that gets near them.)
 
Last edited:
Level 25
Joined
Oct 18, 2008
Messages
945
  • Actions
    • Set QPoint[2] = (Target point of ability being cast)
    • Set QGroup[1] = (your units)
    • For each (Integer QInt[1]) from 1 to 33, do (Actions)
      • Loop - Actions
        • Set QGroup[2] = (Random 12 units from QGroup[1])
        • Unit Group - Remove all units of QGroup[2] from QGroup[1]
        • Unit Group - Order QGroup[2] to Stop
        • Unit Group - Order QGroup[2] to Move To QPoint[2]
        • Custom script: call DestroyGroup(udg_QGroup[2])
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (QGroup[1] is empty) Equal to True
          • Then - Actions
            • Set QInt[1] = 99
          • Else - Actions
    • Custom script: call RemoveLocation(udg_QPoint[2])
    • Custom script: call DestroyGroup(udg_QGroup[1])
you want to do like this
it orders them in groups of 12 which makes the pathing engine work better
 
Status
Not open for further replies.
Top