Skip to content

Latest commit

 

History

History
184 lines (169 loc) · 5.54 KB

GAME_STRINGS.md

File metadata and controls

184 lines (169 loc) · 5.54 KB

TRX Game Strings Configuration

This document describes how to use the game strings. Game strings let users translate the game and change the built-in object names for the purpose of building custom levels. The configuration includes definitions for game levels, objects, and all UI elements, and is structured in a JSON5 format which permits comments.

General structure

The document is organized as follows:

{
    "levels": {
        {
            "title": "City of Vilcabamba",
            "objects": {
                "key_1": {
                    "name": "Silver Key",
                    "description": "This shows when the player examines key1 in the inventory.",
                },
                "puzzle_1": {
                    "name": "Gold Idol",
                    "description": "You can use \n to make new lines and \f to make new pages.",
                },
                "key_2": {
                    "name": "Rusty Key",
                },
                // etc
            },
            "game_strings": {
                "STATS_TIME_TAKEN": "Time Taken",
                // etc
            },
        },
        // etc
    },
    "objects": {
        "lara": {"name": "Lara"},
        // etc
    },
    "game_strings": {
        "STATS_TIME_TAKEN": "Time Taken",
        // etc
    },
}
Property Type Required Description
levels Object array No This is where overrides for individual level details are defined. If a level doesn't override a string through its objects or game_strings, it'll be looked up in the global scope next. If the global scope doesn't define it either, it'll default to an internal default value shipped with the engine.
title String Yes The title of the level.
objects Object array No Object-related strings.
game_strings String-to-string map No General game/UI strings.
name String No Allows to rename any object, including key items and pickups.
description String No Allows longer text descriptions to be defined for key and puzzle items. Players can examine items in the inventory when this text has been defined. Use \n in the text to create new lines; you can also use \f to force a page break. Long text will be automatically wrapped and paginated as necessary. If an empty string is defined, the UI will not be shown and the inventory item simply focused instead.

Common Object IDs and names

JSON key Object ID (TR1) Object ID (TR2)
key_1 129 and 133 193 and 197
key_2 130 and 134 194 and 198
key_3 131 and 135 195 and 199
key_4 132 and 136 196 and 200
pickup_1 141 and 148 205 and 207
pickup_2 142 and 149 206 and 208
puzzle_1 110 and 114 174 and 178
puzzle_2 111 and 115 175 and 179
puzzle_3 112 and 116 176 and 180
puzzle_4 113 and 117 177 and 181
secret_1 - 190
secret_2 - 191
secret_3 - 192

Note

Nearly all pickup items exist in two forms, as early games differentiate between a sprite displayed on the ground and a 3D object depicted in the inventory ring. Secrets are a notable exception, as they never appear in the inventory ring in the original game. For convenience, both forms are defined using a single key.

Usage Guidelines

  • Levels are zero-indexed and match the order with the game flow file.
  • It doesn't make sense to ship a custom level with all of the strings defined. We encourage you to make your strings file as small as possible - the game will fall back to the built-in defaults for you! For example, the following document is perfectly fine:
    {
        "levels": [
            {
                "title": "City of Vilcabamba",
                "objects": {
                    {"name": "key_1": "Gold Key"},
                },
            },
        ]
    }
  • Sometimes it makes sense to rename not just puzzle items and keys, but also other objects, such as enemies. A great example of this is TR2 object #⁠39 - usually it's a tiger, but in the snow levels it becomes a snow leopard.
  • TRX gives a name to all objects. Even when the player cannot normally see names of objects other than pickups and special inventory ring items, these are used in console commands such as /tp and /give – for example, /tp tiger should teleport Lara to the object #⁠39.
  • For a full list of object IDs for a particular engine, please refer to the game strings files shipped with relevant TRX builds.