아래의 구문을 for문을 써서 간소화 시키고 싶습니다.
variables
{
player:
0: nowRound
}
action
{
Create Effect(Filtered Array(All Players(All Teams), Current Array Element.nowRound == Global.J[0]), Sphere, Red, Global.K[0],
Global.L[0], Visible To Position and Radius);
Create Effect(Filtered Array(All Players(All Teams), Current Array Element.nowRound == Global.J[1]), Sphere, Red, Global.K[1],
Global.L[1], Visible To Position and Radius);
}
이러한 내용을 for문을 사용해서 반복적인 부분을 줄일 수 있을까요?
J,K,L에 들어가는 숫자는 단계, 위치, 크기 값이 들어가 있는 배열 순서입니다.
순차적으로 1씩 늘어나요.
예를들면
variables
{
player:
0: nowRound
}
action
{
For Global Variable(U, 0, Count Of(Global.J) - 1, 1);
Wait(1, Ignore Condition);
Create Effect(Filtered Array(All Players(All Teams), Current Array Element.nowRound == Global.J[Global.U]), Sphere, Red,
Global.K[Global.U], Global.L[Global.U], Visible To Position and Radius);
End;
}
이런식으로 증가를 시켜주고 싶은데, J,K,L에 Global.U를 적어주니 생성되는 모든 이펙트가 배열의 마지막 장소에 중첩되서 생성이 됩니다.
이걸 각각 0~count of -1 수치만큼 반복문을 이용해서 배열 순서에 맞게 개별적으로 생성되게 하려면 어떻게 해야하나요?