Progesterone
New Member
- Reaction score
- 0
Dear all,
I need to create a trigger (for computer player) that starts off when a unit (Captain) dies. Once it starts, whenever there are lesser than 2 knights in Region "FrTopDefAct", the Barracks will train one knight and order the trained knight to move to the centre of Region "FrTopDefAct".
The trigger that I created are as follows:
1)Trigger A1
Event
Unit - Captain 0340 <gen> Dies
Condition
(Owner of (Triggering unit)) Equal to Player 5 (Yellow)
Action
Trigger - Turn on Top Def A2 <gen>
2)Trigger A2
Event
Time - Every 3.00 seconds of game time
Condition
(Number of units in (Units in FrTopDefAct <gen> matching ((Unit-type of (Matching unit)) Equal to Knight))) Less than 2
Action
Unit - Order Barracks 0108 <gen> to train/upgrade to a Knight
3)Trigger A3
Event
Unit - Barracks 0108 <gen> Finishes training a unit
Condition
(Unit-type of (Trained unit)) Equal to Knight
Action
Unit - Order (Trained unit) to Attack-Move To (Center of FrTopDefAct <gen>)
The problem I have: even though there were already more than TWO knights in region "FrTopDefAct", the barracks KEPT ON TRAINING MORE KNIGHTS.
Can someone please help me ?
Thanks !
I need to create a trigger (for computer player) that starts off when a unit (Captain) dies. Once it starts, whenever there are lesser than 2 knights in Region "FrTopDefAct", the Barracks will train one knight and order the trained knight to move to the centre of Region "FrTopDefAct".
The trigger that I created are as follows:
1)Trigger A1
Event
Unit - Captain 0340 <gen> Dies
Condition
(Owner of (Triggering unit)) Equal to Player 5 (Yellow)
Action
Trigger - Turn on Top Def A2 <gen>
2)Trigger A2
Event
Time - Every 3.00 seconds of game time
Condition
(Number of units in (Units in FrTopDefAct <gen> matching ((Unit-type of (Matching unit)) Equal to Knight))) Less than 2
Action
Unit - Order Barracks 0108 <gen> to train/upgrade to a Knight
3)Trigger A3
Event
Unit - Barracks 0108 <gen> Finishes training a unit
Condition
(Unit-type of (Trained unit)) Equal to Knight
Action
Unit - Order (Trained unit) to Attack-Move To (Center of FrTopDefAct <gen>)
The problem I have: even though there were already more than TWO knights in region "FrTopDefAct", the barracks KEPT ON TRAINING MORE KNIGHTS.
Can someone please help me ?
Thanks !