Yeah that's it, when this code is run I get a floating text on all the player's characters at the same time.
What I would like, is that the messages show one apart from the other character if you get what I mean. Not at the same time. Like placing some waits inside the loops but thats exactly what I dont want to use, waits inside loops. Any ideas?
JASS:
function CheckLowHeat takes nothing returns nothing
local integer 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 CheckLowHunger takes nothing returns nothing
local integer i = 0
local timer time = CreateTimer()
loop
exitwhen (i>10)
if ( udg_Status_Hunger[i] <= 20.00 ) then
call FloatingTxt("Im hungry", udg_Survivor[i], 70, 70, 0)
endif
set i=i+1
endloop
// Wait again and check the Heat
call TimerStart(time, 10, false, function CheckLowHeat)
endfunction
function CheckLowEnergy takes nothing returns nothing
// Check the Energy
local integer i = 0
local timer time = CreateTimer()
loop
exitwhen (i>10)
if ( udg_Status_Energy[i] <= 20.00 ) then
call FloatingTxt("Im tired", udg_Survivor[i], 15, 15, 100)
endif
set i=i+1
endloop
// Wait and check the Hunger
call TimerStart(time, 10, false, function CheckLowHunger)
endfunction
//===========================================================================
function InitTrig_LowStats takes nothing returns nothing
set gg_trg_LowStats = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_LowStats, 30.00 )
call TriggerAddAction( gg_trg_LowStats, function CheckLowEnergy )
endfunction
What I would like, is that the messages show one apart from the other character if you get what I mean. Not at the same time. Like placing some waits inside the loops but thats exactly what I dont want to use, waits inside loops. Any ideas?