- Joined
- Nov 2, 2004
- Messages
- 1,993
I have a unit (not a hero) which can be revived at the altar. Works just fine.
The only problem is that I want it to dissipate like a hero.
It has a dissipate animation which I renamed to Decay Bone. I'm trying to have it fade out during the animation, but it's not working.
Here's my trigger:
Everything works fine except for the fading out. I also tried attaching the dissipate effect, which also didn't work.
Any idea what could be causing this?
The only problem is that I want it to dissipate like a hero.
It has a dissipate animation which I renamed to Decay Bone. I'm trying to have it fade out during the animation, but it's not working.
Here's my trigger:
JASS:
function Leader_Dissipate_Conditions takes nothing returns boolean
return ( GetUnitTypeId(GetDecayingUnit()) == 'hfal' )
endfunction
function Leader_Dissipate_Actions takes nothing returns nothing
local unit decayingUnit = GetDecayingUnit()
local integer i = 0
local integer opacity = 255
local player localPlayer = GetLocalPlayer()
local force playerAllies = CreateForce()
call ForceEnumAllies(playerAllies, GetOwningPlayer(decayingUnit), null)
if (IsPlayerInForce(localPlayer, playerAllies)) then
call DisplayTextToPlayer(localPlayer, 0, 0, ( GetUnitName(decayingUnit) + " has fallen." ))
endif
loop
exitwhen i >= 5
call TriggerSleepAction( 0.29 )
set opacity = ( opacity - 50)
call SetUnitVertexColor( decayingUnit, 255, 255, 255, opacity )
set i = i + 1
endloop
call RemoveUnit( decayingUnit )
endfunction
function Leader_Dissipate takes nothing returns nothing
local trigger gg_trg_Dissipate = CreateTrigger( )
local integer index = 0
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_Dissipate, Player(index), EVENT_PLAYER_UNIT_DECAY, null)
set index = index + 1
exitwhen index == 16
endloop
call TriggerAddCondition( gg_trg_Dissipate, Condition( function Leader_Dissipate_Conditions ) )
call TriggerAddAction( gg_trg_Dissipate, function Leader_Dissipate_Actions )
endfunction
Everything works fine except for the fading out. I also tried attaching the dissipate effect, which also didn't work.
Any idea what could be causing this?
Last edited: