HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Need a working trigger resurrect trees

03-20-2007, 11:21 PM#1
Melshisedek1
I have a unit with force of nature spell summoning Treants out of trees.

I want my forest to stay has it is. So I tried this:

Trees
Events
Destructible - A destructible within Region 020 <gen> dies
Conditions
((Destructible-type of (Dying destructible)) Equal to Ashenvale Tree Wall) or ((Destructible-type of (Dying destructible)) Equal to Village Tree Wall)
Actions
Destructible - Create a (Destructible-type of (Dying destructible)) at (Position of (Dying destructible)) facing (Random angle) with scale (Random real number between 0.80 and 1.45) and variation (Random integer number between 1 and 4)


It looks good but it doesn't work ingame.

I also tried a variation with a unit cast a spell event, and it did not work. But I think this trigger would be best.

What do you think? Is there something to be done. Or do you have a better leakeless with no slow down trigger has a suggestion.

03-20-2007, 11:55 PM#2
Dil999
Looks like it would work... Try making 2 seperate triggers, one for each type of doodad. Then, replace the actions's (Destructible-type of (Dying destructible)) with Whatever tree that trigger is for.
03-21-2007, 01:10 AM#3
Szythe
Note the fine print in your condition:


In order to do what you want, you need to make two triggers:

Trigger:
Initialization Trees
Collapse Events
Map initialization
Conditions
Collapse Actions
Collapse Destructible - Pick every destructible in (Playable map area) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
(Destructible-type of (Picked destructible)) Equal to Village Tree Wall
Collapse Then - Actions
Trigger - Add to Tree Death <gen> the event (Destructible - (Picked destructible) dies)
Else - Actions

Trigger:
Tree Death
Events
Conditions
Collapse Actions
Destructible - Resurrect (Dying destructible) with (Max life of (Dying destructible)) life and Show birth animation
03-22-2007, 01:46 AM#4
Melshisedek1
Scythe, thanks alot man. I will see to adapt to my map.Did you test it? I take it it will work. Smart stuff :o)
03-22-2007, 02:21 AM#5
Melshisedek1
Just tested the triggers. Oh la major game freeze. One thing is good to know is that the event is recognised. But still I don't get any resurrecting trees. I tried different ways of destroying tress and I get always the same non response.

Maybe If I made a a periodic trigger that just resurrected random dead trees?
03-22-2007, 03:24 AM#6
Melshisedek1
Made this periodic trigger instead:

Trees
Events
Time - Every 60.00 seconds of game time
Conditions
Actions
Destructible - Pick every destructible in Region 020 <gen> and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
(Destructible-type of (Picked destructible)) Equal to Ashenvale Tree Wall
(Destructible-type of (Picked destructible)) Equal to Village Tree Wall
Then - Actions
Destructible - Resurrect (Matching destructible) with (Max life of (Dying destructible)) life and Show birth animation
Else - Actions
Do nothing


It works perfectly.

But would there be a way to slow the birth animation a little (without the use of another trigger) so to make it look more natural.