EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
1.01k stars 192 forks source link

Feature request: text hooking/extraction #2180

Open HenkjanBraaksma opened 4 years ago

HenkjanBraaksma commented 4 years ago

With RPG_RT.exe, it's possible to very easily hook a texthooker such as Textractor to the executable and get a stream of text as it's written onto the message boxes and menus.

For people interested in playing RPGMaker games in foreign languages, perhaps to help them learn it, a way to extract the text like this can be really useful. From there text can be copied to take notes with it, looked up in a dictionary, google-translated directly (I guess, if you really want to) etc.

For me personally, I'd very much appreciate any way to extract text out of the game, even just directly written to a .txt file or something.

Ghabry commented 4 years ago

Interesting idea.

For messages this will be easy but when e.g. opening the menu scene the output will be very chaotic due to how the rendering works.

Need to check how well this works in RPG_RT :)

HenkjanBraaksma commented 4 years ago

Just in case it helps, I ran Textractor through a regular RM2K3 game (Alex III) and here's the text output with a few minor notes on how the extracted text differs from the in-game stuff.

RM2K3 Textractor behaviour.txt

fdelapena commented 4 years ago

Time ago it was proposed, maybe on IRC chat (not sure if you were), a suggestion to support Ctrl+c to copy current message box text to clipboard.

Dumping texts into the log file sounds also useful for debugging, then power users could filter conversation lines from logs.

carstene1ns commented 4 years ago

Inspired by the forum post, here is a rough implementation. Press Insert key (control-c seems a bit ugly since it could possible close something) and content of the message window will be put into clipboard.

Unfortunately some internal control characters (e.g. \f) will be part of it.

20200610-000606

screenshot_4

fmatthew5876 commented 4 years ago

Take a look at Utils::TextNext if you want to filter out RPG_RT escaped characters. You may be able to process the text in your GetFullText() function and throw out escaped characters.

As for ASCII control characters, the only things used now are \n and \f, so you can just check for them or use std::isctrl. Any other ASCII control characters are already removed from the source message text before it gets into Window_Message

Ghabry commented 4 years ago

He means stuff like \c or \^. Can this also be removed with it?

carstene1ns commented 4 years ago

Okay, using TextNext, I came up with this: https://github.com/EasyRPG/Player/compare/master...carstene1ns:feature/text-hook

Ghabry commented 4 years ago

Looks like a good start :)