- Joined
- Sep 26, 2009
- Messages
- 2,595
Hello... I made this trigger
so each time a unit owned by player 4 is trained, it is add to unit group and once this unit group has 6 units in it, it is ordered to go to Goal<gen>.
This trigger works, but only once.
The "Player4_Group_Number" is integer variable with no array and initial value equal to 1.
At first, the trigger didn't have "Player4_Group_Number" variable, but later I add it, hoping that maybe once each unit group is different it would work... but it doesn't...
I also used
Does anyone know what to do so it works every time?
-
Player4 Group
-
Events
-
Unit - A unit Finishes training a unit
-
-
Conditions
-
(Owner of (Triggering unit)) Equal to Player 4 (Purple)
-
-
Actions
-
Unit Group - Add (Trained unit) to Player4_Group[Player4_Group_Number]
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Number of units in Player4_Group[Player4_Group_Number]) Equal to 6
-
-
Then - Actions
-
Wait 1.00 seconds
-
Unit Group - Pick every unit in Player4_Group[Player4_Group_Number] and do (Actions)
-
Loop - Actions
-
Unit - Order (Picked unit) to Attack-Move To (Random point in Goal <gen>)
-
Unit Group - Remove (Picked unit) from Player4_Group[Player4_Group_Number]
-
Set Player4_Group_Number = (Player4_Group_Number + 1)
-
-
-
-
Else - Actions
-
Do nothing
-
-
-
-
so each time a unit owned by player 4 is trained, it is add to unit group and once this unit group has 6 units in it, it is ordered to go to Goal<gen>.
This trigger works, but only once.
The "Player4_Group_Number" is integer variable with no array and initial value equal to 1.
At first, the trigger didn't have "Player4_Group_Number" variable, but later I add it, hoping that maybe once each unit group is different it would work... but it doesn't...
I also used
-
Custom script: call DestroyGroup (udg_Player4_Group)
Does anyone know what to do so it works every time?