Cokemonkey11
Spell Reviewer
- Joined
- May 9, 2006
- Messages
- 3,575
I have a map where trees respawn after they die. Here is the code:
In blizzard.j:
But if I replace GetDyingDestructable() with GetTriggerWidget() it returns a syntax error. Any reason for this?
edit - nevermind poot cleared it up for me, GetDyingDestructable() is the correct function to call in this case.
JASS:
function Trig_Regrow_Trees_Actions takes nothing returns nothing
call TriggerSleepAction(1)
call SetDestructableAnimation(GetDyingDestructable(),"Birth")
call SetDestructableAnimationSpeed(GetDyingDestructable(),3)
call TriggerSleepAction(19.6)
call SetDestructableAnimation(GetDyingDestructable(),"stand")
call SetDestructableAnimationSpeed(GetDyingDestructable(),1)
call DestructableRestoreLife(GetDyingDestructable(),GetDestructableMaxLife(bj_lastCreatedDestructable),false)
endfunction
function InitTrig_regrowTrees takes nothing returns nothing
set gg_trg_regrowTrees = CreateTrigger()
call TriggerRegisterDestDeathInRegionEvent(gg_trg_regrowTrees,bj_mapInitialPlayableArea)
call TriggerAddAction( gg_trg_regrowTrees, function Trig_Regrow_Trees_Actions )
endfunction
In blizzard.j:
JASS:
function GetDyingDestructable takes nothing returns destructable
return GetTriggerWidget()
endfunction
But if I replace GetDyingDestructable() with GetTriggerWidget() it returns a syntax error. Any reason for this?
edit - nevermind poot cleared it up for me, GetDyingDestructable() is the correct function to call in this case.