[MV] 스크립트 반복문(요약문?)을 사용해서 전부 더하는 방법......

by 몽롱하다 posted Dec 16, 2016
?

단축키

Prev이전 문서

Next다음 문서

ESC닫기

크게 작게 위로 아래로 댓글로 가기 인쇄

안녕하세요... 모르는게 있어 질문드립니다....

 

 

 

 

기본 변수 메소드 - $gameVariables.setValue(value,n)

셀프 변수 플러그인 - this.get_self_variable(name,n)

 

 

 

 

질문드리는 식은 아래 초록색 식입니다.

 

for (var i = 0; i < 100; i++) {

$gameVariables.setValue(146, this.get_self_variable("병렬처리대상", i))

}

 

 

 

 

이렇게 썻는데 실행하면 작동은 되는데 게임상에서는

 

$gameVariables.setValue(146, this.get_self_variable("병렬처리대상", 1))

$gameVariables.setValue(146, this.get_self_variable("병렬처리대상", 2))

$gameVariables.setValue(146, this.get_self_variable("병렬처리대상", 3))

$gameVariables.setValue(146, this.get_self_variable("병렬처리대상", 99))

$gameVariables.setValue(146, this.get_self_variable("병렬처리대상", 100))

 

이렇게 표시나요?

 

 

 

 

 

$gameVariables.setValue(146, this.get_self_variable("병렬처리대상", 1~100))

아니면, 빨간색갈 부분의 숫자만 바뀌나요 ..................?

 

 

 

 

-----------------------------------------------------

 

 

 

 

 

$gameVariables.setValue(146, 이곳에)

 

위의 식의 '이곳에'라는 곳에 아래의 식을 다 더해서 넣어주고 싶습니다...

물론, 노가다로 1부터 100까지 직접 작성하는 방법이 있지만,

for문이나 어떠한 요약식으로 요약하여 1~100을 쉽게 더하는 방법이 있는지 질문드립니다... ㅠㅠ

 

this.get_self_variable("병렬처리대상", 1)

this.get_self_variable("병렬처리대상", 2)

this.get_self_variable("병렬처리대상", 3)

.

.

.

this.get_self_variable("병렬처리대상", 99)

this.get_self_variable("병렬처리대상", 100)

 

어떻게 써야 1~100까지 위의 문장을 반복해서 더해줄 수가 있을까요?

 

$gameVariables.setValue(146, this.get_self_variable("병렬처리대상", 1) + .................... + this.get_self_variable("병렬처리대상", 100))

 

이런 느낌입니다...

 

도와주세요 ㅠㅠ


Articles

8 9 10 11 12 13 14 15 16 17