Here comes my problem. Im new to jass (rly new). This is first thing with loops im trying to make.
So, its supporsed to make simple circle of lightnings like that:
So, i tried to make something like that:
But theres some strange bug there On first use of the spell it looks like..:
I dont understand why =\ On second, third, etc uses it looks right how i need.
And if i try to make it localz, so it can be used by many units at one time, addin:
to code, lightnings do not even appear!
Please, i need some help with that =\
P.S. Dont u think there are 2 lightnings on one at red spot on first screenie? O_O
P.P.S. As always i apologize for sucky english
So, its supporsed to make simple circle of lightnings like that:
So, i tried to make something like that:
JASS:
local lightning s
local lightning p
local real a
local real b
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 8
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddLightningLoc( "CLPB", GetUnitLoc(GetSpellAbilityUnit()), PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), ( 200.00 + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_Hero, true)) * 5.00 ) ), udg_int[GetForLoopIndexA()]) )
set udg_int[( GetForLoopIndexA() + 1 )] = ( udg_int[GetForLoopIndexA()] + 45.00 )
set udg_spark[GetForLoopIndexA()] = GetLastCreatedLightningBJ()
set s = udg_spark[GetForLoopIndexA()]
set a = udg_int[GetForLoopIndexA()]
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
set bj_forLoopAIndex = 9
set bj_forLoopAIndexEnd = 17
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
call AddLightningLoc( "CLPB", PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), ( 200.00 + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_Hero, true)) * 5.00 ) ), udg_int[GetForLoopIndexA()]), PolarProjectionBJ(GetUnitLoc(GetSpellAbilityUnit()), ( 200.00 + ( I2R(GetHeroStatBJ(bj_HEROSTAT_INT, udg_Hero, true)) * 5.00 ) ), udg_int[( GetForLoopIndexA() + 1 )]) )
set udg_int[( GetForLoopIndexA() + 1 )] = ( udg_int[GetForLoopIndexA()] + 45.00 )
set udg_spark[GetForLoopIndexA()] = GetLastCreatedLightningBJ()
set p = udg_spark[GetForLoopIndexA()]
set b = udg_int[GetForLoopIndexA()]
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
But theres some strange bug there On first use of the spell it looks like..:
I dont understand why =\ On second, third, etc uses it looks right how i need.
And if i try to make it localz, so it can be used by many units at one time, addin:
JASS:
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 17
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
set udg_int[GetForLoopIndexA()] = b
set udg_spark[GetForLoopIndexA()] = s
set udg_int[GetForLoopIndexA()] = a
set udg_spark[GetForLoopIndexA()] = p
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
to code, lightnings do not even appear!
Please, i need some help with that =\
P.S. Dont u think there are 2 lightnings on one at red spot on first screenie? O_O
P.P.S. As always i apologize for sucky english