Skip to content
sbobovyc edited this page Aug 24, 2012 · 14 revisions

Unpacking

  1. Run the following command:
    ctx_magick.exe somefile.ctx
  2. This should generate a YAML file called somefile.ctx.txt and somefile.sqlite. The sqlite file is a new addition and is easier to edit then the YAML file. The YAML file is now a legacy feature.

Editing sqlite database

  1. Open somefile.sql with an sqlite browser. I recommend http://sourceforge.net/projects/sqlitebrowser/
  • The file will contain a "Meta" table. This table is for information purpose only. The packer will not use it to compile a CTX file.
  • The "eng", "fra", and other tables contain the text IDs and text.
  • When you add items, you have to add the items to all languages.
  1. Save the database after you've made changes.

ctx1

Editing YAML file

  1. Open somefile.ctx.txt with a text editor.
  • Make sure that your text editor does not replace spaces with tabs.
  • When you add items, you have to add the items to all languages.
  • All languages must end with the same item.
  • Text containing punctuation marks must be surrounded with single quotes. For example:
    - [906, '4,73 x 33 mm sans douille']
  1. Save the text file after you've made changes.

Packing

  1. Run the following command:
    ctx_magick.exe somefile.ctx.txt
    Or
    ctx_magic.exe somefile.sqlite
  2. This should generate a CTX file which you should copy into the appropriate location in bin_win32.

CTX format
Text in CTX files is stored in utf-16le.

Notes on sqlite
You can run queries on the data. ctx2