• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

How to make tree respawn after a set time

Status
Not open for further replies.
Level 4
Joined
Jan 5, 2014
Messages
79
The title is selfexplenatory. If I kill some trees, how to make each tree respawn after a set amount of time?
 
Pick all your trees, add a death event, on death event, start a timer, assign the tree to it, on expiration trash the timer and resurrect the assigned tree.

Alternatively, instead of timers, you can also use the more imprecise waits and the event response GetDyingDestructable is trigger-local.
 
To assign something to a timer, you can for example take the timer's handle id with GetHandleId and use it as key in a hashtable.

To assign a timer to something (the other way around), it depends on the class of that something. Basically, you always need some memory space that you can dynamically address and split it up by a unique identification attribute of the base data.
 
Status
Not open for further replies.
Back
Top