赞 | 0 |
VIP | 77 |
好人卡 | 306 |
积分 | 1 |
经验 | 85662 |
最后登录 | 2023-11-23 |
在线时间 | 1782 小时 |
Lv1.梦旅人 虱子
- 梦石
- 0
- 星屑
- 121
- 在线时间
- 1782 小时
- 注册时间
- 2010-6-19
- 帖子
- 3597
|
本帖最后由 Wind2010 于 2014-1-30 23:16 编辑
- =begin
- 用法:
- 事件中调用quick_save,自动存档到一号位然后返回地图
- 调用quick_load,自动读取一号档并返回地图
- =end
- def quick_save(file=1)
- filename = "Save#{file}.rxdata"
- file = File.open(filename, "wb")
- characters = []
- for i in 0...$game_party.actors.size
- actor = $game_party.actors[i]
- characters.push([actor.character_name, actor.character_hue])
- end
- Marshal.dump(characters, file)
- Marshal.dump(Graphics.frame_count, file)
- $game_system.save_count += 1
- $game_system.magic_number = $data_system.magic_number
- Marshal.dump($game_system, file)
- Marshal.dump($game_switches, file)
- Marshal.dump($game_variables, file)
- Marshal.dump($game_self_switches, file)
- Marshal.dump($game_screen, 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
- $scene = Scene_Map.new if !$scene.is_a?(Scene_Map)
- end
- def quick_load(file=1)
- filename = "Save#{file}.rxdata"
- file = File.open(filename, "rb")
- characters = Marshal.load(file)
- Graphics.frame_count = Marshal.load(file)
- $game_system = Marshal.load(file)
- $game_switches = Marshal.load(file)
- $game_variables = Marshal.load(file)
- $game_self_switches = Marshal.load(file)
- $game_screen = 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.magic_number != $data_system.magic_number
- $game_map.setup($game_map.map_id)
- $game_player.center($game_player.x, $game_player.y)
- end
- $game_party.refresh
- file.close
- $scene = Scene_Map.new
- end
复制代码 |
评分
-
查看全部评分
|