赞 | 9 |
VIP | 15 |
好人卡 | 15 |
积分 | 17 |
经验 | 25000 |
最后登录 | 2024-5-31 |
在线时间 | 485 小时 |
Lv3.寻梦者
- 梦石
- 0
- 星屑
- 1743
- 在线时间
- 485 小时
- 注册时间
- 2006-1-7
- 帖子
- 1073
|
简单方法,把你不想继承的剔除,其他都继承
首先- file = File.open("Finished.rxdata", "wb")
- Marshal.dump($game_variables, file)
- Marshal.dump($game_actors, file)
- file.close
复制代码 这部分改成- file = File.open("Finished.rxdata", "wb")
- 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
复制代码 不用吝啬,全写里面才500K左右
其次,轮回里面后面全替换成下面的:- if FileTest.exist?("Finished.rxdata")
- file = File.open("Finished.rxdata", "rb")
- $game_system = Marshal.load(file)
- $game_system = Game_System.new
- $game_switches = Game_Switches.new
- $game_variables = Game_Variables.new
- $game_self_switches = Game_SelfSwitches.new
- $game_screen = Game_Screen.new
- $game_actors = Marshal.load(file)
- $game_party = Marshal.load(file)
- $game_troop = Game_Troop.new
- $game_map = Game_Map.new
- $game_player = Game_Player.new
复制代码 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) 事件启动的判定、以及地图的滚动等功能,不用继承
我知道了,你把$game_party又初始化了。 |
|