RPGXP 스크립트
2013.10.21 06:49

문과 상자를 쉽게 만들수 있는 스크립트

조회 수 2242 추천 수 0 댓글 18
?

단축키

Prev이전 문서

Next다음 문서

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

단축키

Prev이전 문서

Next다음 문서

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

#
# 이벤트 이름에 따라 상자 또는 문으로 작동할 수 있도록 합니다.
# 제작자 jinoh67 (nil)
#
# 비밀번호 형식 (xxxx부분) :
#  1714 -> 비밀번호는 1714이다.
#  012345 -> 비밀번호는 012345이다.
#  v32 -> 비밀번호는 32번 변수의 값이다.
#
# 상자 사용 방법 (이벤트 명령 사용 불가능) :
#  이벤트 이름을 다음과 같은 형식으로 지정해준다.
#
#   _CHEST12 -> 12번 아이템을 얻는다.
#   _CHEST12x4 -> 12번 아이템을 4개 얻는다.
#   _CHEST12_PWDxxxx -> 비밀번호를 입력하면 12번 아이템을 얻는다.
#   _CHEST12x4_PWDxxxx -> 비밀번호를 입력하면 12번 아이템을 4개 얻는다.
#   _CHESTPWDxxxx -> 플레이어를 낚는다.
#
# 문 사용 방법 (비밀번호가 맞을 시 이벤트 명령 실행) :
#   이벤트 이름을 다음과 같은 형식으로 지정해준다.
#   _DOORxxxx -> 비밀번호를 입력하면 이벤트 명령을 실행한다.
#


class Game_Event
  def str2num (str, offset = 0, var = nil, bdg = nil, final = nil)
    i = offset
    if final == nil
      final = str.size
    end
    val = 0
    while i < final && '0'[0] <= str[i] && str[i] <= '9'[0]
      val = val * 10 + (str[i] - '0'[0])
      i += 1
    end
    if var != nil && bdg != nil
      eval "#{var} = " + i.to_s, bdg
    end
    return val
  end
  
  def self.setup2
    waitCmd = RPG::MoveCommand.new(15, [2])
    stopCmd = RPG::MoveCommand.new(0, [])
    k = RPG::MoveRoute.new
    k.repeat = false
    k.skippable = false
    k.list = []
    for i in 16..19 do
      k.list.push (RPG::MoveCommand.new(i))
      k.list.push (waitCmd)
    end
    k.list.push (stopCmd)
    @@openChestMoveRoute = k
    k = RPG::MoveRoute.new
    k.repeat = false
    k.skippable = false
    k.list = []
    for i in 0..3 do
      k.list.push (RPG::MoveCommand.new(19 - i))
      if i < 3
        k.list.push (waitCmd)
      end
    end
    k.list.push (stopCmd)
    @@closeChestMoveRoute = k
    k = RPG::MoveRoute.new
    k.repeat = false
    k.skippable = false
    k.list = [RPG::MoveCommand.new(16), stopCmd]
    @@initalChestMoveRoute = k
    @@chest_array = [];
  end

  self.setup2
  
  def scan_pwd (str, offset, var = nil, bdg = nil)
    @pwd_len = 4
    @pwd_type = 0
    @pwd = nil
    if str[offset] == 'v'[0]
      @pwd_type = 1
      @pwd = str2num (str, offset + 1, var, bdg)
    else
      @pwd_type = 2
      k = nil
      @pwd = str2num (str, offset, :k, binding)
      if var != nil && bdg != nil
        eval "#{var} = " + k.to_s, bdg
      end
      @pwd_len = k - offset
      if @pwd_len <= 0
        @pwd_type = 0
        @pwd = nil
        @pwd_len = 0
      end
    end
  end
  
  alias :refresh_old :refresh

  def refresh # call this method at last in refresh method
    refresh_old
    cn = @event.name
    if cn.index ('_CHEST') == 0
      # get chest number
      @chest_id = @@chest_array.index (self)
      if @chest_id == nil
        @chest_id = @@chest_array.push (self).size - 1
      end
      @chest_id += $chest_start
      
      # scan
      i = 0
      @chest_item = str2num (cn, 6, :i, binding)
      if @chest_item <= 0 || $data_items.size <= @chest_item
        @chest_item = nil
      else
        @item_name = $data_items[@chest_item].name
        k = cn.index('x', i)
        if k != nil
          @chest_quantity = str2num (cn, k + 1, :i, binding)
        else
          @chest_quantity = 1
        end
      end
      i = cn.index('_PW', i) # _CHEST_PW
      @pwd_len = 4
      if i == nil
        @pwd_type = 0 # No password
        @pwd = nil
      else
        scan_pwd (cn, i + 3, :i, binding)
      end
      
      # setup
      @walk_anime = false
      @direction_fix = false
      
      # generate
      @list = [
        RPG::EventCommand.new(209, 0, [0, @@initalChestMoveRoute]),
        RPG::EventCommand.new(111, 0, [2, 0, 0]),
          RPG::EventCommand.new(209, 1, [0, @@openChestMoveRoute]),
          RPG::EventCommand.new(250, 1, [RPG::AudioFile.new("044-Chest01")]),
          RPG::EventCommand.new(210, 1, []),
          RPG::EventCommand.new(101, 1, ["상자가 비었다."]),
          RPG::EventCommand.new(209, 1, [0, @@closeChestMoveRoute]),
          RPG::EventCommand.new(250, 1, [RPG::AudioFile.new("024-Door01")]),
        RPG::EventCommand.new(411, 0, [])
        ];
      ind = 1
      if @pwd_type > 0
        @list.push (RPG::EventCommand.new(101, ind, ["비밀번호가 걸려있다."]))
        @list.push (RPG::EventCommand.new(122, ind, [$tmp_id, $tmp_id, 0, 0, 0]))
        @list.push (RPG::EventCommand.new(103, ind, [$tmp_id, @pwd_len]))
        if @pwd_type == 2
          @list.push (RPG::EventCommand.new(111, ind, [1, $tmp_id, 0, @pwd, 0]))
        else
          @list.push (RPG::EventCommand.new(111, ind, [1, $tmp_id, 1, @pwd, 0]))
        end
        ind += 1
      end
      @list.push(RPG::EventCommand.new(209, ind, [0, @@openChestMoveRoute]))
      @list.push(RPG::EventCommand.new(250, ind,
        [RPG::AudioFile.new("044-Chest01")]))
      @list.push(RPG::EventCommand.new(210, ind, []))
      @list.push(RPG::EventCommand.new(123, ind, [0, 0]))
      if @chest_item == nil
        @list.push(RPG::EventCommand.new(101, ind,
          [(@pwd_type > 0 ? "비밀번호까지 걸렸는데 " : "") + "상자가 비었다."]))
      else
        @list.push(RPG::EventCommand.new(126, ind,
          [@chest_item, 0, 0, @chest_quantity]))
        @list.push(RPG::EventCommand.new(101, ind,
          [@item_name + "을 " + @chest_quantity.to_s + "개 얻었다."]))
      end
      @list.push(RPG::EventCommand.new(209, ind, [0, @@closeChestMoveRoute]))
      @list.push(RPG::EventCommand.new(250, ind,
        [RPG::AudioFile.new("024-Door01")]))
      if @pwd_type > 0
        @list.push (RPG::EventCommand.new(411, ind - 1, []))
        @list.push (RPG::EventCommand.new(101, ind, ["비밀번호가 틀린 듯하다."]))
      end
      for i in 0..(ind-1)
        @list.push (RPG::EventCommand.new(0, i, []))
      end
      # @page.list = @list
    elsif cn.index ("_DOOR") == 0
      # get door number
      list_bkup = @list
      scan_pwd (cn, 5)
      if @pwd_type == 0
        return
      end
      @list = [
        RPG::EventCommand.new(111, 0, [2, 0, 1]),
          RPG::EventCommand.new(101, 1, ["비밀번호가 걸려있다."]),
          RPG::EventCommand.new(122, 1, [$tmp_id, $tmp_id, 0, 0, 0]),
          RPG::EventCommand.new(103, 1, [$tmp_id, @pwd_len]),
          RPG::EventCommand.new(111, 1, [1, $tmp_id, 0, @pwd, 5]),
            RPG::EventCommand.new(101, 2, ["비밀번호가 틀린 듯하다."]),
            RPG::EventCommand.new(115, 2, []),
          RPG::EventCommand.new(123, 1, [0, 0]),
        RPG::EventCommand.new(0, 0, [])
      ]
      if (@pwd_type == 1)
        @list[4] = RPG::EventCommand.new(111, 1, [1, $tmp_id, 1, @pwd, 5])
      end
      @list.concat(list_bkup)
    end
  end
end

?
  • ?
    두부 2013.10.26 05:26
    vx va는 간단하게 작성하기에서 있는데

    xp는 집적 만들어야하니 불편한점이 있었는데...

    감사합니다!
  • ?
    2013.10.26 05:57
    수정했습니다
  • ?
    exam 2013.11.10 00:34
    잘 보고갑니다
  • ?
    XP데이 2013.11.17 02:53
    exam님은 nil님을호출을받자
    누구인줄몰랐습니다.
  • ?
    2013.11.10 04:40
    nil님이 exam님을 호출하였습니다.
  • ?
    exam 2013.11.10 04:38

    전 킹카보단
    잉여킹차가 더 좋을것 같네요 ㅋㅋ
  • ?
    2013.11.10 04:36
    잉여킹카는 어때요?
  • ?
    exam 2013.11.10 04:25
    전 잉여빵보단 잉여킹을 더 좋아합니다 ㅋㅋ
  • ?
    2013.11.10 04:23
    잉여빵은요??

    아 맞다 농구할때 드립을 왜 하죠???
  • ?
    exam 2013.11.10 04:23
    ㅋㅋ
    그래서 제가 잉여맨을 좋아합니다
    (죄송 드립임)
  • ?
    2013.11.10 04:21
    이런 잉여스러운 스크립트에 댓글을 달아 주시다니!!! ㄱㅅ
  • ?
    exam 2013.11.10 04:38
    한국어를 사용합시다
  • ?
    exam 2013.11.10 04:41
    네 모바일 ㅠㅠ
  • ?
    2013.11.10 04:39
    윗부분에 한국어를 주석으로 사용했습니다 :)
    허허 댓글 올린 현재 모바일이시군요 채팅방에 없는거보니
  • ?
    exam 2013.11.10 04:42
    근데 저 스크립트요
    수정해서 붙여넣기 해야되나요
    아니면 그냥 붙여넣기 하면되나요?
  • ?
    2013.11.10 05:18
  • ?
    exam 2013.11.10 05:02

    쓰신 글에서 더 추가안 해도 되죠?
  • ?
    2013.11.10 05:01
    새로 스크립트 만들어서 붙여넣기하세요

  1. 퀘스트 스크립트

  2. 메뉴에 퀘스트 있는거

  3. 문과 상자를 쉽게 만들수 있는 스크립트

  4. 이름조합스크립트

  5. 아이템 조합 스크립트

  6. 모션 스크립트

  7. 메세지에 얼굴, 이름등 다양한 기능 넣기 UMS 스크립트

  8. 타이틀 로고 띄우기 + 로고 SE 가능(예제있음)

  9. Rpg Vx Ace 에서 이벤트 이름 팝업

  10. 3D스크립트!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  11. AraLab_MultiStartingPoint (다중 출발점 스크립트, 캐릭터 선택 스크립트) ver.0.2beta

  12. 8방향 이동스크립트

  13. 달리기스크립트

  14. 스텟찍기스크립트

  15. 말풍선 메세지 스크립트

  16. 횡스크롤 점프 [버튼허용스위치추가]

  17. 얼굴표시/문장을 한글자씩 나타내주는 스크립트 (출처-히페리온)

  18. RPG Maker VX Ace용 로고 스크립트

  19. RPG Maker VX Ace용 640*480 리사이징 스크립트

  20. VX Ace 스크립트 사이트

Board Pagination Prev 1 ... 4 5 6 7 8 9 10 11 12 13 ... 15 Next
/ 15






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

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