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:
So how can I get every unit(of type) to each attack ground a random point in region every 5 seconds.
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.