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

Project1

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

[已经过期] 求存档上限不限脚本

[复制链接]

Lv1.梦旅人

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

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

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

x
求脚本←_←………………………………

评分

参与人数 1星屑 -20 收起 理由
myownroc -20 正文描述问题不清楚

查看全部评分

Lv5.捕梦者 (版主)

梦石
20
星屑
1840
在线时间
6925 小时
注册时间
2012-12-14
帖子
11485

短篇十战斗者组别冠军开拓者贵宾短篇九勇士组亚军

2
发表于 2013-11-16 18:06:30 | 只看该作者
  1. # --------------------------------------------------------------------
  2. class Scene_File
  3.   #——最大存档数量,一般我认为最多50足够了,20比较合适
  4.   SAVEFILE_MAX = 50
  5.   # -------------------
  6.   def initialize(help_text)
  7.     @help_text = help_text
  8.   end
  9.   # -------------------
  10.   def main
  11.     @help_window = Window_Help.new
  12.     @help_window.set_text(@help_text)
  13.     @savefile_windows = []
  14.     @cursor_displace = 0
  15.   #  @menu_com = Sprite.new
  16.   #  @menu_com.bitmap = RPG::Cache.picture("存档.png")
  17.     for i in 0..3
  18.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i), i))
  19.     end
  20.     @file_index = 0
  21.     @savefile_windows[@file_index].selected = true
  22.     Graphics.transition
  23.     loop do
  24.       Graphics.update
  25.       Input.update
  26.       update
  27.       if $scene != self
  28.         break
  29.       end
  30.     end
  31.     Graphics.freeze
  32. #    @menu_com.bitmap.dispose if @menu_com.bitmap
  33. #    @menu_com.dispose
  34.     @help_window.dispose
  35.     for i in @savefile_windows
  36.       i.dispose
  37.     end
  38.   end
  39.   # -------------------
  40.   def update
  41.     @help_window.update
  42.     for i in @savefile_windows
  43.       i.update
  44.     end
  45.     if Input.trigger?(Input::C)
  46.       on_decision(make_filename(@file_index))
  47.       $game_temp.last_file_index = @file_index
  48.       return
  49.     end
  50.     if Input.trigger?(Input::B)
  51.       on_cancel
  52.       return
  53.     end
  54.     if Input.repeat?(Input::DOWN)
  55.       if Input.trigger?(Input::DOWN) or @file_index < SAVEFILE_MAX - 1
  56.         if @file_index == SAVEFILE_MAX - 1
  57.           $game_system.se_play($data_system.buzzer_se)
  58.           return
  59.         end
  60.         @cursor_displace += 1
  61.         if @cursor_displace == 4
  62.           @cursor_displace = 3
  63.           for i in @savefile_windows
  64.             i.dispose
  65.           end
  66.           @savefile_windows = []
  67.           for i in 0..3
  68.             f = i - 2 + @file_index
  69.             name = make_filename(f)
  70.             @savefile_windows.push(Window_SaveFile.new(f, name, i))
  71.             @savefile_windows[i].selected = false
  72.           end
  73.         end
  74.         $game_system.se_play($data_system.cursor_se)
  75.         @file_index = (@file_index + 1)
  76.         if @file_index == SAVEFILE_MAX
  77.           @file_index = SAVEFILE_MAX - 1
  78.         end
  79.         for i in 0..3
  80.           @savefile_windows[i].selected = false
  81.         end
  82.         @savefile_windows[@cursor_displace].selected = true
  83.         return
  84.       end
  85.     end
  86.     if Input.repeat?(Input::UP)
  87.       if Input.trigger?(Input::UP) or @file_index > 0
  88.         if @file_index == 0
  89.           $game_system.se_play($data_system.buzzer_se)
  90.           return
  91.         end
  92.         @cursor_displace -= 1
  93.         if @cursor_displace == -1
  94.           @cursor_displace = 0
  95.           for i in @savefile_windows
  96.             i.dispose
  97.           end
  98.           @savefile_windows = []
  99.           for i in 0..3
  100.             f = i - 1 + @file_index
  101.             name = make_filename(f)
  102.             @savefile_windows.push(Window_SaveFile.new(f, name, i))
  103.             @savefile_windows[i].selected = false
  104.           end
  105.         end
  106.         $game_system.se_play($data_system.cursor_se)
  107.         @file_index = (@file_index - 1)
  108.         if @file_index == -1
  109.           @file_index = 0
  110.         end
  111.         for i in 0..3
  112.           @savefile_windows[i].selected = false
  113.         end
  114.         @savefile_windows[@cursor_displace].selected = true
  115.         return
  116.       end
  117.     end
  118.   end
  119.   # -------------------
  120.   def make_filename(file_index)
  121.     return "Save#{file_index + 1}.rxdata"
  122.   end
  123.   # -------------------
  124. end
  125. class Window_SaveFile < Window_Base
  126.   # -------------------
  127.   def initialize(file_index, filename, position)
  128.     y = 64 + position * 104
  129.     super(0, y, 640, 104)
  130.     self.contents = Bitmap.new(width - 32, height - 32)
  131.     self.opacity = 0
  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
复制代码
因为这个脚本在主站就能搜索到。
好吧,伸手是不对的,下不为例。

评分

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

查看全部评分

大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
9280
在线时间
2504 小时
注册时间
2011-5-20
帖子
15389

开拓者

3
发表于 2013-11-17 08:50:21 | 只看该作者
不推荐···因为存档档位越多游戏运行越卡读档越慢···楼主要做什么游戏要无上限存档档位?
[img]http://service.t.sina.com.cn/widget/qmd/5339802982/c02e16bd/7.png
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

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

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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