Carl-Fredrik
New Member
- Reaction score
- 51
Hey everybody (again).
I've heard that one of the advantages with Jass and vJass is that you may create a timer in one trigger instead of using severeal (In GUI you need one trigger to initialize it and start it and one to detect when it expires)... so I wanted to try this. I came this far (not sure if this is good, tell me if it can be improved):
Problem 1: Nothing happens
Problem 2: I guess I need more than one function with actions to make the trigger detect when the timer expires.. but how do I fix so that it won't happen after 1 second, but when the timer expires??
Thanks in advance!
// Carl-Fredrik
I've heard that one of the advantages with Jass and vJass is that you may create a timer in one trigger instead of using severeal (In GUI you need one trigger to initialize it and start it and one to detect when it expires)... so I wanted to try this. I came this far (not sure if this is good, tell me if it can be improved):
JASS:
scope Timer initializer Init
private function Actions takes nothing returns nothing
local timer GameTimer
local timerdialog GameTimerDialog
call StartTimerBJ( GameTimer, false, 600.00 )
call CreateTimerDialog (GameTimer)
call TimerDialogSetTitle (GameTimerDialog, "Time Left")
set GameTimerDialog = GetLastCreatedTimerDialogBJ()
call TimerDialogDisplay( GameTimerDialog, true )
endfunction
//===========================================================================
private function Init takes nothing returns nothing
local trigger trig = CreateTrigger()
call TriggerRegisterTimerEventSingle( trig, 1.00 )
call TriggerAddAction( trig, function Actions )
endfunction
endscope
Problem 1: Nothing happens
Problem 2: I guess I need more than one function with actions to make the trigger detect when the timer expires.. but how do I fix so that it won't happen after 1 second, but when the timer expires??
Thanks in advance!
// Carl-Fredrik