Save-Point
More on the F12 Bug or Nuisance - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Development Discussion (https://www.save-point.org/forum-17.html)
+--- Thread: More on the F12 Bug or Nuisance (/thread-7500.html)



More on the F12 Bug or Nuisance - kyonides - 06-13-2019

The initialize and dispose methods available in pure Ruby or RGSS are not the same as the CRuby methods I mentioned in my previous post in another thread, they handle the C structs and the hooks and memory management calls needed there. The RGSS dispose methods don't handle anything but the scene elements that were visible and invisible back then. Yeah, the C or C++ part destroys the scene elements later on. Now that it's clear for all our readers, I gotta say that the alias method included in the CRuby version of the Module class isn't as reliable as it should be. Usually CRuby checks a table that includes every variable, Constant and even method names. If CRuby really double checked that the alias method did not exist, the problem would be solved but it doesn't do that against common sense. A CRuby or pure Ruby fix could solve it by just checking whether or not the method name is found among the public method list of any class. As you might remember, the classes and modules are always open so reloading isolated scripts or even the $RGSS_SCRIPTS array (after re-reading the Scripts.rxdata file) doesn't unhook the aliases nor clears many class and module stuff from CRuby but just variables including the global ones. Implementing my first or second idea would permanently solve the reset or F12 bug and stack overflow errors would not show up at all unless you make another kind of mistake like not breaking a loop or for loop or while loop properly.

It's not just argumentative but based in the very design of the CRuby or C or C++ part of the engine. The SDL section doesn't really need to handle that, if you are depending on it in the first place. Yeah, you could tell all scripters they should use either a 3 or 4 line solution or the unless modifier to prevent the stack overflow yourself and I won't say it's wrong. The point is that a programmer should think on this kind of issues and reduce the probability of letting the scripters fall in the stack overflow trap that is the actual bug behind the F12 badly implemented feature that Brainless never cared to fix nor prevent in any of their versions of their engines that included scripting with RGSS.