LTEXT
The information in this article was copied from the SimsWiki and may be outdated. This article has not been reviewed for technical accuracy or updated knowledge on this topic. If you are knowledgeable enough on the topic to review the article, please do so and remove this label. (more info). |
LTEXT or Language Text files are a Unicode text format used by SimCity 4 to give language specific text strings simply and quickly for use in any part of the world. Unicode of course makes this much easier since the vast number of characters can't always be written in standard text. LTEXT files cover everything from news to building and prop names to tool names in the game. They are queried by Instance ID, so make sure your instance is unique when creating new ones!
LTEXT files are partially controlled by the Delocalizers file, which gives the game instructions about converting text into the local language, or not.
LTEXT files are also related to the User Visible Name Key and Item Description Key in exemplars.
Format Specification
WORD - Number of 2 byte characters in the LTEXT. ???? - Compression related information - only found in compressed LTEXT files. WORD - Start of Text - In ASCII, 00000010 binary or 0010 is the control character for start of text. WORD - (Repeating) - 2 Bytes for each character, simply use the Unicode character for the value of these two bytes to see its visible in-game form.
In English, decoding this is easy since the file will appear as an English character followed by a period in most hex editors. Other languages may be harder, i.e. Chinese, Korean.
LTEXT files can be found in SimcityLocale.dat, as well as both Maxis and user-created plugin files. They are generally seen as an LTEXT or XA file by Reader.
PHP Function
Here is a PHP function that returns the string enclosed in an LTEXT file:
function ltextThing($data){ /*ExemplarFile typeID: 6534284a $value = the 'content' array key*/ $thing = str_split($data); foreach ($thing as $char => $word){ if ($char % 2 == int and $char != 2) $return .= $word; } return $return; }
|