本帖最后由 RyanBern 于 2016-9-10 17:20 编辑
试试这个:关闭游戏再打开,更改后的名字不会保存。如果想在存档后生效,请将所有 Game_Temp, $game_temp 替换为 Game_System, $game_system
class Game_Temp def event_name_cache @event_name_cache ||= {} @event_name_cache end def set_event_name(map_id, event_id, name) key = [map_id, event_id] event_name_cache[key] = name end end class Game_Event def name key = [$game_map.map_id, id] $game_temp.event_name_cache[key] || @event.name end end
class Game_Temp
def event_name_cache
@event_name_cache ||= {}
@event_name_cache
end
def set_event_name(map_id, event_id, name)
key = [map_id, event_id]
event_name_cache[key] = name
end
end
class Game_Event
def name
key = [$game_map.map_id, id]
$game_temp.event_name_cache[key] || @event.name
end
end
使用方法:
$game_temp.set_event_name(地图ID, 事件ID, 新名称)
$game_temp.set_event_name(地图ID, 事件ID, 新名称)
|