In the map i;m working on with some other people, i'm trying to find an effective way to respawn the trees a X seconds (we'll say 20) after they are destroyed. Why, because i have abilities that not only require the use of destructables, but also destroy the destructables like it's no ones business.
The problem is that eventually, all the destructables which had created paths will be opned and the map won't work properlyas an AOS.
Can anyone show an easy trigger i can use to help with this dilema?
hmmm, im not too good at reading triggers like this, but from what i can sett, it picks all the trees within 200 of the death trees? that's about all i figured out.
The first part is a trigger with no events that takes the Dying Destructible, waits for a random time between 30 and 90 seconds, and then checks to see if there are any living units co-habiting its space. If there are none, it revives the tree. If there is one or more, it waits again and re-checks.
The second part is a trigger that runs at Time Elapsed 0.00 and adds each tree destructible dying as an event to the first trigger.
The advantages of this system are hard to argue with. It's efficient, small, and it works.
Huh. Well, this can be copied over into a new map, if you change the destructible-type that it looks for to your tree type (where it says GetEnumDestructable()) == 'LTlt', replace LTlt with the raw id for your tree object). It basically does everything over an entire map, and doesn't have any references to anything specific to the map that I wrote it in, I don't think.
It does look big, but it's a pretty straightforward trigger. To make important functional changes, a knowledge of jass functions would be required, but just to use it, that's not really necessary.
Well your JASS gave me some ideas so i could make this
Respawn trees Events Time - Every (Random real number between 15.00 and 20.00) seconds of game time Conditions Actions 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 ((Picked destructible) is dead) Equal to True Then - Actions If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions (Number of units in (Units within 200.00 of (Position of (Picked destructible)))) Greater than 0 Then - Actions Do nothing Else - Actions Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation Else - Actions Do nothing
This is pretty simple i think and it works just the same as what you said yours did. I haven't had any problems while testing, so Eusira, you asked for a simple trigger, here it is.
Well, it's not exactly the same, since each tree has a chance to be resurrected every so-and-so seconds, instead of tracking the time independently for each tree.
On the other hand, it's likely to work pretty well.
Well it seems to work pretty well, the only problem i'd have with these triggers is that there is a chance to trap a unit, or for a hero to exploit the trigger. I wish there was a way around that.
Hmm may be i'll make 1 more tutorial , because you may also make the same trigger as Panto's JASS script . it will consist of 2-3 triggers
1 trigger : event: TIME ELAPSED 0.5 sec. Action: pick every destructible entire world _loop __if __picked destructeble = what you need ___then ___Add event to trigger (trigger2) picked destructible die) ___else ___nothing.
2 trigger: Event Condition Action: wait (random or static time or i don't know...) create 1 of unit type at place of died destructeble