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

Project1

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

[RMVX发布] 游戏中删除存档_v1.1

[复制链接]

Lv3.寻梦者

弓箭手?剑兰

梦石
0
星屑
4804
在线时间
833 小时
注册时间
2010-11-17
帖子
1140
跳转到指定楼层
1
发表于 2011-3-27 20:10:27 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 一箭烂YiJL 于 2011-4-1 18:00 编辑

0.前言
不知道前人是否有做过类似这样的东西呢?
但是不可不承认的是这是一件很渣的东西,
嗯~由于是一时的无聊想法,所以它用了很短的时间制造,同时也很废。

1.版本功能说明
1.0                         : 按下delete按钮,就会删除存挡,如无存档,则发出错误一声。

1.1                         : 按下delete就会弹出选择窗, 然后选择删除。
1.1(载图存档版)     : 跟1.1功能一样,只是专用于载图存档
1.1(新式菜单版)     : 跟1.1功能一样,只是专用于新式菜单
1.1的载图存档版和新式菜单版没有范例,只在5.脚本里提供。


2. 1.1版效果载图

正常:

载图存档版:

新式菜单版:



3.范例
最简洁的:
删除存档_v1.0.zip (282.52 KB, 下载次数: 1907)
有窗口选择的:
删除存档_v1.1.zip (283.19 KB, 下载次数: 4242)


4.版本讯息
    - *1.1.0* (2011-04-01) By 一箭烂(YiJL)
      *会弹出选择窗选择是否删除

    - *1.0.0* (2011-04-27) By 一箭烂(YiJL)
      *初版


5.脚本

1.1载图存档版:


  1. #==============================================================================
  2. # ■ 删除存档v1.1(载图存档版)    by 一箭烂
  3. #------------------------------------------------------------------------------
  4. #  按下delete就会弹出选择窗, 然后选择删除。
  5. #
  6. #    - *1.1.0* (2011-04-01) By 一箭烂(YiJL)
  7. #      *会弹出选择窗选择是否删除
  8. #
  9. #    - *1.0.0* (2011-04-27) By 一箭烂(YiJL)
  10. #      *初版
  11. #==============================================================================
  12. class Scene_File
  13.   Key = Win32API.new("user32","GetAsyncKeyState","i","i")
  14.   #--------------------------------------------------------------------------
  15.   # ● 开始
  16.   #--------------------------------------------------------------------------
  17.   alias del_start start
  18.   def start
  19.     del_start
  20.     @del_window = Window_DelFile.new
  21.     @del_window.z = 500
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 更新幀
  25.   #--------------------------------------------------------------------------
  26.   alias del_update update
  27.   def update
  28.     del_update
  29.     @del_window.update
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 更新选择
  33.   #--------------------------------------------------------------------------
  34.   def update_savefile_selection
  35.     if Input.trigger?(Input::C)
  36.       if @del_window.visible
  37.         case @del_window.index
  38.         when 0
  39.           do_delete
  40.           @del_window.visible = false
  41.         when 1
  42.           @del_window.visible = false
  43.         end
  44.       else
  45.         determine_savefile
  46.       end
  47.     elsif Input.trigger?(Input::B)
  48.       if @del_window.visible
  49.         @del_window.visible = false
  50.       else
  51.         Sound.play_cancel
  52.         return_scene
  53.       end
  54.     elsif Key.call(0x2E) & 1 != 0
  55.       @del_window.visible = true
  56.     end
  57.     if @refresh_index != @command_window.index and @del_window.visible == false
  58.       @refresh_index = @command_window.index
  59.       @savefile_window.dispose
  60.       create_savefile_window
  61.     end
  62.     @command_window.active = !@del_window.visible
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● 删除存档
  66.   #--------------------------------------------------------------------------
  67.   def do_delete
  68.     if FileTest.exist?(SAVE_DIR + make_filename(@command_window.index))
  69.       File.delete(SAVE_DIR + make_filename(@command_window.index))
  70.       @refresh_index = @command_window.index
  71.       @savefile_window.dispose
  72.       create_savefile_window
  73.     else
  74.       Sound.play_buzzer
  75.     end
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● 退出场景
  79.   #--------------------------------------------------------------------------
  80.   alias del_terminate terminate
  81.   def terminate
  82.     del_terminate
  83.     @del_window.dispose
  84.   end
  85. end
  86. #==============================================================================
  87. # ■ Window_DelFile
  88. #==============================================================================
  89. class Window_DelFile < Window_Selectable
  90.   #--------------------------------------------------------------------------
  91.   # ● 对象初始化
  92.   #--------------------------------------------------------------------------
  93.   def initialize
  94.     super((544-250)/2, (416-100)/2, 250, 90)
  95.     self.contents.draw_text(0, 0, 250-32, 24, "是否删除存档?", 1)
  96.     self.contents.draw_text(0, 32, 93, 24, "是", 1)
  97.     self.contents.draw_text(125, 32, 93, 24, "否", 1)
  98.     @item_max = 2
  99.     @column_max = 2
  100.     @index = 1
  101.     self.visible = false
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # ● 帧更新
  105.   #--------------------------------------------------------------------------
  106.   def update
  107.     super
  108.     if self.visible
  109.       if cursor_movable?
  110.         last_index = @index
  111.         if Input.repeat?(Input::DOWN)
  112.           cursor_down(Input.trigger?(Input::DOWN))
  113.         end
  114.         if Input.repeat?(Input::UP)
  115.           cursor_up(Input.trigger?(Input::UP))
  116.         end
  117.         if @index != last_index
  118.           Sound.play_cursor
  119.         end
  120.       end
  121.       update_cursor
  122.       call_update_help
  123.     end
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● 选择矩形
  127.   #--------------------------------------------------------------------------
  128.   def item_rect(index)
  129.     rect = Rect.new(0, 0, 0, 0)
  130.     rect.width = (contents.width + @spacing) / @column_max - @spacing
  131.     rect.height = WLH
  132.     rect.x = index % @column_max * (rect.width + @spacing)
  133.     rect.y = index / @column_max * WLH + 32
  134.     return rect
  135.   end
  136. end
复制代码
1.1新式菜单版:

  1. #==============================================================================
  2. # ■ 删除存档v1.1(新式菜单版)    by 一箭烂
  3. #------------------------------------------------------------------------------
  4. #  按下delete就会弹出选择窗, 然后选择删除。
  5. #
  6. #    - *1.1.0* (2011-04-01) By 一箭烂(YiJL)
  7. #      *会弹出选择窗选择是否删除
  8. #
  9. #    - *1.0.0* (2011-04-27) By 一箭烂(YiJL)
  10. #      *初版
  11. #==============================================================================
  12. class Scene_File < Scene_Menu_Base
  13.   Key = Win32API.new("user32","GetAsyncKeyState","i","i")
  14.   #--------------------------------------------------------------------------
  15.   # ● 开始
  16.   #--------------------------------------------------------------------------
  17.   alias del_start start
  18.   def start
  19.     del_start
  20.     @del_window = Window_DelFile.new
  21.     @del_window.z = 500
  22.   end
  23.   #--------------------------------------------------------------------------
  24.   # ● 更新幀
  25.   #--------------------------------------------------------------------------
  26.   alias del_update update
  27.   def update
  28.     del_update
  29.     @del_window.update
  30.   end
  31.   #--------------------------------------------------------------------------
  32.   # ● 更新选择
  33.   #--------------------------------------------------------------------------
  34.   def update_savefile_selection
  35.     if Input.trigger?(Input::C)
  36.       if @del_window.visible
  37.         case @del_window.index
  38.         when 0
  39.           do_delete
  40.           @del_window.visible = false
  41.         when 1
  42.           @del_window.visible = false
  43.         end
  44.       else
  45.         determine_savefile
  46.       end
  47.     elsif Input.trigger?(Input::B)
  48.       if @del_window.visible
  49.         @del_window.visible = false
  50.       else
  51.         Sound.play_cancel
  52.         return_scene
  53.       end
  54.     elsif Key.call(0x2E) & 1 != 0
  55.       @del_window.visible = true
  56.     end
  57.     if @refresh_index != @file_command_window.index and @del_window.visible == false
  58.       @refresh_index = @file_command_window.index
  59.       @savefile_window.dispose
  60.       create_savefile_window
  61.     end
  62.     @file_command_window.active = !@del_window.visible
  63.   end
  64.   #--------------------------------------------------------------------------
  65.   # ● 删除存档
  66.   #--------------------------------------------------------------------------
  67.   def do_delete
  68.     if FileTest.exist?(SAVE_DIR + make_filename(@file_command_window.index))
  69.       File.delete(SAVE_DIR + make_filename(@file_command_window.index))
  70.       @refresh_index = @file_command_window.index
  71.       @savefile_window.dispose
  72.       create_savefile_window
  73.     else
  74.       Sound.play_buzzer
  75.     end
  76.   end
  77.   #--------------------------------------------------------------------------
  78.   # ● 退出场景
  79.   #--------------------------------------------------------------------------
  80.   alias del_terminate terminate
  81.   def terminate
  82.     del_terminate
  83.     @del_window.dispose
  84.   end
  85. end
  86. #==============================================================================
  87. # ■ Window_DelFile
  88. #==============================================================================
  89. class Window_DelFile < Window_Selectable
  90.   #--------------------------------------------------------------------------
  91.   # ● 对象初始化
  92.   #--------------------------------------------------------------------------
  93.   def initialize
  94.     super((544-250)/2, (416-100)/2, 250, 90)
  95.     self.contents.draw_text(0, 0, 250-32, 24, "是否删除存档?", 1)
  96.     self.contents.draw_text(0, 32, 93, 24, "是", 1)
  97.     self.contents.draw_text(125, 32, 93, 24, "否", 1)
  98.     @item_max = 2
  99.     @column_max = 2
  100.     @index = 1
  101.     self.visible = false
  102.   end
  103.   #--------------------------------------------------------------------------
  104.   # ● 帧更新
  105.   #--------------------------------------------------------------------------
  106.   def update
  107.     super
  108.     if self.visible
  109.       if cursor_movable?
  110.         last_index = @index
  111.         if Input.repeat?(Input::DOWN)
  112.           cursor_down(Input.trigger?(Input::DOWN))
  113.         end
  114.         if Input.repeat?(Input::UP)
  115.           cursor_up(Input.trigger?(Input::UP))
  116.         end
  117.         if @index != last_index
  118.           Sound.play_cursor
  119.         end
  120.       end
  121.       update_cursor
  122.       call_update_help
  123.     end
  124.   end
  125.   #--------------------------------------------------------------------------
  126.   # ● 选择矩形
  127.   #--------------------------------------------------------------------------
  128.   def item_rect(index)
  129.     rect = Rect.new(0, 0, 0, 0)
  130.     rect.width = (contents.width + @spacing) / @column_max - @spacing
  131.     rect.height = WLH
  132.     rect.x = index % @column_max * (rect.width + @spacing)
  133.     rect.y = index / @column_max * WLH + 32
  134.     return rect
  135.   end
  136. end
复制代码

评分

参与人数 1星屑 +48 收起 理由
一瞬间的幻觉 + 48 貌似有点鸡肋,先收藏了看看有什么地方能用.

查看全部评分

Lv1.梦旅人

54酱是大笨蛋!

梦石
0
星屑
66
在线时间
1389 小时
注册时间
2011-2-23
帖子
5014
2
发表于 2011-3-27 20:15:46 | 只看该作者
貌似以前也有过一只这样的东西.......

忘了在哪里见过了...

脚本好像有100多行...

可能是XP的...

年纪大了...

脑子坏了...

什么都记不住了...

于是...

下载尝鲜...

点评

贴上脚本也可= =此物简陋,按delete就把心爱存档删除- -  发表于 2011-3-27 20:19
去你爹的现充.去你爹的异性恋.
回复 支持 反对

使用道具 举报

头像被屏蔽

Lv1.梦旅人 (禁止发言)

梦石
0
星屑
50
在线时间
131 小时
注册时间
2010-6-24
帖子
623
3
发表于 2011-3-28 15:35:37 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
签名被屏蔽
回复 支持 反对

使用道具 举报

Lv3.寻梦者

弓箭手?剑兰

梦石
0
星屑
4804
在线时间
833 小时
注册时间
2010-11-17
帖子
1140
4
 楼主| 发表于 2011-4-1 18:01:04 | 只看该作者
更新了,顺便顶一下。这是版本跟新讯息:
    - *1.1.0* (2011-04-01) By 一箭烂(YiJL)
      *会弹出选择窗选择是否删除

    - *1.0.0* (2011-04-27) By 一箭烂(YiJL)
      *初版
回复 支持 反对

使用道具 举报

Lv2.观梦者

花开堪折直须折

梦石
0
星屑
621
在线时间
943 小时
注册时间
2010-7-17
帖子
4963

贵宾

5
发表于 2011-4-1 19:06:30 | 只看该作者
呼呼,还好地板还在~~剑兰前辈我爱你!~~~~
大家好,我叫节操,有一天,我被吃了。
http://forever-dream.5d6d.com
永恒の梦制作组论坛

129993099
永恒の梦制作组QQ群
回复 支持 反对

使用道具 举报

Lv4.逐梦者

醉啸 长风万里

梦石
0
星屑
6047
在线时间
6586 小时
注册时间
2007-12-16
帖子
4501

贵宾

6
发表于 2011-4-3 12:40:12 | 只看该作者
不错嘛,谢谢剑兰

还在龟速填坑中
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
258 小时
注册时间
2010-8-29
帖子
58
7
发表于 2011-5-24 21:19:29 | 只看该作者
太美妙了~我傻傻的在测试游戏中将游戏存档了!幸亏我找到了这个~
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
46
在线时间
114 小时
注册时间
2012-12-31
帖子
76
8
发表于 2013-3-3 16:07:17 | 只看该作者
话说新式菜单不是存档很多吗?用这个好像没啥用。
(除非游戏太庞大,剧情太多,太难)
回复 支持 反对

使用道具 举报

Lv4.逐梦者

梦石
0
星屑
19279
在线时间
3074 小时
注册时间
2013-1-11
帖子
1288
9
发表于 2013-7-28 13:50:09 | 只看该作者
好复杂...
↓直接删除Save文件夹下的指定存档↓

$i = 存档ID

for i in 1..4
File.delete("Save/Save#{$i}.rvdata") if
FileTest.exist?("Save/Save#{$i}.rvdata")
end
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-4-20 20:47

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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