1. 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
  2. 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
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. The Highway to Hell has been laid open. Come along and participate in the 5th Special Effect Contest.
    Dismiss Notice
  6. 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.

How to make tree respawn after a set time

Discussion in 'World Editor Help Zone' started by _MB_, Mar 29, 2014.

  1. _MB_

    _MB_

    Joined:
    Jan 5, 2014
    Messages:
    79
    Resources:
    0
    Resources:
    0
    The title is selfexplenatory. If I kill some trees, how to make each tree respawn after a set amount of time?
     
  2. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,033
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    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.
     
  3. _MB_

    _MB_

    Joined:
    Jan 5, 2014
    Messages:
    79
    Resources:
    0
    Resources:
    0
    and how I assign a timer to something?
     
  4. WaterKnight

    WaterKnight

    Joined:
    Aug 18, 2009
    Messages:
    4,033
    Resources:
    5
    Maps:
    1
    Tutorials:
    4
    Resources:
    5
    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.
     
  5. Licheus

    Licheus

    Joined:
    Apr 18, 2009
    Messages:
    562
    Resources:
    0
    Resources:
    0