HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

dieing trees

07-15-2005, 03:21 PM#1
hellzfire74
is there something in the gameplay constants or somewhere, where i can change the trees so that they respawn after they are burnned out or sumone used force of nature of them?? like i have seen this in maps like dota and was wondering how to do it;)
07-15-2005, 03:41 PM#2
Thunder_Eye
No You have to do that by trigger, I'll se if I got time later to send one example.

Ok here you have it.

Code:
SpawnTree
    Events
        Destructible - A destructible within (Entire map) dies
    Conditions
    Actions
        Wait 2.00 seconds
        Destructible - Create a Summer Tree Wall at (Position of (Dying destructible)) facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation (Random integer number between 1 and 10)
'

You might have to modify the Wait, Im not 100% if it works thou, did it in like 30 sec.

EDIT, somehow It only respawns the first the the tree is killed.
07-15-2005, 05:54 PM#3
Elven Ronin
Here's one I found in another map :

Destructible - A destructible within region dies


Wait 1.00 seconds
Animation - Play (Dying destructible)'s Birth animation
Animation - Change (Dying destructible)'s animation speed to 300.00% of its original speed
Wait 19.60 seconds
Animation - Play (Dying destructible)'s stand animation
Animation - Change (Dying destructible)'s animation speed to 100.00% of its original speed
Destructible - Resurrect (Dying destructible) with (Max life of (Last created destructible)) life and Hide birth animation
07-15-2005, 06:36 PM#4
CronoImprezaWRX
Quote:
Originally Posted by Thunder_Eye
No You have to do that by trigger, I'll se if I got time later to send one example.

Ok here you have it.

Code:
SpawnTree
    Events
        Destructible - A destructible within (Entire map) dies
    Conditions
    Actions
        Wait 2.00 seconds
        Destructible - Create a Summer Tree Wall at (Position of (Dying destructible)) facing (Random angle) with scale (Random real number between 0.80 and 1.20) and variation (Random integer number between 1 and 10)
'

You might have to modify the Wait, Im not 100% if it works thou, did it in like 30 sec.

EDIT, somehow It only respawns the first the the tree is killed.

In that code, dont you have to make the condition = to Summer Tree Wall?
Else if a barrel or something dies, you'll get trees there..
07-15-2005, 07:21 PM#5
Elven Ronin
Which would be quite interesting. So yes, add that unless there are no other destructibles in the region, as it was in the map I borrowed that trigger from.
07-15-2005, 07:25 PM#6
vile
here is a 100% working jass for this
in the function InitTrig_Regrowth_Register you can change the 2 tree types rawcodes that will spawn. in this case, its ashenvale tree wall and cantropy tree.

Code:
function Trig_Regrowth_Actions takes nothing returns nothing
    local real seconds = 60.00 // Seconds until the tree will respawn
    local destructable tree = GetDyingDestructable()
    call TriggerSleepAction( seconds )
    call DestructableRestoreLife( tree, GetDestructableMaxLife(tree), true )
endfunction

function InitTrig_Regrowth_Register takes nothing returns nothing
    if ( GetDestructableTypeId(GetEnumDestructable()) == 'ATtc' ) then
        call TriggerRegisterDeathEvent( gg_trg_Tree_Regrowth, GetEnumDestructable() )
    elseif GetDestructableTypeId(GetEnumDestructable()) == 'ATtr' then
        call TriggerRegisterDeathEvent( gg_trg_Tree_Regrowth, GetEnumDestructable() )
    endif
endfunction

//===========================================================================
function InitTrig_Tree_Regrowth takes nothing returns nothing
    set gg_trg_Tree_Regrowth = CreateTrigger(  )
    call EnumDestructablesInRectAll( GetPlayableMapRect(), function InitTrig_Regrowth_Register )
    call TriggerAddAction( gg_trg_Tree_Regrowth, function Trig_Regrowth_Actions )
endfunction
07-15-2005, 07:39 PM#7
hellzfire74
Quote:
Originally Posted by vile
here is a 100% working jass for this
in the function InitTrig_Regrowth_Register you can change the 2 tree types rawcodes that will spawn. in this case, its ashenvale tree wall and cantropy tree.

Code:
function Trig_Regrowth_Actions takes nothing returns nothing
    local real seconds = 60.00 // Seconds until the tree will respawn
    local destructable tree = GetDyingDestructable()
    call TriggerSleepAction( seconds )
    call DestructableRestoreLife( tree, GetDestructableMaxLife(tree), true )
endfunction

function InitTrig_Regrowth_Register takes nothing returns nothing
    if ( GetDestructableTypeId(GetEnumDestructable()) == 'ATtc' ) then
        call TriggerRegisterDeathEvent( gg_trg_Tree_Regrowth, GetEnumDestructable() )
    elseif GetDestructableTypeId(GetEnumDestructable()) == 'ATtr' then
        call TriggerRegisterDeathEvent( gg_trg_Tree_Regrowth, GetEnumDestructable() )
    endif
endfunction

//===========================================================================
function InitTrig_Tree_Regrowth takes nothing returns nothing
    set gg_trg_Tree_Regrowth = CreateTrigger(  )
    call EnumDestructablesInRectAll( GetPlayableMapRect(), function InitTrig_Regrowth_Register )
    call TriggerAddAction( gg_trg_Tree_Regrowth, function Trig_Regrowth_Actions )
endfunction

How do i change this is summer tree wall??? and will this work on all types of trees even if there not summer tree wall but make them summer tree wall, cause that would be ok. also do i put this into the custom script section?o_O
07-15-2005, 07:44 PM#8
vile
it will only work for a certain tree TYPE you put
if u put summer tree wall it will respawn every tree within 60 seconds of type summer tree wall

make a new trigger press edit and convert it to custom text
delete whats inside and then paste this into it, call it "Tree Regrowth"

go to the destructibles tab in the editor and press on View -> Display values as raw data

look for your tree rawcode and paste it there

for the summer tree wall:
LTlt

so for the summer tree wall here is the trigger:
Code:
function Trig_Regrowth_Actions takes nothing returns nothing
    local real seconds = 60.00 // Seconds until the tree will respawn
    local destructable tree = GetDyingDestructable()
    call TriggerSleepAction( seconds )
    call DestructableRestoreLife( tree, GetDestructableMaxLife(tree), true )
endfunction

function InitTrig_Regrowth_Register takes nothing returns nothing
    if ( GetDestructableTypeId(GetEnumDestructable()) == 'LTlt' ) then
        call TriggerRegisterDeathEvent( gg_trg_Tree_Regrowth, GetEnumDestructable() )
    endif
endfunction

//===========================================================================
function InitTrig_Tree_Regrowth takes nothing returns nothing
    set gg_trg_Tree_Regrowth = CreateTrigger(  )
    call EnumDestructablesInRectAll( GetPlayableMapRect(), function InitTrig_Regrowth_Register )
    call TriggerAddAction( gg_trg_Tree_Regrowth, function Trig_Regrowth_Actions )
endfunction
07-15-2005, 08:04 PM#9
hellzfire74
It gave me a whole bunch of Varibles that needed names when i tryed to save it.....?!?!?!
07-16-2005, 11:42 AM#10
vile
it doesnt need global variables
it uses locals.
07-16-2005, 03:00 PM#11
hellzfire74
Quote:
Originally Posted by vile
it doesnt need global variables
it uses locals.


umm sorry im kinda nooby in triggers and such, what does that mean?? and how do i fix the errors?
:(
07-16-2005, 03:49 PM#12
Anitarf
Quote:
Originally Posted by vile
it doesnt need global variables
it uses locals.
Actually, gg_trg_Tree_Regrowth is a sort of global variable, which gets created in your map because you made a GUI trigger there before converting it to JASS but if you just copy the JASS code to a blank map it is not there, so the thing doesn't work.
07-16-2005, 04:43 PM#13
vile
it does work, just change the trigger name to "Tree Regrowth"!