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

Project1

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

[已经解决] 截图存档的问题

[复制链接]

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
跳转到指定楼层
1
发表于 2013-7-5 04:58:11 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

x
本帖最后由 紫英晓狼1130 于 2013-7-5 19:09 编辑

这是一个截图存档的脚本
希望大家可以帮我改成我想要的效果
我不是完全伸手党,简单的说就是截图存档和原存档界面结合,剩下的我再自己改...
预想效果:就是将显示信息的区域有多个且与文件数相应循环

@弗雷德 @柳之一
脚本

  1. =begin
  2. 紫英晓狼未修改版存档脚本
  3. 请大家不要直接复制走(复制走也没用,这就是原因...)
  4. 多谢合作~
  5. =end
  6. BBS_66RPG_DIR = "Save/"  
  7. module Screen  
  8.   @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  9.   @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  10.   @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  11.   module_function
  12.   def shot(file = "shot", typ = 1)
  13.     if typ == 0
  14.       typname = ".bmp"
  15.     elsif typ == 1
  16.       typname = ".jpg"
  17.     elsif typ == 2
  18.       typname = ".png"
  19.     end   
  20.     file_index = 0   
  21.     dir = "Save/"   
  22.     file_name = dir + file.to_s + typname.to_s   
  23.     @screen.call(0,0,640,480,file_name,handel,typ)
  24.   end
  25.   def handel
  26.     game_name = "\0" * 256
  27.     @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  28.     game_name.delete!("\0")
  29.     return @findwindow.call('RGSS Player',game_name)
  30.   end
  31. end
  32. class Window_File < Window_Base
  33.   attr_accessor :index
  34.   def initialize(index = 0)
  35.     @backsp = Sprite.new
  36.     @backsp.z = 99
  37.     super(160,0,480,480)
  38.     self.contents = Bitmap.new(width - 32, height - 32)
  39.     @index = index
  40.     @sprite = Sprite.new
  41.     @sprite.visible = false
  42.     @sprite.z = 100
  43.     @sp_ch = []
  44.     @sp_ch[0] = Sprite.new
  45.     refresh
  46.   end
  47.   def refresh
  48.     self.contents.clear
  49.     for i in @sp_ch
  50.       i.visible = false
  51.     end
  52.     @sprite.visible = false
  53.     if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
  54.       @sprite.visible = true
  55.       if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
  56.         @sprite.bitmap = Bitmap.new(BBS_66RPG_DIR+"Save#{@index}.jpg")
  57.       else
  58.         self.contents.draw_text(32,64,400,32," ")
  59.       end
  60.       @sprite.x = 176
  61.       @sprite.y = 16
  62.       @sprite.zoom_x = 0.7
  63.       @sprite.zoom_y = 0.7
  64.       file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "r")
  65.       @time_stamp = file.mtime
  66.       @characters = Marshal.load(file)
  67.       @frame_count = Marshal.load(file)
  68.       @game_system = Marshal.load(file)
  69.       @game_switches = Marshal.load(file)
  70.       @game_variables = Marshal.load(file)
  71.       @total_sec = @frame_count / Graphics.frame_rate
  72.       file.close
  73.       for i in [email][email protected][/email]
  74.         @sp_ch[i] = Sprite.new
  75.         @sp_ch[i].visible = true
  76.         @sp_ch[i].bitmap = RPG::Cache.battler(@characters[i][3], @characters[i][4])
  77.         @sp_ch[i].x = 180 + i*100      
  78.         @sp_ch[i].y = 460 - @sp_ch[i].bitmap.height
  79.         @sp_ch[i].z = 101
  80.       end
  81.       hour = @total_sec / 60 / 60
  82.       min = @total_sec / 60 % 60
  83.       sec = @total_sec % 60
  84.       time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  85.       self.contents.font.color = normal_color
  86.       self.contents.draw_text(4, 390, 420, 32, time_string, 2)
  87.       self.contents.font.color = normal_color
  88.       time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  89.       self.contents.draw_text(4, 420, 420, 32, time_string, 2)
  90.     else
  91.       self.contents.draw_text(32,32,420,32,"这个存档是空的")
  92.     end
  93.   end
  94.   def dispose
  95.     super
  96.     @sprite.dispose
  97.     @backsp.dispose
  98.     for i in @sp_ch
  99.       i.dispose
  100.     end
  101.   end
  102. end
  103. class Scene_Save
  104.   def main
  105.     @command_window = Window_Command.new(160,["进度一","进度二","进度三","进度四","进度五","进度六"])
  106.     @command_window.y = 96
  107.     @command_window.index = $game_temp.last_file_index
  108.     @content_window = Window_File.new($game_temp.last_file_index)
  109.     Graphics.transition
  110.       loop do
  111.       Graphics.update
  112.       Input.update
  113.       update
  114.       if $scene != self
  115.         break
  116.       end
  117.     end
  118.     Graphics.freeze
  119.     @command_window.dispose
  120.     @content_window.dispose
  121.   end
  122.   def update
  123.     @command_window.update   
  124.     if @command_window.index != @content_window.index
  125.       @content_window.index = @command_window.index
  126.       @content_window.refresh
  127.     end   
  128.     if Input.trigger?(Input::B)  
  129.       $game_system.se_play($data_system.cancel_se)
  130.       if $game_temp.save_calling
  131.         $game_temp.save_calling = false
  132.         $scene = Scene_Map.new
  133.         return
  134.       end
  135.       $scene = Scene_Menu.new(4)
  136.     end   
  137.     if Input.trigger?(Input::C)
  138.       $game_system.se_play($data_system.save_se)
  139.       file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "wb")
  140.       write_save_data(file)
  141.       if FileTest.exist?(BBS_66RPG_DIR+"shot.jpg")
  142.         File.rename(BBS_66RPG_DIR+"shot.jpg", BBS_66RPG_DIR+"Save#{@command_window.index}.jpg")
  143.       end
  144.       file.close
  145.       $game_temp.last_file_index = @command_window.index
  146.       if $game_temp.save_calling
  147.         $game_temp.save_calling = false
  148.         $scene = Scene_Map.new
  149.         return
  150.       end
  151.       $scene = Scene_Map.new
  152.     end
  153.   end
  154.   def write_save_data(file)
  155.     characters = []
  156.     for i in 0...$game_party.actors.size
  157.       actor = $game_party.actors[i]
  158.       characters.push([actor.character_name, actor.character_hue, actor.id, actor.battler_name, actor.battler_hue])
  159.     end
  160.     Marshal.dump(characters, file)
  161.     Marshal.dump(Graphics.frame_count, file)
  162.     $game_system.save_count += 1
  163.     $game_system.magic_number = $data_system.magic_number
  164.     Marshal.dump($game_system, file)
  165.     Marshal.dump($game_switches, file)
  166.     Marshal.dump($game_variables, file)
  167.     Marshal.dump($game_self_switches, file)
  168.     Marshal.dump($game_screen, file)
  169.     Marshal.dump($game_actors, file)
  170.     Marshal.dump($game_party, file)
  171.     Marshal.dump($game_troop, file)
  172.     Marshal.dump($game_map, file)
  173.     Marshal.dump($game_player, file)
  174.   end
  175. end
  176. class Scene_Load
  177.   def initialize
  178.     $game_temp = Game_Temp.new
  179.     $game_temp.last_file_index = 0
  180.     latest_time = Time.at(0)
  181.     for i in 0..6
  182.       filename = BBS_66RPG_DIR+"Save#{i}.rxdata"
  183.       if FileTest.exist?(filename)
  184.         file = File.open(filename, "r")
  185.         if file.mtime > latest_time
  186.           latest_time = file.mtime
  187.           $game_temp.last_file_index = i
  188.         end
  189.         file.close
  190.       end
  191.     end
  192.   end  
  193.   def main
  194.     @command_window = Window_Command.new(160,["进度一","进度二","进度三","进度四","进度五","进度六"])
  195.     @command_window.y = 96
  196.     @command_window.index = $game_temp.last_file_index
  197.     @content_window = Window_File.new($game_temp.last_file_index)
  198.     Graphics.transition
  199.     loop do
  200.       Graphics.update
  201.       Input.update
  202.       update
  203.       if $scene != self
  204.         break
  205.       end
  206.     end
  207.     Graphics.freeze
  208.     @command_window.dispose
  209.     @content_window.dispose
  210.   end
  211.   def update
  212.     @command_window.update   
  213.     if @command_window.index != @content_window.index
  214.       @content_window.index = @command_window.index
  215.       @content_window.refresh
  216.     end   
  217.     if Input.trigger?(Input::B)  
  218.     $game_system.se_play($data_system.cancel_se)
  219.     $scene = Scene_Title.new
  220.     end   
  221.     if Input.trigger?(Input::C)
  222.       unless FileTest.exist?(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata")
  223.         $game_system.se_play($data_system.buzzer_se)
  224.         return
  225.       end
  226.       $game_system.se_play($data_system.load_se)
  227.       file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "rb")
  228.       read_save_data(file)
  229.       file.close
  230.       $game_system.bgm_play($game_system.playing_bgm)
  231.       $game_system.bgs_play($game_system.playing_bgs)
  232.       $game_map.update
  233.       $scene = Scene_Map.new
  234.     end
  235.   end
  236.   def read_save_data(file)
  237.     characters = Marshal.load(file)
  238.     Graphics.frame_count = Marshal.load(file)
  239.     $game_system        = Marshal.load(file)
  240.     $game_switches      = Marshal.load(file)
  241.     $game_variables     = Marshal.load(file)
  242.     $game_self_switches = Marshal.load(file)
  243.     $game_screen        = Marshal.load(file)
  244.     $game_actors        = Marshal.load(file)
  245.     $game_party         = Marshal.load(file)
  246.     $game_troop         = Marshal.load(file)
  247.     $game_map           = Marshal.load(file)
  248.     $game_player        = Marshal.load(file)
  249.     if $game_system.magic_number != $data_system.magic_number
  250.       $game_map.setup($game_map.map_id)
  251.       $game_player.center($game_player.x, $game_player.y)
  252.     $game_party.refresh
  253.   end
  254. class Scene_Menu
  255.   alias bbs_66rpg_shotsave_main main
  256.   def main
  257.     if @menu_index == 0
  258.       Screen::shot
  259.     end   
  260.     bbs_66rpg_shotsave_main
  261.   end
  262. class Interpreter
  263.   def command_352
  264.     $game_temp.battle_abort = true
  265.     $game_temp.save_calling = true
  266.     @index += 1
  267.     Screen::shot
  268.     return false
  269.   end
复制代码
希望大家能帮到我,谢谢大家了~   
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴

Lv1.梦旅人

梦石
0
星屑
68
在线时间
585 小时
注册时间
2013-5-25
帖子
1524
2
发表于 2013-7-5 12:37:51 | 只看该作者
本帖最后由 克莉丝 于 2013-7-5 12:47 编辑

把代码保存为txt作为附件发上来,dz解析的时候代码被改掉了

检查无误的话73行的[Email][\Email]应该是发帖时自动加上了

- = 脚本里缺了好多end


看了5遍居然没看懂要改成什么样子

点评

缺少end是自己删的...  发表于 2013-7-5 13:20
回复 支持 反对

使用道具 举报

Lv5.捕梦者 (版主)

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

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

3
发表于 2013-7-5 17:37:17 | 只看该作者
没有用过截图脚本,对立面的功能不了解。
所以,我还是不会改
大家好,这里是晨露的说。请多多指教。
刚入门RM软件制作,请大家多多帮助我哦。
落雪君的欢乐像素教程,欢迎查阅。

回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
4
 楼主| 发表于 2013-7-5 19:16:56 | 只看该作者
美丽晨露 发表于 2013-7-5 17:37
没有用过截图脚本,对立面的功能不了解。
所以,我还是不会改

我对于command也不是很了解
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
68
在线时间
585 小时
注册时间
2013-5-25
帖子
1524
5
发表于 2013-7-5 19:21:25 | 只看该作者
紫英晓狼1130 发表于 2013-7-5 19:16
我对于command也不是很了解

你有必要回答我在沙发提出的问题哦
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
6
 楼主| 发表于 2013-7-5 19:24:39 | 只看该作者
克莉丝 发表于 2013-7-5 12:37
把代码保存为txt作为附件发上来,dz解析的时候代码被改掉了

检查无误的话73行的[Email][\Email]应该是发帖 ...

这是我的轩辕剑的存档界面,我想改成轩辕剑式的存档,就是在存档档位加上图片,剩下的我能自己改

点评

我觉得已经到了全部重写的程度了呢  发表于 2013-7-5 19:40
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
68
在线时间
585 小时
注册时间
2013-5-25
帖子
1524
7
发表于 2013-7-5 19:29:17 | 只看该作者

点评

其实只是加一个截图(不过也没改出来…)应该是把类似与38行的super进行修改, 例如super(160,index_y % 3,480,480)乱写的…  发表于 2013-7-5 19:48
存档信息,这个和XP自带的差不多,我可以自己改~  发表于 2013-7-5 19:37
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
52
在线时间
586 小时
注册时间
2012-5-31
帖子
768
8
发表于 2013-7-5 23:29:56 | 只看该作者
好像很难的样子、、、、我只是路过、、、、、
回复 支持 反对

使用道具 举报

Lv1.梦旅人

矿工

梦石
0
星屑
134
在线时间
898 小时
注册时间
2012-10-5
帖子
1535
9
发表于 2013-7-6 09:10:37 | 只看该作者
本帖最后由 876加几 于 2013-7-6 09:12 编辑

范例:http://rpg.blue/thread-247700-1-1.html
随便把一个非0的SaveXXX复制到EXE文件旁边。
但是非你想要的格式。
  1. #==============================================================================
  2. # 本脚本来自www.66RPG.com,转载和使用请保留此信息
  3. #===============================================================================

  4. BBS_66RPG_DIR = "Save/"  # 储存文件夹名,请制作游戏时自行建立此文件夹

  5. # 若想使用自定义背景图,脚本62行的井号去掉,并放置一张相应图形。

  6. # 在你的Scene_Title中找到这一段(如果使用其他插件脚本,在插件中找):
  7. #    for i in 0..3
  8. #      if FileTest.exist?("Save#{i+1}.rxdata")
  9. # 请自行把0..3改为0..最大进度号,比如0..9
  10. # "Save#{i+1}.rxdata" 改为"Save/Save#{i}.rxdata"

  11. # 增加进度的方法:138,258行,继续添加。你也可以改“进度X”为“回忆X”或者“红/绿/蓝笔记本”

  12. #===============================================================================
  13. module Screen  
  14.   @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  15.   @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  16.   @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  17.   module_function
  18.   #-----------------------------------------------------------------------------
  19.   # here comes the stuff...
  20.   # i add here the stuff for automatic change of the number for the screenshot
  21.   # so it wont overrite the old one...
  22.   # if you want to change so stuff change them in this line below
  23.   # or you can change them in your command line... like
  24.   # Screen::shot("screenshot", 2)
  25.   # this change the name and the type of the screenshot
  26.   # (0 = bmp, 1 = jpg and 2 = png)
  27.   # ----------------------------------------------------------------------------
  28.   def shot(file = "shot", typ = 1)
  29.     # to add the right extension...
  30.     if typ == 0
  31.       typname = ".bmp"
  32.     elsif typ == 1
  33.       typname = ".jpg"
  34.     elsif typ == 2
  35.       typname = ".png"
  36.     end   
  37.     file_index = 0   
  38.     dir = "Save/"   
  39.     # make the filename....
  40.     file_name = dir + file.to_s + typname.to_s   
  41.     # make the screenshot.... Attention dont change anything from here on....
  42.     @screen.call(0,0,640,480,file_name,handel,typ)
  43.   end
  44.   # find the game window...
  45.   def handel
  46.     game_name = "\0" * 256
  47.     @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  48.     game_name.delete!("\0")
  49.     return @findwindow.call('RGSS Player',game_name)
  50.   end
  51. end

  52. class Window_File < Window_Base
  53.   attr_accessor :index
  54.   def initialize(index = 0)
  55.     @backsp = Sprite.new
  56.     #@backsp.bitmap = Bitmap.new("Graphics/Pictures/存盘背景.jpg")
  57.     @backsp.z = 99
  58.     super(160,0,480,480)
  59.     #这行可以不用
  60.     self.contents = Bitmap.new(width - 32, height - 32)
  61.     @index = index
  62.     #这里我要说明一句,之所以用sprite是为了放缩图片
  63.     [url=home.php?mod=space&uid=114926]@sprite[/url] = Sprite.new
  64.     @sprite.visible = false
  65.     @sprite.z = 100
  66.     @sp_ch = []
  67.     @sp_ch[0] = Sprite.new
  68.     refresh
  69.   end
  70.   def refresh
  71.     self.contents.clear
  72.     for i in @sp_ch
  73.       i.visible = false
  74.     end
  75.     @sprite.visible = false
  76.     if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.rxdata")
  77.       @sprite.visible = true
  78.       if FileTest.exist?(BBS_66RPG_DIR+"Save#{@index}.jpg")
  79.         @sprite.bitmap = Bitmap.new(BBS_66RPG_DIR+"Save#{@index}.jpg")
  80.       else
  81.         self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
  82.       end
  83.       @sprite.x = 176
  84.       @sprite.y = 16
  85.       @sprite.zoom_x = 0.7
  86.       @sprite.zoom_y = 0.7
  87.       file = File.open(BBS_66RPG_DIR+"Save#{@index}.rxdata", "r")
  88.       @time_stamp = file.mtime
  89.       @characters = Marshal.load(file)
  90.       @frame_count = Marshal.load(file)
  91.       @game_system = Marshal.load(file)
  92.       @game_switches = Marshal.load(file)
  93.       @game_variables = Marshal.load(file)
  94.       @total_sec = @frame_count / Graphics.frame_rate
  95.       file.close
  96.       for i in [email protected]
  97.         @sp_ch[i] = Sprite.new
  98.         @sp_ch[i].visible = true
  99.         @sp_ch[i].bitmap = RPG::Cache.battler(@characters[i][3], @characters[i][4])
  100.         @sp_ch[i].x = 180 + i*100      
  101.         @sp_ch[i].y = 460 - @sp_ch[i].bitmap.height
  102.         @sp_ch[i].z = 101
  103.       end
  104.       # 描绘游戏时间
  105.       hour = @total_sec / 60 / 60
  106.       min = @total_sec / 60 % 60
  107.       sec = @total_sec % 60
  108.       time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  109.       self.contents.font.color = normal_color
  110.       self.contents.draw_text(4, 390, 420, 32, time_string, 2)
  111.       # 描绘时间标记
  112.       self.contents.font.color = normal_color
  113.       time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  114.       self.contents.draw_text(4, 420, 420, 32, time_string, 2)
  115.     else
  116.       self.contents.draw_text(32,32,420,32,"这个存档是空的")
  117.     end
  118.   end
  119.   def dispose
  120.     super
  121.     @sprite.dispose
  122.     @backsp.dispose
  123.     for i in @sp_ch
  124.       i.dispose
  125.     end
  126.   end
  127. end


  128. class Scene_Save
  129.   def main
  130.     @command_window = Window_Command.new(160,["进度一","进度二","进度三","进度四","进度五","进度六","进度七","进度八","进度九"])
  131.     @command_window.y = 96
  132.     @command_window.index = $game_temp.last_file_index
  133.     @content_window = Window_File.new($game_temp.last_file_index)
  134.     # 执行过渡
  135.     Graphics.transition
  136.     # 主循环
  137.     loop do
  138.       # 刷新游戏画面
  139.       Graphics.update
  140.       # 刷新输入信息
  141.       Input.update
  142.       # 刷新画面
  143.       update
  144.       # 如果画面被切换的话就中断循环
  145.       if $scene != self
  146.         break
  147.       end
  148.     end
  149.     # 准备过渡
  150.     Graphics.freeze
  151.     @command_window.dispose
  152.     @content_window.dispose
  153.   end
  154.   def update
  155.     @command_window.update   
  156.     if @command_window.index != @content_window.index
  157.       @content_window.index = @command_window.index
  158.       @content_window.refresh
  159.     end   
  160.     #——————下面这一部分是原装脚本——————#
  161.     if Input.trigger?(Input::B)  
  162.       $game_system.se_play($data_system.cancel_se)
  163.       if $game_temp.save_calling
  164.         $game_temp.save_calling = false
  165.         $scene = Scene_Map.new
  166.         return
  167.       end
  168.       $scene = Scene_Menu.new(4)
  169.     end   
  170.     #———————————————————————#   
  171.     if Input.trigger?(Input::C)
  172.       # 演奏存档 SE
  173.       $game_system.se_play($data_system.save_se)
  174.       # 写入存档数据
  175.       file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "wb")
  176.       write_save_data(file)
  177.       if FileTest.exist?(BBS_66RPG_DIR+"shot.jpg")
  178.         File.rename(BBS_66RPG_DIR+"shot.jpg", BBS_66RPG_DIR+"Save#{@command_window.index}.jpg")
  179.       end
  180.       file.close
  181.       $game_temp.last_file_index = @command_window.index
  182.       # 如果被事件调用
  183.       if $game_temp.save_calling
  184.         # 清除存档调用标志
  185.         $game_temp.save_calling = false
  186.         # 切换到地图画面
  187.         $scene = Scene_Map.new
  188.         return
  189.       end
  190.       # 切换到菜单画面
  191.       $scene = Scene_Map.new
  192.     end
  193.     #———————————————————————#
  194.   end
  195.   #--------------------------------------------------------------------------
  196.   # ● 写入存档数据
  197.   #     file : 写入用文件对像 (已经打开)
  198.   #--------------------------------------------------------------------------
  199.   def write_save_data(file)
  200.     # 生成描绘存档文件用的角色图形
  201.     characters = []
  202.     for i in 0...$game_party.actors.size
  203.       actor = $game_party.actors[i]
  204.       characters.push([actor.character_name, actor.character_hue, actor.id, actor.battler_name, actor.battler_hue])
  205.     end
  206.     # 写入描绘存档文件用的角色数据
  207.     Marshal.dump(characters, file)
  208.     # 写入测量游戏时间用画面计数
  209.     Marshal.dump(Graphics.frame_count, file)
  210.     # 增加 1 次存档次数
  211.     $game_system.save_count += 1
  212.     # 保存魔法编号
  213.     # (将编辑器保存的值以随机值替换)
  214.     $game_system.magic_number = $data_system.magic_number
  215.     # 写入各种游戏对像
  216.     Marshal.dump($game_system, file)
  217.     Marshal.dump($game_switches, file)
  218.     Marshal.dump($game_variables, file)
  219.     Marshal.dump($game_self_switches, file)
  220.     Marshal.dump($game_screen, file)
  221.     Marshal.dump($game_actors, file)
  222.     Marshal.dump($game_party, file)
  223.     Marshal.dump($game_troop, file)
  224.     Marshal.dump($game_map, file)
  225.     Marshal.dump($game_player, file)
  226.   end
  227. end


  228. class Scene_Load
  229.   def initialize
  230.     # 再生成临时对像
  231.     $game_temp = Game_Temp.new
  232.     # 选择存档时间最新的文件
  233.     $game_temp.last_file_index = 0
  234.     latest_time = Time.at(0)
  235.     for i in 0..6
  236.       filename = BBS_66RPG_DIR+"Save#{i}.rxdata"
  237.       if FileTest.exist?(filename)
  238.         file = File.open(filename, "r")
  239.         if file.mtime > latest_time
  240.           latest_time = file.mtime
  241.           $game_temp.last_file_index = i
  242.         end
  243.         file.close
  244.       end
  245.     end
  246.   end  
  247.   def main
  248.     @command_window = Window_Command.new(160,["进度一","进度二","进度三","进度四","进度五","进度六","进度七","进度八","进度九"])
  249.     @command_window.y = 96
  250.     @command_window.index = $game_temp.last_file_index
  251.     @content_window = Window_File.new($game_temp.last_file_index)
  252.     # 执行过渡
  253.     Graphics.transition
  254.     # 主循环
  255.     loop do
  256.       # 刷新游戏画面
  257.       Graphics.update
  258.       # 刷新输入信息
  259.       Input.update
  260.       # 刷新画面
  261.       update
  262.       # 如果画面被切换的话就中断循环
  263.       if $scene != self
  264.         break
  265.       end
  266.     end
  267.     # 准备过渡
  268.     Graphics.freeze
  269.     @command_window.dispose
  270.     @content_window.dispose
  271.   end
  272.   def update
  273.     @command_window.update   
  274.     if @command_window.index != @content_window.index
  275.       @content_window.index = @command_window.index
  276.       @content_window.refresh
  277.     end   
  278.     #——————下面这一部分是原装脚本——————#
  279.     if Input.trigger?(Input::B)  
  280.     # 演奏取消 SE
  281.     $game_system.se_play($data_system.cancel_se)
  282.     # 切换到标题画面
  283.     $scene = Scene_Title.new
  284.     end   
  285.     #———————————————————————#   
  286.     if Input.trigger?(Input::C)
  287.       # 文件不存在的情况下
  288.       unless FileTest.exist?(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata")
  289.         # 演奏冻结 SE
  290.         $game_system.se_play($data_system.buzzer_se)
  291.         return
  292.       end
  293.       # 演奏读档 SE
  294.       $game_system.se_play($data_system.load_se)
  295.       # 写入存档数据
  296.       file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "rb")
  297.       read_save_data(file)
  298.       file.close
  299.       # 还原 BGM、BGS
  300.       $game_system.bgm_play($game_system.playing_bgm)
  301.       $game_system.bgs_play($game_system.playing_bgs)
  302.       # 刷新地图 (执行并行事件)
  303.       $game_map.update
  304.       # 切换到地图画面
  305.       $scene = Scene_Map.new
  306.     end
  307.     #———————————————————————#
  308.   end
  309.   #--------------------------------------------------------------------------
  310.   # ● 写入存档数据
  311.   #     file : 写入用文件对像 (已经打开)
  312.   #--------------------------------------------------------------------------
  313.   def read_save_data(file)
  314.     # 读取描绘存档文件用的角色数据
  315.     characters = Marshal.load(file)
  316.     # 读取测量游戏时间用画面计数
  317.     Graphics.frame_count = Marshal.load(file)
  318.     # 读取各种游戏对像
  319.     $game_system        = Marshal.load(file)
  320.     $game_switches      = Marshal.load(file)
  321.     $game_variables     = Marshal.load(file)
  322.     $game_self_switches = Marshal.load(file)
  323.     $game_screen        = Marshal.load(file)
  324.     $game_actors        = Marshal.load(file)
  325.     $game_party         = Marshal.load(file)
  326.     $game_troop         = Marshal.load(file)
  327.     $game_map           = Marshal.load(file)
  328.     $game_player        = Marshal.load(file)
  329.     # 魔法编号与保存时有差异的情况下
  330.     # (加入编辑器的编辑过的数据)
  331.     if $game_system.magic_number != $data_system.magic_number
  332.       # 重新装载地图
  333.       $game_map.setup($game_map.map_id)
  334.       $game_player.center($game_player.x, $game_player.y)
  335.     end
  336.     # 刷新同伴成员
  337.     $game_party.refresh
  338.   end
  339. end

  340. class Scene_Menu
  341.   alias bbs_66rpg_shotsave_main main
  342.   def main
  343.     if @menu_index == 0
  344.       Screen::shot
  345.     end   
  346.     bbs_66rpg_shotsave_main
  347.   end
  348. end

  349. class Interpreter
  350.   #--------------------------------------------------------------------------
  351.   # ● 调用存档画面
  352.   #--------------------------------------------------------------------------
  353.   def command_352
  354.     # 设置战斗中断标志
  355.     $game_temp.battle_abort = true
  356.     # 设置调用存档标志
  357.     $game_temp.save_calling = true
  358.     # 推进索引
  359.     @index += 1
  360.     # 结束
  361.     Screen::shot
  362.     return false
  363.   end
  364. end
复制代码
(我也被逼)

点评

这就是截图存档吧,虽然我不需要,但还是谢谢你  发表于 2013-7-6 09:23
呃,发糖贴好冷清呀!
回复 支持 反对

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
3846
在线时间
1966 小时
注册时间
2013-1-3
帖子
9536
10
 楼主| 发表于 2013-7-6 15:02:08 | 只看该作者
wwwcctvty 发表于 2013-7-5 23:29
好像很难的样子、、、、我只是路过、、、、、

哦?好像需要重定义…
《宿愿·寻剑篇》正式版已经发布!快去看看!点击进入论坛发布贴
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-9-29 01:23

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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