Hello there, I managed to make my tower get bonus damage, speed and anything after attacking the same target 5 times, and if it change the target the bonus will be lost, Also if it attacks any target 3 times then start to another target it will have to build 5 attacks and not to continue from the 3 attacks.
What do I need?
the trigger I made is very complicated and needs a lot of times and actions.
Here's how I did it :
First I need to set my targets.
And then the trigger:
My problem is with the first trigger (Setting targets), It requires a lot of actions, If the player need to make 10 towers, then I have to set 10 targets, and look how big it is with 4 targets only, now lets assume the player will make infinite towers
the second trigger is fine, please help with the first one.
What do I need?
the trigger I made is very complicated and needs a lot of times and actions.
Here's how I did it :
First I need to set my targets.
Trigger:
- Setting Targets
- Events
- Unit - A unit Is attacked
- Conditions
- (Owner of (Attacked unit)) Equal to Player 12 (Brown)
- (Unit-type of (Attacking unit)) Equal to Sniper Tower
- Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Sniper_Target Equal to 0
- Then - Actions
- Set Sniper_Aim[1] = (Attacking unit)
- Set Sniper_Target = 1
- Set Sniper_Targ[1] = (Attacked unit)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Sniper_Target Equal to 1
- (Attacking unit) Not equal to Sniper_Aim[1]
- Then - Actions
- Set Sniper_Aim[2] = (Attacking unit)
- Set Sniper_Target = 2
- Set Sniper_Targ[2] = (Attacked unit)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Sniper_Target Equal to 2
- (Attacking unit) Not equal to Sniper_Aim[1]
- (Attacking unit) Not equal to Sniper_Aim[2]
- Then - Actions
- Set Sniper_Aim[3] = (Attacking unit)
- Set Sniper_Target = 3
- Set Sniper_Targ[3] = (Attacked unit)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- Sniper_Target Equal to 3
- (Attacking unit) Not equal to Sniper_Aim[1]
- (Attacking unit) Not equal to Sniper_Aim[2]
- (Attacking unit) Not equal to Sniper_Aim[3]
- Then - Actions
- Set Sniper_Aim[4] = (Attacking unit)
- Set Sniper_Target = 4
- Set Sniper_Targ[4] = (Attacked unit)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Events
And then the trigger:
Trigger:
- Carful Aim
- Events
- Unit - A unit Is attacked
- Conditions
- (Owner of (Attacked unit)) Equal to Player 12 (Brown)
- (Unit-type of (Attacking unit)) Equal to Sniper Tower
- Actions
- For each (Integer A) from 1 to 4, do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Attacking unit) Equal to Sniper_Aim[(Integer A)]
- Then - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Attacked unit) Equal to Sniper_Targ[(Integer A)]
- Then - Actions
- Wait 0.40 seconds
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of (Attacking unit)) Less than or equal to 4
- Then - Actions
- Unit - Set the custom value of (Attacking unit) to ((Custom value of (Attacking unit)) + 1)
- Else - Actions
- If - Conditions
- Else - Actions
- Unit - Set the custom value of (Attacking unit) to 0
- Unit - Remove Item Damage Bonus (+10) from (Attacking unit)
- Unit - Remove Carful Aiming (Sniper Tower) from (Attacking unit)
- If - Conditions
- Wait 0.30 seconds
- Set Sniper_Targ[(Integer A)] = (Attacked unit)
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of (Attacking unit)) Equal to 3
- Then - Actions
- Wait 0.40 seconds
- Unit - Add Item Damage Bonus (+10) to (Attacking unit)
- Unit - Add Carful Aiming (Sniper Tower) to (Attacking unit)
- Else - Actions
- If - Conditions
- For each (Integer A) from 1 to 4, do (Actions)
- Events
My problem is with the first trigger (Setting targets), It requires a lot of actions, If the player need to make 10 towers, then I have to set 10 targets, and look how big it is with 4 targets only, now lets assume the player will make infinite towers
the second trigger is fine, please help with the first one.