TFE Pickup Data: Difference between revisions

From DF21 Wiki
Line 10: Line 10:
Modded versions of <code>pickups.json</code> need to include definitions for all 46 of the pickup items. If any pickup definitions are missing, those pickups will not work when the game is played.
Modded versions of <code>pickups.json</code> need to include definitions for all 46 of the pickup items. If any pickup definitions are missing, those pickups will not work when the game is played.


=== Pickup item properties ===
=== Max Amounts ===
This section of the JSON defines the maximum amounts for each ammo type, health, shields and battery. These apply when picking up items, as well as when using cheats like LAPOSTAL. For battery, it is expressed as a percentage.
 
=== Pickup items and their properties ===
Each pickup item can have the following properties defined. This table lists the properties and what they mean.
Each pickup item can have the following properties defined. This table lists the properties and what they mean.


Line 19: Line 22:
! Property !! Type !! Default value !! Description
! Property !! Type !! Default value !! Description
|-  
|-  
| type || string || 'none' || There are 7 types of pickup. These are:
| type || string || ''none'' || There are 7 types of pickup. These are:
* <code>objective</code>
* <code>objective</code> - mission objective pickup (eg. Death Star Plans). Adds item to the inventory, triggers the <code>COMPLETE</code> elevator, and updates the objective screen in the PDA.
* <code>weapon</code>
* <code>weapon</code> - provides the player with an item (usually a weapon, but doesn't have to be) and ammo. Allows for two alternative messages depending on whether the player already has the item.
* <code>ammo</code>
* <code>ammo</code> - provides the player with ammo, shields, health or battery
* <code>usable</code>
* <code>usable</code> - adds an inventory item, and can also supply ammo. Is used for gasmask and goggles (where battery "ammo" is supplied together with the item), as well as keys.
* <code>codekey</code>
* <code>codekey</code> - adds an item to the inventory, and nothing else. Is used for the codekeys.
* <code>powerup</code>
* <code>powerup</code> - used for the four powerups (supercharges, extra life, revive).
* <code>special</code>
* <code>special</code> - only used for Kyle's gear ("pile"). Restores all of the player's items on Jabship, and triggers the <code>COMPLETE</code> elevator.
|}
|}

Revision as of 05:23, 6 December 2024

Pickup data is hardcoded in Dark Forces but the data has been externalised to a JSON file in The Force Engine. The data is located in ExternalData\DarkForces\pickups.json.

Altering the data in pickups.json will alter the way that pickup items behave in the game. If the JSON file is removed, renamed or corrupted, pickup items will not work correctly. (In this case, an error message will be logged.)

Note that all text in the JSON is case insensitive (uppercase, lowercase or a mixture may be used). The pickups and their properties can be listed in any order.

Mods

A customised version of pickups.json can be included in a mod's ZIP file. A modded pickups.json will take precedence over the base version.

Modded versions of pickups.json need to include definitions for all 46 of the pickup items. If any pickup definitions are missing, those pickups will not work when the game is played.

Max Amounts

This section of the JSON defines the maximum amounts for each ammo type, health, shields and battery. These apply when picking up items, as well as when using cheats like LAPOSTAL. For battery, it is expressed as a percentage.

Pickup items and their properties

Each pickup item can have the following properties defined. This table lists the properties and what they mean.

If a property is not defined in the JSON, it will fall back to the default shown in the table.

Property Type Default value Description
type string none There are 7 types of pickup. These are:
  • objective - mission objective pickup (eg. Death Star Plans). Adds item to the inventory, triggers the COMPLETE elevator, and updates the objective screen in the PDA.
  • weapon - provides the player with an item (usually a weapon, but doesn't have to be) and ammo. Allows for two alternative messages depending on whether the player already has the item.
  • ammo - provides the player with ammo, shields, health or battery
  • usable - adds an inventory item, and can also supply ammo. Is used for gasmask and goggles (where battery "ammo" is supplied together with the item), as well as keys.
  • codekey - adds an item to the inventory, and nothing else. Is used for the codekeys.
  • powerup - used for the four powerups (supercharges, extra life, revive).
  • special - only used for Kyle's gear ("pile"). Restores all of the player's items on Jabship, and triggers the COMPLETE elevator.