With the addition of runtime function definition in GML I feel scripts are losing their design focus. Scripts can now contain multiple object-specific functions but I think they would work better as a vessel for general purpose functions (macros, enums, math, data) instead.
You can now define functions in events, however, events (and their associated functions) won't run without an instance and you must always ensure these functions are defined before any other code that relies on them. If functions could be properties of an object rather than an instance (& therefore bound to one event or another), via some sort of object-level pop-out code editor for function definition that sits outside of events, the size of the scripts group in the asset browser and/or the Create event could be drastically reduced while also centralizing functions to the assets they were designed for.
In addition to allowing functions to be defined as object properties, you might also consider allowing users to initialize object variables this way as well. Right now the best way to handle objects' "metadata" is via JSON, which is much clunkier.
What is going on with script_execute now? Does this run functions? Re-run a script?
It should be mentioned on release, especially for the benefit of new users, that scripts now run before room0 is loaded, so creating layers, singleton controllers, or running other room-reliant functions is not doable here.
Even with code folding and regions JSDOC takes up a lot of screen space if you document your functions fully.
Please sign in to leave a comment.