(Created page with "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 <code>ExternalData\DarkForces\pickups.json</code>. Altering the data in <code>pickups.json</code> 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 i...") |
|||
(2 intermediate revisions by the same user not shown) | |||
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 | === 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. | ||
If a property is not defined in the JSON, it will fall back to the default shown in the table. | If a property is not defined in the JSON, it will fall back to the default shown in the table. | ||
{| border=1 cellpadding=6px | |||
|- | |||
! Property !! Type !! Default value !! Description | |||
|- | |||
| type || string || ''none'' || There are 7 types of pickup; each type has a specific behaviour. These are: | |||
* <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> - 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> - provides the player with ammo, shields, health or battery | |||
* <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> - adds an item to the inventory, and nothing else. Is used for the codekeys. | |||
* <code>powerup</code> - used for the four powerups (supercharges, extra life, revive). | |||
* <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. | |||
|- | |||
| weaponIndex || number (integer) || -1 || Causes the player to switch to a new weapon, corresponding to the number. | |||
|- | |||
| playerItem || string || || Inventory item or weapon that will be given with the pickup. The options are: itemPistol, itemRifle, itemAutogun, itemMortar, itemFusion, itemConcussion, itemCannon, itemRedKey, itemYellowKey, itemBlueKey, itemGoggles, itemCleats, itemMask, itemPlans, itemPhrik, itemDatatape, itemUnused, itemNava, itemDtWeapon, itemCode# (1-9) | |||
|- | |||
| playerAmmo || string || || Ammo type that will be supplied with the pickup. The options are: ammoEnergy, ammoPower, ammoPlasma, ammoDetonator, ammoShell, ammoMine, ammoMissile, shields, health, batteryPower | |||
|- | |||
| amount || string || 0 || Amount to increase the ammo by (up to the maximum). For batteryPower, this is a percentage (100 = five lights). | |||
|- | |||
| message1 || number (integer) || -1 || Message from TEXT.MSG to show when this item is picked up. | |||
|- | |||
| message2 || number (integer) || -1 || Alternative message from TEXT.MSG to show when the player picks up a weapon that he already has. | |||
|- | |||
| fullBright || boolean || false || If true, the sprite will be displayed fully lit. | |||
|- | |||
| noRemove || boolean || false || If true, the pickup item will not be removed from the world even if it is crushed (eg. if a door closes on top of it). | |||
|- | |||
| asset || string || || A WAX sprite or FME that will be used for the pickup item if it is spawned during gameplay (this happens when items are dropped by enemies after they are killed). This does not apply to pickup items that are present at the start of a level; the asset for these are set in the .O file | |||
|} |
Latest revision as of 05:56, 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; each type has a specific behaviour. These are:
|
weaponIndex | number (integer) | -1 | Causes the player to switch to a new weapon, corresponding to the number. |
playerItem | string | Inventory item or weapon that will be given with the pickup. The options are: itemPistol, itemRifle, itemAutogun, itemMortar, itemFusion, itemConcussion, itemCannon, itemRedKey, itemYellowKey, itemBlueKey, itemGoggles, itemCleats, itemMask, itemPlans, itemPhrik, itemDatatape, itemUnused, itemNava, itemDtWeapon, itemCode# (1-9) | |
playerAmmo | string | Ammo type that will be supplied with the pickup. The options are: ammoEnergy, ammoPower, ammoPlasma, ammoDetonator, ammoShell, ammoMine, ammoMissile, shields, health, batteryPower | |
amount | string | 0 | Amount to increase the ammo by (up to the maximum). For batteryPower, this is a percentage (100 = five lights). |
message1 | number (integer) | -1 | Message from TEXT.MSG to show when this item is picked up. |
message2 | number (integer) | -1 | Alternative message from TEXT.MSG to show when the player picks up a weapon that he already has. |
fullBright | boolean | false | If true, the sprite will be displayed fully lit. |
noRemove | boolean | false | If true, the pickup item will not be removed from the world even if it is crushed (eg. if a door closes on top of it). |
asset | string | A WAX sprite or FME that will be used for the pickup item if it is spawned during gameplay (this happens when items are dropped by enemies after they are killed). This does not apply to pickup items that are present at the start of a level; the asset for these are set in the .O file |