I have had several problems with these functions when in a loop, they just stop the code at that point.
Stage 2 is never reached.
Stage 5 is never reached...
I don't understand why these functions don't work in the loops. Is it because of some setting in world editor, or is it a problem with NewGen?? Or is it UMSWE???? I installed NewGen according to this: http://www.hiveworkshop.com/forums/...ing-up-newgen-we-intro-trigger-editor-188349/ :banghead:
JASS:
<call CreateUnit()>
loop
call DisplayTextToForce( GetPlayersAll(), "Stage 1" )
set Data.Dummy<i> = CreateUnit(Data.TrigPlayer, GraphicDummyID, Data.CastX, Data.CastY, Data.Angle)
call DisplayTextToForce( GetPlayersAll(), "Stage 2" )
call UnitApplyTimedLife(Data.Dummy<i>, 039;BTLF039;, 0.5)
call DisplayTextToForce( GetPlayersAll(), "Stage 3" )
set i = i + 1
exitwhen i > NumberOfIllusions[Data.Level]
endloop</i></i>
Stage 2 is never reached.
JASS:
<call UnitDamageTarget>
loop
call GroupRefresh(g)
call DisplayTextToForce( GetPlayersAll(), "Stage 1" )
set u = FirstOfGroup(g)
call DisplayTextToForce( GetPlayersAll(), "Stage 2" )
exitwhen u == null
call DisplayTextToForce( GetPlayersAll(), "Stage 3" )
if not IsUnitType(u, UNIT_TYPE_STRUCTURE) and /*
*/not IsUnitType(u, UNIT_TYPE_MECHANICAL) and /*
*/not IsUnitAlly(u, FFData.TrigPlayer) and /*
*/not IsUnitAlive(u) then
set h = SquareRoot(Pow(GetUnitX(u) - FFData.TargetX, 2) + Pow(GetUnitY(u) - FFData.TargetY, 2))
set i = i + 1
if h <= 100.00 then
set r = 200 * I2R(FFData.Level + 1)
else// <---------------- here we do the math for each level rather than use ifs
set r = ((200 * I2R(FFData.Level + 1)) - (2 * I2R(FFData.Level + 1)) / 3 * (h - 100))
endif
endif
call DisplayTextToForce(GetPlayersAll(), "Stage 4")
call UnitDamageTargetEx(FFData.TrigUnit, u, r, false, false, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS)
call DisplayTextToForce( GetPlayersAll(), "Stage 5" )
call GroupRemoveUnit(g, u)
call DisplayTextToForce( GetPlayersAll(), "Stage 6" )
endloop
Stage 5 is never reached...
I don't understand why these functions don't work in the loops. Is it because of some setting in world editor, or is it a problem with NewGen?? Or is it UMSWE???? I installed NewGen according to this: http://www.hiveworkshop.com/forums/...ing-up-newgen-we-intro-trigger-editor-188349/ :banghead: