XP 스크립트

http://www.phylomortis.com/resource/script/scr039.html
http://www.phylomortis.com/resource/script/scr031.html
  아래 스크립트는 이 둘을 합친 것입니다.(끼워넣는 형태로 만들려면 약간의 노력 요함?)

class Window_SaveFile < Window_Base
#Unlimited Save Files by RPG Advocate
  def initialize(file_index, filename, position)
    y = 64 + position * 104
    super(0, y, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    self.contents.font.name = $defaultfonttype  # "File" (File #) window font
    self.contents.font.size = $defaultfontsize
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.sav"
    @time_stamp = Time.at(0)
    @file_exist = FileTest.exist?(@filename)
    if @file_exist
      file = File.open(@filename, "r")
      @time_stamp = file.mtime
      @characters = Marshal.load(file)
      @frame_count = Marshal.load(file)
      @game_system = Marshal.load(file)
      @game_switches = Marshal.load(file)
      @game_variables = Marshal.load(file)
      @total_sec = @frame_count / Graphics.frame_rate
      file.close
    end
    refresh
    @selected = false
  end
......
end

class Scene_File
#Unlimited Save Files by RPG Advocate
  SAVEFILE_MAX = 99   
# -------------------
  def initialize(help_text)
    @help_text = help_text
  end
# -------------------
  def main
    @help_window = Window_Help.new
    @help_window.set_text(@help_text)
    @savefile_windows = []
    @cursor_displace = 0
    for i in 0..3
      @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
    end
    @file_index = 0
    @savefile_windows[@file_index].selected = true
    Graphics.transition
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    Graphics.freeze
    @help_window.dispose
    for i in @savefile_windows
      i.dispose
    end
    if self.is_a?(Scene_Save) #추가-세이브 덮어씌울 때 확인
    @confirm_window.dispose #Prompt for Overwrite Confirmation when Saving by RPG Advocate
    @yes_no_window.dispose
  end #추가끝
  end
# -------------------
  def update
    @help_window.update
    for i in @savefile_windows
      i.update
    end
    if Input.trigger?(Input::C)
      on_decision(make_filename(@file_index))
      $game_temp.last_file_index = @file_index
      return
    end
    if Input.trigger?(Input::B)
      on_cancel
      return
    end
    if Input.repeat?(Input::DOWN)
      if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1
        if @file_index == SAVEFILE_MAX - 1
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        @cursor_displace += 1
        if @cursor_displace == 4
          @cursor_displace = 3
          for i in @savefile_windows
            i.dispose
          end
          @savefile_windows = []
          for i in 0..3
            f = i - 2 + @file_index
            name = make_filename(f)
            @savefile_windows.push(Window_SaveFile.new(f, name, i))
            @savefile_windows[i].selected = false
          end
        end
        $game_system.se_play($data_system.cursor_se)
        @file_index = (@file_index + 1)
        if @file_index == SAVEFILE_MAX
          @file_index = SAVEFILE_MAX - 1
        end
        for i in 0..3
          @savefile_windows[i].selected = false
        end
        @savefile_windows[@cursor_displace].selected = true
        return
      end
    end
    if Input.repeat?(Input::UP)
      if Input.trigger?(Input::UP) or @file_index > 0
        if @file_index == 0
          $game_system.se_play($data_system.buzzer_se)
          return
        end
        @cursor_displace -= 1
        if @cursor_displace == -1
          @cursor_displace = 0
          for i in @savefile_windows
            i.dispose
          end
          @savefile_windows = []
          for i in 0..3
            f = i - 1 + @file_index
            name = make_filename(f)
            @savefile_windows.push(Window_SaveFile.new(f, name, i))
            @savefile_windows[i].selected = false
          end
        end
        $game_system.se_play($data_system.cursor_se)
        @file_index = (@file_index - 1)
        if @file_index == -1
          @file_index = 0
        end
        for i in 0..3
          @savefile_windows[i].selected = false
        end
        @savefile_windows[@cursor_displace].selected = true
        return
      end
    end
  end
# -------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.sav"
  end
# -------------------
end

class Scene_Save < Scene_File
def initialize
    super("Save to which file?")
    @confirm_window = Window_Base.new(120, 188, 400, 64) #추가
    @confirm_window.contents = Bitmap.new(368, 32)
    string = "이 파일에 덮어쓰시겠습니까?"
    @confirm_window.contents.font.name = $defaultfonttype
    @confirm_window.contents.font.size = 24
    @confirm_window.contents.draw_text(4, 0, 368, 32, string)
    @yes_no_window = Window_Command.new(100, ["Yes", "No"])
    @confirm_window.visible = false
    @confirm_window.z = 1500
    @yes_no_window.visible = false
    @yes_no_window.active = false
    @yes_no_window.index = 1
    @yes_no_window.x = 270
    @yes_no_window.y = 252
    @yes_no_window.z = 1500
    @mode = 0 #추가 끝
  end
#--------------------------------
def on_decision(filename)
    if FileTest.exist?(filename) #추가-저장할 파일을 덮어쓸 것인가?
      @confirm_window.visible = true
      @yes_no_window.visible = true
      @yes_no_window.active = true
      @mode = 1
    else
    $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(4)
    end
  end
 # -----------------------------
  def update
    if @mode == 0
      super
    else
      @help_window.update
      @yes_no_window.update
      if Input.trigger?(Input::C)
        $game_system.se_play($data_system.decision_se)
        if @yes_no_window.index == 0
          filename = make_filename(@file_index)
          $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
          else
            $scene = Scene_Menu.new(4)
          end
        else
          @confirm_window.visible = false
          @yes_no_window.visible = false
          @yes_no_window.active = false
          @yes_no_window.index = 1
          @mode = 0
        end
      end
      if Input.trigger?(Input::B)
        @confirm_window.visible = false
        @yes_no_window.visible = false
        @yes_no_window.active = false
        @yes_no_window.index = 1
        @mode = 0
      return
    end
  end
end
.......
end

Who's 백호

?

이상혁입니다.

http://elab.kr

Comment '5'

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 6153
34 저장 [ AutoSave ]오토세이브, 뜻 그대로 자동저장스크립트 17 file 제로스S2 2009.08.06 3693
33 저장 세이브파일 망가뜨리기 by RPG Advocate 3 백호 2009.02.22 2657
32 저장 렉없은 자동 세이브 15 알피지GM 2010.03.07 2326
31 저장 심플 세이브&로드 개조(필요할 때 원하는 슬롯에 자동저장) 5 나렌시아 2011.02.24 2290
30 저장 멀티넷스크립트 -> 아이피 세이브,로드 스크립트 9 file 백호 2009.02.22 2204
29 저장 링메뉴에 빠져 봅시다 - 링메뉴의 세이브시 팅김이 사라지는 방법 !! 3 file 백호 2009.02.21 1998
28 저장 렉없는 자동세이브(중복임??) 4 캉쿤 2011.09.12 1986
27 저장 Improved Save by gerrtunk 2 file Alkaid 2010.10.13 1983
26 저장 심플 세이브 로드(1개의 세이브 사용하기) 3 백호 2009.02.22 1971
25 저장 세이브 & 로드 화면 개조 스크립트 file 백호 2009.02.21 1961
24 저장 KGC_2PaneSave 15 file 키라링 2009.01.23 1868
23 저장 [KGC]_2PaneSave 스크립트 1 file 백호 2009.02.22 1655
22 저장 ASM - Advanced Save Menu 3 file 백호 2009.02.21 1639
21 저장 렉없는 자동세이브 스크립트 2 백호 2009.02.22 1590
20 저장 Chaos Project Save Layout 1.4 by Fantasist, Blizzard file Alkaid 2010.10.08 1558
19 저장 Advanced Save System Edit (현재 맵을 보여주지 않음) file 백호 2009.02.22 1557
» 저장 세이브 슬롯 갯수 증가와 세이브 덮어씌울 때 확인 by RPG Advocate 5 백호 2009.02.22 1505
17 저장 키라링님이 올리신 [KGC_2PaneSave] 번역 1 무뇌인 2010.08.18 1471
16 저장 자동 세이브 스크립트 4 WMN 2008.03.17 1470
15 저장 [신기술 체험] 데이터 저장 6 file 백호 2009.02.22 1420
Board Pagination Prev 1 2 Next
/ 2