Artikash / Textractor

Extracts text from video games and visual novels. Highly extensible.
GNU General Public License v3.0
2.16k stars 208 forks source link

textractorconfig.txt format for mono games (in particular Shin'en no Labyrinthos) #1348

Closed Yuletide64 closed 1 week ago

Yuletide64 commented 1 week ago

Okay I've read plenty of sources to try figure out the answers to my question and they all led me back to https://github.com/Artikash/Textractor/issues/307. Which is fine and all but no matter which way I try to follow the instructions, I can't get it to work the right way. The game is Shin'en no Labyrinthos and the particular hook class I want is string:Split (char[]), please see the screenshots of permutations I have used to try get this to work:

Capture Capture2 Capture3 Capture4

(Yes I have saved in each case before closing and reopening textractor and attaching it, I just redid everything I'd done for screenshotting purposes.)

In each case I attach the game, advance the text once, and it freezes for a bit, until ultimately textractor has continued to brute force hook the same vast number of hooks as before. Can someone tell me what I'm doing wrong?

Thanks in advance.

Chenx221 commented 1 week ago

@Yuletide64 It looks like this game doesn't require the TextractorConfig.txt configuration file to activate the brute force mode.

2024-11-22_220230

However, if you still need it: create a file named TextractorConfig.txt in the game directory, with the content string:Substring (int,int), save it, and then restart Textractor and the game.

2024-11-22_221706

Yuletide64 commented 1 week ago

Ahh no, what I mean is that textractor brute forces hooks automatically and this causes the game to pick up more and more hooks until the game runs so slow its unplayable. I'd like to only have the one hook but from what I've read, you can only minimize it down into specific hook classes, for example "string:Split (char[])" by "putting it into the textractorconfig.txt file". But I'm lost as to how you're supposed to actually paste it into the file...

Chenx221 commented 1 week ago

TextractorConfig.txt ↑ example

Chenx221 commented 1 week ago

Wait, please temporarily delete the TextractorConfig.txt file from the game directory, then use Textractor to attach to the game. Check if your textractor console output contains the following content:

Mono_X64: If the following hooks don't work, create the TextractorConfig.txt file via the "Configure game" button to activate the brute force mode
Mono_X64,Insert: TextMeshProUGUI_set_text Hook BY:IOV
Textractor: inserting hook: TextMeshProUGUI_set_text
Mono_X64,Insert: UGUI_set_text Hook BY:IOV
Textractor: inserting hook: UGUI_set_text

Or something like the following:

Textractor: inserting hook: Mono Searcher
......
......
Textractor: inserting hook: Mono Searcher
Textractor: inserting hook: Mono Searcher
Textractor: Mono Dynamic ENTER (hooks = brute force)
Textractor: inserting hook: string:ToCharArray () 
Textractor: inserting hook: string:wstrcpy (char*,char*,int) 
Textractor: inserting hook: string:Compare (string,string,System.StringComparison) 
Textractor: inserting hook: string:ToLowerInvariant () 
......
......
Textractor: inserting hook: string:IndexOfUnchecked (char,int,int) 
Textractor: inserting hook: string:GetHashCode () 
Textractor: inserting hook: string:EndsWith (char) 
Textractor: inserting hook: string:LastIndexOfUnchecked (char,int,int) 
Textractor: Mono Dynamic used brute force: if performance issues arise, please specify the correct hook in the game configuration

If the second case occurs without the TextractorConfig.txt file, please download the latest texthook.dll build from here (https://github.com/Artikash/Textractor/issues/868#issuecomment-1249146885) and replace the texthook.dll file in your Textractor folder.

Yuletide64 commented 1 week ago

TextractorConfig.txt ↑ example

Thanks for clearing this up, for some reason it has decided to miraculously work this morning using this format (of which I'd thought I had already tried last night).