• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! 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