조회 수 2884 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

 사용 에디터 : RPG Maker VX Ace Lite

   Gemini



 연구한 이유 : RPG Maker VX Ace Lite에서 Event 생성 제한(이벤트 생성 10개 초과 불가능)에 따른 문제점을 타파하기 위해 연구했습니다.


 문제점 : 스크립트가 길어집니다.

     Tool로 작업이 제한됩니다.(10개 초과된 이벤트를 선택시 오류 메세지가 작동됩니다.)

             쉽게 사용하기가 어렵습니다.

             이벤트 코드를 암기 및 알고 있어야합니다.(이벤트 코드에 관련된 것은 스크립트로 수정을 하여 처리가 가능합니다. 꼭 암기할 필요는 없습니다만, 알고있어야됩니다.)


 장점 : 일반화된 스크립트가 완성되면, Tool의 제약을 받지 않고 에딧팅 할 수 있습니다.



 스크립트

 Map001에 대해서만 기록합니다.

 선택지 로 1,2,3,4,5,6에서 고를시 텍스트 1,2,3,4,5,6이 나오게 되는 스크립트입니다.

 

data_map      = load_data("Data/Map001.rvdata2")

data_map.events.store(1,RPG::Event.new(0,0))

data_map.events[1].pages[0].list.clear

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(102,0,[["1","2","3","4","5","6"],0]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(402,0,[0,"1"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(101,1,["",0,0,2]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(401,1,["1"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(402,0,[1,"2"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(101,1,["",0,0,2]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(401,1,["2"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(402,0,[2,"3"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(101,1,["",0,0,2]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(401,1,["3"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(402,0,[5,"4"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(101,1,["",0,0,2]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(401,1,["4"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(402,0,[4,"5"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(101,1,["",0,0,2]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(401,1,["5"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(402,0,[3,"6"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(101,1,["",0,0,2]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(401,1,["6"]))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(403,0,0))

data_map.events[1].pages[0].list.push(RPG::EventCommand.new(0,0,0))#안전을 위한 Event 없으면 오류날 가능성 높습니다.

save_data(data_map,"Data/Map001.rvdata2")


설명

 data_map으로 맵을 불러와서 데이터를 메모리에 올린 후,

 이벤트들을 모아둔 해쉬 데이터인 events에, 첫번째 이벤트(key가 숫자 1인 이벤트)를 추가시킵니다.

 여기서 RPG에 정의된 클래스인 Event을 생성합니다.


  data_map.events.store(1,RPG::Event.new(0,0))


 여기서 1은 1번 이벤트(첫번째 이벤트)를 뜻하고, RPG::Event.new(0,0)는 새로 생성하는 이벤트 좌표가 0,0이라는 뜻입니다.

 

 이벤트 구조는 맵의 좌표값과 페이지를 저장시키고 있는 배열을 가집니다.(기타 강좌  을 참고)

 페이지는 이벤트 커맨드(실제 이벤트의 내용물)와 그래픽 행동 양식을 포장하고 있습니다.


 그래서 pages[0](첫번째 페이지)에 들어가서 list(이벤트 커맨드가 저장되어 있는 변수)를 변경해줍니다.


data_map.events[1].pages[0].list.clear


 new을 사용하면, 클래스는 최초에 초기화를 거치게 되어 간단하게 만들기 위해서 일단 다 비우는 스크립트입니다.


data_map.events[1].pages[0].list.push(RPG::EventCommand.new(102,0,[["1","2","3","4","5","6"],0]))

...


 이벤트 커맨드 입력 스크립트입니다.

 이벤트 커맨드는 이벤트 코드라는 것을 가지고 있으며( 참조), 코드에 따라서 행해지는 이벤트가 달라집니다.

 에 보면, 102는 선택지 추가이며, 0은 들여쓰기(이벤트 발동 위치; 만약, 이벤트가 1에 발동 하는 중에 0으로 가는 경우는 이벤트의 끝(선택의 경우 when cancel)이 정의 되지 않았을때는 발동되지 않습니다,) []매개변수(매개 변수가 없을 경우 []로 만들거나 0으로 할 것.)입니다.


 매개변수는 이벤트 코드에 따라서 바뀌며, 일반적으로, Tool에 있는 순서대로 따라갑니다.

 이벤트 코드에 따라서 단일 이벤트인 경우가 있고, 복합(2개 이상의 이벤트 구조)를 가집니다.

 선택지, 글자 같은 경우 복합 이벤트 구조이고, 스위치 on/off, 변수값 지정, 타이틀 화면으로 이동 같은 경우 단일 이벤트 구조입니다.


save_data(data_map,"Data/Map001.rvdata2")


 적용을 위해서 저장시킵니다.


 윗 코드를 적용 시킬시 선택지는 6개가 나타나게되고, 글자가 출력됩니다.


 만약,

      Tool로 작업이 제한됩니다.(10개 초과된 이벤트를 선택시 오류 메세지가 작동됩니다.)

 이게 문제라면, 윗 방법으로 처리할 수 있는 소스는 다음과 같습니다.


 Tools에서 제한 하는 것은 key 값이 10을 초과하면, 오류 메세지를 출력하도록 만들기 때문에, 다음과 같이 만드시면, 이상이 없습니다.


tt = 11

te = Hash.new

for i1 in data_map.events.keys

te.store(tt,data_map.events[i1])

tt+=1

end

data_map.events=te

save_data(data_map,"Data/Map001.rvdata2")


이런식으로 짜시면, 뒤로 밀리면서 Tool로 이벤트를 계속 추가 할 수 있습니다.(단, 뒤로 밀린 이벤트는 다시 수정 불가능합니다. 이거 쓰시기 전에 완전히 이벤트를 완성 시킨 후에 실행 시키시길 바랍니다.)

?
  • ?
    123123 2020.06.22 17:27
    Lite 뿐만 아니라 스크립트로 이벤트를 생성하는 방법을 찾고 있었는데, 도움이 되었습니다. 감사합니다.

  1. 게임제작강좌 A-Z 색인 (2016.1.24 ver)

    Date2016.01.12 Category초급강의실 By천무 Views7877 Votes1
    read more
  2. [RMMV] 크로노 엔진(Chrono Engine) 플러그인 사용법

    Date2017.07.16 Category고급강의실 By러닝은빛 Views3874 Votes2
    Read More
  3. [MV플러그인] Armor Scaling 강의

    Date2016.02.13 Category고급강의실 By백난화백 Views3688 Votes2
    Read More
  4. [MV플러그인] Action Sequence 강의

    Date2016.02.12 Category고급강의실 By백난화백 Views5772 Votes1
    Read More
  5. [동영상] 스크립트 나도좀 잘해보자 -1-

    Date2016.02.04 Category고급강의실 By천무 Views1791 Votes1
    Read More
  6. PIXI Filter 총정리 (PIXI 2.2.9)

    Date2016.01.18 Category고급강의실 By러닝은빛 Views18771 Votes3
    Read More
  7. [RGSS2 강좌] 기초편 2. 변수와 상수

    Date2016.01.10 Category고급강의실 By천무 Views697 Votes0
    Read More
  8. [RGSS2 강좌] 기초편 1. 소개

    Date2016.01.10 Category고급강의실 By천무 Views1110 Votes0
    Read More
  9. Rpg Maker MV 함수 리스트(공식포럼)

    Date2016.01.10 Category고급강의실 Byplam Views1473 Votes1
    Read More
  10. 타이틀에 동영상을 넣는 플러그인 사용법

    Date2016.01.08 Category고급강의실 By러닝은빛 Views2768 Votes1
    Read More
  11. RPG Maker MV 메모리 누수 문제 해결법

    Date2016.01.07 Category고급강의실 By러닝은빛 Views4914 Votes1
    Read More
  12. XP to MV 컨버터 사용법

    Date2015.12.28 Category고급강의실 By러닝은빛 Views2926 Votes0
    Read More
  13. 기본 게임 폰트를 다른 폰트로 바꾸기

    Date2015.12.21 Category고급강의실 By러닝은빛 Views7675 Votes0
    Read More
  14. 처음부터 전체화면으로 시작하기

    Date2015.12.21 Category고급강의실 By러닝은빛 Views4479 Votes0
    Read More
  15. [RPG MV] 타이틀 메뉴 일부 없애기

    Date2015.12.20 Category고급강의실 By박야옹 Views3952 Votes1
    Read More
  16. [RPGMV Plugin 영상] 무작정 해보기 "Gameus' Quest System"

    Date2015.12.20 Category고급강의실 By천무 Views1944 Votes0
    Read More
  17. [RPGMV Plugin 영상] 무작정 해보기 "심플ATB"

    Date2015.12.20 Category고급강의실 By천무 Views1230 Votes0
    Read More
  18. VX Ace to MV 컨버터 사용법 ( .rvdata2 → .json )

    Date2015.12.14 Category고급강의실 By러닝은빛 Views7495 Votes0
    Read More
  19. [RPGMV Plugin 영상] 한국어 조사처리, 해상도변경 플러그인!!

    Date2015.12.12 Category고급강의실 By천무 Views1498 Votes0
    Read More
  20. [소공지] 플러그인 무작정 해드린다 진행해봅니다.

    Date2015.12.09 Category고급강의실 By천무 Views733 Votes0
    Read More
  21. [RPGMV Plugin 영상] 한글이름 입력, 전투속도증가 플러그인!!

    Date2015.12.09 Category고급강의실 By천무 Views2056 Votes0
    Read More
Board Pagination Prev 1 2 3 4 Next
/ 4


[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)