- Joined
- Jul 20, 2009
- Messages
- 295
These are the triggers, and I need someone to help me out:
If anything you do not understand about the triggers, you can ask.
-Though this is what is and supposed to be happening, when a Tower takes damage, (Buildings_Towers[7-25, 32-34]) an Engineer appears from Tents (Buildings_Towers[26-31]), repairs the damaged tower until they stop repairing, then they cast storm bolt (Return To Tent) ability on their Tents, and get removed from game. Each Engineer is given the custom value of the Tower's custom value.
-Engineers are controlled by comps, Engineers and tents are invulnerable.
-I tried making an Engineer under my control and cast Return To Tent, and it worked fine + removed the Engineer, it seems that the only trigger that doesn't work is the 3rd one. Engineers also do appear when Towers takes damage.
-
Create Unit
- Events
- Conditions
-
Actions
- -------- ============================== --------
- -------- Repair Buildings --------
- -------- ============================== --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- ((Attacked unit) is A structure) Equal to True
-
Then - Actions
-
For each (Integer IntegerRepair) from 7 to 10, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to IntegerRepair
- Buildings_Repair[IntegerRepair] Equal to False
-
Then - Actions
- Set Buildings_Repair[IntegerRepair] = True
- Set Temp_Location2 = ((Center of Team1 Tent 1 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer IntegerRepair) from 11 to 13, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to IntegerRepair
- Buildings_Repair[IntegerRepair] Equal to False
-
Then - Actions
- Set Buildings_Repair[IntegerRepair] = True
- Set Temp_Location2 = ((Center of Team1 Tent 2 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer IntegerRepair) from 14 to 17, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to IntegerRepair
- Buildings_Repair[IntegerRepair] Equal to False
-
Then - Actions
- Set Buildings_Repair[IntegerRepair] = True
- Set Temp_Location2 = ((Center of Team1 Tent 3 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer IntegerRepair) from 18 to 20, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to IntegerRepair
- Buildings_Repair[IntegerRepair] Equal to False
-
Then - Actions
- Set Buildings_Repair[IntegerRepair] = True
- Set Temp_Location2 = ((Center of Team1 Tent 4 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer IntegerRepair) from 21 to 22, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to IntegerRepair
- Buildings_Repair[IntegerRepair] Equal to False
-
Then - Actions
- Set Buildings_Repair[IntegerRepair] = True
- Set Temp_Location2 = ((Center of Team1 Tent 5 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer IntegerRepair) from 23 to 24, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to IntegerRepair
- Buildings_Repair[IntegerRepair] Equal to False
-
Then - Actions
- Set Buildings_Repair[IntegerRepair] = True
- Set Temp_Location2 = ((Center of Team1 Tent 6 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- 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 (Attacked unit)) Equal to 25
- Buildings_Repair[25] Equal to False
-
Then - Actions
- Set Buildings_Repair[25] = True
- Set Temp_Location2 = ((Center of Team1 Tent 5 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Custom script: call GroupAddUnit (udg_Repairing, bj_lastCreatedUnit)
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Custom script: call RemoveLocation(udg_Temp_Location2)
- Set Temp_Location2 = ((Center of Team1 Tent 6 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[((Custom value of (Attacked unit)) + 1)] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to ((Custom value of (Attacked unit)) + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to 32
- Buildings_Repair[32] Equal to False
-
Then - Actions
- Set Buildings_Repair[32] = True
- Set Temp_Location2 = ((Center of Team1 Tent 5 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to 33
- Buildings_Repair[33] Equal to False
-
Then - Actions
- Set Buildings_Repair[33] = True
- Set Temp_Location2 = ((Center of Team1 Tent 6 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Attacked unit)) Equal to 34
- Buildings_Repair[34] Equal to False
-
Then - Actions
- Set Buildings_Repair[34] = True
- Set Temp_Location2 = ((Center of Team1 Tent 5 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Custom script: call GroupAddUnit (udg_Repairing, bj_lastCreatedUnit)
- Set Buildings_Repairer[(Custom value of (Attacked unit))] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Custom script: call RemoveLocation(udg_Temp_Location2)
- Set Temp_Location2 = ((Center of Team1 Tent 6 <gen>) offset by 150.00 towards 225.00 degrees)
- Unit - Create 1 Engineer for Player 11 (Dark Green) at Temp_Location2 facing 225.00 degrees
- Set Buildings_Repairer[((Custom value of (Attacked unit)) + 1)] = (Last created unit)
- Unit - Set the custom value of (Last created unit) to ((Custom value of (Attacked unit)) + 1)
- Else - Actions
-
If - Conditions
- Custom script: call GroupAddUnit (udg_Repairing, bj_lastCreatedUnit)
- Custom script: call RemoveLocation(udg_Temp_Location2)
- Unit - Create 1 Swordsman for Neutral Passive at (Center of Region 110 <gen>) facing Default building facing degrees
- Unit - Set the custom value of (Last created unit) to (Custom value of (Attacked unit))
- Unit - Add a 0.01 second Generic expiration timer to (Last created unit)
- Trigger - Turn on Stop Repair <gen>
-
For each (Integer IntegerRepair) from 7 to 10, do (Actions)
- Else - Actions
-
If - Conditions
-
Order To Repair
-
Events
- Unit - A unit owned by Neutral Passive Dies
-
Conditions
- (Unit-type of (Dying unit)) Equal to Swordsman
-
Actions
-
For each (Integer IntegerRepair) from 7 to 24, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Dying unit)) Equal to IntegerRepair
-
Then - Actions
- Unit - Order Buildings_Repairer[(Custom value of (Dying unit))] to Human Peasant - Repair Buildings_Towers[(Custom value of (Dying unit))]
- 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 (Dying unit)) Equal to 25
-
Then - Actions
- Unit - Order Buildings_Repairer[(Custom value of (Dying unit))] to Human Peasant - Repair Buildings_Towers[(Custom value of (Dying unit))]
- Unit - Order Buildings_Repairer[((Custom value of (Dying unit)) + 1)] to Human Peasant - Repair Buildings_Towers[(Custom value of (Dying unit))]
- Else - Actions
-
If - Conditions
-
For each (Integer IntegerRepair) from 32 to 33, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Dying unit)) Equal to IntegerRepair
-
Then - Actions
- Unit - Order Buildings_Repairer[(Custom value of (Dying unit))] to Human Peasant - Repair Buildings_Towers[(Custom value of (Dying unit))]
- 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 (Dying unit)) Equal to 34
-
Then - Actions
- Unit - Order Buildings_Repairer[(Custom value of (Dying unit))] to Human Peasant - Repair Buildings_Towers[(Custom value of (Dying unit))]
- Unit - Order Buildings_Repairer[((Custom value of (Dying unit)) + 1)] to Human Peasant - Repair Buildings_Towers[(Custom value of (Dying unit))]
- Else - Actions
-
If - Conditions
-
For each (Integer IntegerRepair) from 7 to 24, do (Actions)
-
Events
-
Stop Repair
-
Events
- Time - Every 1.00 seconds of game time
- Conditions
-
Actions
-
Unit Group - Pick every unit in Repairing and do (Actions)
-
Loop - Actions
- Custom script: if GetUnitCurrentOrder(GetEnumUnit()) != 852024 then
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Custom value of (Picked unit)) Equal to 7
- (Custom value of (Picked unit)) Equal to 8
- (Custom value of (Picked unit)) Equal to 9
- (Custom value of (Picked unit)) Equal to 10
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Custom script: call IssueTargetOrderBJ( GetEnumUnit(), "thunderbolt", udg_Buildings_Towers[26] )
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
Or - Any (Conditions) are true
-
Conditions
- (Custom value of (Picked unit)) Equal to 11
- (Custom value of (Picked unit)) Equal to 12
- (Custom value of (Picked unit)) Equal to 13
-
Conditions
-
Or - Any (Conditions) are true
-
Then - Actions
- Custom script: call IssueTargetOrderBJ( GetEnumUnit(), "thunderbolt", udg_Buildings_Towers[27] )
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Unit Group - Remove (Picked unit) from Repairing
- Custom script: endif
-
Loop - Actions
-
Unit Group - Pick every unit in Repairing and do (Actions)
-
Events
-
Remove
-
Events
- Unit - A unit Starts the effect of an ability
-
Conditions
- (Ability being cast) Equal to Return To Tent
-
Actions
- Unit - Remove (Triggering unit) from the game
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of (Triggering unit)) Not equal to 26
- (Custom value of (Triggering unit)) Not equal to 35
-
Then - Actions
- Set Buildings_Repair[(Custom value of (Triggering unit))] = False
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Repairing is empty) Equal to True
-
Then - Actions
- Trigger - Turn off Stop Repair <gen>
- Else - Actions
-
If - Conditions
-
Events
-Though this is what is and supposed to be happening, when a Tower takes damage, (Buildings_Towers[7-25, 32-34]) an Engineer appears from Tents (Buildings_Towers[26-31]), repairs the damaged tower until they stop repairing, then they cast storm bolt (Return To Tent) ability on their Tents, and get removed from game. Each Engineer is given the custom value of the Tower's custom value.
-Engineers are controlled by comps, Engineers and tents are invulnerable.
-I tried making an Engineer under my control and cast Return To Tent, and it worked fine + removed the Engineer, it seems that the only trigger that doesn't work is the 3rd one. Engineers also do appear when Towers takes damage.