Mass Random Artillery

Velex

New Member
Reaction score
1
I'm trying to trigger stationary units to attack ground at a random point in a region without leaks. (I would perfer that they all attack a different random point) The problem i've got is only 12 units can be selected in a unit group so only 12 will attack ground. These units can be produced during the game and there can be an undefined number on the field at once. Heres my trigger:

Code:
Archers
    Events
        Time - Every 5.00 seconds of game time
    Conditions
    Actions
        Set Target = (Random point in Boat 2 <gen>)
        Set Archers = (Units in Boat 1 <gen> matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True))
        Unit Group - Order Archers to Attack Ground Target
        Custom script:   call DestroyGroup(udg_Archers)
        Custom script:   call RemoveLocation(udg_Target)
        Set Target = (Random point in Boat 1 <gen>)
        Set Archers = (Units in Boat 2 <gen> matching (((Matching unit) belongs to an ally of Player 7 (Green)) Equal to True))
        Unit Group - Order Archers to Attack Ground Target
        Custom script:   call DestroyGroup(udg_Archers)
        Custom script:   call RemoveLocation(udg_Target)

So how can I get every unit(of type) to each attack ground a random point in region every 5 seconds.
 

Dirac

22710180
Reaction score
147
Do this...

Code:
        Set Archers = (Units in Boat 1 <gen> matching (((Matching unit) belongs to an ally of Player 1 (Red)) Equal to True))
        Unit Group - Pick every unit in Archers and do (Actions)
          Set Target = (Random point in Boat 2 <gen>)
          Order Picked Unit to Attack Ground Target
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top