加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 喵呜喵5 于 2014-2-13 14:58 编辑
修改DataManager中保存存档头数据的方法make_save_header,使用下面这种写法:
def make_save_header header = {} header[:characters] = $game_party.characters_for_savefile header[:playtime_s] = $game_system.playtime_s header[:chapter] = $game_variables[4] header end
def make_save_header
header = {}
header[:characters] = $game_party.characters_for_savefile
header[:playtime_s] = $game_system.playtime_s
header[:chapter] = $game_variables[4]
header
end
能够正常保存存档,但是使用下面这种写法:
alias m5_make_save_header make_save_header def make_save_header m5_make_save_header header[:chapter] = $game_variables[4] header end
alias m5_make_save_header make_save_header
def make_save_header
m5_make_save_header
header[:chapter] = $game_variables[4]
header
end
却会报错,请问是为什么?
原方法:
def make_save_header header = {} header[:characters] = $game_party.characters_for_savefile header[:playtime_s] = $game_system.playtime_s header end
def make_save_header
header = {}
header[:characters] = $game_party.characters_for_savefile
header[:playtime_s] = $game_system.playtime_s
header
end
|