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

Complex Tree Respawn. Need Help

Status
Not open for further replies.
Level 2
Joined
Jul 26, 2008
Messages
22
Hello I've not been on Warcraft 3 for quite a few months due to college however now that I've finished my course I've gone back to playing Dota and mapmaking, I'm having a bit of trouble mimicking the Dota tree respawn system (If unit is near, tree waits to respawn (This prevents units getting stuck etc)). This is what I have so far, its not working, I was wondering if anybody can do better via triggers or Jass.

  • TreeRessStart
    • Events
      • Destructible - A destructible within (Entire map) dies
    • Conditions
    • Actions
      • Wait 10.00 seconds
      • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Dying destructible))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to No unit
            • Then - Actions
              • Destructible - Resurrect (Dying destructible) with (Max life of Ashenvale Tree Wall 2090 <gen>) life and Hide birth animation
            • Else - Actions
              • Trigger - Run TreeRessCont <gen> (ignoring conditions)
  • TreeRessCont
    • Events
    • Conditions
    • Actions
      • Wait 10.00 seconds
      • Unit Group - Pick every unit in (Units within 500.00 of (Position of (Dying destructible))) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Picked unit) Equal to No unit
            • Then - Actions
              • Destructible - Resurrect (Dying destructible) with (Max life of Ashenvale Tree Wall 2090 <gen>) life and Hide birth animation
            • Else - Actions
              • Trigger - Run TreeRessCont <gen> (ignoring conditions)
Thank you. (Rep will be given for useful working suggestions)
 
Level 12
Joined
Dec 10, 2008
Messages
850
You cant select a unit that isnt there, sorry :)

Just use a handy little line that looks like this...

  • TreeRespawn
    • Events
      • Destructible - A destructible within (Entire map) dies
    • Conditions
    • Actions
      • Set TempLoc = (Position of (Dying destructible))
      • Wait 10.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units within 500.00 of TempLoc)) Equal to 0
        • Then - Actions
          • Destructible - Resurrect (Dying destructible) with (Max life of (Dying destructible)) life and Show birth animation
        • Else - Actions
      • Custom script: call RemoveLocation(udg_TempLoc)
I didn't test it, but it should work (might not be MUI)
 
Level 2
Joined
Jul 26, 2008
Messages
22
Ahhhh I get it now. Thats brilliant! I was being a bit lame choosing another tree to base its health on when it revives, chances are it would cause all sorts of problems and leaks. This method seems bulletproof. Just a few questions, whats the Custom Script thing at the end?

Also will this trigger cover numerous trees dying at the same time?
Also what happens if the unit is not of of the 500 radius? Is there a way to make the actions of the trigger repeat themselves? or is that already incorperated?
 
Last edited:
Level 2
Joined
Jul 26, 2008
Messages
22
Please forgive me for the multi posting, I'm not new to forums or anything like that, so there isn't an excuse, so I apologise... But I've realised what is wrong. The Event:
  • Destructible - A destructible within (Entire map) dies
The Tool tip underneath the even when selecting it states: "Only the first 64 destructibles within the region when this event is registered are monitored for death. It is best to use this even for regions."

Ha, well I've figured out the problem, now I just need to find a way around it. Any suggestions?
 
Status
Not open for further replies.
Top