HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Regrowing trees

09-14-2003, 05:35 AM#1
Blo0d-Angel
I made a trigger for this but it's not working. If anyone has a reason why pls post it as well as a trigger that will work...

Event:
Destructible - A destructible within (Playable map area) dies

Condition:
((Destructible-type of (Dying destructible)) Equal to Ruins Tree Wall) or ((Destructible-type of (Dying destructible)) Equal to Ruins Canopy Tree)

Action:
Destructible - Resurrect (Dying destructible) with (Max life of (Matching destructible)) life and Show birth animation

Thanks in advance!
09-14-2003, 06:03 AM#2
Roland of Gilead
I posted these a little while ago about someone asking about regrowing trees.

Code:
[color=red]
Tree Resurrect
    Events
        Destructible - A destructible within (Current camera bounds) dies
    Conditions
        (Destructible-type of (Dying destructible)) Equal to Summer Tree Wall
    Actions
        Wait 15.00 seconds
        Destructible - Resurrect (Dying destructible) with (Max life of
Last created destructible)) life and Show birth animation
[/color]

you can add more conditions and remove the wait.
09-14-2003, 07:07 AM#3
Grater
Dont use matching destructable, use dying destructable or whatever it is.
09-14-2003, 08:06 AM#4
Blo0d-Angel
I did what you said grater but it still isn't working. Nothing at all happens when trees dies. I'm positive that I have the right tree type set.
09-14-2003, 08:11 AM#5
Panto
Quite a while ago this question was up here. I copied the info, since I thought I'd use it. Here's what folks settled on to solve the problem (although it looks like this solution is slightly different in nature from Mister-Peepers').
Code:
Respawning Trees
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Nature's Healing
Actions
Wait 2.00 game-time seconds
Destructible - Pick every destructible in (Playable map area) and do (Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation)
Hope that helps some.
BTW, it occurs to me that a flaw with your initial trigger may be in attempting to resurrect the tree before it's fully "dead", since your trigger fires at it's death and immediately attempts to res it.
09-14-2003, 08:27 AM#6
Blo0d-Angel
I found in another thread that the problem was that the max number of doodads that can be monitored with the (Playable map area) region is 64 or something and I have like 5000 doodads. I tried my trig with the region changed to something small and it worked. This is a serious problem because that is the only method which seems feasible to resurect ONLY those trees which have died during the game. The other methods resurect tree stumps that I placed that I want left dead. I'm gonna try making a region that covers the whole map. Maybe it will not have the limitation of (Playable map area) region.
09-14-2003, 10:18 AM#7
Grater
Quote:
Revive dead trees
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Destructible - Pick every destructible in (Playable map area) and do (If (((Picked destructible) is dead) Equal to True) then do (Destructible - Resurrect (Picked destructible) with (Max life of (Picked destructible)) life and Show birth animation) else do (Do nothing))
You can always use this simple enough trigger. Or this one:
Quote:
Make trees never die
Events
Time - Every 1.00 seconds of game time
Conditions
Actions
Destructible - Pick every destructible in (Playable map area) and do (Destructible - Set life of (Picked destructible) to 100.00%)

That last trigger is used in a lot of "no limits" maps to ensure the trees dont get used up. You might wanna throw some conditions in to ensure it doesn't mess with non-trees.

You might think the triggers would cause lag, but they dont seem to.
09-14-2003, 10:24 AM#8
Blo0d-Angel
That 100% one would work cept for if a tree was killed in under a second. Picking all trees then resurecting them also resurects stumps I want to stay dead.
09-14-2003, 10:52 AM#9
Grater
A little more info would be helpful, like why you want to the trees to ressurect, and why you want others to not?

Like, why cant you just make the trees invunerable? (ie give them heaps of hitpoints... or change targetting)
09-14-2003, 07:46 PM#10
Blo0d-Angel
Well if I make trees invulnerable can they still be harvested by peasents?
09-14-2003, 10:23 PM#11
Roland of Gilead
Here I made a map with 4 triggers to regrow trees, since there is a limit of 64 trees per trigger, its set to count how many trees are killed and when it gets to 62 it turns it self off and runs the next trigger and that triggers turns the other on. Makeing a trigger loop. 2 triggesr per tree type. Hope it helps let me know if it works i tested it with 2 different clumps of trees and it worked for each. Play the map and you will see it works.
09-14-2003, 10:48 PM#12
Blo0d-Angel
The problem with those trigs is it only happens when the trees are within the camera bounds. I need it to happen no matter where they are.
09-14-2003, 11:19 PM#13
Raptor--
well, the non-trigger way you could simply set the trees life to like 10000 and then occasionally reset the health back to 100%, cause i doubt trees will be damaged that fast
09-15-2003, 12:39 AM#14
Roland of Gilead
Why would it being set to camera bounds make any difference. The only place camera bounds does not react to is where you have a boundry placed, like on the very edge of the map that looks greyed out. That is the boundry. So camera bounds is everywere, like you want it.
09-15-2003, 12:51 AM#15
Guest
The best way i think is kinda like what one person said... Have it so that after 60 Tree Deaths it then disable that trigger and Create a new one or just have it create a new event of unit dies... and start it all over again... And yes this can be done through jass and if you have UMSWE some of it can be done through the GUI..