ACE3/docs/wiki/framework/vehicledamage-framework.md
johnb432 80b2fa9a05
Vehicle damage - Code cleanup (#9831)
* Cook-off improvements

* More changes

* Update fnc_getVehicleAmmo.sqf

* Better engine fire placement

* Update fnc_detonateAmmunition.sqf

* Update XEH_postInit.sqf

* Update fnc_getVehicleAmmo.sqf

* Update events-framework.md

* Various improvements

* Separate effect handling

* Tweaks

* Update XEH_postInit.sqf

* Prevent double ammo detonation

* Fixed objects not being able to cook-off again

* Added incendiary rounds as source of box cookoff

* Converted enable setting to bool

* Fixed brackets

* Update fnc_cookOff.sqf

* Update CfgEden.hpp

* Removed GVAR(enable), added GVAR(enableFire) back

* Vehicle damage fixes

* Made hitpoint hash common

* Update fnc_addEventHandler.sqf

* Update fnc_medicalDamage.sqf

* Update fnc_handleBail.sqf

* Changed API

* Remove `CBA_fnc_getConfigEntry` as much as possible, as it's 2x slower

* More cleanup

* More cleanup

* Fix merging issues, remove turret tossing

* Update translations

* More cleanup

* Reverted some logic back to original, minor tweaks & fixes

* Fix undefined variable

* Cleanup

* Fixed bad logic

* Update addons/vehicle_damage/script_macros.hpp

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/vehicle_damage/functions/fnc_handleDamage.sqf

* Update addons/vehicle_damage/stringtable.xml

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/vehicle_damage/stringtable.xml

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>

* Update addons/vehicle_damage/XEH_postInit.sqf

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com>
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2024-08-20 16:23:21 -03:00

3.8 KiB

layout title description group order parent mod version
wiki Vehicle Damage Framework Explains how to configure vehicles to simulate vehicle damage. framework 5 wiki ace
major minor patch
3 14 0

1. CfgVehicles

1.1 Config Values

The only configuration needed for vehicles are their probabilities to cook-off/detonate upon being penetrated. These values are dice-rolls within system, tweak to get better feeling effects.

All values in range [0, 1] unless specified otherwise

1.1.1 ace_vehicle_damage_hullDetonationProb

The probability for the vehicle to detonate ammunition upon its hull being penetrated

Default: 0.2

1.1.2 ace_vehicle_damage_turretDetonationProb

The probability for the vehicle to detonate ammunition upon its turret being penetrated

Default: 0.2

1.1.3 ace_vehicle_damage_engineDetonationProb

The probability for the vehicle to detonate ammunition upon its turret being penetrated

Default: 0.2

1.1.4 ace_vehicle_damage_hullFireProb

The probability for the vehicle to catch on fire upon its hull being penetrated

Default: 0.5

1.1.5 ace_vehicle_damage_turretFireProb

The probability for the vehicle to catch on fire upon its turret being penetrated

Default: 0.2

1.1.6 ace_vehicle_damage_engineFireProb

The probability for the vehicle to catch on fire upon its engine being penetrated

Default: 0.5

1.1.7 ace_vehicle_damage_detonationDuringFireProb

The probabilitiy for the vehicle to detonate ammunition while its on fire

Default: 0.2

1.1.8 ace_vehicle_damage_canHaveFireRing

Whether or not this vehicle can spawn a ring-of-fire effect (Boolean value: 0 or 1)

Default: 0

1.1.9 ace_cookoff_canHaveFireJet

Whether or not this vehicle can spawn a jet effect (Boolean value: 0 or 1)

Default: 1

1.1.10 ace_vehicle_damage_slatHitpoints

An array of all hitpoints that are defined to be SLAT. String array

Default: {}

1.1.11 ace_vehicle_damage_eraHitpoints

An array of all hitpoints that are defined to be ERA. String array

Default: {}

1.1.12 ace_vehicle_damage_turret

String for turret classname to spawn when catastrophically destroyed, followed by offset the object should spawn with. Turret will pop-off and this is the class spawned

Default: {}

1.2 Defined Hitpoints

1.2.1 Default assumed hitpoints

  • Engine: hitengine
  • Hull: hithull, hitbody, #structural
  • Tracks: hitltrack, hitrtrack
  • Wheels: hitlbwheel, hitlmwheel, hitlfwheel, hitlf2wheel, hitrbwheel, hitrmwheel, hitrlwheel, hitrfwheel, hitrf2wheel
  • Fuel: hitfuel

1.2.2 Turret, Gun, ERA, and SLAT hitpoints

On vehicle placement the system will iterate through all hitpoints define in class Turrets and find the relevant weapons and add their hitpoints. This occurs for ERA and SLAT as well

2. CfgAmmo

The only configuration needed on ammo is the warhead type (if applicable) and the incendiary value

2.1 ace_vehicle_damage_incendiary

Value in range [0, 1] for how incendiary the ammo is. This is used in calculations to ignite fires. Not based on any real-world value, tweak as feels right.

2.1.1 Default Values

  • Tandem/HEAT: 1
  • AP: 0.1
  • HE: 0.3
  • Incendiary Bullet: 0.7

2.2 warheadName

Default ARMA config value. We assume that the warheads are vanilla strings, so options are

  • HE
  • AP
  • HEAT
  • TandemHEAT

If no ace_vehicle_damage_incendiary defined, this value will be used to assume a default based on above table of common values (excluding Incendiary Bullet which is 0).

3. Disabling crew bailing for individual vehicles

Crew bailing when their vehicle is disabled (immobile or can't shoot) can be disabled for a specific vehicle:

_vehicle setVariable ["ace_vehicle_damage_allowCrewInImmobile", true, true];