赞 | 3 |
VIP | 333 |
好人卡 | 91 |
积分 | 2 |
经验 | 55775 |
最后登录 | 2017-7-18 |
在线时间 | 2070 小时 |
Lv1.梦旅人 Mr.Gandum
- 梦石
- 0
- 星屑
- 226
- 在线时间
- 2070 小时
- 注册时间
- 2007-1-31
- 帖子
- 3039
|
在Game_Interpreter最后一个end上头插入:- def do_load(file_name)
- file = File.open(file_name, "rb")
- characters = Marshal.load(file)
- Graphics.frame_count = Marshal.load(file)
- @last_bgm = Marshal.load(file)
- @last_bgs = Marshal.load(file)
- $game_system = Marshal.load(file)
- $game_message = Marshal.load(file)
- $game_switches = Marshal.load(file)
- $game_variables = Marshal.load(file)
- $game_self_switches = Marshal.load(file)
- $game_actors = Marshal.load(file)
- $game_party = Marshal.load(file)
- $game_troop = Marshal.load(file)
- $game_map = Marshal.load(file)
- $game_player = Marshal.load(file)
- if $game_system.version_id != $data_system.version_id
- $game_map.setup($game_map.map_id)
- $game_player.center($game_player.x, $game_player.y)
- end
- file.close
- $scene = Scene_Map.new
- RPG::BGM.fade(1500)
- Graphics.fadeout(60)
- Graphics.wait(40)
- @last_bgm.play
- @last_bgs.play
- end
- def do_save(file_name)
- file = File.open(file_name, "wb")
- characters = []
- for actor in $game_party.members
- characters.push([actor.character_name, actor.character_index])
- end
- $game_system.save_count += 1
- $game_system.version_id = $data_system.version_id
- @last_bgm = RPG::BGM::last
- @last_bgs = RPG::BGS::last
- Marshal.dump(characters, file)
- Marshal.dump(Graphics.frame_count, file)
- Marshal.dump(@last_bgm, file)
- Marshal.dump(@last_bgs, file)
- Marshal.dump($game_system, file)
- Marshal.dump($game_message, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, file)
- Marshal.dump($game_actors, file)
- Marshal.dump($game_party, file)
- Marshal.dump($game_troop, file)
- Marshal.dump($game_map, file)
- Marshal.dump($game_player, file)
- file.close
- end
复制代码 之后在事件脚本内用:- do_save(file_name)
- do_load(file_name)
复制代码 分别表示存档(上面的),读档(下面的)
在file_name处输入存档名称,要用""包着。 |
|