- Joined
- May 4, 2008
- Messages
- 113
Trying to make a trigger to get a building to automatically train units.
When it is built, it will add five units to the queue, and then when a unit finishes training it will add another one. When a unit is trained, it will be sent to a certain point depending on which player it belongs to.
Here are the triggers im using:
Through adding debug messages and whatnot to the triggers i've found that the first one doesn't even seem to fire at all, whilst the second one does, but the only action that is carried out is the very last one, the Order. I am guessing the reason neither of them work is due to conditions, but I am not quite sure what I should change! Any solutions anyone can give?
Thanks in advance.
When it is built, it will add five units to the queue, and then when a unit finishes training it will add another one. When a unit is trained, it will be sent to a certain point depending on which player it belongs to.
Here are the triggers im using:
Code:
Mechanikennel Init
Events
Unit - Any Unit construction progress is Completed
Local Variables
loop = 1 <Integer>
Conditions
(Unit type of (Triggering progress unit)) == Mechanikennel
Actions
General - For each integer loop from 1 to 5 with increment 1, do (Actions)
Actions
Unit - Order (Triggering progress unit) to (Mechanikennel Train Attack Dog) (After Existing Orders)
Code:
Attack Dog Spawn
Events
Unit - Any Unit training progress is Completed
Conditions
(Unit type of (Triggering progress unit)) == Attack Dog
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Owner of (Triggering progress unit)) == 1
(Owner of (Triggering progress unit)) == 2
(Owner of (Triggering progress unit)) == 3
(Owner of (Triggering progress unit)) == 4
Then
Unit - Order (Triggering progress unit) to ( Attack targeting Player 2 Target) (After Existing Orders)
Else
General - If (Conditions) then do (Actions) else do (Actions)
If
(Owner of (Triggering progress unit)) == 5
(Owner of (Triggering progress unit)) == 6
(Owner of (Triggering progress unit)) == 7
(Owner of (Triggering progress unit)) == 8
Then
Unit - Order (Triggering progress unit) to ( Attack targeting Player 1 Target) (After Existing Orders)
Else
Unit - Order (Triggering unit) to (Mechanikennel Train Attack Dog) (After Existing Orders)
Through adding debug messages and whatnot to the triggers i've found that the first one doesn't even seem to fire at all, whilst the second one does, but the only action that is carried out is the very last one, the Order. I am guessing the reason neither of them work is due to conditions, but I am not quite sure what I should change! Any solutions anyone can give?
Thanks in advance.