Player icon indicating copy to clipboard operation
Player copied to clipboard

Feature request: text hooking/extraction

Open HenkjanBraaksma opened this issue 5 years ago • 9 comments

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.

HenkjanBraaksma avatar Apr 29 '20 18:04 HenkjanBraaksma

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 :)

Ghabry avatar Apr 29 '20 19:04 Ghabry

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

HenkjanBraaksma avatar Apr 29 '20 19:04 HenkjanBraaksma

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.

fdelapena avatar Apr 29 '20 20:04 fdelapena

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

carstene1ns avatar Jun 09 '20 22:06 carstene1ns

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

mateofio avatar Jun 10 '20 02:06 mateofio

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

Ghabry avatar Jun 10 '20 09:06 Ghabry

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

carstene1ns avatar Jun 17 '20 15:06 carstene1ns

Looks like a good start :)

Ghabry avatar Jun 17 '20 16:06 Ghabry

This feature is still implementing? I want it to read some Japan rpg game

thanhloi1606 avatar Aug 15 '25 14:08 thanhloi1606