Scene_File FIX
#1
Scene_File FIX
for VX ACE

by 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:

Code:
  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:

  1. The children objects first
  2. 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:

Code:
# * 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.
"For God has not destined us for wrath, but for obtaining salvation through our Lord Jesus Christ," 1 Thessalonians 5:9

Maranatha!

The Internet might be either your friend or enemy. It just depends on whether or not she has a bad hair day.

[Image: SP1-Scripter.png]
[Image: SP1-Writer.png]
[Image: SP1-Poet.png]
[Image: SP1-PixelArtist.png]
[Image: SP1-Reporter.png]

My Original Stories (available in English and Spanish)

List of Compiled Binary Executables I have published...
HiddenChest & Roole

Give me a free copy of your completed game if you include at least 3 of my scripts! Laughing + Tongue sticking out

Just some scripts I've already published on the board...
KyoGemBoost XP VX & ACE, RandomEnkounters XP, KSkillShop XP, Kolloseum States XP, KEvents XP, KScenario XP & Gosu, KyoPrizeShop XP Mangostan, Kuests XP, KyoDiscounts XP VX, ACE & MV, KChest XP VX & ACE 2016, KTelePort XP, KSkillMax XP & VX & ACE, Gem Roulette XP VX & VX Ace, KRespawnPoint XP, VX & VX Ace, GiveAway XP VX & ACE, Klearance XP VX & ACE, KUnits XP VX, ACE & Gosu 2017, KLevel XP, KRumors XP & ACE, KMonsterPals XP VX & ACE, KStatsRefill XP VX & ACE, KLotto XP VX & ACE, KItemDesc XP & VX, KPocket XP & VX, OpenChest XP VX & ACE
Reply


Messages In This Thread
Scene_File FIX - by kyonides - 10-11-2025, 11:30 PM



Users browsing this thread: 1 Guest(s)