Carl-Fredrik
New Member
- Reaction score
- 51
Hey again... the second trigger I made worked on first try (Yay!), the second one is causing a mess though.
First one:
Second one:
Seems like I can't use the same name for the Conditions / Actions / Initializer in each trigger... I thought I could, so I just had to ask, do I have to name them different each time??
Thanks in advance!
// Carl-Fredrik
First one:
JASS:
scope Revive initializer Init
function Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == false
endfunction
function Actions takes nothing returns nothing
local location UnitLoc = GetUnitLoc(GetTriggerUnit())
call PolledWait(10)
call CreateNUnitsAtLoc( 1, GetUnitTypeId(GetTriggerUnit()), GetOwningPlayer(GetTriggerUnit()), UnitLoc, bj_UNIT_FACING )
set UnitLoc = null
call RemoveLocation (UnitLoc)
endfunction
//===========================================================================
function Init takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( trig, Condition( function Conditions ) )
call TriggerAddAction( trig, function Actions )
endfunction
endscope
Second one:
JASS:
scope ReviveHeroes initializer Init
function Conditions takes nothing returns boolean
return IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true
endfunction
function Actions takes nothing returns nothing
local location HeroLoc = GetUnitLoc(GetTriggerUnit())
call PolledWait(10)
call ReviveHeroLoc(GetTriggerUnit(), HeroLoc, true)
set HeroLoc = null
call RemoveLocation (HeroLoc)
endfunction
//===========================================================================
function Init takes nothing returns nothing
local trigger trig = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( trig, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( trig, Condition( function Conditions ) )
call TriggerAddAction( trig, function Actions )
endfunction
endscope
Seems like I can't use the same name for the Conditions / Actions / Initializer in each trigger... I thought I could, so I just had to ask, do I have to name them different each time??
Thanks in advance!
// Carl-Fredrik