• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

[Trigger] Make units invisible near trees.

Status
Not open for further replies.
Level 10
Joined
Feb 19, 2006
Messages
237
Here is a trigger that makes every unit near a tree invisible. When units leave the tree's range, they are visible again. I know this is a simple trigger, but it took me a while to figure it out so im posting it in case someone would like to use it.

  • Camoflauge
    • Events
      • Time - Every 0.50 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) and do (Actions)
        • Loop - Actions
          • Unit Group - Remove (Picked unit) from invis_group
          • Destructible - Pick every destructible within 200.00 of (Position of (Picked unit)) and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
                • Then - Actions
                  • Unit Group - Add (Picked unit) to invis_group
                  • Unit - Add Permanent Invisibility to (Picked unit)
                • Else - Actions
                  • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is in invis_group) Equal to False
            • Then - Actions
              • Unit - Remove Permanent Invisibility from (Picked unit)
            • Else - Actions
              • Do nothing
 
Status
Not open for further replies.
Top