TFE Projectile Data: Difference between revisions

From DF21 Wiki
No edit summary
Line 23: Line 23:
| zeroWidth || boolean || <code>false</code> || If true, the projectile will not have a collision radius. Most projectiles have zero width.
| 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.
| 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.
| 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.
Line 43: Line 43:
| minDamage || number (integer) || 0 || Minimum damage caused by the projectile. Once the damage has fallen off to this value, no further falloff will occur.
| minDamage || number (integer) || 0 || Minimum damage caused by the projectile. Once the damage has fallen off to this value, no further falloff will occur.
|-
|-
|  
| force || number (decimal) || 0 || How much the projectile will "push" an object on impact. Is multiplied by the projectile's speed.
|-
| speed || number (integer) || 0 || The initial speed of the projectile. DFU per second.
|-
| horzBounciness || number (decimal) || 0 || Defines how much of the projectile's speed is retained after it bounces off a wall. A bounciness of 1.0 means that the projectile will maintain the same speed after bouncing; numbers less than 1.0 mean that the projectile will lose speed. (Setting bounciness to a value greater than 1.0 will cause the projectile to ''gain'' speed when bouncing!) Bounciness is only calculated when bounceCount is -1 (in practice, this means that it is only used for Thermal detonators).
|-
| vertBounciness || number (decimal) || 0 || Defines how much of the projectile's speed is retained after it bounces off a ceiling or floor. See above.
|-
| bounceCount || number (integer) || 0 || Number of times that a projectile can bounce or reflect off a surface. If set to a positive value, the projectile will only bounce in a sector with the "magseal" flag set. If set to 0, the projectile will never bounce; it will explode on first impact. If set to -1, the projectile can bounce an infinite number of times until its time expires, and it will bounce in any sector (whether magseal or not).  BounceCount is set to -1 for thermal detonators.
 
|}
|}

Revision as of 05:57, 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.)

Note that all text in the JSON is case insensitive (uppercase, lowercase or a mixture may be used).

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.
updateFunc string "standard" This defines how the projectile will travel through space. There are four options.
  • standard - The projectile will move in a straight line.
  • arcing - The projectile will be pulled downwards by gravity (thermal detonators and mortars)
  • landmine - Used for landmines
  • homing - A homing projectile.
damage number (integer) 0 Maximum damage caused by the projectile (equivalent to hitpoints). The projectile will cause this amount of damage before any falloff occurs.
falloffAmount number (decimal) 0 Damage falloff amount
nextFalloffTick number (integer) 0 Number of ticks (after projectile is spawned) before first damage falloff occurs. There are 145 ticks per second.
damageFalloffDelta number (integer) 0 Time interval (in ticks) between subsequent damage falloffs.
minDamage number (integer) 0 Minimum damage caused by the projectile. Once the damage has fallen off to this value, no further falloff will occur.
force number (decimal) 0 How much the projectile will "push" an object on impact. Is multiplied by the projectile's speed.
speed number (integer) 0 The initial speed of the projectile. DFU per second.
horzBounciness number (decimal) 0 Defines how much of the projectile's speed is retained after it bounces off a wall. A bounciness of 1.0 means that the projectile will maintain the same speed after bouncing; numbers less than 1.0 mean that the projectile will lose speed. (Setting bounciness to a value greater than 1.0 will cause the projectile to gain speed when bouncing!) Bounciness is only calculated when bounceCount is -1 (in practice, this means that it is only used for Thermal detonators).
vertBounciness number (decimal) 0 Defines how much of the projectile's speed is retained after it bounces off a ceiling or floor. See above.
bounceCount number (integer) 0 Number of times that a projectile can bounce or reflect off a surface. If set to a positive value, the projectile will only bounce in a sector with the "magseal" flag set. If set to 0, the projectile will never bounce; it will explode on first impact. If set to -1, the projectile can bounce an infinite number of times until its time expires, and it will bounce in any sector (whether magseal or not). BounceCount is set to -1 for thermal detonators.