- Joined
- Sep 9, 2009
- Messages
- 658
I made a spell looks like this.
I realized later on that I could probably do it in one big loop. So I did.
the debug message shows the angle increasing by 30 degrees but only one lane of ice shows up. I think all three lanes are made on the same angle.
How do I do this in only one loop?
I realized later on that I could probably do it in one big loop. So I did.
JASS:
set pf = facing + 0.523
loop
exitwhen pi > 3
loop
exitwhen i > 8
set px = ux + distance * Cos(pf)
set py = uy + distance * Sin(pf)
call DestroyEffect(AddSpecialEffect(A, px, py))
call GroupEnumUnitsInRange(Group, px, py, 150, null)
loop
set f = FirstOfGroup(Group)
exitwhen f == null
if not IsUnitInGroup(f, g) and IsUnitEnemy(f, GetOwningPlayer(u)) and not IsUnitType(f, UNIT_TYPE_STRUCTURE) and not IsUnitType(f, UNIT_TYPE_FLYING) and not IsUnitType(f, UNIT_TYPE_DEAD) and GetUnitTypeId(f) !=0 then
call GroupAddUnit(g, f)
endif
call GroupRemoveUnit(Group, f)
endloop
set distance = distance + 100
set i = i + 1
endloop
set pf = pf - 0.523
call BJDebugMsg(R2S(pf))
set pi = pi + 1
endloop
the debug message shows the angle increasing by 30 degrees but only one lane of ice shows up. I think all three lanes are made on the same angle.
How do I do this in only one loop?