- Joined
- Jun 24, 2024
- Messages
- 59
Hi Dudes,
i got a difficult time with a rather simple trigger (at least it think it should be simple).
Scene: Tower Defense Game - I create an object and below the tower Base(being also an object)
The trigger below should check, if the object in question triggers its sell ability, and therefore gets sold.
With this process the Tower Base should be deleted as well.
The reason behind the Base being separate is, because it will change on other conditions.
Anyone got an idea, why the TowerBaseCommon won't get picked by the trigger?
Code:
i got a difficult time with a rather simple trigger (at least it think it should be simple).
Scene: Tower Defense Game - I create an object and below the tower Base(being also an object)
The trigger below should check, if the object in question triggers its sell ability, and therefore gets sold.
With this process the Tower Base should be deleted as well.
The reason behind the Base being separate is, because it will change on other conditions.
Anyone got an idea, why the TowerBaseCommon won't get picked by the trigger?
Code:
-
SellTowerAndBase
-
Events
-
Unit - A unit Starts the effect of an ability
-
-
Conditions
-
(Unit-type of (Triggering unit)) Equal to Random Tower
-
(Ability being cast) Equal to Sell Tower
-
-
Actions
-
Player - Add 5 to (Owner of (Triggering unit)).Current lumber
-
Unit Group - Pick every unit in (Units within 10.00 of (Position of (Triggering unit)).) and do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
(Unit-type of (Picked unit)) Equal to TowerBaseCommon
-
-
Then - Actions
-
Unit - Remove (Picked unit) from the game
-
-
Else - Actions
-
-
-
-
Unit - Remove (Triggering unit) from the game
-
-
JASS:
SellTowerAndBase
Events
Unit - A unit Starts the effect of an ability
Conditions
(Unit-type of (Triggering unit)) Equal to Random Tower
(Ability being cast) Equal to Sell Tower
Actions
Player - Add 5 to (Owner of (Triggering unit)).Current lumber
Unit Group - Pick every unit in (Units within 10.00 of (Position of (Triggering unit)).) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Picked unit)) Equal to TowerBaseCommon
Then - Actions
Unit - Remove (Picked unit) from the game
Else - Actions
Unit - Remove (Triggering unit) from the game