- Joined
- Jun 1, 2009
- Messages
- 125
Hi!
I'm trying to swap two abilities with another pair of abilities and vice-versa each time a Lightning tower: mode swap (customized "defend") ability got activated\deactivated.
The problem is that one default ability, the Lightning Barrage (customized "troll berserk") out of two is not removed by the first time "defend" got clicked (yet, the trigger adds another pair of abilities correctly). And for some reason, the trigger works fine on each next activation of "defend".
If the tower is a "standalone" - the trigger works fine.
If the tower is an upgrade of another tower - this glitch appears.
Storing the CD time in the variable does not help.
A temporary fix I've made - is a tower replacement with the same unit type, but since I've heard that the "replace unit" still does a memory leak, I hope to find a more elegant solution!
The trigger parts:
I'm trying to swap two abilities with another pair of abilities and vice-versa each time a Lightning tower: mode swap (customized "defend") ability got activated\deactivated.
The problem is that one default ability, the Lightning Barrage (customized "troll berserk") out of two is not removed by the first time "defend" got clicked (yet, the trigger adds another pair of abilities correctly). And for some reason, the trigger works fine on each next activation of "defend".
If the tower is a "standalone" - the trigger works fine.
If the tower is an upgrade of another tower - this glitch appears.
Storing the CD time in the variable does not help.
A temporary fix I've made - is a tower replacement with the same unit type, but since I've heard that the "replace unit" still does a memory leak, I hope to find a more elegant solution!
The trigger parts:
-
Unit is issued an order with no target
-
Events
-
Unit - A unit Is issued an order with no target
-
-
Conditions
-
(Player number of (Owner of (Ordered unit))) Less than 9
-
-
Actions
-
Set VariableSet UO_Triggering = (Ordered unit)
-
-------- Towers --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Check Range for UO_Triggering) Greater than 0
-
-
Then - Actions
-
-------- Order: magicdefense --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Issued order) Equal to (Order(magicdefense))
-
-
Then - Actions
-
-------- Lightning Tower --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Lightning tower: mode swap for UO_Triggering) Greater than 0
-
-
Then - Actions
-
Unit - Add Chain Lightning to UO_Triggering
-
Unit - Add Magic Lightning to UO_Triggering
-
Unit - For Unit UO_Triggering, start cooldown of ability Chain Lightning (Lightning Tower) " over "(Ability Cooldown Remaining of UO_Triggering for ability Lightning Barrage..) seconds.
-
Unit - Remove Discharge from UO_Triggering
-
Unit - Remove Lightning Barrage from UO_Triggering
-
Unit - Set Unit: UO_Triggering's Weapon Boolean Field: Attacks Enabled ('uaen')at Index:1 to Value: True
-
Unit - Set Unit: UO_Triggering's Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: False
-
-
Else - Actions
-
-
-
-
-------- Order: magicundefense --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Issued order) Equal to (Order(magicundefense))
-
-
Then - Actions
-
-------- Lightning Tower --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Level of Lightning tower: mode swap for UO_Triggering) Greater than 0
-
-
Then - Actions
-
Unit - Add Lightning Barrage to UO_Triggering
-
Unit - Add Discharge to UO_Triggering
-
Unit - For Unit UO_Triggering, start cooldown of ability Lightning Barrage " over "(Ability Cooldown Remaining of UO_Triggering for ability Chain Lightning..) seconds.
-
Unit - Remove Chain Lightning from UO_Triggering
-
Unit - Remove Magic Lightning from UO_Triggering
-
Unit - Set Unit: UO_Triggering's Weapon Boolean Field: Attacks Enabled ('uaen')at Index:0 to Value: True
-
Unit - Set Unit: UO_Triggering's Weapon Boolean Field: Attacks Enabled ('uaen')at Index:1 to Value: False
-
-
-
-
-
-
-
-
Last edited: