I want in to save a unitgroup in a hashtable, attached to a timer
but i can't load this unitgroup, except, I don't attach it, but save it in the category 1 for example...
The test1 message isn't displayed
but i can't load this unitgroup, except, I don't attach it, but save it in the category 1 for example...
JASS:
function ForcePushGroupMove takes nothing returns nothing
call BJDebugMsg("test1") //important
endfunction
function ForcePushTimerCallback takes nothing returns nothing
local timer t = GetExpiredTimer()
local integer ID = GetHandleId(t)
local unit u = LoadUnitHandle(udg_ForcePushH, ID, 0)
local real array x
local real array y
if LoadReal(udg_ForcePushH, ID, 2) < LoadReal(udg_ForcePushH, ID, 1) then
set udg_TempInt[0] = ID
set udg_TempReal[0] = (10*LoadInteger(udg_ForcePushH, ID, 0)) * (1.001-LoadReal(udg_ForcePushH, ID, 2)/LoadReal(udg_ForcePushH, ID, 1))
call BJDebugMsg(I2S(CountUnitsInGroup(LoadGroupHandle(udg_ForcePushH, ID, 0)))) //important
call ForGroup(LoadGroupHandle(udg_ForcePushH, ID, 3), function ForcePushGroupMove) //important
call SaveReal(udg_ForcePushH, ID, 2, LoadReal(udg_ForcePushH, ID, 2)+udg_TempReal[0])
else
call ForGroup(LoadGroupHandle(udg_ForcePushH, ID, 0), function ForcePushDestroyEffects)
call DestroyGroup(LoadGroupHandle(udg_ForcePushH, ID, 0))
call DestroyTimer(t)
call FlushChildHashtable(udg_ForcePushH, ID)
endif
endfunction
function ForcePushActions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local real array x
local real array y
local group g = CreateGroup()
local timer t = CreateTimer()
local location l = GetSpellTargetLoc()
set x[1] = GetUnitX(u)
set y[1] = GetUnitY(u)
set x[0] = GetLocationX(l)
set y[0] = GetLocationY(l)
call RemoveLocation(l)
set l = null
set udg_TempUnit[0] = u
set udg_TempReal[0] = bj_RADTODEG * Atan2(y[0]-y[1], x[0]-x[1])
call GroupEnumUnitsInRange(g, x[0], y[0], 800, Condition(function ForcePushInRangeAngle))
set udg_TempInt[0]=GetHandleId(t)
call SaveGroupHandle(udg_ForcePushH, udg_TempInt[0], 0, CreateGroup()) //important
call GroupAddGroup(g, LoadGroupHandle(udg_ForcePushH, udg_TempInt[0], 0)) //important
call ForGroup(g, function ForcePushDamage)
call SaveReal(udg_ForcePushH, udg_TempInt[0], 2, 0)
call SaveReal(udg_ForcePushH, udg_TempInt[0], 1, GetUnitAbilityLevel(u, 'A002')*80)
call SaveInteger(udg_ForcePushH, udg_TempInt[0], 0, GetUnitAbilityLevel(u, 'A002'))
call TimerStart(t, 0.03, true, function ForcePushTimerCallback)
set u = null
endfunction
The test1 message isn't displayed
