Pmd2 text strings: Difference between revisions

From ProjectPokemon Wiki
Jump to navigation Jump to search
m (added missing links to sub-sections)
(→‎Known Character Encoding: Forgot to write some details on the text encoding)
Line 19: Line 19:


==== Known Character Encoding ====
==== Known Character Encoding ====
{|class="wikitable"
{|class="wikitable"
!File
!File
!Encoding
!Encoding
|-
|-
|text_e.str
| text_e.str
|ANSI
| 8-bits, [http://en.wikipedia.org/wiki/ISO/IEC_8859-1 ISO 8859-1], or [http://en.wikipedia.org/wiki/Windows-1252 Windows-1252]
|-
|-
|text_j.str
| text_j.str
|Shift JIS
| 8-bits, [http://en.wikipedia.org/wiki/Shift_JIS Shift JIS] or [http://en.wikipedia.org/wiki/Code_page_932 Windows-31J]
|}
|}


== File Structure ==  
== File Structure ==  

Revision as of 22:47, 31 March 2015


The "text_e.str" file contains a table of pointers to null terminated strings contained further down in the file. In other languages versions of the game, the letter "e" is changed to indicate the language. For example, "text_j.str" is the name of the file for the Japanese version of the game.

More Details

In addition to the characters from the character sets used, the game sometimes uses unprintable character sequences to represent special characters in-game. The game also uses several square brackets enclosed tags that can trigger a wide range of things, going from replacing the tag with a value or string, adding a pause for input, changing the text formatting, playing a sound/music, etc..

The file also appears to be somehow linked to the "tbl_talk.tlk" file.

Notes

  • In Explorers of Sky the English file contains 18,452 strings. The Japanese one, 19,010.
  • In Explorers of Time/Darkness the English file contains 13,666 strings.

Known Character Encoding

File Encoding
text_e.str 8-bits, ISO 8859-1, or Windows-1252
text_j.str 8-bits, Shift JIS or Windows-31J

File Structure

Overview

A quick overview of the main parts of the file. Note that there is no padding between the Pointer Table and the Strings Block!

Offset Length Endianness Type Name Description
0x00 Varies Pointer Table A table of pointers to every null-terminate strings in the Strings Block.
After Pointer Table Varies Strings Block A block containing null-terminated strings of characters one after the other. The last pointer points to the end of the file, after the last string.

Pointer Table

A very straightforward list of 4 bytes pointers to every strings in the file. Pointers are all little endian, as usual.

  • NOTE: The last pointer in the table must points to the end of the file, after the last string.

Strings Block

Again, this is very straightforward. All null-terminated strings are simply stored one after the other. There is no padding at the end of the file.

Special Characters

As mentioned above, the game uses several special sequences of unprintable characters for displaying some in-game characters or pictogram.

Here are some of the known ones:

Sequence Description

Tags

As mentioned above the game uses square brackets enclosed expressions for runtime text replacement, formatting, or triggering various events.

Here are some of the known ones:

Expression Description