- Joined
- Sep 18, 2007
- Messages
- 104
I am trying to make a hero revival system, but this is not working, can you show me why? And please acutally show me, not say something like "Use TimerUtils". The map saves fine, but the trigger doesn't seem to fire. I want the hero to be revived in the time specified as long as he doesn't belong to one of the neutral players.
And if it isn't obvious I am just learning JASS.
And I might as well ask, what is faster: StartTimerBJ or TimerStart?
And if it isn't obvious I am just learning JASS.
JASS:
function HeroReviveConditions takes nothing returns boolean
if (IsUnitType(GetTriggerUnit(), UNIT_TYPE_HERO) == true) and ((GetOwningPlayer(GetTriggerUnit()) != Player(PLAYER_NEUTRAL_AGGRESSIVE) ) or (GetOwningPlayer(GetTriggerUnit()) != Player(bj_PLAYER_NEUTRAL_VICTIM) ) or (GetOwningPlayer(GetTriggerUnit()) != Player(bj_PLAYER_NEUTRAL_EXTRA) ) or (GetOwningPlayer(GetTriggerUnit()) != Player(PLAYER_NEUTRAL_PASSIVE) ) ) then
return true
endif
return false
endfunction
function HeroReviveActions takes nothing returns nothing
local timerdialog Window
local integer time
local timer Timer
local unit Hero
local real x
local real y
call BJDebugMsg("Debug0")
set Hero = GetTriggerUnit()
set time = 30
set Timer = CreateTimer()
set x = 0
set y = 0
call StartTimerBJ(Timer, false, I2R(time))
call CreateTimerDialogBJ(Timer, "Revive")
set Window = GetLastCreatedTimerDialogBJ()
call TimerDialogDisplay(Window, true)
call PolledWait(time)
call ReviveHero(Hero, x, y, false)
set Hero = null
set Timer = null
set Window = null
set time = 0
set x = 0
set y = 0
endfunction
//===========================================================================
function HeroReviveInit takes nothing returns nothing
local trigger HeroRevive = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ( HeroRevive, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( HeroRevive, Condition( function HeroReviveConditions ) )
call TriggerAddAction( HeroRevive, function HeroReviveActions )
set HeroRevive = null
endfunction
And I might as well ask, what is faster: StartTimerBJ or TimerStart?
Last edited: