Eventing 'vs.' Scripting
Hey RMers,
I was motivated to write this post and drudge up this old argument after viewing some script requests on the forum that ask, starry-eyed, for something to be done better via scripting than it could be done via eventing.
And, in some regards, this is not inaccurate view; scripting can be infinitely more flexible. However, something made via scripting is not inherently better than an evented counterpart and the reason is because scripting and eventing are the same thing; events are not a separate entity, they are predefined methods that have been given a user interface. One way that may help to express the relationship between events and scripting is to think of a big box (scripting) with a smaller box inside (eventing); both boxes have an identical purpose however one is able to carry a heavier load than the other.
There's an impressive history of complex systems being evented; menus, battle systems, minigames. Whether such systems would have been better off being scripted is its own question but the end result is what matters. The only time you need to use scripting, the only time scripting is objectively 'better', is when some aspect of the system simply cannot be done via eventing. And these situations do arise due to eventing's limited functionality and their methods can carry associated baggage (like a text box's system interruption) but quite a few posts that 'need' scripts to accomplish something, well, don't; all that is necessary is to comb through the existing methods of the editor and how they interact with one another.
So far this may sound like a very pro-eventing post and, in some regards, it is; in that I would like to elevate the attitude towards events and dissolve the sheen of scripting. Being overly dedicated to eventing has its own problems though. Ignoring its objective limitations (and again, they irrefutably are limited) even the UI of eventing is tedious. Viewing a series of nested conditionals is unpleasant, editing one can be a nightmare. Simple tasks like creating a variable or setting a co-ordinate can feel like they take a lifetime. Bugfixes are tedious because the engine won't crash and give an error message (that's kind of a point in its favour as well though). Eventing is the introduction, its something you are intended to progress from, no other engine I've used doesn't just drop you in front of a script editor. However, that doesn't make the logic that events are capable of carrying out any lesser.
What I'm trying to convey is scripting is great but events are just scripting in disguise and are also great. The next time you can't figure something out with events and you aren't comfortable with scripting yet then try approaching it a different way with events. Then try another way with events. Then maybe re-evaluating what exactly you want out of the system. Then, before asking for helpy, try eventing one more time. You'll be surprised what you can accomplish without ever opening the script editor (and you may be devastated at the reality if you continue to treat scripting as some magical shortcut to complex systems).
-
4



7 Comments
Recommended Comments