XP 스크립트

메뉴를 바꾸는 스크립트

by. №1

 

[소개]

이 스크립트는 장비, 스킬등등을 안띄우고 싶을 때 사용하시면 됩니다.

제가 습작님이 올리신 ESG(Etude87's Script Generator ver.1.62)를 이용해 만들어봤습니다.

 

일단 아이템, 저장, 종료만 있는 메뉴 스크립트입니다.

 

--------------------------------------아래부터---------------------------------------

 

class Scene_Menu
  def main
    s0 = $data_system.words.item
    s1 = "세이브"
    s2 = "게임 종료"
    @command_window = Window_Command.new(160, [s0, s1, s2])
    @command_window.index = @menu_index
    if $game_party.actors.size == 0
      @command_window.disable_item(0)
    end
    if $game_system.save_disabled
      @command_window.disable_item(1)
    end
    @playtime_window = Window_PlayTime.new
    @playtime_window.x = 0
    @playtime_window.y = 224
    @steps_window = Window_Steps.new
    @steps_window.x = 0
    @steps_window.y = 320
    @gold_window = Window_Gold.new
    @gold_window.x = 0
    @gold_window.y = 416
    @status_window = Window_MenuStatus.new
    @status_window.x = 160
    @status_window.y = 0
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @command_window.dispose
    @playtime_window.dispose
    @steps_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      if $game_party.actors.size == 0 and (@command_window.index != 1 or @command_window.index != 2)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @command_window.index
      when 0
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Item.new
      when 1
        if $game_system.save_disabled
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Save.new
      when 2
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_End.new
      end
      return
    end
  end
end
class Scene_Item
  def update_item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(0)
      return
    end
    if Input.trigger?(Input::C)
      @item = @item_window.item
      unless @item.is_a?(RPG::Item)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      unless $game_party.item_can_use?(@item.id)
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      if @item.scope >= 3
        @item_window.active = false
        @target_window.x = (@item_window.index + 1) % 2 * 304
        @target_window.visible = true
        @target_window.active = true
        if @item.scope == 4 || @item.scope == 6
          @target_window.index = -1
        else
          @target_window.index = 0
        end
      else
        if @item.common_event_id > 0
          $game_temp.common_event_id = @item.common_event_id
          $game_system.se_play(@item.menu_se)
          if @item.consumable
            $game_party.lose_item(@item.id, 1)
            @item_window.draw_item(@item_window.index)
          end
          $scene = Scene_Map.new
          return
        end
      end
      return
    end
  end
end
class Scene_Save < Scene_File
  def on_decision(filename)
    $game_system.se_play($data_system.save_se)
    file = File.open(filename, "wb")
    write_save_data(file)
    file.close
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    $scene = Scene_Menu.new(1)
  end
  def on_cancel
    $game_system.se_play($data_system.cancel_se)
    if $game_temp.save_calling
      $game_temp.save_calling = false
      $scene = Scene_Map.new
      return
    end
    $scene = Scene_Menu.new(1)
  end
end
class Scene_End
  def update
    @command_window.update
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Menu.new(2)
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0
        command_to_title
      when 1
        command_shutdown
      when 2
        command_cancel
      end
      return
    end
  end
  def command_cancel
    $game_system.se_play($data_system.decision_se)
    $scene = Scene_Menu.new(2)
  end
end

 

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

 

이번엔 아예 메뉴창 안띄우기

 

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

 

class Scene_Map
  def call_menu
  end
end

 

 

 

 

P.S.그리고 이것 말고도 다르게 하시려면 댓글로 달아주세요. 혹은 습작님이 올리신 ESG를 다운받으셔서 직접 만드셔도 되고요.

Comment '14'
  • profile
    습작 2012.08.04 19:07

    ESG는 미리 작성된 코드를 사용자의 선택에 따라서 재배치하여 출력하는 간단한 GUI 입니다. 원본 코드는 Enterbrain社에 저작권이 있으며, 저는 해당 코드를 수정한 사람이 되겠습니다. ESG를 사용하여 출력이후 해당 코드를 추가 수정하지 않으셨다면 게시자 본인 이름으로 배포를 삼가해 주시면 감사하겠습니다.^^;

  • ?
    №1 2012.08.05 14:00

    알겠습니다 ^^

  • profile
    푸솜양 2012.09.19 19:43
    잘 가져갑니다!
  • ?
    푸솜양님 축하합니다.^^ 2012.09.19 19:43
    포인트 팡팡!에 당첨되셨습니다.
    푸솜양님은 16포인트를 보너스로 받으셨습니다.
  • ?
    아쉐메레스 2012.12.11 20:24
    잘쓰겠습니다!
  • profile
    간담보이 2012.12.22 16:06
    다른건 다 있고 저장만 없는건 없나요?
    여관 같은 데서만 저장을 할수 있게 하려구요..
  • profile
    존재감제로 2013.03.16 12:33
    세이브 금지의 변경 쓰면 되지 않나요?
  • ?
    구름인간 2013.04.25 15:49
    간담보이님이 세이브금지의변경을 몰라서 질문하신것보다는...
    메뉴커맨드자체의 세이브를 없애고 싶으셔서 질문하신것같네요ㅇㅅㅇ
  • profile
    간담보이 2013.05.30 15:08
    네.. 세이브가 있는데 않되면..
    플레이하는 입장으로도 좀 짜증나니까요
  • ?
    프리다 2013.04.07 12:09
    잘 쓰겠습니다!
  • ?
    JellyBean 2013.09.26 18:42
    탈출맵에 유용하겠군요
    잘 사용하겟습니다.
  • profile
    아방스닉넴 2014.11.23 00:21
    감사합니다^^
  • ?
    dnjs1580 2016.05.18 19:08
    감사합니다!
  • ?
    치킨수련 2019.02.18 14:21
    잘쓰게습니다

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
1021 액터 (killer님 요청)자동회복 스크립트 3 나뚜루 2009.02.22 2572
1020 기타 (T-RPG) 데미지 표시 시의 폰트를 설정 백호 2009.02.22 1348
1019 메뉴 1-Scene CMS 1.03 by LegACy@rmxp.org (SDK호환) file 백호 2009.02.22 871
1018 메뉴 1-Scene CMS 1.1 by LegACy@rmxp.org (SDK호환) file 백호 2009.02.22 953
1017 메뉴 1-Scene CMS 1.16 by LegACy (SDK호환) 3 file 백호 2009.02.22 1564
1016 메시지 1문자식 표시랑 따랑소리 나는 스크립트 8 백호 2009.02.22 2304
1015 메뉴 1인 캐릭터 메뉴 스크립트 27 file - 하늘 - 2009.08.06 4789
1014 메뉴 1인용 메뉴 스크립트 6 WMN 2008.03.17 2450
1013 메뉴 3D Menu Script 7 현문 2010.10.06 4077
1012 기타 3d 렌더링스크립트 어렵게 찾음 9 라구나 2011.03.05 3610
1011 이동 및 탈것 3D 캐릭 스크립트 7 백호 2009.02.22 3443
1010 기타 3D스크립트 48 file ok하승헌 2010.02.18 3808
1009 기타 4방향 마우스 스크립트 12 file 아방스 2009.02.28 2662
1008 기타 8방향 마우스 스크립트 10 file 아방스 2009.02.28 4063
1007 이동 및 탈것 8방향 스크립트 12 file 백호 2009.02.21 2412
1006 이동 및 탈것 8방향 이동 & 대쉬 스크립트 5 백호 2009.02.21 1703
1005 이동 및 탈것 8방향움직임과 8방향 캐릭터칩 호환 2 file 백호 2009.02.21 2273
1004 이동 및 탈것 8방향이동 9 캉쿤 2011.09.19 2529
1003 이동 및 탈것 8방향이동, Shift키 누르면 대쉬 63 WinHouse 2010.06.12 4025
1002 전투 A-battle 수정 file 백호 2009.02.21 1155
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ... 52 Next
/ 52