Jump to content
Jack Finlind

How do I fix the helmet not being attached to my characters head?

Recommended Posts

So Ive gone along for the first time and down my editing and made some high poly models for arma 3, specifically a sniper veil, but I cant get the helmet to attach itself to the character, it just floats above his head (https://imgur.com/a/5XnSC) and it floats along above him. Its not affected by the state of his head,  it just floats at a constant height. Dont mind the terrible color, Im working on that and some RV mats now, But i really am stuck on this one bit. Im including my configs. Thanks for helping ! :D

 

|CONFIG.CPP|

 

#include "basicdefines_A3.hpp"
class DefaultEventhandlers;

#include "cfgPatches.hpp"

class UniformSlotInfo;

class CfgVehicles
{
    class Man;
    class CAManBase: Man
    {
        class HitPoints
        {
            class HitHead;
            class HitBody;
            class HitHands;
            class HitLegs;
        };
    };

    class SoldierWB: CAManBase
    {
        threat[] = {1, 0.1, 0.1};
    };

    //Base class for BLUFOR soldiers
    class GHelm_Soldier_base_F: SoldierWB
    {
        faceType = Man_A3; /// this soldier is going to use standard faces
        side = 1; /// that means BLUFOR
        faction = BLU_F; /// Standard NATO faction
        genericNames = "NATOMen"; /// Standard names for lads of NATO (and European civils)
        vehicleClass = Men; /// Should be listed under Men

        scope = 0; /// base class should not be visible in editor
        class Wounds /// changes material of skin according to damage
        {
            tex[] = {};
            mat[] = {
                "A3\Characters_F\Common\Data\basicbody.rvmat",             /// what material is changed
                "A3\Characters_F\Common\Data\basicbody_injury.rvmat",    /// how does the material look like in damage 0.5 and more
                "A3\Characters_F\Common\Data\basicbody_injury.rvmat",    /// how does the material look like while the part has damage 1

                "A3\Characters_F\Heads\Data\hl_white_bald_muscular.rvmat",            /// next materials are used through personality of the soldier
                "A3\Characters_F\Heads\Data\hl_white_bald_muscular_injury.rvmat",
                "A3\Characters_F\Heads\Data\hl_white_bald_muscular_injury.rvmat",

                "A3\Characters_F\Heads\Data\hl_black_bald_muscular.rvmat",
                "A3\Characters_F\Heads\Data\hl_black_bald_muscular_injury.rvmat",
                "A3\Characters_F\Heads\Data\hl_black_bald_muscular_injury.rvmat",

                "A3\Characters_F\Heads\Data\hl_white_hairy_muscular.rvmat",
                "A3\Characters_F\Heads\Data\hl_white_hairy_muscular_injury.rvmat",
                "A3\Characters_F\Heads\Data\hl_white_hairy_muscular_injury.rvmat",

                "A3\Characters_F\Heads\Data\hl_white_old.rvmat",
                "A3\Characters_F\Heads\Data\hl_white_old_injury.rvmat",
                "A3\Characters_F\Heads\Data\hl_white_old_injury.rvmat",

                "A3\Characters_F\Heads\Data\hl_asian_bald_muscular.rvmat",
                "A3\Characters_F\Heads\Data\hl_asian_bald_muscular_injury.rvmat",
                "A3\Characters_F\Heads\Data\hl_asian_bald_muscular_injury.rvmat"
            };
        };

        model             = "\Samples_f\Test_Character_01\A3_character_example.p3d"; /// path to model
        modelSides[]     = {3, 1};                 /// what sides could use this uniform, means civilians and BLUFOR can use it
        nakedUniform     = "U_BasicBody";        /// what "uniform" does this soldier use without any other uniform
        uniformClass     = "U_Test_uniform";        /// standard uniform used by this soldier, there is a special one defined later
        camouflage        = 1.4;                     /// how easy is to spot soldier -> bigger means better spotable, used by uniform

        class UniformInfo /// defines allowed slots of the uniform
        {
            class SlotsInfo
            {
                class NVG: UniformSlotInfo {slotType = NVG_SLOT; };
                class Scuba: UniformSlotInfo {slotType = SCUBA_SLOT;};
                class Googles: UniformSlotInfo {slotType = GOGGLE_SLOT;};
                class Headgear: UniformSlotInfo {slotType = HEADGEAR_SLOT;};
            };
        };

        class HitPoints
        {
            class HitFace
            {
                armor               = 1; // coefficient of the total armor defined below for the whole object
                material            = -1; // damage material (-1 means "unused")
                name                = "face_hub"; // selection name from hit points LOD in object
                passThrough         = 0.1; // coefficient defining how much damage will pass into total damage when this hit point is damaged
                radius              = 0.08; // size of the hit point sphere, this is how it works: https://community.bistudio.com/wiki/Arma_3_Damage_Description
                explosionShielding  = 0.1; // multiplier of explosive damage (parameter: explosive > 0 in ammunition type)
                minimalHit          = 0.01; // minimal damage value that can be applied, damage below this threshold is ignored
            };
            class HitNeck: HitFace
            {
                armor                = 1;
                material            = -1;
                name                = "neck";
                passThrough            = 0.1;
                radius                = 0.1;
                explosionShielding    = 0.5;
                minimalHit            = 0.01;
            };
            class HitHead: HitNeck
            {
                armor                = 1;
                material            = -1;
                name                = "head";
                passThrough            = 0.1;
                radius                = 0.2;
                explosionShielding    = 0.5;
                minimalHit            = 0.01;
                depends                = "HitFace max HitNeck"; // returns the greater of HitFace and HitNeck
            };
            class HitPelvis
            {
                armor                = 1;
                material            = -1;
                name                = "pelvis";
                passThrough            = 0.1;
                radius                = 0.2;
                explosionShielding    = 1;
                visual                = "injury_body";
                minimalHit            = 0.01;
            };
            class HitAbdomen: HitPelvis
            {
                armor                = 1;
                material            = -1;
                name                = "spine1";
                passThrough            = 0.1;
                radius                = 0.15;
                explosionShielding    = 1;
                visual                = "injury_body";
                minimalHit            = 0.01;
            };
            class HitDiaphragm: HitAbdomen
            {
                armor                = 1;
                material            = -1;
                name                = "spine2";
                passThrough            = 0.1;
                radius                = 0.15;
                explosionShielding  = 6;
                visual                = "injury_body";
                minimalHit            = 0.01;
            };
            class HitChest: HitDiaphragm
            {
                armor                = 1;
                material            = -1;
                name                = "spine3";
                passThrough            = 0.1;
                radius                = 0.15;
                explosionShielding    = 6;
                visual                = "injury_body";
                minimalHit            = 0.01;
            };
            class HitBody: HitChest
            {
                armor                = 1000;
                material            = -1;
                name                = "body";
                passThrough            = 0.1;
                radius                = 0.16;
                explosionShielding    = 6;
                visual                = "injury_body";
                minimalHit            = 0.01;
                depends                = "HitPelvis max HitAbdomen max HitDiaphragm max HitChest"; // depends work only for hit points defined in inheritance chain
            };
            class HitArms
            {
                armor                = 1;
                material            = -1;
                name                = "arms";
                passThrough            = 1;
                radius                = 0.1;
                explosionShielding    = 1;
                visual                = "injury_hands";
                minimalHit            = 0.01;
            };
            class HitHands: HitArms
            {
                armor                = 1;
                material            = -1;
                name                = "hands";
                passThrough            = 1;
                radius                = 0.1;
                explosionShielding  = 1;
                visual                = "injury_hands";
                minimalHit            = 0.01;
                depends                = "HitArms";
            };
            class HitLegs
            {
                armor                = 1;
                material            = -1;
                name                = "legs";
                passThrough            = 1;
                radius                = 0.12;
                explosionShielding  = 1;
                visual                = "injury_legs";
                minimalHit            = 0.01;
            };
        };

        armor                    = 2; // keep constant among various soldiers so that the hit points armor coefficients remains on the same scale
        armorStructural            = 0.4; // divide all damage taken to total hit point, either directly or through hit point passThrough coefficient, must be adjusted for each model to achieve consistent total damage results
        explosionShielding        = 0.04; // for consistent explosive damage after adjusting = ( armorStructural / 10 )
        minTotalDamageThreshold    = 0.001; // minimalHit for total damage
        impactDamageMultiplier    = 0.5; // multiplier for falling damage

        hiddenSelections[] = {"Camo", "insiginia"}; /// selection defined in sections of model that may have texture and materials changed by setObjectTexture or next parameter
        hiddenSelectionsTextures[] = {"\a3\characters_f\common\data\basicbody_grey_co.paa"}; /// what texture does this soldier use for camo selection
        hideProxySelections[] = {"ghillie_hide"}; /// names of selections hidden on proxies (used in vest in this case, see overlaySelectionsInfo[])

        weapons[] = {Test_weapon_01_holo_pointer_F, Throw, Put}; /// we have a sample weapon, why not use it? Throw and put weapons are required for grenades/mines
        respawnWeapons[] = {Test_weapon_01_holo_pointer_F, Throw, Put}; /// should be the same as previous most of the time
        Items[] = {FirstAidKit}; /// one First aid kit is good to start with
        RespawnItems[] = {FirstAidKit};
        magazines[] = {30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, HandGrenade, HandGrenade};
        respawnMagazines[] = {30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, 30Rnd_test_mag, HandGrenade, HandGrenade};
        linkedItems[] = {V_Test_Vest, H_Test_Headgear, ItemMap, ItemCompass, ItemWatch, ItemRadio, NVGoggles}; /// items directly in inventory slots
        respawnLinkedItems[] = {V_Test_Vest, H_Test_Headgear, ItemMap, ItemCompass, ItemWatch, ItemRadio, NVGoggles};
    };

    class GHelm_Soldier_F: GHelm_Soldier_base_F /// class visible in editor
    {
        scope = 2; /// scope needs to be 2 to have a visible class
        displayName = "GHelm Player"; /// what's displayed in editor or on cursor over
        class EventHandlers;
    };

    class GHelm_Soldier_02_F: GHelm_Soldier_F
    {
        displayName = "GHelm Soldier (random headgear and facewear)";
        headgearList[] =
        {
            /* [headgearClass1, probability1, headgearClass2, probability2, ...] */
            "", 0.1, // Empty array means no headgear nor face wear
            "H_GHelm_Headgear", // Our test headgear, defined in CfgHeadegar.hpp
            "H_GHelm_Headgear_Fake", 0.9, // In this case, there is no headgear but there is a face wear
            "H_HelmetB_light", 0.6,
            "H_Booniehat_khk_hs", 0.4,
            "H_HelmetIA_net", 0.4,
            "H_HelmetIA_camo", 0.4,
            "H_HelmetB_grass", 0.4
        };
        class EventHandlers: EventHandlers
        {
            // Documentation: https://community.bistudio.com/wiki/BIS_fnc_unitHeadgear
            // Args: Units, [] (headgear pool), [] (face wear pool)
            init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear;};";
        };
    };

    // Soldier with a randomized headgear only
    class GHelm_Soldier_03_F: GHelm_Soldier_02_F
    {
        displayName = "GHelm Soldier (random headgear only)";
        headgearList[] =
        {
            "H_HelmetIA", 0.4,
            "H_HelmetIA_net", 0.4,
            "H_HelmetIA_camo", 0.4
        };
        class EventHandlers: EventHandlers
        {
            // Args: Units, [] (headgear pool), false (face wear pool)
            init = "if (local (_this select 0)) then {[(_this select 0), [], false] call BIS_fnc_unitHeadgear;};";
        };
    };

    // Solider with a randomized face wear but no headgear
    class GHelm_Soldier_04_F: GHelm_Soldier_02_F
    {
        // Same as the others, except for the headgear which is H_Test_Headgear_Fake, declared in CfgHeadegar.hpp
        linkedItems[] = {V_Test_Vest, H_Test_Headgear_Fake, ItemMap, ItemCompass, ItemWatch, ItemRadio, NVGoggles}; /// items directly in inventory slots
        class EventHandlers: EventHandlers
        {
            // Args: Units, [] (headgear pool), [] (face wear pool)
            init = "if (local (_this select 0)) then {[(_this select 0), [], []] call BIS_fnc_unitHeadgear;};";
        };
    };
};

class cfgWeapons
{
    class InventoryItem_Base_F;
    class ItemCore;
    #include "cfgHeadgear.hpp"    /// sample cap is defined in a separate file to make it cleaner
};

 

 

|MODEL.CFG|

 

class CfgSkeletons
{
    class Default
    {
        isDiscrete = 1;
        skeletonInherit = "";
        skeletonBones[] = {};
    };
    class OFP2_ManSkeleton
    {
        isDiscrete = 0;
        skeletonInherit = "";
        skeletonBones[] =
        {
            "Pelvis","",
            "Spine","Pelvis",
            "Spine1","Spine",
            "Spine2","Spine1",
            "Spine3","Spine2",
            "Camera","Pelvis",
            "weapon","Spine1",
            "launcher","Spine1",
            
            // Head skeleton in hierarchy
            "neck","Spine3",
            "neck1","neck",
            "head","neck1",
            
            // New facial features
            "Face_Hub","head",
            "Face_Jawbone","Face_Hub",
            "Face_Jowl","Face_Jawbone",
            "Face_chopRight","Face_Jawbone",
            "Face_chopLeft","Face_Jawbone",
            "Face_LipLowerMiddle","Face_Jawbone",
            "Face_LipLowerLeft","Face_Jawbone",
            "Face_LipLowerRight","Face_Jawbone",
            "Face_Chin","Face_Jawbone",
            "Face_Tongue","Face_Jawbone",
            "Face_CornerRight","Face_Hub",
            "Face_CheekSideRight","Face_CornerRight",
            "Face_CornerLeft","Face_Hub",
            "Face_CheekSideLeft","Face_CornerLeft",
            "Face_CheekFrontRight","Face_Hub",
            "Face_CheekFrontLeft","Face_Hub",
            "Face_CheekUpperRight","Face_Hub",
            "Face_CheekUpperLeft","Face_Hub",
            "Face_LipUpperMiddle","Face_Hub",
            "Face_LipUpperRight","Face_Hub",
            "Face_LipUpperLeft","Face_Hub",
            "Face_NostrilRight","Face_Hub",
            "Face_NostrilLeft","Face_Hub",
            "Face_Forehead","Face_Hub",
            "Face_BrowFrontRight","Face_Forehead",
            "Face_BrowFrontLeft","Face_Forehead",
            "Face_BrowMiddle","Face_Forehead",
            "Face_BrowSideRight","Face_Forehead",
            "Face_BrowSideLeft","Face_Forehead",
            "Face_Eyelids","Face_Hub",
            "Face_EyelidUpperRight","Face_Hub",
            "Face_EyelidUpperLeft","Face_Hub",
            "Face_EyelidLowerRight","Face_Hub",
            "Face_EyelidLowerLeft","Face_Hub",
            "EyeLeft","Face_Hub",
            "EyeRight","Face_Hub",            
            
            // Left upper side
            "LeftShoulder","Spine3",
            "LeftArm","LeftShoulder",
            "LeftArmRoll","LeftArm",
            "LeftForeArm","LeftArmRoll",
            "LeftForeArmRoll","LeftForeArm",
            "LeftHand","LeftForeArmRoll",
            "LeftHandRing","LeftHand",
            "LeftHandRing1","LeftHandRing",
            "LeftHandRing2","LeftHandRing1",
            "LeftHandRing3","LeftHandRing2",
            "LeftHandPinky1","LeftHandRing",
            "LeftHandPinky2","LeftHandPinky1",
            "LeftHandPinky3","LeftHandPinky2",
            "LeftHandMiddle1","LeftHand",
            "LeftHandMiddle2","LeftHandMiddle1",
            "LeftHandMiddle3","LeftHandMiddle2",
            "LeftHandIndex1","LeftHand",
            "LeftHandIndex2","LeftHandIndex1",
            "LeftHandIndex3","LeftHandIndex2",
            "LeftHandThumb1","LeftHand",
            "LeftHandThumb2","LeftHandThumb1",
            "LeftHandThumb3","LeftHandThumb2",
            
            // Right upper side
            "RightShoulder","Spine3",
            "RightArm","RightShoulder",
            "RightArmRoll","RightArm",
            "RightForeArm","RightArmRoll",
            "RightForeArmRoll","RightForeArm",
            "RightHand","RightForeArmRoll",
            "RightHandRing","RightHand",
            "RightHandRing1","RightHandRing",
            "RightHandRing2","RightHandRing1",
            "RightHandRing3","RightHandRing2",
            "RightHandPinky1","RightHandRing",
            "RightHandPinky2","RightHandPinky1",
            "RightHandPinky3","RightHandPinky2",
            "RightHandMiddle1","RightHand",
            "RightHandMiddle2","RightHandMiddle1",
            "RightHandMiddle3","RightHandMiddle2",
            "RightHandIndex1","RightHand",
            "RightHandIndex2","RightHandIndex1",
            "RightHandIndex3","RightHandIndex2",
            "RightHandThumb1","RightHand",
            "RightHandThumb2","RightHandThumb1",
            "RightHandThumb3","RightHandThumb2",
            
            // Left lower side
            "LeftUpLeg","Pelvis",
            "LeftUpLegRoll","LeftUpLeg",
            "LeftLeg","LeftUpLegRoll",
            "LeftLegRoll","LeftLeg",
            "LeftFoot","LeftLegRoll",
            "LeftToeBase","LeftFoot",
            
            // Right lower side
            "RightUpLeg","Pelvis",
            "RightUpLegRoll","RightUpLeg",
            "RightLeg","RightUpLegRoll",
            "RightLegRoll","RightLeg",
            "RightFoot","RightLegRoll",
            "RightToeBase","RightFoot"
        };
        // location of pivot points (local axes) for hierarchical animation
        pivotsModel="A3\anims_f\data\skeleton\SkeletonPivots.p3d";
    };
};

class CfgModels
{
    class Default
    {
        sectionsInherit="";
        sections[] = {};
        skeletonName = "";
    };

    class ArmaMan: Default
    {
        htMin = 60;          // Minimum half-cooling time (in seconds)
        htMax = 1800;        // Maximum half-cooling time (in seconds)
        afMax = 30;          // Maximum temperature in case the model is alive (in celsius)
        mfMax = 0;           // Maximum temperature when the model is moving (in celsius)
        mFact = 1;           // Metabolism factor - number from interval <0, 1> (0 - metabolism has no influence, 1 - metabolism has full influence (no other temperature source will be considered)).
        tBody = 37;  // Metabolism temperature of the model (in celsius)

        sections[] =
        {
            "osobnost","Head_Injury","Body_Injury","l_leg_injury","l_arm_injury","r_arm_injury","r_leg_injury", "injury_body", "injury_legs", "injury_hands",
            "clan","clan_sign","Camo","CamoB","Camo1","Camo2","personality","hl", "injury_head", "insignia", "ghillie_hide"
        };
        skeletonName = "OFP2_ManSkeleton";
    };

    class A3_headgear_example: ArmaMan{};
    class A3_headgear_NVGslot: ArmaMan{};
    class A3_character_example: ArmaMan{};
    class A3_vest_example: ArmaMan{};
    class Model: Armaman{};
};

 

 

Share this post


Link to post
Share on other sites

as in it has to have "Head" assigned to it within the model selection window, otherwise it will float between his legs.

Share this post


Link to post
Share on other sites

You appear to be missing 'weighting' - how the points of the model map to the skeleton that's used for animating the character. Without that, your model knows it needs to exist, but not where to 'stick' on the model and move. Is it supposed to be stuck to the scalp? The leg? The tip of the right hand ring finger? Without weighting, the game has no idea.

 

To fix it as road runner suggested, open Object builder, select all of your model, then create a selection called 'Head' (find a list that looks like the one in the lower right hand corner of the image below, right click in some empty space in that list & select New). And that's it!

 

maxresdefault.jpg

 

 

If you've done that and it's still out of place, it'll just be a matter of moving the model until it fits on the head properly. There should be an example in the arma 3 sample models for headgear that you can use as a guide.

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×