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

Project1

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

如何让存档超过3个

 关闭 [复制链接]

Lv1.梦旅人

梦石
0
星屑
20
在线时间
0 小时
注册时间
2008-1-18
帖子
1
跳转到指定楼层
1
发表于 2008-1-18 03:31:38 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
如何让存档超过3个

Lv1.梦旅人

雷欧纳德的宠物

梦石
0
星屑
50
在线时间
769 小时
注册时间
2006-8-6
帖子
3778

贵宾

2
发表于 2008-1-18 03:33:48 | 只看该作者
打酱油的- -b
回复 支持 反对

使用道具 举报

Lv1.梦旅人

忘记

梦石
0
星屑
55
在线时间
4 小时
注册时间
2007-12-15
帖子
3062
3
发表于 2008-1-18 04:08:40 | 只看该作者
增加存档数量脚本
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  3. #==============================================================================



  4. # --------------------------------------------------------------------
  5. # 本脚本来自www.66rpg.com,转载自www.phylomortis.com,转载请保留此信息
  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. class Window_SaveFile < Window_Base
  127.   # -------------------
  128.   def initialize(file_index, filename, position)
  129.     y = 64 + position * 104
  130.     super(0, y, 640, 104)
  131.     self.contents = Bitmap.new(width - 32, height - 32)
  132.     @file_index = file_index
  133.     @filename = "Save#{@file_index + 1}.rxdata"
  134.     @time_stamp = Time.at(0)
  135.     @file_exist = FileTest.exist?(@filename)
  136.     if @file_exist
  137.       file = File.open(@filename, "r")
  138.       @time_stamp = file.mtime
  139.       @characters = Marshal.load(file)
  140.       @frame_count = Marshal.load(file)
  141.       @game_system = Marshal.load(file)
  142.       @game_switches = Marshal.load(file)
  143.       @game_variables = Marshal.load(file)
  144.       @total_sec = @frame_count / Graphics.frame_rate
  145.       file.close
  146.     end
  147.     refresh
  148.     @selected = false
  149.   end
  150. end


  151. #==============================================================================
  152. # 本脚本来自www.66RPG.com,使用和转载请保留此信息
  153. #==============================================================================
复制代码
因为你哭泣的时候有我想你你被人嘲笑时有我陪你在你感觉最无助的那一刻有个声音鼓励
<font color=#8600E9>忘记</font>
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2025-7-26 14:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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