1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  3. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  4. Don’t forget to sign up for the Hive Cup. There’s a 555 EUR prize pool. Sign up now!
    Dismiss Notice
  5. The Hive Workshop Cup contest results have been announced! See the maps that'll be featured in the Hive Workshop Cup tournament!
    Dismiss Notice
  6. The results are out! Check them out.
    Dismiss Notice
  7. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  8. The raddest synthwave tracks were chosen - Check out our Music Contest #12 - Results and congratulate the winners!
    Dismiss Notice
  9. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Tree Disguise V 1.0.0.2

Submitted by maddeem
This bundle is marked as approved. It works and satisfies the submission rules.
Ingame Screenshot
[​IMG]

ToolTip
[​IMG]

Triggers
  • 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)

Credits
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
Moderator
9th Nov 2011 Bribe: It's weird. Approved. Please add a better description on how to import it though.
  1. 9th Nov 2011
    Bribe: It's weird.

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

    Vehster

    Joined:
    Apr 11, 2011
    Messages:
    156
    Resources:
    0
    Resources:
    0
    The only problem I can see with this is using custom value...

    Otherwise I love this spell madd.
    Though I suggest trying to duplicate custom value with a integer variable instead of actually using custom value.
    Same goes for using the global loop... ( Integer A )
     
  3. maddeem

    maddeem

    Joined:
    Jan 1, 2011
    Messages:
    1,268
    Resources:
    5
    Maps:
    2
    Spells:
    3
    Resources:
    5
    Nothing wrong with using custom value so long as it comes from an indexer. Also, I use Integer A to save myself from creating another variable =p
     
  4. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Integer A can cause a lot of issues :/
    It's best to create a new integer and use it.

    If you disagree, you'd be saying that using one global integer as an index for iteration throughout the map is 'ok' :/
     
  5. maddeem

    maddeem

    Joined:
    Jan 1, 2011
    Messages:
    1,268
    Resources:
    5
    Maps:
    2
    Spells:
    3
    Resources:
    5
    BLARGGGGGGGG!!!!!!!!!
    You know there is a problem if Magtheridon disagrees with you. I'll fix it asap. Lol.

    ~Fixed
     
  6. Bannar

    Bannar

    Joined:
    Mar 19, 2008
    Messages:
    3,087
    Resources:
    20
    Spells:
    5
    Tutorials:
    1
    JASS:
    14
    Resources:
    20
    Don't you think that this spell is too simple?
    (Target destructible of ability being cast) should be stored in variable.

    +rep for preview picture D;
     
  7. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Almost forgot about that :p

    Actually, when BRIBE disagrees with you, you know there's a problem :p
     
  8. maddeem

    maddeem

    Joined:
    Jan 1, 2011
    Messages:
    1,268
    Resources:
    5
    Maps:
    2
    Spells:
    3
    Resources:
    5
    Whoops, I keep forgetting to post a trigger. There we go.
     
  9. Bannar

    Bannar

    Joined:
    Mar 19, 2008
    Messages:
    3,087
    Resources:
    20
    Spells:
    5
    Tutorials:
    1
    JASS:
    14
    Resources:
    20
    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
     
  10. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    Or you could use custom scripts :p

    • Custom script: if udg_Duration[udg_TempInteger] <= 0. or IsUnitType(udg_TempUnit, UNIT_TYPE_DEAD) then
    • // PASTE THE ACTIONS INSIDE THE IF->THEN OVER HERE
    • Custom script: else
    • // PASTE THE ACTIONS INSIDE THE IF->ELSE OVER HERE
    • Custom script: endif
     
  11. Bannar

    Bannar

    Joined:
    Mar 19, 2008
    Messages:
    3,087
    Resources:
    20
    Spells:
    5
    Tutorials:
    1
    JASS:
    14
    Resources:
    20
    @Maggy Or... move to jass ;>
     
  12. Magtheridon96

    Magtheridon96

    Joined:
    Dec 12, 2008
    Messages:
    6,006
    Resources:
    26
    Maps:
    1
    Spells:
    8
    Tutorials:
    7
    JASS:
    10
    Resources:
    26
    That works too c:
     
  13. RakEnRoL

    RakEnRoL

    Joined:
    Sep 2, 2011
    Messages:
    316
    Resources:
    0
    Resources:
    0
    This looks like in fufu :D Cool
     
  14. Orcnet

    Orcnet

    Joined:
    Jul 31, 2010
    Messages:
    3,864
    Resources:
    4
    Maps:
    3
    Tutorials:
    1
    Resources:
    4
    what a really useful spell, might wait for the updates to get fix :)
     
  15. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,032
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    • 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)
     
  16. Ilike

    Ilike

    Joined:
    Dec 17, 2010
    Messages:
    272
    Resources:
    0
    Resources:
    0
    Reminds me of this: http://www.youtube.com/watch?v=oEjLEFrRgUM&feature=related

    Awesome spell by the way.
     
  17. maddeem

    maddeem

    Joined:
    Jan 1, 2011
    Messages:
    1,268
    Resources:
    5
    Maps:
    2
    Spells:
    3
    Resources:
    5
    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
     
  18. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,032
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    It makes more sense to have the array cap at "Int Tree Dummies" because that's the designated spot for configuration.
     
  19. Maker

    Maker

    Joined:
    Mar 6, 2006
    Messages:
    9,193
    Resources:
    17
    Maps:
    2
    Spells:
    14
    Tutorials:
    1
    Resources:
    17
    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.