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 저장 Inn & Save Point System by SephirothSpawn (SDK호환) 1 file 백호 2009.02.22 810
33 저장 SG_Automatic Save 백호 2009.02.22 970
32 저장 [KGC] 스크립트 저장된 리셋 불어오기 [스샷첨부] 1 file 백호 2009.02.22 1052
31 저장 SG_Broken Save File Fix by sandgolem (SDK호환) 1 백호 2009.02.22 1068
30 저장 Law's Custom Save System by The Law G14 & Night Runner 1 file Alkaid 2013.02.18 1073
29 저장 [KCG] 2 Pane Save Scene 번역본 백호 2009.02.22 1118
28 저장 [KCG] 2 Pane Save Scene file 백호 2009.02.22 1128
27 저장 StupidStormy36's Custom Save System 3 Alkaid 2010.10.05 1199
26 저장 Advanced Save Menu 편집 20101006 Edition (SDK2용) 1 Alkaid 2010.10.06 1217
25 저장 Advanced Save Menu 편집한 것. (SDK2용) Alkaid 2010.09.11 1219
24 저장 StupidStormy36's Custom Save System 2010-10-06(05?) Edition 1 Alkaid 2010.10.07 1247
23 저장 Advanced Save Menu 편집 20101005 Edition (SDK2용) 3 Alkaid 2010.10.05 1293
22 저장 Woratana's Neo Save System for RMXP by LiTTleDRAgo 5 Alkaid 2013.01.19 1398
21 저장 오류 수정한 자동세이브 2 백호 2009.02.22 1403
20 저장 [신기술 체험] 데이터 저장 6 file 백호 2009.02.22 1420
19 저장 자동 세이브 스크립트 4 WMN 2008.03.17 1470
18 저장 키라링님이 올리신 [KGC_2PaneSave] 번역 1 무뇌인 2010.08.18 1471
» 저장 세이브 슬롯 갯수 증가와 세이브 덮어씌울 때 확인 by RPG Advocate 5 백호 2009.02.22 1505
16 저장 Advanced Save System Edit (현재 맵을 보여주지 않음) file 백호 2009.02.22 1557
15 저장 Chaos Project Save Layout 1.4 by Fantasist, Blizzard file Alkaid 2010.10.08 1558
Board Pagination Prev 1 2 Next
/ 2