Scene_File FIX
Scene_File FIXby Kyonides
Introduction
Scripts like GOBJ try to catch weird stuff the RM engine does when creating visual objects or disposing of them, but I think it's a terrible approach because they simply ignore the bugs already contained in the default scripts.
Yes, I know that VX ACE includes 2 bug fixes by default nowadays. Still, they're not all inclusive at all. There's one potential issue that has been ignored for quite a long time: the disposal of a Viewport object BEFORE its children have been disposed. Those children objects include Sprites and Windows. A perfect example of this is the Scene_File class, the parent class of Scene_Save and Scene_Load.
In the default script you can find the terminate method that says:
Ruby:
def terminate
super
@savefile_viewport.dispose
@savefile_windows.each {|window| window.dispose }
end
That means that the Scene_File class and its children classes are disposing of the Viewport right before it takes care of the Savefile windows. A bad choice indeed. It should always followed the opposite order.
Get rid of:
[*]The children objects first
[*]Then dispose of the parent object safely.
How can you fix it?
Well, the solution is QUITE SIMPLE: just invert the order in which those objects get disposed of, and that's it. So you'd only need to paste the following code in the bug fix section of the Script Editor and you'll be fine:
Ruby:
# * Scene_File FIX * #
class Scene_File
def terminate
super
@savefile_windows.each {|window| window.dispose }
@savefile_viewport.dispose
end
end
Why is this fix relatively important for you as a game developer?
It might not look impressive or critical at all, yet, it's highly convenient to prevent the engine from trying to do stuff in the incorrect / not-so-logical order in the first place. Debugger scripts like GOBJ will try to catch all those windows or their custom contents as critical objects that need to be notified otherwise.
Terms & Conditions
None.
本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/scene_file-fix.180523/
页:
[1]