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

Project1

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

[已经过期] 截图存档@characters[i][3] + "_save.png"和@characters[i][3]的区别

 关闭 [复制链接]

Lv1.梦旅人

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

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

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

x
本帖最后由 a2802320 于 2011-6-17 15:45 编辑

我下了截图存档的范例和石焚刃暖这个游戏
里面的截图存档脚本是同一个,但是我想加人物进去却不成功,麻烦帮看看
截图存档范例的脚本如下:
  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.     @sprite = 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
复制代码
石焚刃暖脚本如下:
  1. #===============================================================================

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

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

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

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

  10. # 注意:这个脚本是兼容亿万星辰的“轩辕剑菜单”的版本,不过用在其他场合貌似也不会出错
  11. #   使用时把这个脚本放在“轩辕剑菜单”脚本的下方,也就是更靠近Main的位置
  12. # 兼容处理:叶子
  13. #===============================================================================
  14. module Screen  
  15. @screen = Win32API.new 'Dll\screenshot', 'Screenshot', %w(l l l l p l l), ''
  16. @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  17. @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  18. module_function
  19. #-----------------------------------------------------------------------------
  20. # here comes the stuff...
  21. # i add here the stuff for automatic change of the number for the screenshot
  22. # so it wont overrite the old one...
  23. # if you want to change so stuff change them in this line below
  24. # or you can change them in your command line... like
  25. # Screen::shot("screenshot", 2)
  26. # this change the name and the type of the screenshot
  27. # (0 = bmp, 1 = jpg and 2 = png)
  28. # ----------------------------------------------------------------------------
  29. def shot(file = "shot", typ = 1)
  30.   # to add the right extension...
  31.   if typ == 0
  32.     typname = ".bmp"
  33.   elsif typ == 1
  34.     typname = ".jpg"
  35.   elsif typ == 2
  36.     typname = ".png"
  37.   end   
  38.   file_index = 0   
  39.   dir = "Save/"   
  40.   # make the filename....
  41.   file_name = dir + file.to_s + typname.to_s   
  42.   if $shot_guodu == 1
  43.     file_name = "Graphics/Pictures/sys_screen.jpg"
  44.     $shot_guodu = 0
  45.   end
  46.   # make the screenshot.... Attention dont change anything from here on....
  47.   @screen.call(0,0,640,480,file_name,handel,typ)
  48. end
  49. # find the game window...
  50. def handel
  51.   game_name = "\0" * 256
  52.   @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  53.   game_name.delete!("\0")
  54.   return @findwindow.call('RGSS Player',game_name)
  55. end
  56. end

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


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


  250. class Scene_Load
  251. def initialize(force = false)
  252.   @in_game = force
  253.   # 再生成临时对像
  254.   $game_temp = Game_Temp.new
  255.   # 选择存档时间最新的文件
  256.   $game_temp.last_file_index = 0
  257.   latest_time = Time.at(0)
  258.   for i in 0..6
  259.     filename = BBS_66RPG_DIR+"Save#{i}.rxdata"
  260.     if FileTest.exist?(filename)
  261.       file = File.open(filename, "r")
  262.       if file.mtime > latest_time
  263.         latest_time = file.mtime
  264.         $game_temp.last_file_index = i
  265.       end
  266.       file.close
  267.     end
  268.   end
  269. end  
  270. def main
  271.   @command_window = Window_Command.new(160,["回忆 1","回忆 2","回忆 3","回忆 4","回忆 5","回忆 6","回忆 7","回忆 8","回忆 9","回忆10","回忆11","回忆12","回忆13","回忆14"])
  272.   @command_window.y = 0
  273.   @command_window.index = $game_temp.last_file_index
  274.   @content_window = Window_File.new($game_temp.last_file_index)
  275.   # 执行过渡
  276.   Graphics.transition
  277.   # 主循环
  278.   loop do
  279.     # 刷新游戏画面
  280.     Graphics.update
  281.     # 刷新输入信息
  282.     Input.update
  283.     # 刷新画面
  284.     update
  285.     # 如果画面被切换的话就中断循环
  286.     if $scene != self
  287.       break
  288.     end
  289.   end
  290.   # 准备过渡
  291.   Graphics.freeze
  292.   @command_window.dispose
  293.   @content_window.dispose
  294. end
  295. def update
  296.   @command_window.update   
  297.   if @command_window.index != @content_window.index
  298.     @content_window.index = @command_window.index
  299.     @content_window.refresh
  300.   end   
  301.   #——————下面这一部分是原装脚本——————#
  302.   if Input.trigger?(Input::B)  
  303.   # 演奏取消 SE
  304.   $game_system.se_play($data_system.cancel_se)
  305.    if @in_game
  306.      $scene = $scene = Scene_Menu.new(4)
  307.    else
  308.      # 切换到标题画面
  309.      $scene = Scene_Title.new
  310.    end
  311.   end   
  312.   #———————————————————————#   
  313.   if Input.trigger?(Input::C)
  314.     # 文件不存在的情况下
  315.     unless FileTest.exist?(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata")
  316.       # 演奏冻结 SE
  317.       $game_system.se_play($data_system.buzzer_se)
  318.       return
  319.     end
  320.     #..........................................................................
  321.     if $piantou == 1
  322.       case $menu_back_type
  323.       when 0
  324.         for i in 0..46
  325.           $menupicback[i].bitmap.dispose
  326.           $menupicback[i].dispose
  327.         end
  328.       when 1
  329.         for i in 0..69
  330.           $menupicback[i].bitmap.dispose
  331.           $menupicback[i].dispose
  332.         end
  333.       when 2
  334.         for i in 0..49
  335.           $menupicback[i].bitmap.dispose
  336.           $menupicback[i].dispose
  337.         end
  338.       end
  339.     end
  340.     #..........................................................................
  341.     # 演奏读档 SE
  342.     $game_system.se_play($data_system.load_se)
  343.     # 写入存档数据
  344.     file = File.open(BBS_66RPG_DIR+"Save#{@command_window.index}.rxdata", "rb")
  345.     read_save_data(file)
  346.     file.close
  347.     # 还原 BGM、BGS
  348.     $game_system.bgm_play($game_system.playing_bgm)
  349.     $game_system.bgs_play($game_system.playing_bgs)
  350.     # 刷新地图 (执行并行事件)
  351.     $game_map.update
  352.     # 切换到地图画面
  353.     $scene = Scene_Map.new
  354.   end
  355.   #———————————————————————#
  356. end
  357. #--------------------------------------------------------------------------
  358. # ● 写入存档数据
  359. #     file : 写入用文件对像 (已经打开)
  360. #--------------------------------------------------------------------------
  361. def read_save_data(file)
  362.   @gold = Marshal.load(file)
  363.   @save_map_name = Marshal.load(file)
  364.   # 读取描绘存档文件用的角色数据
  365.   characters = Marshal.load(file)
  366.   # 读取测量游戏时间用画面计数
  367.   Graphics.frame_count = Marshal.load(file)
  368.   # 读取各种游戏对像
  369.   $game_system        = Marshal.load(file)
  370.   $game_switches      = Marshal.load(file)
  371.   $game_variables     = Marshal.load(file)
  372.   $game_self_switches = Marshal.load(file)
  373.   $game_screen        = Marshal.load(file)
  374.   $game_actors        = Marshal.load(file)
  375.   $game_party         = Marshal.load(file)
  376.   $game_troop         = Marshal.load(file)
  377.   $game_map           = Marshal.load(file)
  378.   $game_player        = Marshal.load(file)
  379.   # 魔法编号与保存时有差异的情况下
  380.   # (加入编辑器的编辑过的数据)
  381.   if $game_system.magic_number != $data_system.magic_number
  382.     # 重新装载地图
  383.     $game_map.setup($game_map.map_id)
  384.     $game_player.center($game_player.x, $game_player.y)
  385.   end
  386.   # 刷新同伴成员
  387.   $game_party.refresh
  388. end
  389. end

  390. class Scene_Menu
  391. alias bbs_66rpg_shotsave_main main
  392. def main
  393.   if @menu_index == 0
  394.     Screen::shot
  395.   end   
  396.   bbs_66rpg_shotsave_main
  397. end
  398. end

  399. class Interpreter
  400. #--------------------------------------------------------------------------
  401. # ● 调用存档画面
  402. #--------------------------------------------------------------------------
  403. def command_352
  404.   # 设置战斗中断标志
  405.   $game_temp.battle_abort = true
  406.   # 设置调用存档标志
  407.   $game_temp.save_calling = true
  408.   # 推进索引
  409.   @index += 1
  410.   # 结束
  411.   Screen::shot
  412.   return false
  413. end
  414. end
复制代码
我用石焚刃暖的截图脚本后,加入自己的人物,就老说找不到_save文件,但我已将文件放进去,请问如何解决?

还有请问下@characters[3]是什么意思……
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2025-7-22 23:34

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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