RPGM Experimental Tool I'm Writing

kayot

Member
Dec 19, 2017
207
329
Brief history, how I got here, some complaints...
You don't have permission to view the spoiler content. Log in or register now.

Programming is a hobby of mine and I decided to make an application to assist me in my translations. Please note that I've only tested this with "Ecchi Riyu and the Mystery of Snowy Peak" which is the game that I'm translating. It's short, consists of only a few thousand lines of dialog, and no one cares about it so the chances of someone else working on it is slim.

What it does;
Allows you to open the files inside it's own text editor, which has syntax highlighting. I've make two Lexers, one for RPGMT, and one for TES. This program should select the correct one. Key word, should.
Each code file has it's own notes area which is saved along side the file. This is at the bottom of the code editing screen.
Keep track of Character Names (Will add location notes next)
Build the project (Will handle the TES patch automatically... probably)
Run the game.

How it works;
When you fire it up, you'll be greeted by an empty window. File->New and then select your game EXE for the game you want to translate. This must be a game that RPGMAKER TRANS v4.5 can break down. That list is XP/VX/VX Ace. It might do 2000, but I wouldn't hold my breath.

This program then extracts it's included 7 zip file to sub folders in the project.

(more complaints)
You don't have permission to view the spoiler content. Log in or register now.

Now that you've created the project file and named it, the next time you run this program, just target the .pt file it created. I'd honestly just move this application and ScintillaNET.dll to the folder of the translation project since everything else is already there.

What I plan to add;
Dialog Testing - So I can make sure my dialog fits correctly.
Auto make Project File for RPG Maker Editor - Some times I need to edit a game to remove random battles and max/min my stats for various scenes. Such as Virgin/Non-virgin, pregnant/non-pregnant, or damage levels. Stuff that's too annoying to do in game.

Once I get done with my Kanji and a little more grammar, I'll continue my translation and as I need features, I'll add them. Since the included programs use GNU I have to provide my code as part of this exchange. I'm not really testing to see if it works and you'll need the Bin.7z and ScintillaNET.dll from the compiled program for this to work correctly.

Before anyone asks, no it doesn't work on MV.

Compiled Program;
0.0.2


Source Code;
0.0.2


Change Log;
2018-07-09;
v0.0.2
Fixed: The ':' symbol no longer triggers a comment color when not part of a system directive.

v0.0.1
Fixed: I broke the Global Search function when I changed the Layout of the folders. Now it works correctly.
Added: In document search, shamelessly stolen from ScintillaNETs Demo.
Fixed: Added Escape character \ to the Lexers, it should work correctly now.
Other: Code Cleanup, removed unused code, etc etc...


2018-07-08 - First Release.

Other;
Please note that I have the utmost respect for the authors of the listed decryptors. Without them, I wouldn't have been able to make this program. My complaints are mainly regarding usage and annoyances I have encountered while writing this application.
 

Chingonerio

Member
Oct 1, 2017
401
467
I'm guessing there are no User Defined Language *.xml files Notepad++ can load for RPGMaker Trans and WolfTrans text files? The name display bit is pretty neat, though.

Lacking a text search feature inside the text editor portion is a bit annoying, though. I do appreciate the promise of game-files-wide search feature accessed from the main window, though. I'm assuming it's normal for it not to be working yet.

It doesn't seem to properly detect commented out lines that are actually preceded by the special character handler in-text. For example:
Code:
> BEGIN STRING
The retired \#1 (self-proclaimed) tentacle "hunter".
Playing with tentacles is both her job and her hobby.
> CONTEXT: Actors/1/description/ < UNTRANSLATED

> END STRING
The text "#1 (self-proclaimed) tentacle "hunter"." is entirely highlighted in red as if it were going to be treated as a comment, when ideally it should recognize that the "\" preceding the "#" implies it's actually a part of the string.

It's also a bit overzealous at interpreting colons in strings as part of the context queues. For example:
Code:
> BEGIN STRING
■Demon Sighting Alert
■Caution: Path only opens in the afternoon.
> CONTEXT: Map003/events/7/pages/0/0/Dialogue < UNTRANSLATED
The text ": Path only opens in the afternoon." is highlighted in red, much like ": Map003/events/7/pages/0/0/Dialogue <" is.

Otherwise, your tool works as expected. I do worry a bit that it seems every text file claims to be using Patch File Version 3.2 as opposed to 4.5 Legacy. Kudos for the work so far.
 

kayot

Member
Dec 19, 2017
207
329
I've updated the program;

Changes:
Fixed: I broke the Global Search function when I changed the Layout of the folders. Now it works correctly.
Added: In document search, shamelessly stolen from ScintillaNETs Demo.
Fixed: Added Escape character \ to the Lexers, it should work correctly now.
Other: Code Cleanup, removed unused code, etc etc...

Regarding ':', this is my first time playing with Code Lexers (The thing that colors the text) so I'm still figuring it out. Regarding the patch version, that's what the CLI version of Habisain's tools puts there. He's been quiet and I'm not sure if I should try tracking him down. I hope that his v5 of the program comes with a CLI.
 
  • Like
Reactions: Chingonerio

Chingonerio

Member
Oct 1, 2017
401
467
Notepad++ also uses Lexers for its built-in supported languages, which are supposed to be more powerful than the User Defined Language v2.1 it also carries within itself by virtue of being able to accept things such as regular expressions for its conditional statements, so here's hoping you figure your way around it soon.
I'm guessing blindly here since I've never seen the TES Patch format beyond that one screenshot you provided, but maybe limiting the dark red coloring with something like the following regex would ensure colons in strings meant for translation are untouched:
Code:
/(?<=> EVENT CODE):.*|(?<=> VALUE ID):.*|(?<=> PARAMETER ID):.*/gm
Similarly, for RPGMaker Trans, you'd just simplify that to:
Code:
/(?<=> CONTEXT):.*/gm
Of course, that's assuming both patch formats go untouched in the future. Judging by how different the v2.0 patches for VH are in comparison to v3.2's, it's quite possible that they could be subjected to changes again at some point in the future.
In case support for ye olde patch format ever rears its head, though, here's the regex I'd built for its colon coloring:
Code:
/(?<=# CONTEXT ):.*|(?<=# ADVICE ):.*/gm
 

kayot

Member
Dec 19, 2017
207
329
Oh, I already fixed the colon issue. It was in the 0.0.2 update earlier today. I'm not updating the screenshots for a while since they tend to stay pretty accurate. I plan to make the syntax colors customizable in the future, but for now I'm studying Japanese a bit more since I was quickly humbled during my translation efforts.

When it comes to lexers, I'm avoiding regular expressions since the ScintillaNET documentation recommends not using them due to performance issues. That's the library that I'm using to color the text. It's really robust, but building a custom lexer isn't easy since I have to do it per character and I have to think with a loop in mind. I honestly don't like the way they have me doing it since it's using GOTO which is a crazy bad programming practice. I'd prefer a different approach, maybe using a while somehow, but for now I'm still learning the basics of the lexer.

The reason I'm not using Notepad++ for editing is because I wanted to search through the files quickly without loading them all in different tabs. The idea was to keep everything under a single application. I wanted to quickly build and test every few lines to make sure they looked good and to avoid missing lines. I also wanted to keep notes on each file as I went, hence the bottom edit window which is for notes. Syntax highlighting was originally done with SyncFusion, but those libraries are crazy large and over blown. SyncFusion did use an XML file but it was unique to SyncFusion.

I could write a Notepad++ xml, but ultimately I'd never use it. I wrote one for MacroQuest a few years back and it was pretty straight forward. If I was to do it again, I'd just write a program like this one since I could pre-program all the commands and add in auto-complete with note hints.

If you know how to program in C#, I suggest downloading my source and reading through it. It's very basic with exception to the in document search (that I liberated from ScintillaNETs Demo) and part of the lexer. All you'd need to do is get Visual Studio 2017 Community which is freely available and use NuGet to get ScintillaNET. Please note that I didn't put any sort of documentation in the source since I'm not expecting too many people to care about it. The average user will get the binaries and use those.

On an unrelated note, I've been reading through the source code for the TES patcher and I think it might be possible to port it to C. At this point I can't look into it any further since this is a work heavy week and I won't have free time until Saturday. RPGMaker Trans isn't looking that great since it's far more complicated. I have zero experience with ruby and next to no experience with decryption, so some of it looks alien to me, such as the << and >> but I'm sure some documentation reading will help with that. This is of course pure speculation and it's possible that I'll stonewall myself long before I get anything usable out of it. One thing is certain, a C/Cpp binary would be a hell of a lot smaller and run way faster than Ruby running through an interpreter.
 
  • Like
Reactions: Chingonerio