Modding Tutorials/Damage Hide

Intro
Hiding hit locations based on damage state is an intricate dance between three different vehicle files: the P3D model, model.cfg, and config.cpp.

You should be familiar with the concepts in Modding Tutorials/Animation Explained before proceeding with this section of the wiki.

These techniques make use of Arma 3's undocumented AnimationSources templates--hiding/swapping geometry based on hit location damage is considered use of a 'custom' animation source. (Hide/swap based on global vehicle damage would not require AnimationSources).

(As usual, there are a variety of standards found in Arma 3's config files--the examples below are based on Samples_F/Car_01, which are by far the simplest)

Hide Damaged Location Model (e.g. Glass)
We can follow the Arma 3 AnimationSources template for vehicle glass in order to hide destroyed (or damaged) hit locations.

model.cfg animations
We start with an animation definition inside model.cfg. Here are the required elements:

config.cpp AnimationSources
As we're using a "custom" animation source ("HitGlass1_health"), we need to define that source in config.cpp. Here is the template for defining a hide-on-damage source:

Swap Damaged Location Model (e.g. Tire)
We can follow the Arma 3 AnimationSources template for wheeled vehicle tires in order to swap models on destroyed (or damaged) hit locations. This process is identical to "Hide Damaged Location" above, but with an extra component in model.cfg.

model.cfg animations
We start with an animation definition inside model.cfg. Here are the required elements:

config.cpp AnimationSources
As we're using a "custom" animation source ("HitLFWheel_health"), we need to define that source in config.cpp. Here is the template for defining a hide-on-damage source:

Swap Damaged Location Texture
(Link to separate tutorial).

Global Damage Hide/Swap
You can perform hide/swaps for geometry based on overall vehicle destruction too. In fact Arma does this all the time with vanilla vehicles (well, at least the hiding part)--e.g. most tank turrets disappear when the vehicle is destroyed.

The process is not difficult, but the common complicating factor is that parts that you might want to hide are also linked (by selection name) to other bone-anims. In these situations simply adding geometry in the P3D to your global "damageHide" selection will "work", but it will disrupt any other animations that geometry is associated with (e.g. turret geometry will stop rotating properly, wheels stop turning, etc.). The Arma engine gets very confused when multiple bone-anims overlap on the same piece of geometry.

The solution is simply to make a separate damageHide animation for each named selection set that also has other animations. These damageHide animations can inherit from the main damageHide--the "selection" property just needs to be changed to the name of the particular selection set.

damageHide animation
Because this damageHide is dependent only on the global damage state of the vehicle, the animation can be defined exclusively in model.cfg without the need for a corresponding AnimationSource in CfgVehicles.

Here is a typical example:

Links
,, ,