STRG (Metroid Prime): Difference between revisions

From Retro Modding Wiki
Jump to navigation Jump to search
>Aruki
No edit summary
>Aruki
mNo edit summary
Line 1: Line 1:
''See [[STRG (File Format)]] for the other revisions of this format.''
The '''STRG format''' is used to store string tables. Each STRG file can contain any number of strings, as well as variations for different languages; the Prime series supports English, French, German, Spanish, Italian, Dutch, and Japanese.
The '''STRG format''' is used to store string tables. Each STRG file can contain any number of strings, as well as variations for different languages; the Prime series supports English, French, German, Spanish, Italian, Dutch, and Japanese.



Revision as of 17:57, 29 May 2015

See STRG (File Format) for the other revisions of this format.

The STRG format is used to store string tables. Each STRG file can contain any number of strings, as well as variations for different languages; the Prime series supports English, French, German, Spanish, Italian, Dutch, and Japanese.

Format

Header

Offset Size Description
0x0 4 Magic; always 0x87654321
0x4 4 Version; see hub article
0x8 4 Language count
0xC 4 String count
0x10 End of header

Languages

Following is a table that describes which languages appear in the file.

Offset Size Description
0x0 4 Language fourCC
0x4 4 Language strings offset (relative to start of string tables)
0x8 4 Language strings size (note: this is not in Prime 1)
0xC Language entry end

String Names

In Echoes, strings can have names attached to them. Note that this table only appears in the Echoes STRG format; for Prime 1, skip ahead to the string tables.

Offset Size Description
0x0 4 Name count
0x4 4 Name table size
0x8 Name entries begin

Each entry is structured as follows:

Offset Size Description
0x0 4 Name offset (relative to after the name table size value)
0x4 4 String index - this is the string number that the name is associated with
0x8 End of entry

After every name entry comes all the names in the form of a large UTF-8 string array. The names are zero-terminated, and they're sorted in alphabetical order; the sorting is case-sensitive, so 'Z' will appear before 'a'.

String Tables

Last are the actual string tables themselves. Each table contains some metadata followed by a series of UTF-16 strings. The number of strings is declared in the header; there will be one of these tables present per language present in the file.

Offset Size Description
0x0 4 String table size (note: this is not in Echoes)
0x4 4 × string count String offsets (relative to after the size value)
- Varies UTF-16 strings

Tools

  • STRG Editor by Parax - supports creating/editing and resaving STRG files in Metroid Prime 1/2's formats