Humm people, I know that the TriggerSleepAction() function isn't accurate below 0.27s. And I also know this question may be a little stupid but when I test the map, this piece of code just gives me almost a double floating text, one over the other, separated by an offset of somewhat near 10 on the Z axis. My question is, the 'call TriggerRegisterTimerEventPeriodic( gg_trg_LowStats, 10.00 )' and both 'call TriggerSleepAction(10)' run separately? I mean, am I getting a wait of 30s total or is it every 10s that the trigger is being run? I'm just getting mad with a stupid question but I can't seem to be able to make them show separately from each other.
The code is here:
Any help would be appreciated. Thanks in advance
EDIT: Shit, I thought this was on the Triggers & Scripts section. If any mod comes by, please move it there. In the JASS section.
The code is here:
JASS:
function CheckLowStats takes nothing returns nothing
// Check if the Energy is low
local integer i
set i=0
loop
exitwhen (i>10)
if ( udg_Status_Energy[i] <= 20.00 ) then
call FloatingTxt("Im tired", udg_Survivor[i], 15, 15, 100)
else
endif
set i=i+1
endloop
// Wait and check if the Hunger is low
call TriggerSleepAction(10)
set i=0
loop
exitwhen (i>10)
if ( udg_Status_Hunger[i] <= 20.00 ) then
call FloatingTxt("Im hungry", udg_Survivor[i], 70, 70, 0)
else
endif
set i=i+1
endloop
// Wait again and check if the Heat is low
call TriggerSleepAction(10)
set i=0
loop
exitwhen (i>10)
if ( udg_Status_Heat[i] <= 20.00 ) then
call FloatingTxt("Im cold", udg_Survivor[i], 55, 55, 100)
else
endif
set i=i+1
endloop
endfunction
//===========================================================================
function InitTrig_LowStats takes nothing returns nothing
set gg_trg_LowStats = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_LowStats, 10.00 )
call TriggerAddAction( gg_trg_LowStats, function CheckLowStats )
endfunction
Any help would be appreciated. Thanks in advance
EDIT: Shit, I thought this was on the Triggers & Scripts section. If any mod comes by, please move it there. In the JASS section.
Last edited: