设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 1366|回复: 2
打印 上一主题 下一主题

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

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
0 小时
注册时间
2013-11-16
帖子
6
跳转到指定楼层
1
发表于 2013-11-16 21:17:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
求脚本啊………………………………………………………………………………

Lv1.梦旅人

梦石
0
星屑
50
在线时间
33 小时
注册时间
2012-12-22
帖子
12
2
发表于 2013-11-16 23:12:59 | 只看该作者
RUBY 代码复制
  1. # --------------------------------------------------------------------  
  2.  
  3. # 本脚本来自[url]www.66rpg.com[/url],转载自[url]www.phylomortis.com[/url],转载请保留此信息
  4. # --------------------------------------------------------------------
  5.  
  6.  
  7. class Scene_File
  8.   #——最大存档数量,一般我认为最多50足够了,20比较合适
  9.   SAVEFILE_MAX = 20
  10.   # -------------------
  11.   def initialize(help_text)
  12.     @help_text = help_text
  13.   end
  14.   # -------------------
  15.   def main
  16.     @help_window = Window_Help.new
  17.     @help_window.set_text(@help_text)
  18.     @savefile_windows = []
  19.     @cursor_displace = 0
  20.     for i in 0..3
  21.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
  22.     end
  23.     @file_index = 0
  24.     @savefile_windows[@file_index].selected = true
  25.     Graphics.transition
  26.     loop do
  27.       Graphics.update
  28.       Input.update
  29.       update
  30.       if $scene != self
  31.         break
  32.       end
  33.     end
  34.     Graphics.freeze
  35.     @help_window.dispose
  36.     for i in @savefile_windows
  37.       i.dispose
  38.     end
  39.   end
  40.   # -------------------
  41.   def update
  42.     @help_window.update
  43.     for i in @savefile_windows
  44.       i.update
  45.     end
  46.     if Input.trigger?(Input::C)
  47.       on_decision(make_filename(@file_index))
  48.       $game_temp.last_file_index = @file_index
  49.       return
  50.     end
  51.     if Input.trigger?(Input::B)
  52.       on_cancel
  53.       return
  54.     end
  55.     if Input.repeat?(Input::DOWN)
  56.       if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1
  57.         if @file_index == SAVEFILE_MAX - 1
  58.           $game_system.se_play($data_system.buzzer_se)
  59.           return
  60.         end
  61.         @cursor_displace += 1
  62.         if @cursor_displace == 4
  63.           @cursor_displace = 3
  64.           for i in @savefile_windows
  65.             i.dispose
  66.           end
  67.           @savefile_windows = []
  68.           for i in 0..3
  69.             f = i - 2 + @file_index
  70.             name = make_filename(f)
  71.             @savefile_windows.push(Window_SaveFile.new(f, name, i))
  72.             @savefile_windows[i].selected = false
  73.           end
  74.         end
  75.         $game_system.se_play($data_system.cursor_se)
  76.         @file_index = (@file_index + 1)
  77.         if @file_index == SAVEFILE_MAX
  78.           @file_index = SAVEFILE_MAX - 1
  79.         end
  80.         for i in 0..3
  81.           @savefile_windows[i].selected = false
  82.         end
  83.         @savefile_windows[@cursor_displace].selected = true
  84.         return
  85.       end
  86.     end
  87.     if Input.repeat?(Input::UP)
  88.       if Input.trigger?(Input::UP) or @file_index > 0
  89.         if @file_index == 0
  90.           $game_system.se_play($data_system.buzzer_se)
  91.           return
  92.         end
  93.         @cursor_displace -= 1
  94.         if @cursor_displace == -1
  95.           @cursor_displace = 0
  96.           for i in @savefile_windows
  97.             i.dispose
  98.           end
  99.           @savefile_windows = []
  100.           for i in 0..3
  101.             f = i - 1 + @file_index
  102.             name = make_filename(f)
  103.             @savefile_windows.push(Window_SaveFile.new(f, name, i))
  104.             @savefile_windows[i].selected = false
  105.           end
  106.         end
  107.         $game_system.se_play($data_system.cursor_se)
  108.         @file_index = (@file_index - 1)
  109.         if @file_index == -1
  110.           @file_index = 0
  111.         end
  112.         for i in 0..3
  113.           @savefile_windows[i].selected = false
  114.         end
  115.         @savefile_windows[@cursor_displace].selected = true
  116.         return
  117.       end
  118.     end
  119.   end
  120.   # -------------------
  121.   def make_filename(file_index)
  122.     return "Save#{file_index + 1}.rxdata"
  123.   end
  124.   # -------------------
  125. end
  126.  
  127.  
  128.  
  129.  
  130. class Window_SaveFile < Window_Base
  131.   # -------------------
  132.   def initialize(file_index, filename, position)
  133.     y = 64 + position * 104
  134.     super(0, y, 640, 104)
  135.     self.contents = Bitmap.new(width - 32, height - 32)
  136.     @file_index = file_index
  137.     @filename = "Save#{@file_index + 1}.rxdata"
  138.     @time_stamp = Time.at(0)
  139.     @file_exist = FileTest.exist?(@filename)
  140.     if @file_exist
  141.       file = File.open(@filename, "r")
  142.       @time_stamp = file.mtime
  143.       @characters = Marshal.load(file)
  144.       @frame_count = Marshal.load(file)
  145.       @game_system = Marshal.load(file)
  146.       @game_switches = Marshal.load(file)
  147.       @game_variables = Marshal.load(file)
  148.       @total_sec = @frame_count / Graphics.frame_rate
  149.       file.close
  150.     end
  151.     refresh
  152.     @selected = false
  153.   end
  154. end

评分

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

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
138 小时
注册时间
2012-7-2
帖子
173
3
发表于 2013-11-18 16:59:43 | 只看该作者
给楼楼一个建议:4个存档位其实刚刚好,存档位太多会降低游戏难度
我只属于我一个人的世界~~~
回复 支持 反对

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-9-30 04:25

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表