Revisiting Script Loading

Well, I do know that RPGMaker Trans's VX use hasn't been widespread, at present - far too many critical bugs which weren't found. But oh well. In any case, much more interesting is adding VX Ace support, given that's where all the new games are at.


In any case, I've picked a test game, and then found that my current method, a generic version control script for RPGMaker, doens't work. Custom data types, which Ruby doesn't like unmarshalling without a definition. Of course, a sane person would have picked a new test game, but it's far more fun to get custom data types working. Also more useful in the long run.

Therefore I'm migrating away from the older approach of assuming the structure and onto an approach where the structure is loaded from the Scripts file, as happens in the RPGMaker runtime. There's a couple of downsides to this, unfortunately. The first is negligble - the scripts get a chance to run, which leaves you open to malicous scripts. While this sounds bad, it leaves you no less vulnerable than if you just ran the RPGMaker game, so I'm not concerned here.

The second is somewhat more annoying: XP/VX use Ruby 1.8, XV Ace uses 1.9, and these have different syntax's. This probably means that on Windows I'll end up shipping multiple Ruby binaries in the pruby folder. On other platforms... it's less clear what I'll do, but probably the onus will be on the user to provide an appropriate Ruby interpreter (perhaps using RVM). That said, most of the time it should be perfectly fine to use a different Ruby interpreter, it's just the little corner cases.

There's also going to be an overhaul of how things are checked for if they're translateable - probably along the lines of Ruby files which inform the patcher - but before I can comment on how that's going to work I need to get a better hang of Ruby metaprogramming so I can provide a nice, clean, interface.

On a side note, does anyone know how to programmatically call all the methods on a Ruby Module? I know how to do it with a Class, but finding out how to do it for a Module is driving me nuts... EDIT: Think I've got this now...

Comments

Comments powered by Disqus