Project1

标题: 如何读取指定档 [打印本页]

作者: wxs29    时间: 2011-5-6 12:10
标题: 如何读取指定档
我想在读档时不出现选择档的界面,直接读某个档,要怎样实现?dsu_plus_rewardpost_czw
作者: 小⑨    时间: 2011-5-6 17:51
参考默认的读档脚本,记得好像有一个函数是直接读档的,选用你要的那个存档编号就可以了= =
作者: wxs29    时间: 2011-5-6 18:21
小⑨ 发表于 2011-5-6 17:51
参考默认的读档脚本,记得好像有一个函数是直接读档的,选用你要的那个存档编号就可以了= = ...

请说具体些行吗
作者: Wind2010    时间: 2011-5-6 18:27
  1. def louse_load(id)
  2.   unless FileTest.exist?("Save#{id}.rxdata")
  3.     $game_system.se_play($data_system.buzzer_se)
  4.     return
  5.   end
  6.   $game_system.se_play($data_system.load_se)
  7.   file = File.open("Save#{id}.rxdata", "rb")
  8.   characters           = Marshal.load(file)
  9.   Graphics.frame_count = Marshal.load(file)
  10.   $game_system         = Marshal.load(file)
  11.   $game_switches       = Marshal.load(file)
  12.   $game_variables      = Marshal.load(file)
  13.   $game_self_switches  = Marshal.load(file)
  14.   $game_screen         = Marshal.load(file)
  15.   $game_actors         = Marshal.load(file)
  16.   $game_party          = Marshal.load(file)
  17.   $game_troop          = Marshal.load(file)
  18.   $game_map            = Marshal.load(file)
  19.   $game_player         = Marshal.load(file)
  20.   if $game_system.magic_number != $data_system.magic_number
  21.     $game_map.setup($game_map.map_id)
  22.     $game_player.center($game_player.x, $game_player.y)
  23.   end
  24.   $game_party.refresh
  25.   file.close
  26.   $game_system.bgm_play($game_system.playing_bgm)
  27.   $game_system.bgs_play($game_system.playing_bgs)
  28.   $game_map.update
  29.   $scene = Scene_Map.new
  30. end
复制代码
不知道是否可行,读取直接用louse_load(存档ID)
作者: wxs29    时间: 2011-5-7 09:39
Wind2010 发表于 2011-5-6 18:27
不知道是否可行,读取直接用louse_load(存档ID)

错误了         
作者: h907308901    时间: 2011-5-7 13:40
本帖最后由 h907308901 于 2011-5-7 13:40 编辑

最简单的办法:
  1. Scene_Load.new.on_decision(文件名)
复制代码

作者: wxs29    时间: 2011-5-8 16:41
回复 Wind2010 的帖子

Interpreter 7错误
作者: Wind2010    时间: 2011-5-8 18:48
LZ调用的是事件脚本 嗯
  1. class Interpreter
  2. def louse_load(id)
  3.   unless FileTest.exist?("Save#{id}.rxdata")
  4.     $game_system.se_play($data_system.buzzer_se)
  5.     return
  6.   end
  7.   $game_system.se_play($data_system.load_se)
  8.   file = File.open("Save#{id}.rxdata", "rb")
  9.   characters           = Marshal.load(file)
  10.   Graphics.frame_count = Marshal.load(file)
  11.   $game_system         = Marshal.load(file)
  12.   $game_switches       = Marshal.load(file)
  13.   $game_variables      = Marshal.load(file)
  14.   $game_self_switches  = Marshal.load(file)
  15.   $game_screen         = Marshal.load(file)
  16.   $game_actors         = Marshal.load(file)
  17.   $game_party          = Marshal.load(file)
  18.   $game_troop          = Marshal.load(file)
  19.   $game_map            = Marshal.load(file)
  20.   $game_player         = Marshal.load(file)
  21.   if $game_system.magic_number != $data_system.magic_number
  22.     $game_map.setup($game_map.map_id)
  23.     $game_player.center($game_player.x, $game_player.y)
  24.   end
  25.   $game_party.refresh
  26.   file.close
  27.   $game_system.bgm_play($game_system.playing_bgm)
  28.   $game_system.bgs_play($game_system.playing_bgs)
  29.   $game_map.update
  30.   $scene = Scene_Map.new
  31. end
  32. end
复制代码
事件脚本测试可用
作者: wxs29    时间: 2011-5-9 12:07
回复 Wind2010 的帖子

成功了!非常感谢!好人啊!




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1