• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Tree Respawn System

Status
Not open for further replies.
Level 30
Joined
Jan 31, 2010
Messages
3,551
Hi there. I need a system for my map, preferably GUI one.

Whenever a tree on map dies, there is a pause before it respawns. All trees will respawn every 4 minutes. Trees will not spawn where there is a hero nearby, this so heroes aren't as easily trapped.

Helper(s) will be rewarded with reputation.

Status: Incomplete!

 
Last edited:
Level 19
Joined
Feb 25, 2009
Messages
2,004
  • Ressurect
    • Events
      • Time - Every 30.00 seconds of game time
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • And - All (Conditions) are true
                • Conditions
                  • ((Picked destructible) is alive) Equal to False
                  • (Destructible-type of (Picked destructible)) Equal to Summer Tree Wall
            • Then - Actions
              • Set TempLoc = (Position of (Picked destructible))
              • Set TempGroup = (Units within 225.00 of TempLoc matching (((Matching unit) is A Hero) Equal to True))
              • Custom script: set udg_Target = FirstOfGroup(udg_TempGroup)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Target Equal to No unit
                • Then - Actions
                  • Destructible - Resurrect (Picked destructible) with (Max life of (Last created destructible)) life and Show birth animation
                • Else - Actions
              • Custom script: call DestroyGroup (udg_TempGroup)
              • Custom script: call RemoveLocation (udg_TempLoc)
            • Else - Actions
 
Level 4
Joined
Oct 15, 2010
Messages
71
This tree respawn trigger should work using custom script:
  • RegrowTrees Setup
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Destructible - Pick every destructible in (Entire map) and do (Actions)
        • Loop - Actions
          • Trigger - Add to RegrowTrees <gen> the event (Destructible - (Picked destructible) dies)
          • Trigger - Run RegrowTrees <gen> (checking conditions)

  • RegrowTrees
    • Events
    • Conditions
    • Actions
      • Custom script: local destructable BADTREE = GetDyingDestructable()
      • Wait 9.00 seconds
      • Custom script: call DestructableRestoreLife( BADTREE, GetDestructableMaxLife(BADTREE), true )
 
  • Like
Reactions: sPy
Status
Not open for further replies.
Top