Wednesday, 18 February 2015

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...

7 comments:

  1. This would basically make it possible to feasibly translate a game like Princess Knight Rachel(RJ147124) because as I found out, 100% of the dialogue in that game is stored in dynamic link libraries(which is crazy btw), and that's a little beyond my scope. Or at least, that's what I got out of this message.

    ReplyDelete
    Replies
    1. Uh, I'm like 99% certain that the dialogue is not stored in the DLL files. If it is, then this wouldn't help, because a DLL file isn't a Ruby file.

      If you mean "translate stuff that's in non-standard locations" (I notice the game you mentioned has a Main.rvdata2 file, which is non-standard) then yes, this would help to an extent. At the very least, it would be able to parse the game, and theoretically someone savvy enough would be able to get it to dump the text. However, if the game is using a completely non-standard dialogue system this might not help, unless you want to translate line-by-line... (there's quite a lot of processing internally to convert the event stream to usable dialogues; if you have a nonstandard event stream, none of that would work)

      So long story short, it'll help somewhat with non-standard games - mainly those which extend RPGMaker in some way - but it might not be ideal for games which are completely reimplementing the standard game engine. Such games might technically be translateable by RPGMaker, but in a non-ideal fashion. That said, RPGMaker Trans is open source, and if someone adds support for a specific game engine I'd gladly incorporate it.

      Delete
    2. As an addendum, I've just looked through that game and you have 3 DLL files: 2 look like image loaders, and also 1 standard RGSS library. Pretty certain that the dialogue won't be in those.

      Delete
  2. Well, regardless, they might not be in the DLLs, but I couldn't figure out where the hell the text was lol!

    ReplyDelete
  3. Hi there,

    I'm trying to translate an RPG Maker VX game, and found your programme. However, I can't find a readme or anything, so I'm not sure I'm using it properly. When I first ran it, ticking Create Patch, it gave me a patch folder and a translated folder. I assumed I should change the text files in the patch folder, so I went through and translated one of the maps, then I guessed you should run the programme again to apply the patch - however, this didn't do anything, and the game in the translated folder still has the original untranslated text. What am I doing wrong?

    I did get some error messages when running it, as follows:
    "Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=52, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=52, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=52, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=52, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=52, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=51, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=51, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=51, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=51, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=52, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=52, ruleStack=['Base', 'Bracket']); script not translated
    Error parsing inline script: String out of bounds: RubyParserState(string=..'\n'.., index=52, ruleStack=['Base', 'Bracket']); script not translated"

    Sorry to be a bother!

    ReplyDelete
    Replies
    1. No. 1: This is probably not the place to ask for help.
      No. 2: The documentation is clearly there on the website. Although thanks for bringing to my attention that for some reason the readme isn't being included, I'll fix this in the next release.
      No. 3: If you could file a bug report on that error (including which game its from) I'll take a loog at it.

      Delete
    2. Sorry, you're right, totally the wrong place to ask - also, I'm an idiot; I was replacing the text instead of putting the translated text in the new line. The error messages given don't seem to affect the ability to translate text.

      Delete

Note: only a member of this blog may post a comment.