TFE Projectile Data: Difference between revisions

From DF21 Wiki
(Created page with "Projectile 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\projectiles.json</code>. Altering the data in <code>projectiles.json</code> will alter the way that weapon projectiles behave in the game. If the JSON file is removed, renamed or corrupted, weapons will not work correctly. (In this case, an error message will be logged to the TFE console when loadin...")
 
No edit summary
Line 4: Line 4:


=== Mods ===
=== Mods ===
A customised version of <code>projectiles.json</code> can be included in a mod's ZIP file. A modded <code>projectiles.json</code> will take precedence over the original.
A customised version of <code>projectiles.json</code> can be included in a mod's ZIP file. A modded <code>projectiles.json</code> will take precedence over the base version.
 
=== Projectile properties ===
Each projectile type can have the following properties defined. This table lists the properties and what they mean.
 
{| border=1 cellpadding=6px
|-
! Property !! Type !! Default value !! Description
|-
| assetType || string || <code>"spirit"</code> || The type of asset that the projectile uses. It must be one of the following: "spirit", "frame", "sprite" or "3d". (A spirit is an invisible object that has no asset.)
|-
| asset || string ||  || A <code>.FME</code>, <code>.WAX</code>, or <code>.3DO</code> file. The type must match the assetType. If the assetType is <code>spirit</code>, this property can be left unset and will be ignored.
|-
| fullBright || boolean || <code>false</code> || Whether or not the asset will be rendered fullbright.
|-
| zeroWidth || boolean || <code>false</code> || If true, the projectile will not have a collision radius. Most projectiles have zero width.
|-
| autoAim || boolean || <code>false</code> || If true, the player's weapons will auto-aim at the projectile. (This applies to Mohc's homing missiles because they can be shot down.
|-
| movable || boolean || <code>false</code> || If true, the projectile will be moved by elevators. For example if you lay a mine on a rotating sector, the mine will rotate with it.
|}

Revision as of 04:26, 23 November 2024

Projectile 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\projectiles.json.

Altering the data in projectiles.json will alter the way that weapon projectiles behave in the game. If the JSON file is removed, renamed or corrupted, weapons will not work correctly. (In this case, an error message will be logged to the TFE console when loading the game.)

Mods

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

Projectile properties

Each projectile type can have the following properties defined. This table lists the properties and what they mean.

Property Type Default value Description
assetType string "spirit" The type of asset that the projectile uses. It must be one of the following: "spirit", "frame", "sprite" or "3d". (A spirit is an invisible object that has no asset.)
asset string A .FME, .WAX, or .3DO file. The type must match the assetType. If the assetType is spirit, this property can be left unset and will be ignored.
fullBright boolean false Whether or not the asset will be rendered fullbright.
zeroWidth boolean false If true, the projectile will not have a collision radius. Most projectiles have zero width.
autoAim boolean false If true, the player's weapons will auto-aim at the projectile. (This applies to Mohc's homing missiles because they can be shot down.
movable boolean false If true, the projectile will be moved by elevators. For example if you lay a mine on a rotating sector, the mine will rotate with it.