- Joined
- Aug 3, 2008
- Messages
- 2,345
Hi, I'm working on a TD, Paintball TD (link in my sig) and I'm in the process of creating a multiboard for it. There will be one multiboard for each player, and I've got it creating and displaying the boards just fine. Now the problem is, whenever I try to update the multiboard (I've made the triggers to update the time remaining to the next wave and to update which wave you are currently on), it doesn't display on screen. These are my triggers:
JASS:
function Trig_TimerUpdate_Actions takes nothing returns nothing
local integer i = 0
local integer time
loop
exitwhen i >= MAX_PLAYERS
if udg_IsPlayerPlaying[i] then
set time = R2I(TimerGetRemaining(udg_WaveTimers[i]))
call MultiboardSetItemValueBJ(udg_Multiboards[i], udg_NumPlayers+4, 1, I2S(time) + " seconds")
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_TimerUpdate takes nothing returns nothing
set gg_trg_TimerUpdate = CreateTrigger( )
call TriggerRegisterTimerEvent( gg_trg_TimerUpdate, 1.00, true )
call TriggerAddAction( gg_trg_TimerUpdate, function Trig_TimerUpdate_Actions )
endfunction
JASS:
function NextWave takes nothing returns nothing
local integer i = 0
local timer tim = GetExpiredTimer()
loop
exitwhen i >= MAX_PLAYERS or udg_WaveTimers[i] == tim
set i = i + 1
endloop
if i >= MAX_PLAYERS then
debug call BJDebugMsg("ERROR: Some dodgy timer called NextWave!")
return
endif
call CreepTypes[udg_Levels[i]].Spawn(i)
set udg_Levels[i] = udg_Levels[i] + 1
call MultiboardSetItemValueBJ(udg_Multiboards[i], udg_NumPlayers+2, 2, I2S(udg_Levels[i]))
set tim = null
endfunction
function Trig_Next_Wave_Actions takes nothing returns nothing
local integer i = 0
loop
exitwhen i >= MAX_PLAYERS
if udg_IsPlayerPlaying[i] then
call TimerStart(udg_WaveTimers[i], WAVE_TIMER, true, function NextWave)
endif
set i = i + 1
endloop
endfunction
//===========================================================================
function InitTrig_Next_Wave takes nothing returns nothing
set gg_trg_Next_Wave = CreateTrigger()
call TriggerRegisterTimerEvent(gg_trg_Next_Wave, 0.01, false)
call TriggerAddAction(gg_trg_Next_Wave, function Trig_Next_Wave_Actions)
endfunction