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

[Solved] The Tree Resurrection Trigger Attached to a Spell

Status
Not open for further replies.
Level 15
Joined
Sep 6, 2015
Messages
576
I've been trying to create a trigger which would resurrect the trees in the aoe area of a cast spell, but so far, the results haven't been very promising. I've also been looking in various threads but found nothing useful so far. This is the last trigger I've come up with and it doesn't work as it's supposed to either:

  • Regrow Trees
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Regrow Trees
    • Actions
      • Destructible - Pick every destructible within 300.00 of (Target point of ability being cast) and do (If (((Picked destructible) is dead) Equal to True) then do (Destructible - Set life of (Picked destructible) to 30.00) else do (Do nothing))
Basically, what the trigger does at the moment is destroy all the trees alive in the aoe area of the spell (even though I've put "(If (((Picked destructible) is dead) Equal to True)"), and resurrects the dead ones, but it doesn't show their model whatsoever, except the shadow, until the trees are clicked or start to be cut. I've also tried replacing the "Set life of" with "Resurrect", but then the trigger just kills all the alive trees and then resurrects all the trees in the area with the birth animation just to let them drop dead immediately after, so these behaviours of the triggers are pretty strange. I've also tried various other triggers and variations of this trigger, but nothing has worked so far.
 
Level 37
Joined
Jul 22, 2015
Messages
3,485
The thought of changing the life of a dead destructible sounds awkward... you should just use the Destructible - Resurrect option since it gives you the option to show or hide the birth animation.

I've also tried replacing the "Set life of" with "Resurrect", but then the trigger just kills all the alive trees and then resurrects all the trees in the area with the birth animation just to let them drop dead immediately after, so these behaviours of the triggers are pretty strange. I've also tried various other triggers and variations of this trigger, but nothing has worked so far.
There must be something wrong with your conditional statements then. I've tested this in a map and it works just fine
  • Destructible - Pick every destructible in (Playable map area) and do (Actions)
    • Loop - Actions
      • Set tempDest = (Picked destructible)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (tempDest is dead) Equal to True
        • Then - Actions
          • Destructible - Resurrect tempDest with (Max life of tempDest) life and Show birth animation
        • Else - Actions
 
Level 15
Joined
Sep 6, 2015
Messages
576
I gave it another thought and realised that I had based my Regrow Tree spell on Flamestrike, and even though I had removed all the damage and effects from it, Flamestrike still causes trees to die by itself. I've replaced the spell with the Cloud spell, and everything works fine now.
Thanks for the help anyway. This thread can be marked as solved.
Here's the full working trigger if anyone comes upon this post while searching for a viable trigger of this kind:

  • Regrow Trees
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Cloud
    • Actions
      • Destructible - Pick every destructible within 300.00 of (Target point of ability being cast) and do (If (((Picked destructible) is dead) Equal to True) then do (Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation) else do (Do nothing))
 
Status
Not open for further replies.
Top