Ok, I've been working on a unit passive ability for a mod off of the strategy game my friends and i are working on. The passive ability is supposed to stealth the unit in question (Drenai Merry Man) when around the trees of his home country, but remove the stealth when not around the trees. Heres the trigger I have for the stealth part, but i can't seem to figure out a trigger for removing the stealth.
Treewalk
Events
Time - Every 0.40 seconds of game time
Conditions
Actions
Set TempDestructible = (Destructible-type of Summer Tree Wall 0263 <gen>)
Set TempGroup = (Units of type Drenai Merry Man)
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Set TempLoc = (Position of (Picked unit))
Destructible - Pick every destructible within 256.00 of TempLoc and do (Actions)
Loop - Actions
If ((Destructible-type of (Picked destructible)) Equal to TempDestructible) then do (Set TempBoolean = True) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempBoolean Equal to True
Then - Actions
Unit - Add Permanent Invisibility to (Picked unit)
Else - Actions
Treewalk
Events
Time - Every 0.40 seconds of game time
Conditions
Actions
Set TempDestructible = (Destructible-type of Summer Tree Wall 0263 <gen>)
Set TempGroup = (Units of type Drenai Merry Man)
Unit Group - Pick every unit in TempGroup and do (Actions)
Loop - Actions
Set TempLoc = (Position of (Picked unit))
Destructible - Pick every destructible within 256.00 of TempLoc and do (Actions)
Loop - Actions
If ((Destructible-type of (Picked destructible)) Equal to TempDestructible) then do (Set TempBoolean = True) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempBoolean Equal to True
Then - Actions
Unit - Add Permanent Invisibility to (Picked unit)
Else - Actions