Rhadamanthus
New Member
- Reaction score
- 5
So....
I'm trying to make an ability that gives a unit (Dryad) evasion if it's near a tree...
Then...
So what am I doing wrong and how can I fix it?
I'm trying to make an ability that gives a unit (Dryad) evasion if it's near a tree...
Trigger:
- Forestwalk Detect
- Events
- Time - Every 1.00 seconds of game time
- Conditions
- Actions
- Destructible - Pick every destructible in (Playable map area) and do (Actions)
- Loop - Actions
- Set Forest = (Picked destructible)
- Loop - Actions
- Unit Group - Pick every unit in (Units within 300.00 of (Position of Forest)) and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Level of Forestwalk for (Picked unit)) Greater than or equal to 1
- Then - Actions
- Unit Group - Add (Picked unit) to Forestwalkers
- Unit - Set the custom value of (Picked unit) to 3
- Else - Actions
- Do nothing
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Set Forest = No destructible
- Trigger - Run Forestwalk Effect <gen> (checking conditions)
- Destructible - Pick every destructible in (Playable map area) and do (Actions)
- Events
Then...
Trigger:
- Forestwalk Effect
- Events
- Conditions
- Actions
- Unit Group - Pick every unit in Forestwalkers and do (Actions)
- Loop - Actions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
- (Custom value of (Picked unit)) Greater than 0
- Then - Actions
- Unit - Add Evasion (Neutral Hostile) to (Picked unit)
- Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 1)
- Else - Actions
- Unit - Remove Evasion (Neutral Hostile) from (Picked unit)
- Unit Group - Remove (Picked unit) from Forestwalkers
- If - Conditions
- If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Loop - Actions
- Unit Group - Pick every unit in Forestwalkers and do (Actions)
So what am I doing wrong and how can I fix it?