질문과 답변

Extra Form

메뉴를 수정하고 세이브 금지를 하더니 세이브 금지가 안되네여...

겨우 스크립트 쪼끔 수정하고 나면 반투명은 됬는데 버튼누르니까 들어가더라군요..

최대한 짧게 설명하기 위해서 수정한 스크립트를 적겠습니다.

 

Scene_Menu

#==============================================================================
# ■ Scene_Menu
#------------------------------------------------------------------------------
# 메뉴 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     menu_index : 커멘드의 커서 초기 위치
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ● 개시 처리
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 360)
    @status_window = Window_MenuStatus.new(160, 0)
  end
  #--------------------------------------------------------------------------
  # ● 종료 처리
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 윈도우의 작성
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    s5 = Vocab::save
    s6 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s5, s6])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # 파티 인원수가 0 명의 경우
      @command_window.draw_item(0, false)     # 아이템을 무효화
      @command_window.draw_item(1, false)     # 스킬을 무효화
      @command_window.draw_item(2, false)     # 장비를 무효화
      @command_window.draw_item(3, false)     # 스테이터스를 무효화
    end
    if $game_system.save_disabled             # 세이브 금지의 경우
      @command_window.draw_item(1, false)     # 세이브를 무효화
    end
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 선택의 갱신
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # 아이템
        $scene = Scene_Item.new
      when 4,5,3  # 스킬, 장비, 스테이터스
        start_actor_selection
      when 1      # 세이브
        $scene = Scene_File.new(true, false, false)
      when 2      # 게임 종료
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 액터 선택의 개시
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # ● 액터 선택의 종료
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  #--------------------------------------------------------------------------
  # ● 액터 선택의 갱신
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # 스킬
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # 장비
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # 스테이터스
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end

 

Scene_File

#==============================================================================
# ■ Scene_File
#------------------------------------------------------------------------------
# 저장 파일 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_File < Scene_Base
  #--------------------------------------------------------------------------
  # ● 오브젝트 초기화
  #     saving     : 세이브 플래그 (false 라면 로드 화면)
  #     from_title : 타이틀의 「이어서 하기」로 불려 간 플래그
  #     from_event : 이벤트의 「세이브 화면의 호출」로 불려 간 플래그
  #--------------------------------------------------------------------------
  def initialize(saving, from_title, from_event)
    @saving = saving
    @from_title = from_title
    @from_event = from_event
  end
  #--------------------------------------------------------------------------
  # ● 개시 처리
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    @help_window = Window_Help.new
    create_savefile_windows
    if @saving
      @index = $game_temp.last_file_index
      @help_window.set_text(Vocab::SaveMessage)
    else
      @index = self.latest_file_index
      @help_window.set_text(Vocab::LoadMessage)
    end
    @savefile_windows[@index].selected = true
  end
  #--------------------------------------------------------------------------
  # ● 종료 처리
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @help_window.dispose
    dispose_item_windows
  end
  #--------------------------------------------------------------------------
  # ● 원래의 화면에 돌아온다
  #--------------------------------------------------------------------------
  def return_scene
    if @from_title
      $scene = Scene_Title.new
    elsif @from_event
      $scene = Scene_Map.new
    else
      $scene = Scene_Menu.new(1)
    end
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @help_window.update
    update_savefile_windows
    update_savefile_selection
  end
  #--------------------------------------------------------------------------
  # ● 세이브 파일 윈도우의 작성
  #--------------------------------------------------------------------------
  def create_savefile_windows
    @savefile_windows = []
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
    end
    @item_max = 1
  end
  #--------------------------------------------------------------------------
  # ● 세이브 파일 윈도우의 해방
  #--------------------------------------------------------------------------
  def dispose_item_windows
    for window in @savefile_windows
      window.dispose
    end
  end
  #--------------------------------------------------------------------------
  # ● 세이브 파일 윈도우의 갱신
  #--------------------------------------------------------------------------
  def update_savefile_windows
    for window in @savefile_windows
      window.update
    end
  end
  #--------------------------------------------------------------------------
  # ● 세이브 파일 선택의 갱신
  #--------------------------------------------------------------------------
  def update_savefile_selection
    if Input.trigger?(Input::C)
      determine_savefile
    elsif Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    else
      last_index = @index
      if Input.repeat?(Input::DOWN)
        cursor_down(Input.trigger?(Input::DOWN))
      end
      if Input.repeat?(Input::UP)
        cursor_up(Input.trigger?(Input::UP))
      end
      if @index != last_index
        Sound.play_cursor
        @savefile_windows[last_index].selected = false
        @savefile_windows[@index].selected = true
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 세이브 파일의 결정
  #--------------------------------------------------------------------------
  def determine_savefile
    if @saving
      Sound.play_save
      do_save
    else
      if @savefile_windows[@index].file_exist
        Sound.play_load
        do_load
      else
        Sound.play_buzzer
        return
      end
    end
    $game_temp.last_file_index = @index
  end
  #--------------------------------------------------------------------------
  # ● 커서를 아래에 이동
  #     wrap : rack-around 허가
  #--------------------------------------------------------------------------
  def cursor_down(wrap)
    if @index < @item_max - 1 or wrap
      @index = (@index + 1) % @item_max
    end
  end
  #--------------------------------------------------------------------------
  # ● 커서를 위에 이동
  #     wrap : rack-around 허가
  #--------------------------------------------------------------------------
  def cursor_up(wrap)
    if @index > 0 or wrap
      @index = (@index - 1 + @item_max) % @item_max
    end
  end
  #--------------------------------------------------------------------------
  # ● 파일명의 작성
  #     file_index : 세이브 파일의 인덱스 (03)
  #--------------------------------------------------------------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rvdata"
  end
  #--------------------------------------------------------------------------
  # ● 타임 스탬프가 최신의 파일을 선택
  #--------------------------------------------------------------------------
  def latest_file_index
    index = 0
    latest_time = Time.at(0)
    for i in 0...@savefile_windows.size
      if @savefile_windows[i].time_stamp > latest_time
        latest_time = @savefile_windows[i].time_stamp
        index = i
      end
    end
    return index
  end
  #--------------------------------------------------------------------------
  # ● 세이브의 실행
  #--------------------------------------------------------------------------
  def do_save
    file = File.open(@savefile_windows[@index].filename, "wb")
    write_save_data(file)
    file.close
    return_scene
  end
  #--------------------------------------------------------------------------
  # ● 로드의 실행
  #--------------------------------------------------------------------------
  def do_load
    file = File.open(@savefile_windows[@index].filename, "rb")
    read_save_data(file)
    file.close
    $scene = Scene_Map.new
    RPG::BGM.fade(1500)
    Graphics.fadeout(60)
    Graphics.wait(40)
    @last_bgm.play
    @last_bgs.play
  end
  #--------------------------------------------------------------------------
  # ● 세이브 데이터의 기록
  #     file : 쓰기용 파일 오브젝트 (오픈이 끝난 상태)
  #--------------------------------------------------------------------------
  def write_save_data(file)
    characters = []
    for actor in $game_party.members
      characters.push([actor.character_name, actor.character_index])
    end
    $game_system.save_count += 1
    $game_system.version_id = $data_system.version_id
    @last_bgm = RPG::BGM::last
    @last_bgs = RPG::BGS::last
    Marshal.dump(characters,           file)
    Marshal.dump(Graphics.frame_count, file)
    Marshal.dump(@last_bgm,            file)
    Marshal.dump(@last_bgs,            file)
    Marshal.dump($game_system,         file)
    Marshal.dump($game_message,        file)
    Marshal.dump($game_switches,       file)
    Marshal.dump($game_variables,      file)
    Marshal.dump($game_self_switches,  file)
    Marshal.dump($game_actors,         file)
    Marshal.dump($game_party,          file)
    Marshal.dump($game_troop,          file)
    Marshal.dump($game_map,            file)
    Marshal.dump($game_player,         file)
  end
  #--------------------------------------------------------------------------
  # ● 세이브 데이터의 읽기
  #     file : 읽기용 파일 오브젝트 (오픈이 끝난 상태)
  #--------------------------------------------------------------------------
  def read_save_data(file)
    characters           = Marshal.load(file)
    Graphics.frame_count = Marshal.load(file)
    @last_bgm            = Marshal.load(file)
    @last_bgs            = Marshal.load(file)
    $game_system         = Marshal.load(file)
    $game_message        = Marshal.load(file)
    $game_switches       = Marshal.load(file)
    $game_variables      = Marshal.load(file)
    $game_self_switches  = Marshal.load(file)
    $game_actors         = Marshal.load(file)
    $game_party          = Marshal.load(file)
    $game_troop          = Marshal.load(file)
    $game_map            = Marshal.load(file)
    $game_player         = Marshal.load(file)
    if $game_system.version_id != $data_system.version_id
      $game_map.setup($game_map.map_id)
      $game_player.center($game_player.x, $game_player.y)
    end
  end
end

 

Scene_End

#==============================================================================
# ■ Scene_End
#------------------------------------------------------------------------------
# 게임 종료 화면의 처리를 실시하는 클래스입니다.
#==============================================================================

class Scene_End < Scene_Base
  #--------------------------------------------------------------------------
  # ● 개시 처리
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
  end
  #--------------------------------------------------------------------------
  # ● 개시 후처리
  #--------------------------------------------------------------------------
  def post_start
    super
    open_command_window
  end
  #--------------------------------------------------------------------------
  # ● 종료 사전 처리
  #--------------------------------------------------------------------------
  def pre_terminate
    super
    close_command_window
  end
  #--------------------------------------------------------------------------
  # ● 종료 처리
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_command_window
    dispose_menu_background
  end
  #--------------------------------------------------------------------------
  # ● 원래의 화면에 돌아온다
  #--------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(2)
  end
  #--------------------------------------------------------------------------
  # ● 프레임 갱신
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @command_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    elsif Input.trigger?(Input::C)
      case @command_window.index
      when 0  # 타이틀로 나감
        command_to_title
      when 1  # 프로그램 종료
        command_shutdown
      when 2  # 취소하기
        command_cancel
      end
    end
  end
  #--------------------------------------------------------------------------
  # ● 메뉴 화면계의 배경 갱신
  #--------------------------------------------------------------------------
  def update_menu_background
    super
    @menuback_sprite.tone.set(0, 0, 0, 128)
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 윈도우의 작성
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::to_title
    s2 = Vocab::shutdown
    s3 = Vocab::cancel
    @command_window = Window_Command.new(172, [s1, s2, s3])
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = (416 - @command_window.height) / 2
    @command_window.openness = 0
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 윈도우의 해방
  #--------------------------------------------------------------------------
  def dispose_command_window
    @command_window.dispose
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 윈도우를 연다
  #--------------------------------------------------------------------------
  def open_command_window
    @command_window.open
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 255
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 윈도우를 닫는다
  #--------------------------------------------------------------------------
  def close_command_window
    @command_window.close
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 0
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 [타이틀로 나감] 선택시의 처리
  #--------------------------------------------------------------------------
  def command_to_title
    Sound.play_decision
    RPG::BGM.fade(800)
    RPG::BGS.fade(800)
    RPG::ME.fade(800)
    $scene = Scene_Title.new
    close_command_window
    Graphics.fadeout(60)
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 [프로그램 종료] 선택시의 처리
  #--------------------------------------------------------------------------
  def command_shutdown
    Sound.play_decision
    RPG::BGM.fade(800)
    RPG::BGS.fade(800)
    RPG::ME.fade(800)
    $scene = nil
  end
  #--------------------------------------------------------------------------
  # ● 커멘드 [취소하기] 선택시의 처리
  #--------------------------------------------------------------------------
  def command_cancel
    Sound.play_decision
    return_scene
  end
end

 

 급하게 작성해도 이해해주세여.. 빨리 가야하능...

Who's 파루키아

?

[이름의 어원:End+Alice]

게임을 만들려면 그림을 그려야하는데 발퀄그림 보기싫은건 핑계고

어서 겜을 만들어야하는데 뭘하는거냐 난 ㅠ

Comment '2'
  • ?
    허걱 2011.09.27 03:18
      # 스크립트를 수정할 때는 수정전에 백업하는 습관을 들이는게 좋습니다.
      # update_command_selection 부분을 아래 내용으로 바꿔보시기 바랍니다.
      #--------------------------------------------------------------------------
      # ● 커멘드 선택의 갱신
      #--------------------------------------------------------------------------
      def update_command_selection
        if Input.trigger?(Input::B)
          Sound.play_cancel
          $scene = Scene_Map.new
        elsif Input.trigger?(Input::C)
          Sound.play_decision
          case @command_window.index
          when 0      # 아이템
            if $game_party.members.size == 0
              Sound.play_buzzer
            else
              $scene = Scene_Item.new
            end
          when 1      # 세이브
            if $game_party.members.size == 0 or
                $game_system.save_disabled
              Sound.play_buzzer
            else
              $scene = Scene_File.new(true, false, false)
            end
          when 2      # 게임 종료
            $scene = Scene_End.new
          end
        end
      end
  • ?
    파루키아 2011.09.27 08:20

    헉.. 감사해여 허걱님 ㅠㅠㅠㅠㅠ

    집에가면 한번 써볼께여 ㅠㅠㅠㅠㅠㅠㅠㅠ


List of Articles
종류 분류 제목 글쓴이 날짜 조회 수
공지 묻고 답하기 가이드 습작 2014.06.14 12388
RMVX 오프닝후 게임진행에 대한 질문입니다. 2 김만들기 2011.10.01 1472
RMXP rpg xp질문이요 1 우왕- 2011.09.30 1822
RMVX [ KGC_CategorizeSkill]스킬 사용 취소시, 카테고리창이 출력되지 않는 현상에 대한 질문입니다. 3 file 니노미야 2011.09.29 1871
RMVX 전투 시에 적의 모습 뿐 아니라 하단에 자기캐릭터 모습 나오게끔.. 1 아루쿠 2011.09.29 1489
기타 프로세스 작성실패 1 뻥카는재밋죠 2011.09.29 1764
RMVX KGC_CategorizeSkill 관련 질문입니다. 2 니노미야 2011.09.29 1619
RMVX 음...뭐라 해야하지? 아이템 창 불러온 뒤에 메뉴로 안보내고 없애기. 1 file 하늘바라KSND 2011.09.28 1863
RMVX 로드는 어떻게 하나요? 1 라유 2011.09.27 1752
RMXP 퍼즐 만드는법 1 file MACH 2011.09.27 2487
RMXP 몬스터가 닿았는데도 죽지가 않아요 1 Pencil 2011.09.27 2009
RMXP 문장나오는 속도조절어떻게하나요?? 6 프라임헌터즈 2011.09.27 1878
RMVX 사이드뷰 전투할때 캐릭터 이미지 질문 입니다 SBS 사이드뷰 전투 방식 입니다 1 file 나미요 2011.09.27 2411
RMXP 사이드뷰 어떻게 하는건가요? 3 마우리 2011.09.27 1267
RMXP 전투 방법좀 가르켜 주세요 ㅠㅠ 1 마우리 2011.09.26 1726
RM2k 게임 내에 이벤트 봤던 것을 초기화 하는 방법이 있을까요? 2 고양이사줘 2011.09.26 1955
RMVX SBS 전투, 스킬 카테고리 스크립트 질문입니다. 2 file 니노미야 2011.09.25 1617
RMVX bgm이 재생이 안되네요 1 동그라미 2011.09.25 1918
RMVX 메뉴 변경후 세이브 금지 오류 2 file 파루키아 2011.09.25 991
RMVX RPG VX에서 "레벨업 퀘스트" 나 "레벨 마크" 정하는 방법 있을까여?.? 2 쿠쿠밥솥 2011.09.25 1998
RMVX 속도보정치가 뭐죠? 1 라유 2011.09.25 2072
Board Pagination Prev 1 ... 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 ... 516 Next
/ 516