- Joined
- Sep 14, 2009
- Messages
- 284
Hey. I just started to learn jass and it's fine so far but I don't understand why this loop doesn't work, none of the actions/functions/we in the loop is executed but the actions before the loop is.
Some lines are just for debug and I know I miss some nullifies but that's not what i need help with.
Some lines are just for debug and I know I miss some nullifies but that's not what i need help with.
JASS:
//===========================================================================
function IceFCastCond takes nothing returns boolean
return GetSpellAbilityId()=='A004'
endfunction
function IceFCastAct takes nothing returns nothing
local unit IceFCastCaster
local unit IceFCastTarDum
local location IceFCastPointA
local location IceFCastPointB
local boolean IceFCastActive
local integer IceFCastLoop
set IceFCastCaster = GetTriggerUnit()
set IceFCastPointA = GetSpellTargetLoc()
set IceFCastActive = true
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Hey")
loop
exitwhen IceFCastLoop > 5
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, "Loop")
set IceFCastPointB = PolarProjectionBJ(IceFCastPointA, 20.00, (72.00 * I2R(GetForLoopIndexA())))
set IceFCastTarDum = CreateUnitAtLoc(GetOwningPlayer(IceFCastCaster), 'u002', IceFCastPointB, 0.00)
set IceFCastB = null
set IceFCastLoop = IceFCastLoop + 1
endloop
endfunction
//===========================================================================
function InitTrig_IceFlower takes nothing returns nothing
local trigger IceFCast
set IceFCast=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(IceFCast, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(IceFCast, Condition(function IceFCastCond))
call TriggerAddAction(IceFCast, function IceFCastAct)
endfunction