Ok, so
you must have relevant sections defined in the cfgmodels, AND defined in the p3d model :
PHP Code:
class CfgModels
{
class Default
{
sections[]={};
sectionsInherit="";
};
class Man: Default
{
sections[] =
{
"head injury","body injury",
"l arm injury","r arm injury","p arm injury",
"l leg injury","r leg injury","p leg injury",
"medic",
"hlava",
"krk",
"zasleh",
"armpatch"
};
sectionsInherit=Head;
};
class my_soldier Man{
sections[]={"helmet","arm","jacket"};
sectionsInherit="man";
};
};
Then, a hiddenselection entry in the cfgvehicles :
PHP Code:
class CfgVehicles
{
class All{};
class AllVehicles: All{};
class Land: AllVehicles{};
class Man: Land{};
class Soldier: Man{};
class Civilian: Man{};
class SoldierWB: Soldier{};
class OfficerW: SoldierWB{};
class SoldierEB: Soldier{};
class OfficerE: SoldierEB{};
class SoldierGB: Soldier{};
class OfficerG: SoldierGB{};
class my_soldier: SoldierWB
{
vehicleclass="blabla";
side=TWest;
displayName="my beautiful soldier";
model="\path to my model\my_soldier.p3d";
hiddenSelections[]={"helmet","arm","jacket"};
weapons[]={blabla};
magazines[]={blabla};
};
};
Then you can use a script to hide / unhide hidden selection AND to change their textures by script with the setobjecttexture command :
[name of the soldier] exec "texture.sqs" :
Texture.sqs :
PHP Code:
_soldier = _this Select 0
_soldier setObjectTexture [0, "\path to my texture\my_texture.pac"]
Exit
"0" in the setobjecttexture array points to the first element of the hiddenselections array ("helmet" in this example) :
PHP Code:
_soldier setObjectTexture [1, "\path to my texture\my_texture.pac"]
points to the second element, "arm" here.
Finally, the quality of the texture loaded may be bad (i still don't know why), so it's usually better if the texture is loaded BEFORE the setobjettexture command is launched (for example, one vertice of the model is already textured with this texture).