查看: 1714|回复: 2

[已经过期] 求教 存档上限只有4个,怎么弄的更大,求脚本

[复制链接]
梦石
0
星屑
50
在线时间
0 小时
注册时间
2013-11-16
回帖
2
发表于 2013-11-16 21:17:15 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
求脚本啊………………………………………………………………………………
梦石
0
星屑
50
在线时间
33 小时
注册时间
2012-12-22
回帖
12
发表于 2013-11-16 23:12:59 | 显示全部楼层
[pre lang="ruby" line="1"]
# --------------------------------------------------------------------  

# 本脚本来自www.66rpg.com,转载自www.phylomortis.com,转载请保留此信息
# --------------------------------------------------------------------


class Scene_File
  #——最大存档数量,一般我认为最多50足够了,20比较合适
  SAVEFILE_MAX = 20
  # -------------------
  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
  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.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.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.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.selected = false
        end
        @savefile_windows[@cursor_displace].selected = true
        return
      end
    end
  end
  # -------------------
  def make_filename(file_index)
    return "Save#{file_index + 1}.rxdata"
  end
  # -------------------
end

  


class Window_SaveFile < Window_Base
  # -------------------
  def initialize(file_index, filename, position)
    y = 64 + position * 104
    super(0, y, 640, 104)
    self.contents = Bitmap.new(width - 32, height - 32)
    @file_index = file_index
    @filename = "Save#{@file_index + 1}.rxdata"
    @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
  
[/pre]

评分

参与人数 1星屑 +60 收起 理由
myownroc + 60 塞糖

查看全部评分

回复

使用道具 举报

梦石
0
星屑
50
在线时间
138 小时
注册时间
2012-7-2
回帖
105
发表于 2013-11-18 16:59:43 | 显示全部楼层
给楼楼一个建议:4个存档位其实刚刚好,存档位太多会降低游戏难度
我只属于我一个人的世界~~~
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部