Skip to content

Text editor for Ghost Trick, hopefully.

Notifications You must be signed in to change notification settings

CrazyMLC/ghost-treader

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

137 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ghost-treader

A specialized version of ghost-tripper meant to deal with the text files of Capcom's DS release, Ghost Trick: Phantom Detective.

The project is limited to standard libraries for the sake of portability, besides using PIL for images.

Text files?

There are hundreds of text files within the Ghost Trick ROM. Some of them are script files, but the majority are dialogue files.

ghost-treader is able to decode all of these files into plaintext, as well as encode that plaintext back into a file the game can read. Basically, you can edit the dialogue in any way you like. You can even add or remove text boxes, change portraits, the works.

Script files? Does that mean you can modify more than just the dialogue?

All of the dialogue files are in the format .##.xml.lz, where ## is a two letter language code. But some of the filenames don't have any language code; they end with only .xml.lz. These files contain the scripting language for the game, which appears to control every aspect of gameplay. For now, ghost-treader only works with dialogue files. But that could change in the future.

File guide

  • decode.py - This handles the job of decoding Ghost Trick's text files. Drag one into the script and it'll show up in the .\decoded\ folder.
  • encode.py - Encodes your decoded text files back into a format Ghost Trick can use. Just like decode.py, just drag a decoded file in and check .\encoded\. (You can also run encode.py to autmatically encode any files in the decoded folder)
  • lib\tables.py - The byte-to-text dictionary. It also doubles as a guide, since it lists every command. If you start seeing hex numbers in your text, you can try contributing to this file.
  • lib\readme.txt - Explains the contents of the lib folder.
  • notes.txt - Some of my personal notes on decoding the 1LMG file format and byte commands.
  • CREDITS - The people this project wouldn't have gotten this far without.

To-do list

  1. Remove the need for Tinke entirely.
  2. Discover the difference between the different functions that shake the screen.
  3. Decode the scripting language.
  4. Expand back into handling images.

How to use

  1. First, you're going to need some resources.
    1. You'll need Python 3, as well as this repo cloned onto your device.
    2. You'll be needing tinke's binary, or one of its many forks.
    3. Then, you're going to need the Ghost Trick ROM. It's recommended that you dump the cartridge that you bought.
  2. Once that's all set up, you'll have to get a 1LMG file out of the ROM using tinke.
    1. "st01/st01_game000_Expand.en.xml.lz" is recommended for this purpose; it has the english dialogue for the opening scenes of the game.
    2. Select a .en.xml.lz file, click on the Extract button, and save the file somewhere.
  3. This is the easy part. Time to edit the file!
    1. Drag your extracted .en.xml.lz file into this project's decode.py.
    2. Check the "decoded" subfolder, and open the .txt file in your text editor of choice.
    3. Make some changes! Make someone say something funny, and it'll be easy to notice.
    4. You can look at lib\tables.py to find more information on the various commands that have been discovered.
  4. Now to encode the text file back into a 1LMG file.
    1. Drag the text file into this project's encode.py.
    2. Check the "encoded" subfolder. If there weren't any errors, your file should be good to go to be reinserted with tinke.
  5. Time to insert the file back into Ghost Trick with tinke.
    1. Navigate back to the file you originally extracted, and click the Change file button. Replace it with your encoded file.
    2. Click Save ROM and save your new ROM. (Don't overwrite your original!)
  6. Open the new ROM file in an emulator and admire your work.

About

Text editor for Ghost Trick, hopefully.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 60.6%
  • C++ 38.8%
  • Makefile 0.6%