Open HenkjanBraaksma opened 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 :)
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.
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.
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.
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
He means stuff like \c or \^. Can this also be removed with it?
Okay, using TextNext
, I came up with this:
https://github.com/EasyRPG/Player/compare/master...carstene1ns:feature/text-hook
Looks like a good start :)
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.