the_dude_abides
Member
I have noticed that a GMS 1 project of mine, when trying to export to YYC, gets an error that isn't present when running it as Windows. Basically, a script that isn't even being called by the single instance, in the single running room, throws an error because it's checking an uninitialized variable that at this point has no defined value.
At this point in time it shouldn't matter that it has no value, because I'm not calling it. Nor does the object in the room call it. So why does Gamemaker Studio 1 insist on checking it, and throwing an error?
I understand the need for error checking, but it would seem to my mind, that only checking the room that is currently active would be the obvious starting point, and then working from there to the objects in that room: creation code, and then event code. Looking for scripts called, or other objects being referenced, or timelines called. Anything where there's a link to something else, and it justifies the effort of making sure all of these connections are properly working.
As is, the approach seems like overkill, and is both irritating, and to a layman, feels like it ought to be adding quite a lot of needless expense. Obviously YoYo felt the same, as GMS 2 doesn't replicate this behaviour, and in my experience will ignore the content of unused scripts when making a YYC build.
I'm no expert, but this behaviour seems way off how I'd approach it, and really, really, really unnecessary. Presumably it is actually building a picture of variables defined through various facets of the game, since it is true that this variable is missing. I'm aware that it's missing. It shouldn't matter that it's missing.
I know how to correct the error, but to my mind it shouldn't even be an issue in the first place. Can I somehow turn off this behaviour, or at least direct it to be more efficient?
EDIT:
There are objects present in my project that call this script, and technically if they were to do so, it would crash. But these objects are not in any room, or ever called into existence, so it seems foolish to me, that GMS 1 appears to go by checking the objects in the project, or the script library. Rather than looking at the current room, and seeing what objects are in it, then starting with those objects and working it's way out.
I'm assuming it's parsing probably the scripts library, and just seeing if the variables are defined. Since the "solution" is to define the variable, even if the actual value is non-existent when run as code, it doesn't now throw an error. I don't understand why it feels the need to look through all of them as the default practice, unless that is felt to be less costly than actually parsing all the resources and working out what scripts are actually going to be called.
At this point in time it shouldn't matter that it has no value, because I'm not calling it. Nor does the object in the room call it. So why does Gamemaker Studio 1 insist on checking it, and throwing an error?
I understand the need for error checking, but it would seem to my mind, that only checking the room that is currently active would be the obvious starting point, and then working from there to the objects in that room: creation code, and then event code. Looking for scripts called, or other objects being referenced, or timelines called. Anything where there's a link to something else, and it justifies the effort of making sure all of these connections are properly working.
As is, the approach seems like overkill, and is both irritating, and to a layman, feels like it ought to be adding quite a lot of needless expense. Obviously YoYo felt the same, as GMS 2 doesn't replicate this behaviour, and in my experience will ignore the content of unused scripts when making a YYC build.
I'm no expert, but this behaviour seems way off how I'd approach it, and really, really, really unnecessary. Presumably it is actually building a picture of variables defined through various facets of the game, since it is true that this variable is missing. I'm aware that it's missing. It shouldn't matter that it's missing.
I know how to correct the error, but to my mind it shouldn't even be an issue in the first place. Can I somehow turn off this behaviour, or at least direct it to be more efficient?
EDIT:
There are objects present in my project that call this script, and technically if they were to do so, it would crash. But these objects are not in any room, or ever called into existence, so it seems foolish to me, that GMS 1 appears to go by checking the objects in the project, or the script library. Rather than looking at the current room, and seeing what objects are in it, then starting with those objects and working it's way out.
I'm assuming it's parsing probably the scripts library, and just seeing if the variables are defined. Since the "solution" is to define the variable, even if the actual value is non-existent when run as code, it doesn't now throw an error. I don't understand why it feels the need to look through all of them as the default practice, unless that is felt to be less costly than actually parsing all the resources and working out what scripts are actually going to be called.
Last edited: