- Joined
- Jun 7, 2008
- Messages
- 440
I need to know why its not working. The timer works properly but the loop doesnt fire.
Any Ideas?
JASS:
function EndTimer_Callback takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer count = LoadInteger(udg_DDHash,GetHandleId(t),1)
local real x = GetLocationX(udg_Temp_Loc)
local real y = GetLocationY(udg_Temp_Loc)
local unit dest = CreateUnit(udg_Target, udg_DDS[count], x, y, 0.00)
call UnitApplyTimedLife(dest, 'BTLF', 2.00)
set dest = null
if count>10 then
call PauseTimer(t)
call DestroyTimer(t)
call FlushChildHashtable(udg_DDHash,GetHandleId(t))
endif
call SaveInteger(udg_DDHash,GetHandleId(t),1,count+1)
endfunction
function Trig_TTD_Actions takes nothing returns nothing
local integer b = 0
local integer bf = CountUnitsInGroup(udg_Temp_Group)
local real x = GetLocationX(udg_Temp_Loc)
local real y = GetLocationY(udg_Temp_Loc)
local timer t = CreateTimer()
local unit dest
local unit dumb
local unit u
call SaveInteger (udg_DDHash, GetHandleId(t), 1, 0)
call TimerStart(t, .5, true, function EndTimer_Callback)
loop
exitwhen b > bf
set u = FirstOfGroup(udg_Temp_Group)
call DisplayTextToPlayer(Player(0), x, y, I2S(b))
set dumb = CreateUnit(udg_Target, 'h00C',x, y, 0.00)
call UnitAddAbility(dumb, udg_DestructionBolt)
call IssueTargetOrder(dumb,"firebolt", u)
call UnitApplyTimedLife(dumb, 'BTLF', 5.00 )
set dumb = null
set b = b + 1
call GroupRemoveUnit(udg_Temp_Group, u)
set u = null
if b == bf then
call SetUnitExploded(udg_Relic, true)
call KillUnit(udg_Relic)
endif
endloop
if (IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS)) then
call EnableUserControl(false)
endif
call CinematicModeBJ( false, bj_FORCE_ALL_PLAYERS )
set udg_In_Event = false
endfunction
//===========================================================================
function InitTrig_TTD takes nothing returns nothing
set gg_trg_TTD = CreateTrigger( )
call DisableTrigger( gg_trg_TTD )
call TriggerAddAction( gg_trg_TTD, function Trig_TTD_Actions )
endfunction
Any Ideas?
Last edited: