In the original Tomb Raider I, items dropped by enemies were hardcoded such that only specific enemies could drop, and the items and quantities that they dropped were immutable. This is no longer the case, with the game flow providing a mechanism to allow the majority of enemy types to carry and drop items. Note that this also means by default that the original enemies who did drop items will not do so unless the game flow has been configured as such.
Item drops can be defined in two ways. If enable_tr2_item_drops
is true
,
then custom level builders can add items directly to the level file, setting
their position to be the same as the enemies who should drop them.
For the original levels, enable_tr2_item_drops
is false
. Item drops are
instead defined in the item_drops
section of a level's definition by creating
objects with the following parameter structure. You can define at most one entry
per enemy, but that definition can have as many drop items as necessary (within
the engine's overall item limit).
{
"path": "data/example.phd",
"music_track": 57,
"item_drops": [
{"enemy_num": 17, "object_ids": [86]},
{"enemy_num": 50, "object_ids": [87]},
{"enemy_num": 12, "object_ids": [93, 93]},
{"enemy_num": 47, "object_ids": [111]},
],
"sequence": [
{"type": "loop_game"},
{"type": "level_stats"},
{"type": "level_complete"},
],
},
This translates as follows.
Parameter | Type | Description |
---|---|---|
enemy_num
|
Integer | The index of the enemy in the level's item list. |
object_ids
|
Integer / string array | A list of item types to drop. These items will spawn dynamically and do not need to be added to the level file. Duplicate IDs are permitted in the same array. |
You can also toggle convert_dropped_guns
in
global properties. When true
, if an enemy drops a gun
that Lara already has, it will be converted to the equivalent ammo. When
false
, the gun will always be dropped.
All enemy types are permitted to carry and drop items. This includes regular enemies as well as TR1 Atlantean pods (objects 163, 181), TR1 centaur statues (object 161), and TR2 statues (objects 42, 44). For pods, the items will be allocated to the creature within (obviously empty pods are excluded).
Items dropped by flying or swimming creatures will fall to the ground (TR1 only).
For clarity, following is a list of all enemy type IDs which you can reference when building your game flow. The game flow will ignore drops for non-enemy type objects, and a suitable warning message will be produced in the log file.
TR1 | TR2 | ||
---|---|---|---|
Object ID | Name | Object ID | Name |
7 | Wolf | 15 | Dog |
8 | Bear | 16 | Masked Goon 1 |
9 | Bat | 17 | Masked Goon 2 |
10 | Crocodile | 18 | Masked Goon 3 |
11 | Alligator | 19 | Knife Thrower |
12 | Lion | 20 | Shotgun Goon |
13 | Lioness | 21 | Rat |
14 | Puma | 22 | Dragon Front |
15 | Ape | 25 | Shark |
16 | Rat | 26 | Eel |
17 | Vole | 27 | Big Eel |
18 | T-rex | 28 | Barracuda |
19 | Raptor | 29 | Scuba Diver |
20 | Flying mutant | 30 | Gunman Goon 1 |
21 | Grounded mutant (shooter) | 31 | Gunman Goon 2 |
22 | Grounded mutant (non-shooter) | 32 | Stick Wielding Goon 1 |
23 | Centaur | 33 | Stick Wielding Goon 2 |
24 | Mummy (Tomb of Qualopec) | 34 | Flamethrower Goon |
27 | Larson | 35 | Jellyfish |
28 | Pierre (not runaway) | 36 | Spider |
30 | Skate kid | 37 | Giant Spider |
31 | Cowboy | 38 | Crow |
32 | Kold | 39 | Tiger |
33 | Natla (items drop after second phase) | 40 | Marco Bartoli |
34 | Torso | 41 | Xian Spearman |
42 | Xian Spearman Statue | ||
43 | Xian Knight | ||
44 | Xian Knight | ||
45 | Yeti | ||
46 | Bird Monster | ||
47 | Eagle | ||
48 | Mercenary 1 | ||
49 | Mercenary 2 | ||
50 | Mercenary 3 | ||
52 | Black Snowmobile Driver | ||
214 | T-Rex |
The following object types are capable of being carried and dropped. The game flow will ignore anything that is not in this list, and a suitable warning message will be produced in the log file.
TR1 | TR2 | ||
---|---|---|---|
Object ID | Name | Object ID | Name |
84 | Pistols | 135 | Pistols |
85 | Shotgun | 136 | Shotgun |
86 | Magnums | 137 | Automatic Pistols |
87 | Uzis | 138 | Uzis |
89 | Shotgun ammo | 139 | Harpoon Gun |
90 | Magnum ammo | 140 | M16 |
91 | Uzi ammo | 141 | Grenade Launcher |
93 | Small medipack | 142 | Pistol Clips |
94 | Large medipack | 143 | Shotgun Shells |
110 | Puzzle1 | 144 | Automatic Pistol Clips |
111 | Puzzle2 | 145 | Uzi Clips |
112 | Puzzle3 | 146 | Harpoons |
113 | Puzzle4 | 147 | M16 Clips |
126 | Lead bar | 148 | Grenades |
129 | Key1 | 149 | Small Medipack |
130 | Key2 | 150 | Large Medipack |
131 | Key3 | 152 | Flare |
132 | Key4 | 151 | Flares Box |
141 | Pickup1 | 174 | Puzzle Item 1 |
142 | Pickup2 | 175 | Puzzle Item 2 |
144 | Scion (à la Pierre) | 176 | Puzzle Item 3 |
177 | Puzzle Item 4 | ||
193 | Key 1 | ||
194 | Key 2 | ||
195 | Key 3 | ||
196 | Key 4 | ||
205 | Pickup Item 1 | ||
206 | Pickup Item 2 | ||
190 | Secret 1 | ||
191 | Secret 2 | ||
192 | Secret 3 |