ROTS19
TH.net Regular
- Reaction score
- 12
i made a trigger that when a unit attacks then a certain ammount of gold is drained from the player. that part works just fine. But i also tried to make it so that when the player researches a certain upgrade, that it drains less gold on each attack. This is the part that doesn't work.
The problem is that even when the upgrade is researched, 4 gold is drained anyway. What's wrong with the triggers?
Trigger:
- Events
- Unit - A unit Finishes an upgrade
- Conditions
- (Researched tech-type) Equal to Capacity
- Actions
- Set CapResearched[(Player number of (Owner of (Researching unit)))] = True
Trigger:
- S
- Events
- Unit - A unit Is attacked
- Conditions
- (Unit-type of (Attacking unit)) Equal to Peon
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- ((Owner of (Attacking unit)) Current gold) Less than 4
- Then - Actions
- Unit - Order (Attacking unit) to Stop
- Skip remaining actions
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- CapResearched[(Player number of (Owner of (Attacking unit)))] Equal to True
- Then - Actions
- Player - Add -2 to (Owner of (Attacking unit)) Current gold
- Else - Actions
- Player - Add -4 to (Owner of (Attacking unit)) Current gold
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
The problem is that even when the upgrade is researched, 4 gold is drained anyway. What's wrong with the triggers?