As the title says, just want to know if this leaks. It's the type of trigger that'll run often, with every single selection event in the whole game. Also, is there a better way to do it?
Just to explain, there's a broken scout tower that a player can repair if they want. This trigger is so that any player can select the broken scout tower and gain ownership of it so they can upgrade it to a non-broken scout tower (which, if destroyed again, is triggered to create a broken scout tower again).
[war3]Broken Tower Select
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Conditions
Actions
Set temp_Unit = (Random unit from (Units currently selected by (Triggering player)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of temp_Unit) Equal to Scout Tower (Broken)
Then - Actions
Unit - Change ownership of temp_Unit to (Triggering player) and Change color
Else - Actions
[/war3]
Just to explain, there's a broken scout tower that a player can repair if they want. This trigger is so that any player can select the broken scout tower and gain ownership of it so they can upgrade it to a non-broken scout tower (which, if destroyed again, is triggered to create a broken scout tower again).
[war3]Broken Tower Select
Events
Player - Player 1 (Red) Selects a unit
Player - Player 2 (Blue) Selects a unit
Player - Player 3 (Teal) Selects a unit
Player - Player 4 (Purple) Selects a unit
Conditions
Actions
Set temp_Unit = (Random unit from (Units currently selected by (Triggering player)))
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of temp_Unit) Equal to Scout Tower (Broken)
Then - Actions
Unit - Change ownership of temp_Unit to (Triggering player) and Change color
Else - Actions
[/war3]