In TR1 and TR2 originally, Lara's meshes were taken from the O_LARA object,
with mesh swaps being performed as required at runtime using additional objects,
such as O_LARA_PISTOL, O_LARA_SHOTGUN, O_LARA_EXTRA etc. TR3 moved to a
dedicated O_LARA_SKIN object, but still depended on the additional gun and
extra mesh swaps, and these remained tightly coupled with the level's outfit.
For example, when putting a shotgun in Lara's hand, the relevant mesh would
include an entire copy of her hand, when in reality only the shotgun was
required. This meant if customizing Lara's gloves, the builder would need to do
so on several different objects.
TRX uses a different skin system, both to allow outfit swaps in-game for players and to remove unnecessary mesh faces where applicable for a more streamlined data setup. Custom level builders can define up to 32 outfits; following is a guide to the data and JSON configuration, and some scenario/workflow examples.
The skin system uses the following objects. These are provided in the
lara_outfits.bin injection, and are available to download as a separate WAD
(see injections).
O_LARA_SKIN_SWAP_1...O_LARA_SKIN_SWAP_32
Each of these should contain a distinct Lara model, with the mesh count and bone order conforming to the standard for Lara. Bone offsets are used (e.g. consider Bacon Lara's different structure); animations are not used.
O_LARA_SKIN_SWAP_EXTRA
This object contains various additional meshes for Lara, such as altered torsos when the TR1 braid is in use, Lara's combat face, and meshes used in extra animations, such as pulling the dagger in Dragon's Lair. It also contains both the TR1 and TR2/3 braid.
O_LARA_SKIN_SWAP_GUNS
This object contains holsters - both empty and equipped with the various guns - as well as the guns themselves when they are in Lara's hands or on her back.
O_LARA_SKIN_SWAP_LEGS
This object contains copies of Lara's legs for each outfit, with holster strap textures removed. This allows levels such as Home Sweet Home to swap out Lara's legs when she has no holsters. It is not an essential object to include.
The file cfg/outfits.json5 sets up the available outfits, and how they should
behave. The structure of this file is described below.
| Property | Type | Description |
|---|---|---|
outfits |
Object map | The keys in this map define the available outfits, and these are the keys that should be used in the game-flow. The outfit object is described separately below. |
extra_meshes |
Integer map |
This map defines mesh offsets in O_LARA_SKIN_SWAP_EXTRA,
which are required for various events/paths in the engine.
|
gun_maps |
Object array |
These maps dictate which meshes to use in
O_LARA_SKIN_SWAP_GUNS for a given outfit and gun combination.
|
"tr1_classic": {
"name_gs": "LARA_OUTFIT_TR1_CLASSIC",
"mesh_object": "O_LARA_SKIN_SWAP_2",
"is_reflective": false,
"gun_map": 0,
"combat_face_offset": 1,
"braid": {
"mode": "BRAID_MODE_TR1_FULL",
"mesh_offset": 10,
"gold_offset": 16,
"hair_pos": {
"x": 0,
"y": 20,
"z": -45,
},
},
"no_holster_offsets": {
"thigh_r": 1,
"thigh_l": 2,
},
"extra_outfits": {
"LS_EXTRA_TREX_KILL": "tr1_mauled",
"LS_EXTRA_MIDAS_KILL": "tr1_golden_lara",
},
},
| Property | Type | Description | |
|---|---|---|---|
name_gs |
String |
The game string enum key used for localized UI labels for this outfit
(for example, LARA_OUTFIT_TR1_CLASSIC).
|
|
mesh_object |
String | Indicates which object contains the outfit's meshes and bones. | |
is_reflective |
Boolean | Indicates whether or not the outfit is reflective. | |
gun_map |
Integer |
The index into the gun_maps array to use for this outfit.
|
|
braid |
Object | The braid setup specific to this outfit. If omitted, no braid will be shown. See the braids section below. | |
combat_face_offset |
Integer |
The mesh offset in O_LARA_SKIN_SWAP_EXTRA for Lara's combat
face. -1 implies no combat face swap. This mesh is used when
Lara is firing a weapon (traditionally, the O_LARA_UZI head
mesh was used).
|
|
no_holster_offsets |
Integer map |
The mesh offsets in O_LARA_SKIN_SWAP_LEGS to use when Lara's
holsters aren't visible. Omitting this property infers no mesh swaps.
|
|
extra_outfits |
String map | Pointers to alternative outfits to use for specific game events. The two supported events are as follows. If these are omitted, no swaps will occur for the events. | |
LS_EXTRA_TREX_KILL |
When Lara is killed by the T-rex - instant full outfit swap. | ||
LS_EXTRA_MIDAS_KILL |
When Lara steps on the Midas hand - progressive outfit swap. | ||
| Property | Type | Description | |
|---|---|---|---|
mode |
String | Indicates special handling when the braid is active. | |
BRAID_MODE_NONE |
No special treatment (this mode is implied if mode is not
specified).
|
||
BRAID_MODE_TR1_HEAD_ONLY |
Replaces Lara's head with EXTRA_MESH_TR1_BRAID_DEFAULT_HEAD
defined in the O_LARA_SKIN_SWAP_EXTRA object.
|
||
BRAID_MODE_TR1_FULL |
As per BRAID_MODE_TR1_HEAD_ONLY, plus Lara's torso will be
replaced with EXTRA_MESH_TR1_BRAID_DEFAULT_TORSO.
|
||
BRAID_MODE_TR1_MAULED |
As per BRAID_MODE_TR1_FULL, but the torso swap mesh used here
is EXTRA_MESH_TR1_BRAID_MAULED_TORSO.
|
||
BRAID_MODE_TR1_GOLD |
As per BRAID_MODE_TR1_FULL, but the swap meshes used here
are EXTRA_MESH_TR1_BRAID_GOLD_HEAD and
EXTRA_MESH_TR1_BRAID_GOLD_TORSO.
|
||
mesh_offset |
Integer |
The starting offset in O_LARA_SKIN_SWAP_EXTRA for the regular
braid meshes and bones.
|
|
gold_offset |
Integer |
The starting offset in O_LARA_SKIN_SWAP_EXTRA for the golden
braid meshes and bones.
|
|
hair_pos |
XYZ | The position relative to Lara's head where the braid will be drawn. | |
{
"LGT_DESERT_EAGLE": {
"hand_r": 62,
"thigh_r": 9,
},
"LGT_UZIS": {
"hand_r": 63,
"hand_l": 64,
"thigh_r": 10,
"thigh_l": 11,
},
"LGT_SHOTGUN": {
"hand_r": 65,
"torso": 72,
},
}
The map keys must match known engine weapons. See weapons and
cfg/weapons.json5 for reference. Any entry may omit hand, thigh or torso, and
note that specific gun types will only look for particular entries. For example,
defining a thigh_l property for LGT_SHOTGUN is meaningless and will be
ignored. Any missing fields imply that no mesh is drawn for that slot.
| Property | Type | Description |
|---|---|---|
hand_rhand_l
|
Integer |
The mesh offset in O_LARA_SKIN_SWAP_GUNS for the gun to draw
in Lara's hands.
|
thigh_rthigh_l
|
Integer |
The mesh offset in O_LARA_SKIN_SWAP_GUNS for the gun to draw
against Lara's thighs. This expects the holster to be part of the mesh.
|
torso
|
Integer |
The mesh offset in O_LARA_SKIN_SWAP_GUNS for the gun to draw
on Lara's back.
|
I don't need to customize Lara's outfit, and I don't mind players freely switching outfits.
In this scenario, simply ship your level with lara_outfits.bin and the default
cfg/outfits.json5.
I don't need to customize Lara's outfit, nor do I want the player to change it.
In this case, you can simply enforce the outfit option, and continue to ship the
standard files as above. Provided your game-flow level has an accurate
lara_outfit entry, you can enforce as follows.
"enforced_config": {
"lara_outfit": null,
},
Using null here means that if your second level uses a different outfit, that will still be honoured.
I don't need to customize Lara's outfits, but I want to restrict the ones that can be selected by the player.
Ship the default injection file, but edit cfg/outfits.json5 by removing the
entries from the outfits section that you do not need.
I want to customize Lara's outfits.
Download the provided TRX WAD to access the data included in the shipped
injection. Move each of the relevant objects to your WAD. You can then proceed
to edit the meshes as required. Ensure that you remove the lara_outfits.bin
from your game-flow, otherwise these will override the data in your level.
I want to customize Lara's braid.
Braid meshes and bones are taken from the O_LARA_SKIN_SWAP_EXTRA object, so to
customize it you will need to follow the same steps as for customizing outfits
i.e. import the TRX WAD, edit the data and remove the injection.