Ability help, Passive Dryad ability.

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...

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)
      • 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
      • Set Forest = No destructible
      • Trigger - Run Forestwalk Effect <gen> (checking conditions)


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



So what am I doing wrong and how can I fix it?
 

Rhadamanthus

New Member
Reaction score
5
This is funny, no sooner than I ask, I manage to fix it...


I'm sure something, somewhere is laughing.




Problem solved!
 

tommerbob

Minecraft. :D
Reaction score
110
I don't know if you care or not, but your spell will bug if the unit is next to a destructible that is NOT a tree, because you do not distinguish between trees and other types of destructibles.
 

Rhadamanthus

New Member
Reaction score
5
Riiight, Forgot that, thanks.

And sorry for double posting. >.<


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
          • Unit Group - Pick every unit in (Units within 300.00 of (Position of (Picked destructible))) 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
                  • (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
                • Then - Actions
                  • Unit Group - Add (Picked unit) to Forestwalkers
                  • Unit - Set the custom value of (Picked unit) to 3
                • Else - Actions
                  • Do nothing
      • Set Forest = No destructible
      • Trigger - Run Forestwalk Effect &lt;gen&gt; (checking conditions)


And that's how I fixed it. It worked after I skipped the "forest" variable for some reason.
 

tommerbob

Minecraft. :D
Reaction score
110
I'm sure you're happy with it as it is, but just FYI there is a way to detect ANY tree type, not just ashenvale, in case you ever want to use your spell with multiple tree types in a single map. I know this because I made a spell very similar to yours for my own project. :) In case you want to look at how I did it, you can find my spell here. (No I am not self-advertising :p)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top