{"name":"Arma 3: Soldier Protection","title":"Arma 3: Soldier Protection","type":"topic","url":"https://community.bistudio.com/wiki/Arma_3:_Soldier_Protection","revid":351448,"updated":"2023-12-06T09:57:37Z","aliases":["Arma 3 Soldier Protection"],"markdown":"This new system allows the definition of the protection level of various hit-points (head, face, neck) in a given piece of equipment (I.e. Headgear, vest).\nEach equipment item which should have a certain level of protection should have the necessary hit point configured (see examples below).\n\nFor the story, the old system was able to cover only one hit-point, as shown hereafter:\n\n| Old System | New System | New supported hitpoints |\n|---|---|---|\n|  |  | - head<br>- face<br>- neck<br>- chest<br>- diaphragm<br>- abdomen<br>- pelvis<br>- arms<br>- hands<br>- legs |\n| ```cpp<br>class ItemInfo<br>{<br>    hitPointName    = \"HitBody\";<br>    armor            = 1; //float [0 .. ∞]<br>    passThrough        = 1.0 //float [0 .. 1]<br>};<br>``` | ```cpp<br>class ItemInfo<br>{<br>    class HitpointsProtectionInfo<br>    {<br>        class Chest<br>        {<br>            hitpointName    = \"HitChest\";<br>            armor            = 1 ; //float [0 .. ∞]<br>            passThrough        = 1.0; //float [0 .. 1]<br>        };<br>        class Diaphragm<br>        {<br>            hitpointName    = \"HitDiaphragm\";<br>            armor            = 1 ; //float [0 .. ∞]<br>            passThrough        = 1.0 ; //float [0 .. 1]<br>        };<br>    };<br>};<br>``` |  |\n\n### Implementation\n\nAs described hereafter, various properties (hitpoint) need to be defined in the config to fully benefit from the soldier protection.\n\n#### Unit base class\n\nThe following code is an example of a custom man base class containing every config parameters relevant to the soldier protection.\nIts values represents the state of the soldier protection without any equipment, each piece of gear can increase the protection level of one of these hit points, provided it is configured.\nThis class is just here to help you understanding the relation between the configuration of a gear item and the base class.\n\nNote: Good practice is not to edit or update the base class but create a new class which inherits from the vanilla class.\n\n```cpp\nclass CfgVehicles\n{\n    class Man;\n    class CAManBase : Man\n    {\n        class HitPoints\n        {\n            class HitHead;\n            class HitBody;\n            class HitHands;\n            class HitLegs;\n        };\n    };\n    class TM4_CAManBase : CAManBase\n    {\n        armor                = 2;    // total hit points (meaning global \"health\") of the object.\n                                    // keep constant among various soldiers so that the hit points armor coefficients remains on the same scale\n        armorStructural        = 0.4;    // divides all damage taken to total hit point, either directly or through hit point passThrough coefficient.\n                                    // must be adjusted for each model to achieve consistent total damage results\n        explosionShielding    = 0.04; // for consistent explosive damage after adjusting = ( armorStructural / 10 )\n        minTotalDamageThreshold    = 0.001;    // minimalHit for total damage\n        impactDamageMultiplier    = 0.5;        // multiplier for falling damage\n\n        class HitPoints\n        {\n            class HitFace\n            {\n                armor                =  1;    // \"Healthpoints\" of this hitpoint is armor value (of hitpoint) * armor value (coefficient of the total armor defined below for the whole object)\n                material            = -1;    // damage material (-1 means \"unused\")\n                name                = \"face_hub\"; // selection name from hit points LOD in object\n                passThrough            = 0.1;    // coefficient defining how much damage will pass into total damage when this hit point is damaged\n                radius                = 0.08;    // size of the hit point sphere, this is how it works: https://community.bistudio.com/wiki/Arma_3_Damage_Description\n                explosionShielding    = 0.1;    // multiplier of explosive damage (parameter: explosive > 0 in ammunition type)\n                minimalHit            = 0.01;    // minimal damage value that can be applied (based on armor value), damage below this threshold is ignored\n                                            // example: total hit point armor = 2 and hitpoint class armor = 10 and minimalHit = 0.04\n                                            // -> all damage below a hit value of 2*10*0.04 = 0.8 is ignored\n            }\n            class HitNeck : HitFace\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"neck\";\n                passThrough            = 0.1;\n                radius                = 0.1;\n                explosionShielding    = 0.5;\n                minimalHit            = 0.01;\n            }\n            class HitHead : HitNeck\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"head\";\n                passThrough            = 0.1;\n                radius                = 0.2;\n                explosionShielding    = 0.5;\n                minimalHit            = 0.01;\n                depends                = \"HitFace max HitNeck\"; // returns the greater of HitFace and HitNeck.\n                // for depends to work, HitHead must be inheriting from HitFace and HitNeck.\n                // \"max\" is not the only operator you can use. + and * are confirmed working.\n                // Other operators from the https://community.bistudio.com/wiki/Simple_Expression list may be usable as well.\n            };\n            class HitPelvis\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"pelvis\";\n                passThrough            = 0.1;\n                radius                = 0.2;\n                explosionShielding    = 1;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n            };\n            class HitAbdomen : HitPelvis\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"spine1\";\n                passThrough            = 0.1;\n                radius                = 0.15;\n                explosionShielding    = 1;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n            };\n            class HitDiaphragm : HitAbdomen\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"spine2\";\n                passThrough            = 0.1;\n                radius                = 0.15;\n                explosionShielding    = 6;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n            }\n            class HitChest : HitDiaphragm\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"spine3\";\n                passThrough            = 0.1;\n                radius                = 0.15;\n                explosionShielding    = 6;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n            };\n            class HitBody : HitChest\n            {\n                armor                = 1000; // not supposed to take damage directly\n                material            = -1;\n                name                = \"body\";\n                passThrough            = 0.1;\n                radius                = 0.16;\n                explosionShielding    = 6;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n                depends                = \"HitPelvis max HitAbdomen max HitDiaphragm max HitChest\"; // depends work only for hit points defined in inheritance chain\n                // arbitrary example for different operator usage: = \"(2* (HitPelvis + HitAbdomen) * HitDiaphragm) max HitChest\";\n\n            };\n            class HitArms\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"arms\";\n                passThrough            = 1;\n                radius                = 0.1;\n                explosionShielding    = 1;\n                visual                = \"injury_hands\";\n                minimalHit            = 0.01;\n            };\n            class HitHands : HitArms\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"hands\";\n                passThrough            = 1;\n                radius                = 0.1;\n                explosionShielding    = 1;\n                visual                = \"injury_hands\";\n                minimalHit            = 0.01;\n                depends                = \"HitArms\";\n            };\n            class HitLegs\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"legs\";\n                passThrough            = 1;\n                radius                = 0.12;\n                explosionShielding    = 1;\n                visual                = \"injury_legs\";\n                minimalHit            = 0.01;\n            };\n        };\n    };\n};\n```\n\n#### Armored vest\n\nThe following vest config will provide protection for the neck, arms, chest, diaphragm abdomen and body.\n\n```cpp\n// Carrier Special Rig (Green)\nclass V_PlateCarrierSpec_rgr : Vest_NoCamo_Base\n{\n    /* other properties */\n    class ItemInfo : ItemInfo\n    {\n        /* other properties */\n        class HitpointsProtectionInfo\n        {\n            class Neck\n            {\n                hitpointName    = \"HitNeck\";    // reference to the hit point class defined in the man base class\n                armor            = 8;            // addition to armor of referenced hitpoint\n                passThrough        = 0.5;            // multiplier of base passThrough defined in referenced hitpoint\n            };\n            class Arms\n            {\n                hitpointName    = \"HitArms\";\n                armor            = 8;\n                passThrough        = 0.5;\n            };\n            class Chest\n            {\n                hitpointName    = \"HitChest\";\n                armor            = 24;\n                passThrough        = 0.1;\n            };\n            class Diaphragm\n            {\n                hitpointName    = \"HitDiaphragm\";\n                armor            = 24;\n                passThrough        = 0.1;\n            };\n            class Abdomen\n            {\n                hitpointName    = \"HitAbdomen\";\n                armor            = 24;\n                passThrough        = 0.1;\n            };\n            class Body\n            {\n                hitpointName    = \"HitBody\";\n                passThrough        = 0.1;\n            };\n        };\n    };\n};\n```\n\n#### Headgear\n\nThis headgear increases the protection of the Head only, for example it doesn't provide additional protection for the face,\nso the value from the base class (above) will be used as they are defined.\n\n```cpp\nclass H_HelmetB : ItemCore\n{\n    /* other properties */\n    class ItemInfo : HeadgearItem\n    {\n        /* other properties */\n        class HitpointsProtectionInfo\n        {\n            class Head\n            {\n                hitpointName    = \"HitHead\";    // reference to the hit point class defined in the man base class\n                armor            = 6;            // addition to armor of referenced hitpoint\n                passThrough        = 0.5;            // multiplier of base passThrough defined in referenced hitpoint\n            };\n        };\n    };\n};\n```","sections":[{"heading":null,"level":1,"markdown":"This new system allows the definition of the protection level of various hit-points (head, face, neck) in a given piece of equipment (I.e. Headgear, vest).\nEach equipment item which should have a certain level of protection should have the necessary hit point configured (see examples below).\n\nFor the story, the old system was able to cover only one hit-point, as shown hereafter:\n\n| Old System | New System | New supported hitpoints |\n|---|---|---|\n|  |  | - head<br>- face<br>- neck<br>- chest<br>- diaphragm<br>- abdomen<br>- pelvis<br>- arms<br>- hands<br>- legs |\n| ```cpp<br>class ItemInfo<br>{<br>    hitPointName    = \"HitBody\";<br>    armor            = 1; //float [0 .. ∞]<br>    passThrough        = 1.0 //float [0 .. 1]<br>};<br>``` | ```cpp<br>class ItemInfo<br>{<br>    class HitpointsProtectionInfo<br>    {<br>        class Chest<br>        {<br>            hitpointName    = \"HitChest\";<br>            armor            = 1 ; //float [0 .. ∞]<br>            passThrough        = 1.0; //float [0 .. 1]<br>        };<br>        class Diaphragm<br>        {<br>            hitpointName    = \"HitDiaphragm\";<br>            armor            = 1 ; //float [0 .. ∞]<br>            passThrough        = 1.0 ; //float [0 .. 1]<br>        };<br>    };<br>};<br>``` |  |"},{"heading":"Implementation","level":3,"markdown":"As described hereafter, various properties (hitpoint) need to be defined in the config to fully benefit from the soldier protection."},{"heading":"Unit base class","level":4,"markdown":"The following code is an example of a custom man base class containing every config parameters relevant to the soldier protection.\nIts values represents the state of the soldier protection without any equipment, each piece of gear can increase the protection level of one of these hit points, provided it is configured.\nThis class is just here to help you understanding the relation between the configuration of a gear item and the base class.\n\nNote: Good practice is not to edit or update the base class but create a new class which inherits from the vanilla class.\n\n```cpp\nclass CfgVehicles\n{\n    class Man;\n    class CAManBase : Man\n    {\n        class HitPoints\n        {\n            class HitHead;\n            class HitBody;\n            class HitHands;\n            class HitLegs;\n        };\n    };\n    class TM4_CAManBase : CAManBase\n    {\n        armor                = 2;    // total hit points (meaning global \"health\") of the object.\n                                    // keep constant among various soldiers so that the hit points armor coefficients remains on the same scale\n        armorStructural        = 0.4;    // divides all damage taken to total hit point, either directly or through hit point passThrough coefficient.\n                                    // must be adjusted for each model to achieve consistent total damage results\n        explosionShielding    = 0.04; // for consistent explosive damage after adjusting = ( armorStructural / 10 )\n        minTotalDamageThreshold    = 0.001;    // minimalHit for total damage\n        impactDamageMultiplier    = 0.5;        // multiplier for falling damage\n\n        class HitPoints\n        {\n            class HitFace\n            {\n                armor                =  1;    // \"Healthpoints\" of this hitpoint is armor value (of hitpoint) * armor value (coefficient of the total armor defined below for the whole object)\n                material            = -1;    // damage material (-1 means \"unused\")\n                name                = \"face_hub\"; // selection name from hit points LOD in object\n                passThrough            = 0.1;    // coefficient defining how much damage will pass into total damage when this hit point is damaged\n                radius                = 0.08;    // size of the hit point sphere, this is how it works: https://community.bistudio.com/wiki/Arma_3_Damage_Description\n                explosionShielding    = 0.1;    // multiplier of explosive damage (parameter: explosive > 0 in ammunition type)\n                minimalHit            = 0.01;    // minimal damage value that can be applied (based on armor value), damage below this threshold is ignored\n                                            // example: total hit point armor = 2 and hitpoint class armor = 10 and minimalHit = 0.04\n                                            // -> all damage below a hit value of 2*10*0.04 = 0.8 is ignored\n            }\n            class HitNeck : HitFace\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"neck\";\n                passThrough            = 0.1;\n                radius                = 0.1;\n                explosionShielding    = 0.5;\n                minimalHit            = 0.01;\n            }\n            class HitHead : HitNeck\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"head\";\n                passThrough            = 0.1;\n                radius                = 0.2;\n                explosionShielding    = 0.5;\n                minimalHit            = 0.01;\n                depends                = \"HitFace max HitNeck\"; // returns the greater of HitFace and HitNeck.\n                // for depends to work, HitHead must be inheriting from HitFace and HitNeck.\n                // \"max\" is not the only operator you can use. + and * are confirmed working.\n                // Other operators from the https://community.bistudio.com/wiki/Simple_Expression list may be usable as well.\n            };\n            class HitPelvis\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"pelvis\";\n                passThrough            = 0.1;\n                radius                = 0.2;\n                explosionShielding    = 1;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n            };\n            class HitAbdomen : HitPelvis\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"spine1\";\n                passThrough            = 0.1;\n                radius                = 0.15;\n                explosionShielding    = 1;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n            };\n            class HitDiaphragm : HitAbdomen\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"spine2\";\n                passThrough            = 0.1;\n                radius                = 0.15;\n                explosionShielding    = 6;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n            }\n            class HitChest : HitDiaphragm\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"spine3\";\n                passThrough            = 0.1;\n                radius                = 0.15;\n                explosionShielding    = 6;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n            };\n            class HitBody : HitChest\n            {\n                armor                = 1000; // not supposed to take damage directly\n                material            = -1;\n                name                = \"body\";\n                passThrough            = 0.1;\n                radius                = 0.16;\n                explosionShielding    = 6;\n                visual                = \"injury_body\";\n                minimalHit            = 0.01;\n                depends                = \"HitPelvis max HitAbdomen max HitDiaphragm max HitChest\"; // depends work only for hit points defined in inheritance chain\n                // arbitrary example for different operator usage: = \"(2* (HitPelvis + HitAbdomen) * HitDiaphragm) max HitChest\";\n\n            };\n            class HitArms\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"arms\";\n                passThrough            = 1;\n                radius                = 0.1;\n                explosionShielding    = 1;\n                visual                = \"injury_hands\";\n                minimalHit            = 0.01;\n            };\n            class HitHands : HitArms\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"hands\";\n                passThrough            = 1;\n                radius                = 0.1;\n                explosionShielding    = 1;\n                visual                = \"injury_hands\";\n                minimalHit            = 0.01;\n                depends                = \"HitArms\";\n            };\n            class HitLegs\n            {\n                armor                =  1;\n                material            = -1;\n                name                = \"legs\";\n                passThrough            = 1;\n                radius                = 0.12;\n                explosionShielding    = 1;\n                visual                = \"injury_legs\";\n                minimalHit            = 0.01;\n            };\n        };\n    };\n};\n```"},{"heading":"Armored vest","level":4,"markdown":"The following vest config will provide protection for the neck, arms, chest, diaphragm abdomen and body.\n\n```cpp\n// Carrier Special Rig (Green)\nclass V_PlateCarrierSpec_rgr : Vest_NoCamo_Base\n{\n    /* other properties */\n    class ItemInfo : ItemInfo\n    {\n        /* other properties */\n        class HitpointsProtectionInfo\n        {\n            class Neck\n            {\n                hitpointName    = \"HitNeck\";    // reference to the hit point class defined in the man base class\n                armor            = 8;            // addition to armor of referenced hitpoint\n                passThrough        = 0.5;            // multiplier of base passThrough defined in referenced hitpoint\n            };\n            class Arms\n            {\n                hitpointName    = \"HitArms\";\n                armor            = 8;\n                passThrough        = 0.5;\n            };\n            class Chest\n            {\n                hitpointName    = \"HitChest\";\n                armor            = 24;\n                passThrough        = 0.1;\n            };\n            class Diaphragm\n            {\n                hitpointName    = \"HitDiaphragm\";\n                armor            = 24;\n                passThrough        = 0.1;\n            };\n            class Abdomen\n            {\n                hitpointName    = \"HitAbdomen\";\n                armor            = 24;\n                passThrough        = 0.1;\n            };\n            class Body\n            {\n                hitpointName    = \"HitBody\";\n                passThrough        = 0.1;\n            };\n        };\n    };\n};\n```"},{"heading":"Headgear","level":4,"markdown":"This headgear increases the protection of the Head only, for example it doesn't provide additional protection for the face,\nso the value from the base class (above) will be used as they are defined.\n\n```cpp\nclass H_HelmetB : ItemCore\n{\n    /* other properties */\n    class ItemInfo : HeadgearItem\n    {\n        /* other properties */\n        class HitpointsProtectionInfo\n        {\n            class Head\n            {\n                hitpointName    = \"HitHead\";    // reference to the hit point class defined in the man base class\n                armor            = 6;            // addition to armor of referenced hitpoint\n                passThrough        = 0.5;            // multiplier of base passThrough defined in referenced hitpoint\n            };\n        };\n    };\n};\n```"}],"categories":["Arma 3: Editing","Arma 3: Tutorials","Stubs"],"groups":["General"]}