AGTH Commands

AGTH has many different command parameters that can be used to correct text problems and provide other features to AGTH. These commands are used by adding them after the agth.exe location and before the game .exe location in the game shortcut Properties box Target line, as explained in the previous section, AGTH Basics.

Some of these parameters can be very confusing, and only effectively used by those with some computer programming knowledge. In this tutorial, only some of the basic and most commonly used AGTH commands will be discussed; be aware there are also more command parameters available. You can see a list of all the command parameters by double-clicking on agth.exe and the selecting "Help" at the top of the AGTH window.

/C Command: Copy Text to the Clipboard

The /c command tells AGTH to copy each set of extracted text automatically to the clipboard. This way, the Atlas translation software can automatically translate the text from the clipboard, allowing each dialogue box in the game to be translated as you play. Therefore, the /c command is vital, and you will always need to include it.

Also, if you highlight text directly from the AGTH window, it will also automatically be copied to the clipboard. This is handy if you want to go back and look at a previous line, or send segments of lines to Atlas (which sometimes can give a better translation than it trying to do several long sentences all at once). When you do this, you may encounter Atlas only getting question marks instead of the copied text.

The solution to this problem is to use the Language Bar to set the AGTH window from English setting to Japanese. If you do not already have the Language Bar on your system, please look at Installing Japanese Language Support starting at step #6 for how to enable the Language Bar.

With the AGTH window as the active window (you'll know it's the active window because the top bar will be in blue instead of gray), click on the Language Bar icon on your Windows taskbar and switch it from EN to JP.

Now try manually highlighting the text from the AGTH window. This time, it will copy over to Atlas fine.

The /c command can also be used to delay the amount of time between extracting the text and copying it to the clipboard. This is useful if the game you are playing does not have an option to change the text speed, and dialogue is being sent to the Atlas window before all the sentences are finished being written to the dialogue box. By adding a time delay, you can tell AGTH not to copy the text until the specified length of time, allowing the game to finish writing the text. The time delay is used by adding the time in milliseconds directly after the /c. By default, AGTH waits 150 milliseconds before copying text to the clipboard. So if you would like to double the time until it copies the text to the clipboard, you would use /c300. This parameter is used on the game Perfect Prince to correct timing issues between AGTH and Atlas.

/W Command: Automatically Select a Text Thread

The /w command is used to tell AGTH to automatically select a specific text thread when it is available, so that you do not have to go up to the top of the AGTH window and manually select the thread every time you play the game. The way /w works is to add the address of the thread directly after the /w. This will be the number found at the beginning of the thread name, excluding the 0x00 in front of it. In the below example with Kichiku Megane, the correct text is on the thread "0x00516575:00000000 RealLive", so to set AGTH to automatically select this thread every time you open the game, you would add /w516575. It will also still work if you leave in the leading zeros, but you need to make sure not to include the "0x" part at the beginning of the address.

/KS Command: Suppress Repeated Characters

The /ks command is used to remove repeated characters when the extracted text repeats each character multiple times. By default, /ks will remove one of every repeated character. So if the game is extracting ""AAbbccdd"", then it will correct it to "Abcd" by removing each duplicate. If the game is repeating each character more than once, then you will add the number of characters you wish /ks to remove directly after /ks. So if every character is being written three times, such as """AAAbbbcccddd""", then you need two of each character removed to correct the text, so you would use /ks2. Below is an example, the game Fanatica, which is extracting each character three times.

To correct this, the /ks2 command is added to the Target field of the game shortcut. As you can see below, this has corrected the duplicate characters so that Atlas can translate the sentences correctly.

/KF Command: Suppress Repeated Lines

The /kf command is used to remove repeated sentences when AGTH is extracting the sentences more than once. Sometimes AGTH will continually extract a sentence repeatedly without stopping (which can often be caused by certain screen effects), and the /kf parameter will hault it from doing this. Below is an example of from Bara no Ki ni Bara no Hanasaku -- as soon as the screen goes into it's "wavy flashback" effect, the dialogue box is written continually to AGTH without stopping, repeating the text over and over.

After adding the /kf command, the text extracts correctly.

The /kf command uses tracing parameters to fix repeated sentences. Sometimes changing the numbers of these tracing parameters can make it fix repeated sentences more effectively. The most commonly used altered tracing parameter is /kf1:200. In regards to BL and Girls' games, the /kf1:200 command helps make some games programmed with Macromedia partially compatible with AGTH.

/X and /V Commands: Show Hidden Threads

The /x and /v commands are used to bring up more threads in the AGTH window than it shows by default. Most of these threads are simply extracting system data, but sometimes within these hidden threads, you can find the game text, which may not be extracting in any of the default threads. Therefore, the /x and /v commands are extremely useful. There are actually two different /x commands: /x and /x2, each of which bring up different threads. Sometimes if you have AGTH load too many threads at once, you may get a lock up, so these are to be used separately. However, if you want to load all the threads from both /x and /x2 at the same time, you would use the single command /x3. The /v command also brings up a different set of hidden threads.

If you can't find any threads extracting the text by default, or the threads are extracting text incorrectly (such as with missing characters), then always try adding /x3 /v and see if something shows up in any of the added threads. If you have an issue with AGTH or the game locking up because there are too many threads, then add /x and see if there are any correct threads, if not change it to /x2 and check again for any correct threads, and if still no luck change it to /v and check again. In the example below, by default AGTH brings up three threads for Rakuen Yuki, two of which have no text, and one which has text with missing characters:

Now the /x parameter has been added. Notice that now there are tons of possible AGTH threads in the window. The easiest way to search through them is to hit the Tab key to highlight the top AGTH window, and then hit the down arrow to move through the threads looking for any that may have the correct text.

As you can see, the correct text was found on a very obscure hidden thread, "0x0100170D9:00000000 lstrlenA". This is an instance where using the /w command explained earlier is extremely helpful: in addition to adding the /x command, you can also add /w100170D9 so that AGTH will automatically select that thread the next time you play so you don't have to hunt through the long list of threads for the correct one again.

Adding /x3 /v can also bring up text from games made with Macromedia, where you can find text hiding in ":000003A4 MultiByteToWideChar" threads. The text in these threads often needs some editing (such as repairing unnecessary line breaks), but this at least makes these games partially compatible, instead of completely incompatible, so /x3 /v are very powerful commands.

Since /x3 /v may cause slowdowns or lock ups in some cases because of the large amount of threads being displayed, never add them if you already have perfect text extraction in a default thread. If there is some text problem, then try /x3 and /v to search in hidden threads. Also, if text extraction is splitting parts of the text to different threads (such as menu item options to a separate thread than game dialogue), you may want to try adding just /v to see if there is a thread putting all the text into the single thread.

/PN and /P Commands: Attach AGTH to the Game Process

The /pn and /p commands are used to attach AGTH to a game after the game is already running, instead of setting it to load up with the game. Sometimes trying to load AGTH up with the game can cause the game to crash, so attaching AGTH to the game after it is already loaded and running can fix this issue. You would also need to use /pn or /p if the game loads itself off of two .exe files. Using /pn attaches to the game process name, and using /p attaches to the game process ID number. Using /pn is more convenient, since the process ID number changes every time you load the game, so you would have to change the process ID number in your AGTH shortcut everytime. However, if another program has the same process name as your game .exe, then you will need to use /p with a process number instead of /pn.

The game Angel's Feather loads off of two .exe files: the autorun.exe file must first be opened to launch the game, but the af.exe runs the actual game. Because of this, trying to make a shortcut to af.exe to add AGTH to the target line will not work. Therefore, we need to use the /pn command to attach AGTH to Angel's Feather after it is running. Below will outline how to use the /pn command.

1. First, you are going to make a shortcut of agth.exe. Go into your AGTH folder, right-click on agth.exe, and select "Create Shortcut" from the list. You will see a copy of agth.exe with the little arrow in the corner. To make it easier to access, this shortcut file will be moved to the game folder. Right-click on the shortcut and select "Cut".

Now browse to your game install folder, and right-click anywhere in the folder and select "Paste". Your agth.exe shortcut will now be in your game folder, where it is easy to access.

2. Load up the game normally (in the case of Angel's Feather, the autorun.exe is launched to load up the game). Now with the game running, press down Ctrl+Alt+Del on your keyboard to bring up Windows Task Manager. In Windows Task Manager, click on the Processes tab. Click on "View" at the very top of Windows Task Manager and go to "Select Columns". Put a checkmark next to PID (Process Identifier) and hit Okay. Now on the Processes tab, you'll see the names of all running processes on your computer, with a PID number next to it. Search in the process list for the game process: usually it should be named the same as the game .exe file (in this case, af.exe). Therefore in the future, you may not even need to look in Windows Task Manager at all and should just be able to use the game .exe name with the /pn command. The /p command uses the PID number instead of the process name, but this number changes every time you load the game, so it is much easier (and recommended) to use /pn instead, unless another process has the same name as the game .exe process.

3. Go back to your game folder where your agth.exe shortcut is. Right-click on it and go down to Properties. This will bring up the Properties window, and it will be on the Shortcut tab. In the Target box, AFTER the address to agth.exe, add the command /pn followed directly with the name of the game process: in this case, /pnaf.exe. Then follow this with /c and any other commands you would like AGTH to run with. Hit Apply and OK.

4. Now with your game running, double-click the agth.exe shortcut that is inside your game folder. AGTH will now load up. It may not find any threads when you first load it, but once you get into the game where there are dialogue boxes, the text threads should appear, and now you can select the thread extracting the game text.

/H Command: Correct Text Extraction Problems

The /h command is a very complex command, which allows AGTH to hook into a specific address to find the text for the game and extract it. It is used to correct text problems such as missing characters, text being repeated multiple times, incorrect breaks, and text being extracted in a pyramid style (grabbing a character and adding all previous characters again each time).

Figuring out the correct parameters to use with the /h command is a difficult process and requires some knowledge of programming, so it is difficult to explain the complexity of this command. If you are interested in a little more information on the command, I would recommend the information posted by danj2k @ Hongfire, and especially the video tutorials posted by Freaka @ Hongfire. Freaka also explains some tactics for using /h with font caching issues in this post, and speaker name and text dialogue separation issues in this post.

For the most part, if a game is having weird text issues, you will need to check and see if someone has discovered a /h command that may be used to correct it. For bishoujo games, you can check for these on my Anime Games Text Hooker Thread. For boys' love and girls' games, check my BL Games Compatibility List and Girls' Games Compatibility List. It is important to follow the instructions exactly from these compatibility lists, since the address used in the /h code depends on the game .exe. Some codes require certain patches to be applied, or they will not work.

In the following example of Hoshi no Oujo, the game uses font caching so that there are missing characters in the text thread, making translation by Atlas impossible.

The programmer Niphty was able to find the correct parameters for the /h command to fix the font caching issue with games by Mirai, such as Hoshi no Oujo. In this case, with Hoshi no Oujo patched with its official update patch, the command to fix the missing characters is /HBC*0@444060. Adding this command for Hoshi no Oujo will fix the font caching problem so all the text is extracted. When the /h command is used, the correct text will be found on a "UserHook" thread in the AGTH window.

The /h command is extremely powerful, and one of the main things that sets AGTH apart from text hookers of the past. The only bad part about it is that you truly have to have some programming knowledge and use of code debuggers to find out all the correct parameters needed for the /h command of a specific game, and every game is different.

Several game engines which requires /h codes in the past have now been automatically built into AGTH: the RealLive game engine, and the KiriKiri game engine, and Alice Soft's System4.0 game engine. Now if AGTH detects these game engines, it will automatically create the correct hook under either the "RealLive", "KiriKiri", or "System40" user thread, so now /h codes are no longer required for games on these engines. Hopefully in the future, even more game engines may be able to be auto-corrected.

If you are having problems with incorrect text, don't immediately freak out and think you have to have a /h command to fix it: there are many simple things people don't try that can fix text issues without needing a /h command. For example, make sure you always have your in-game text speed set to the highest setting (there are a few cases where games may extract better on a slower setting, but not in general). If no text is extracting, try changing the font in the game. Also, always check by adding the /x3 and /v commands to see if there are any hidden threads extracting the correct text. If all of these fail, and you are getting text extraction with missing characters or some other problem, then there is a good chance that the /h command can fix the problem, if someone can discover the correct parameters for the /h command with that game.

Other Commands

As stated before, there are many different commands for AGTH. Here are a few other useful commands:

/t = Makes the AGTH window always stay on top.

/ns = Tells AGTH to not use subcontexts, so that it can take texts which are being separated into different threads and put them into one thread. This is useful, for example, on Ein's games where the different colored fonts are being separated into separate text threads, so that all the text will be in one thread instead.

/b = Allows the paragraph split parameters to be changed. The default is /b4:16:1000. Increasing the first or second value may be able to fix unnecessary line breaks. It cannot fix line breaks that occur from the /kf parameter.

/nf = AGTH filters out some curser characters that may appear in the text. Using /nf will disable this feature.

/f = Renames specified threads and hides all other threads. This can be used to label the text threads in AGTH rather than having the default "TextOutA", etc. as the thread names. It is used in the following format: /f[Preferred thread name]@[thread address];[Preferred thread name]@[address]. For example, /FDialogue@404F37;Furigana@405725:1124. This would hide all threads except for two which would come up in the AGTH window as "Dialogue" and "Furigana". This makes it easy for you to tell your threads apart and hide the threads you don't use.


Boys' Love Games Headquarters Complete Idiot's Guide to Japanese Gaming © March 2009
Presented by Mastress Alita @ Boys' Love Games Headquarters
Please do not redistribute information in this guide without permission.
Complete Idiot's Guide trademark is copyright of its respective owners.
All outside sources of information linked to from this guide are copyright of their respective authors.