Jump to content
Sign in to follow this  
Kuzuri

Hidden Selection Textures issue Custom Helmet

Recommended Posts

Hi, I have a problem getting hidden selection textures to show for a custom helmet mod: Heré's what I've done to make it work:

 

1) I've made the selection in Object Builder using the whole model and called it "Camo".

 

2) Added it in CfgModels to sections.

 

3) This is the CfgWeapons:

class cfgWeapons {
class ItemCore; 
class HeadgearItem; 
 
   class Pak_Vch_Blk : ItemCore {
author = "Kuzuri, Zayden";
dlc = "Dawn";
scope = 2;
weaponPoolAvailable = 1;
displayName = "Vehicle Crew Helmet (Black)";
model = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";
hiddenSelections[] = {"Camo"}; 
   
class ItemInfo : HeadgearItem {
mass = 40;
uniformModel = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";
modelSides[] = {3, 1};
 
 
       class HitpointsProtectionInfo {
               class Head {
               hitpointName = "HitHead" 
               Armor = 8;
               passThrough = 0.5;
   };
};
};
};
 
   class Pak_Vch_Wht : Pak_Vch_Blk {
author = "Kuzuri, Zayden";
displayName = "Vehicle Crew Helmet (White)";
hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Wht_co.paa"};
};
 
   class Pak_Vch_Khk : Pak_Vch_Blk {
author = "Kuzuri, Zayden";
displayName = "Vehicle Crew Helmet (Khaki)";
hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Khk_co.paa"};
};
 
class Pak_Vch_Grn : Pak_Vch_Blk {
author = "Kuzuri, Zayden";
displayName = "Vehicle Crew Helmet (Green)";
hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Grn_co.paa"};
};
};

 

Share this post


Link to post
Share on other sites

I beleive for certain items (helmets included) 'hiddenSelectionsTextures' needs to be within the itemInfo subclass:

e.g.

class ItemInfo : HeadgearItem 
{
mass = 40;
uniformModel = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";
hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Wht_co.paa"};
modelSides[] = {3, 1};
};

Share this post


Link to post
Share on other sites

Thanks for the quick reply.

 

No, I've already tried defining it under Class ItemInfo, it doesn't work. The net result is the same, I have the base texture which I attached to the .p3d on all variants.

 

Any other ideas?

Share this post


Link to post
Share on other sites

Selections are case-sensitive, so is the selection definitely named 'Colour' within the model itself? If its 'colour' it wont work. The reason I ask is your model.cfg references the selection with a capitalised 'C' and your post makes mention of the selection with a lower-case 'c'.

Share this post


Link to post
Share on other sites

Sorry about that in the post, it's definitely upper-case in everything, no mistakes there.

Share this post


Link to post
Share on other sites
Just to clarify what the code looks like with the hiddenSelectionsTextures under class ItemInfo:

 


class cfgWeapons {

class ItemCore;

class HeadgearItem;

 

class Pak_Vch_Blk : ItemCore {

hiddenSelections[] = {"Colour"};

author = "Kuzuri, Zayden";

dlc = "Dawn";

scope = 2;

weaponPoolAvailable = 1;

displayName = "Vehicle Crew Helmet (Black)";

model = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";

 

class ItemInfo : HeadgearItem {

mass = 40;

uniformModel = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";

modelSides[] = {3, 1};

 

 

       class HitpointsProtectionInfo {

               class Head {

               hitpointName = "HitHead"

               Armor = 8;

               passThrough = 0.5;

   };

};

};

};

 

class Pak_Vch_Wht : Pak_Vch_Blk {

author = "Kuzuri, Zayden";

displayName = "Vehicle Crew Helmet (White)";

 

class ItemInfo : HeadgearItem {

mass = 40;

uniformModel = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";

hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Wht_co.paa"};

modelSides[] = {3, 1};

};

};

 

   class Pak_Vch_Khk : Pak_Vch_Blk {

author = "Kuzuri, Zayden";

displayName = "Vehicle Crew Helmet (Khaki)";

hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Khk_co.paa"};

};

 

class Pak_Vch_Grn : Pak_Vch_Blk {

author = "Kuzuri, Zayden";

displayName = "Vehicle Crew Helmet (Green)";

hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Grn_co.paa"};

};

};


 

The issue with specifying it under ItemInfo is the child class no longer inherits anything from the parent class: So in game the helmet has disappeared completely and it's protection stats are no longer inherited either. so then I transfer properties from the parent class to the child class and it looks like this:



class cfgWeapons {

class ItemCore;

class HeadgearItem;

 

   class Pak_Vch_Blk : ItemCore {

hiddenSelections[] = {"Colour"};

author = "Kuzuri, Zayden";

dlc = "Dawn";

scope = 2;

weaponPoolAvailable = 1;

displayName = "Vehicle Crew Helmet (Black)";

picture = "\genoma_helmets\data\UI\Type2desert.paa";

model = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";

 

   class ItemInfo : HeadgearItem {

mass = 40;

uniformModel = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";

modelSides[] = {3, 1};

 

 

       class HitpointsProtectionInfo {

               class Head {

               hitpointName = "HitHead"

               Armor = 8;

               passThrough = 0.5;

   };

};

};

};

 

   class Pak_Vch_Wht : Pak_Vch_Blk {

author = "Kuzuri, Zayden";

displayName = "Vehicle Crew Helmet (White)";

picture = "\genoma_helmets\data\UI\Type3desert.paa";

model = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";

       

class ItemInfo : HeadgearItem {

            mass = 40;

uniformModel = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";

hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Wht_co.paa"};

modelSides[] = {3, 1};

 

               class HitpointsProtectionInfo {

               class Head {

               hitpointName = "HitHead"

               Armor = 8;

               passThrough = 0.5;

   };

};

};

};

 

   class Pak_Vch_Khk : Pak_Vch_Blk {

author = "Kuzuri, Zayden";

displayName = "Vehicle Crew Helmet (Khaki)";

picture = "\genoma_helmets\data\UI\Type3desert.paa";

hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Khk_co.paa"};

};

 

class Pak_Vch_Grn : Pak_Vch_Blk {

author = "Kuzuri, Zayden";

displayName = "Vehicle Crew Helmet (Green)";

picture = "\genoma_helmets\data\UI\Type3desert.paa";

hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Grn_co.paa"};

};

};

 



 

 

However, that brings me back to square one with the model having the original .p3d texture, and not the hiddenSelectionsTextures I specified.

 

Thoughts? Has Bohemia changed the way hidden selections are handled?

Share this post


Link to post
Share on other sites

Thoughts? Has Bohemia changed the way hidden selections are handled?

No, because every addon I've made that uses HiddenSelections still work...

Also, put your config code within the code box, not spoilers as spoilers fuck mess up the formatting hard making it harder to follow.

Share this post


Link to post
Share on other sites

Okay, uhhh how do i do that? Put it in a code box that is.

Share this post


Link to post
Share on other sites

Alright, figured it out, courtesy my co-author... You have to have hiddenSelections[] = {"Camo"}; added in the base class, in this case "class Pak_Vch_Blk", If you don't the model will disappear when you add it to "class ItemInfo" (which is need to make hiddenselections work in the first place.)  The code I used to make it work is below, leaving it here to help anyone who needs it.

 

HiddenSelectionsTextures does not have to be added in ItemInfo, you can just add it to the Child classes. Thanks Jackal326!

class cfgWeapons {
class ItemCore; 
class HeadgearItem; 
 
   class Pak_Vch_Blk : ItemCore {
author = "Kuzuri, Zayden";
dlc = "Dawn";
scope = 2;
weaponPoolAvailable = 1;
displayName = "Vehicle Crew Helmet (Black)";
model = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";
hiddenSelections[] = {"Camo"};
hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Blk_co.paa"};
 
   class ItemInfo : HeadgearItem {
mass = 40;
uniformModel = "\Vehicle_Crew_Helmet\Data\Models\Veh_Crw_Hlm";
modelSides[] = {3, 1};
hiddenSelections[] = {"Camo"};
 
 
       class HitpointsProtectionInfo {
               class Head {
               hitpointName = "HitHead" 
               Armor = 8;
               passThrough = 0.5;
   };
};
};
};
 
   class Pak_Vch_Wht : Pak_Vch_Blk {
author = "Kuzuri, Zayden";
displayName = "Vehicle Crew Helmet (White)";
hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Wht_co.paa"};
       
};
 
   class Pak_Vch_Khk : Pak_Vch_Blk {
author = "Kuzuri, Zayden";
displayName = "Vehicle Crew Helmet (Khaki)";
hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Khk_co.paa"};
};
 
class Pak_Vch_Grn : Pak_Vch_Blk {
author = "Kuzuri, Zayden";
displayName = "Vehicle Crew Helmet (Green)";
hiddenSelectionsTextures[] = {"\Vehicle_Crew_Helmet\Data\Textures\Pak_Hpg_Grn_co.paa"};
};
};
  • Like 1

Share this post


Link to post
Share on other sites

I've just released a MICH2001 addon, that has over 28 hidden selections, so nothing wrong my end.


This is how I have set up all the classes, you must define the base model first, that uses the default texture applied in O2, it's the subsequent models that will all be using the "Hidden selection texture"

class cfgWeapons
{
    class H_HelmetB;
    class ItemCore;
    class InventoryItem_Base_F;
    class HeadgearItem;



    class MICH2001: H_HelmetB
    {
        scope = 2;
        dlc = "DEVGRU";
        weaponPoolAvailable = 1;
        displayName = "MICH2001 camo 1";
        picture = "MICH2001\ui\mich2001_helmet_ui.paa";
        model = "\MICH2001\MICH_2001_1";
        hiddenSelections[] = {"_NVGArm",
                              "_Bungee",        
                              "_Bungee2",
                              "_Shroud",
                              "_NVGMount",
                              "_MantaRear",
                              "_SureFire",
                              "_SureFire2",
                              "_VLiteRear",
                              "_VLiteTop",
                              "_VLiteNav",
                              "_ContourHD",
                              "_HelmHeadset2",
                              "_HelmHeadset3",
                              "_HelmHeadset4",
                              "_HelmGoggles",
                              "_HelmStrobeBack",
                              "_HelmNVGStrap",
                              "_HelmStrobeRear",
                              "_HelmStrobeTop",
                              "_HelmNVGBattery",
                              "_HelmRail"};
        hiddenSelectionsTextures[] = {};
        author = "Road Runner";
                
                  

        class ItemInfo: HeadgearItem
        {
            mass = 20;
            uniformmodel = "\MICH2001\MICH_2001_1";
        hiddenSelections[] = {"_NVGArm",
                              "_Bungee",        
                              "_Bungee2",
                              "_Shroud",
                              "_NVGMount",
                              "_MantaRear",
                              "_SureFire",
                              "_SureFire2",
                              "_VLiteRear",
                              "_VLiteTop",
                              "_VLiteNav",
                              "_ContourHD",
                              "_HelmHeadset2",
                              "_HelmHeadset3",
                              "_HelmHeadset4",                              
                              "_HelmGoggles",
                              "_HelmStrobeBack",
                              "_HelmNVGStrap",
                              "_HelmStrobeRear",
                              "_HelmStrobeTop",
                              "_HelmNVGBattery",
                              "_HelmRail"};
            modelSides[] = {3,1};
         class HitpointsProtectionInfo
            {
                class Head
                {
                    hitpointName = "HitHead";
                    armor = 6;
                    passThrough = 0.5;
                };
            };
        };
    };

    class MICH_2001_2: MICH2001
    {
        scope = 2;
        dlc = "DEVGRU";
        weaponPoolAvailable = 1;
        displayName = "MICH2001 camo 2";
        picture = "MICH2001\ui\mich2001_helmet_ui.paa";
        model = "\MICH2001\MICH_2001_1";
        hiddenSelections[] =     {"Camo",
                                  "_NVGArm",
                                  "_Bungee",        
                                  "_Bungee3",
                                  "_NOROTOS",
                                  "_NVGMount",
                                  "_MantaTop",
                                  "_SureFire",
                                  "_SureFire2",
                                  "_VLiteRear",
                                  "_VLiteTop",
                                  "_ContourHD",
                                  "_HelmGoggles",
                                  "_HelmNVGStrap",
                                  "_HelmStrobeRear",
                                  "_HelmStrobeBack",                              
                                  "_HelmStrobeTop",
                                  "_HelmHeadset",
                                  "_HelmHeadset3",
                                  "_HelmHeadset4",                                  
                                  "_HelmHeadstrap"};
        hiddenSelectionsTextures[] = {"\MICH2001\tx\Helmet_2_co.paa"};
        author = "Road Runner";
                
                  

        class ItemInfo: HeadgearItem
        {
            mass = 20;
            uniformmodel = "\MICH2001\MICH_2001_1";
        hiddenSelections[] =     {"Camo",
                                  "_NVGArm",
                                  "_Bungee",        
                                  "_Bungee3",
                                  "_NOROTOS",
                                  "_NVGMount",
                                  "_MantaTop",
                                  "_SureFire",
                                  "_SureFire2",
                                  "_VLiteRear",
                                  "_VLiteTop",
                                  "_ContourHD",
                                  "_HelmGoggles",
                                  "_HelmNVGStrap",
                                  "_HelmStrobeRear",
                                  "_HelmStrobeBack",                              
                                  "_HelmStrobeTop",
                                  "_HelmHeadset",
                                  "_HelmHeadset3",
                                  "_HelmHeadset4",                                  
                                  "_HelmHeadstrap"};
        hiddenSelectionsTextures[] = {"\MICH2001\tx\Helmet_2_co.paa"};
            modelSides[] = {3,1};
         class HitpointsProtectionInfo
            {
                class Head
                {
                    hitpointName = "HitHead";
                    armor = 6;
                    passThrough = 0.5;
                };
            };
        };
    };

  • Like 1

Share this post


Link to post
Share on other sites

You have to have the hiddenSelections[] property in the ItemInfo subclass, not hiddenSelectionsTextures[].

Share this post


Link to post
Share on other sites

You have to have the hiddenSelections[] property in the ItemInfo subclass, not hiddenSelectionTextures[].

Can you elaborate a bit more please mate, as the MICH2001 addon I made works perfectly the way I have it set up. 

Edit my config to show me more clearer what you mean, if you don't mind?

Am I right in saying the selections only need to be in this part?

 

 class ItemInfo: HeadgearItem

        {

            mass = 20;

            uniformmodel = "\MICH2001\MICH_2001_1";

        hiddenSelections[] =     {"Camo",

                                  "_NVGArm",

                                  "_Bungee",        

                                  "_Bungee3",

                                  "_NOROTOS",

                                  "_NVGMount",

                                  "_MantaTop",

                                  "_SureFire",

                                  "_SureFire2",

                                  "_VLiteRear",

                                  "_VLiteTop",

                                  "_ContourHD",

                                  "_HelmGoggles",

                                  "_HelmNVGStrap",

                                  "_HelmStrobeRear",

                                  "_HelmStrobeBack",                              

                                  "_HelmStrobeTop",

                                  "_HelmHeadset",

                                  "_HelmHeadset3",

                                  "_HelmHeadset4",                                  

                                  "_HelmHeadstrap"};

        hiddenSelectionsTextures[] = {"\MICH2001\tx\Helmet_2_co.paa"};

            modelSides[] = {3,1};

         class HitpointsProtectionInfo

            {

                class Head

                {

                    hitpointName = "HitHead";

                    armor = 6;

                    passThrough = 0.5;

                };

            };

        };

    };

Share this post


Link to post
Share on other sites

In the config of the item class itself, you need both hiddenSelections[] and hiddenSelectionsTextures[] (unless you inherit them, of course). In the ItemInfo subclass, you need hiddenSelections[] only (the texture is taken from the item class). What confuses me is the amount of selections in your hiddenSelections[] property; only the selection which you assign a texture to via hiddenSelectionsTextures[] (or hiddenSlectionsMaterials[]) has to be there.

  • Like 1

Share this post


Link to post
Share on other sites

In the config of the item class itself, you need both hiddenSelections[] and hiddenSelectionsTextures[] (unless you inherit them, of course). In the ItemInfo subclass, you need hiddenSelections[] only (the texture is taken from the item class). What confuses me is the amount of selections in your hiddenSelections[] property; only the selection which you assign a texture to via hiddenSelectionsTextures[] (or hiddenSlectionsMaterials[]) has to be there.

That's what I have, all these selections are separate items, however all from the same texture, if I didn't "hide them as selections"  then they'd all show or be hidden by default.

The items that have separate textures such as the manta and the HD contour don't need to have the texture hidden, it's a default texture from the base model, unless I was planning to use alternate camo's, then I'd have the textures as hidden also.

 

If I wanted to, I could Group items together cutting down the amount of selections available.

I have something like 28 separate items on the helmet model, so from a single model, I can make, with the 30 odd textures, over 15,000 variations pure overkill of course, but it shows that it's possible to have headgear that can be fully customisable for "eye candy" purposes.

Share this post


Link to post
Share on other sites

Let me explain. :) The game takes the hiddenSelections array and hiddenSelectionsTextures array, and applies the n-th texture from hiddenSelectionsTextures to the n-th selection from hiddenSelections; the rest of the selections from the model use the texture that is assigned to them in the model. Generally, you need as many hiddenSelections as you have textures which you want to change in a config. (That means you don't have to use hiddenSelections at all, if you just want to use what you have in the model.) By the way, your config above effectively does this: the one texture you have in hiddenSelectionsTextures is applied to the first selection you have in hiddenSelections ("camo"), and that's about it. :)

  • Like 2

Share this post


Link to post
Share on other sites

Let me explain. :) The game takes the hiddenSelections array and hiddenSelectionsTextures array, and applies the n-th texture from hiddenSelectionsTextures to the n-th selection from hiddenSelections; the rest of the selections from the model use the texture that is assigned to them in the model. Generally, you need as many hiddenSelections as you have textures which you want to change in a config. (That means you don't have to use hiddenSelections at all, if you just want to use what you have in the model.) By the way, your config above effectively does this: the one texture you have in hiddenSelectionsTextures is applied to the first selection you have in hiddenSelections ("camo"), and that's about it. :)

Thanks, it's pretty technical talk lol

Share this post


Link to post
Share on other sites

I can try to explain it more simply, if you have any questions; no worries. :)

Share this post


Link to post
Share on other sites

I appreciate that you'd take the time.

My understanding is that Hidden selections are basically parts of the model you DON'T want seen

 

Hidden selection textures allows you change the textures on the fly of said selections?

Share this post


Link to post
Share on other sites

HiddenSelections is a list of selections that can have their texture or material changed with either hiddenSelectionsTextures / hiddenSelectionsMaterials in a config and with setObjectTexture / setObjectMaterial commands. If no texture is set in hiddenSelectionsTextures for a selection listed in hiddenSelections, then the selection will be hidden (= will have no texture).

  • Like 2

Share this post


Link to post
Share on other sites

That's interesting Locklear, I thought as much, although I also thought that hidden selections also mean that it was possible to hide individually assigned parts, regardless of their textures?

I love it and what it can do, I have been able to get this working on a single vest model too, by having the various pouches and addon bits of shit, by "hiding them" it offers so much more variation, throw in the hidden selection texture and you can have 4-5 different cammo patterns, along with a multitude of variations. 

Not sure that's what BIS had in mind when they created that little beauty, but man I'm glad they did.. no more multiple models, just multiple selections!! I've been using this feature for several years now.

 

Once again thank you for your time and expertise.

Share this post


Link to post
Share on other sites

Glad to help. :)

 

Just a random thought: if you "hide" a selection thanks to assigning it no texture via this hiddenSelections magic, it doesn't affect the shadow LOD of the model, so the selection still casts shadow. Thus it might be a better idea just to use a new model.

Share this post


Link to post
Share on other sites

Glad to help. :)

 

Just a random thought: if you "hide" a selection thanks to assigning it no texture via this hiddenSelections magic, it doesn't affect the shadow LOD of the model, so the selection still casts shadow. Thus it might be a better idea just to use a new model.

I'm was sure if the named selection was named in the shadow LOD too, that it was hidden too, but I could be wrong - you're more likely to know than I am :P

Share this post


Link to post
Share on other sites

Glad to help. :)

 

Just a random thought: if you "hide" a selection thanks to assigning it no texture via this hiddenSelections magic, it doesn't affect the shadow LOD of the model, so the selection still casts shadow. Thus it might be a better idea just to use a new model.

only if that selections been made with shadows lods :D only thing that's casting a shadow is the helmet itself, adding shadow LODS to all these small attachments just increases the poly count, they're small objects as it is.

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
Sign in to follow this  

×