• 🏆 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!

Tree Disguise V 1.0.0.2

Ingame.jpg

ToolTip.jpg

  • Int Tree Dummies
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TreeDummyType[0] = Summer Tree Wall
      • Set TreeDummyType[1] = Summer Tree Dummy
      • Set TreeDummyType[2] = Ashenvale Tree Wall
      • Set TreeDummyType[3] = Ashenvale Tree Dummy
  • Cast Tree Disguise
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Tree Disguise
    • Actions
      • Set TempUnit = (Triggering unit)
      • Set TempInteger = (Custom value of TempUnit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (TempUnit is in DisguisedGroup) Equal to False
        • Then - Actions
          • Unit - Add Permanent Invisibility to TempUnit
          • For each (Integer TempInteger) from 0 to 3, do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Destructible-type of (Target destructible of ability being cast)) Equal to TreeDummyType[TempInteger]
                • Then - Actions
                  • Set TreeType[(Custom value of TempUnit)] = TreeDummyType[(TempInteger + 1)]
                • Else - Actions
          • Set TempInteger = (Custom value of TempUnit)
          • Set Duration[TempInteger] = (Current life of (Target destructible of ability being cast))
          • Unit Group - Add TempUnit to DisguisedGroup
          • Set TempPoint = (Position of TempUnit)
          • Destructible - Create a dead TreeType[TempInteger] at TempPoint facing 270.00 with scale 1.00 and variation 0
          • Custom script: call RemoveLocation(udg_TempPoint)
          • Set Tree[TempInteger] = (Last created destructible)
          • Animation - Play Tree[TempInteger]'s stand animation
          • Trigger - Turn on Tree Disguise Periodic <gen>
          • Special Effect - Create a special effect attached to the chest of TempUnit using Units\NightElf\Wisp\WispExplode.mdl
          • Special Effect - Destroy (Last created special effect)
        • Else - Actions
          • Set Duration[TempInteger] = (Duration[TempInteger] + (Current life of (Target destructible of ability being cast)))
          • Special Effect - Create a special effect attached to the chest of TempUnit using Abilities\Spells\NightElf\Taunt\TauntCaster.mdl
          • Special Effect - Destroy (Last created special effect)
  • Tree Disguise Periodic
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in DisguisedGroup and do (Actions)
        • Loop - Actions
          • Set TempUnit = (Picked unit)
          • Set TempInteger = (Custom value of TempUnit)
          • Set Duration[TempInteger] = (Duration[TempInteger] - 0.03)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Duration[TempInteger] Greater than 0.00
              • (TempUnit is dead) Equal to False
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • UnitMoving[TempInteger] Equal to True
                • Then - Actions
                  • Destructible - Remove Tree[TempInteger]
                  • Set TempPoint = (Position of TempUnit)
                  • Destructible - Create a dead TreeType[TempInteger] at TempPoint facing 270.00 with scale 1.00 and variation 0
                  • Custom script: call RemoveLocation(udg_TempPoint)
                  • Set Tree[TempInteger] = (Last created destructible)
                  • Animation - Play Tree[TempInteger]'s stand animation
                • Else - Actions
                  • Animation - Play Tree[TempInteger]'s stand animation
            • Else - Actions
              • Unit Group - Remove TempUnit from DisguisedGroup
              • Destructible - Remove Tree[TempInteger]
              • Unit - Remove Permanent Invisibility from TempUnit
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in DisguisedGroup) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
              • Special Effect - Create a special effect attached to the chest of TempUnit using Units\NightElf\Wisp\WispExplode.mdl
              • Special Effect - Destroy (Last created special effect)
Thanks to Bribe for his index system and Is Unit Moving system.

Feel free to edit and use this spell without credits.

Change Log

V 1.0.0.0 - Uploaded To Hive.
V 1.0.0.1 - Fixed A Stupid Integer Thing.
V 1.0.0.2 - Redid some if/then/else logic.
Keywords:
Tree Disguise, Disguise, Tree, Night Elf, Treant, Leaves
Contents

Tree Disguise (Map)

Reviews
9th Nov 2011 Bribe: It's weird. Approved. Please add a better description on how to import it though.

Moderator

M

Moderator

9th Nov 2011
Bribe: It's weird.

Approved. Please add a better description on how to import it though.
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
Switch "Then" with "Else" actions and do:

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • Duration[TempInteger] Less than or equal to 0.00
          • (TempUnit is dead) Equal to True
->>
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Duration[TempInteger] Greater than 0.00
      • (TempUnit is dead) Equal to False
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,456
  • For each (Integer TempInteger) from 0 to 3, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Destructible-type of (Target destructible of ability being cast)) Equal to TreeDummyType[TempInteger]
        • Then - Actions
          • Set TreeType[(Custom value of TempUnit)] = TreeDummyType[(TempInteger + 1)]
        • Else - Actions
The "3" in "0-3" should be configurable if someone wanted to register more or fewer tree types, for example.

I am not sure why you use (TempInteger + 1) instead of TempInteger. I'm not even sure why you need this search-method in the first place instead of just doing this:

  • Set TreeType[(Custom value of (Triggering unit))] = Destructable-type of (Target destructable of ability being cast)
 
Level 23
Joined
Jan 1, 2011
Messages
1,504
  • For each (Integer TempInteger) from 0 to 3, do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Destructible-type of (Target destructible of ability being cast)) Equal to TreeDummyType[TempInteger]
        • Then - Actions
          • Set TreeType[(Custom value of TempUnit)] = TreeDummyType[(TempInteger + 1)]
        • Else - Actions
The "3" in "0-3" should be configurable if someone wanted to register more or fewer tree types, for example.

I am not sure why you use (TempInteger + 1) instead of TempInteger. I'm not even sure why you need this search-method in the first place instead of just doing this:

  • Set TreeType[(Custom value of (Triggering unit))] = Destructable-type of (Target destructable of ability being cast)

Because I need a dummy tree (one that has no collision so that the movement looks fluent) and I stored the tree types and stuff in the initialization of the map. You save it like this.
  • Int Tree Dummies
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set TreeDummyType[0] = Summer Tree Wall
      • Set TreeDummyType[1] = Summer Tree Dummy
      • Set TreeDummyType[2] = Ashenvale Tree Wall
      • Set TreeDummyType[3] = Ashenvale Tree Dummy
There is a order, the original tree goes first then you +1 it to find the dummy tree... Hope that cleared it up. And it is configurable. Just do a 1 min search of the code and you should find it xD
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
I don't think you need to play the destructible's animation if the unit is not moving.

  • Special Effect - Destroy (Last created special effect)
^The last action in the cast trigger in both else and then branches. Make it the last action in the trigger, don't place it inside the I/T/E.
 
Level 23
Joined
Jan 1, 2011
Messages
1,504
I don't think you need to play the destructible's animation if the unit is not moving.

  • Special Effect - Destroy (Last created special effect)
^The last action in the cast trigger in both else and then branches. Make it the last action in the trigger, don't place it inside the I/T/E.

Yup, you do. If you remove it and the unit stops moving then the tree will play the stump animation after a while.
 
Top