====== ArmA 2 hiddenSelectionsTextures ======
[[https://www.pmctactical.org/forum/viewforum.php?f=50|ArmA 2 Forum]], [[:arma2|ArmA 2 Home]], [[arma2:config|ArmA 2 Config]], [[arma2:file_formats|ArmA 2 File Formats]], [[arma2:missions|ArmA 2 Missions]], [[arma2:modeling|ArmA 2 3D Modeling]], [[arma2:scripting|ArmA 2 Scripting]], [[arma2:terrain|ArmA 2 Terrain]], [[arma2:texturing|ArmA 2 Texturing]], [[arma2:tools|ArmA 2 Tools]]
See also [[arma:texturing:custom_texture|ArmA custom texture]] and [[arma2:texturing:setobjecttexture|setObjectTexture]].
====== hiddenSelections[] ======
CfgVehicles
Defines selections on the model, which are not shown at mission startup.
This is useful for creating variations of one model, where the different selections are left out with hiddenSelections. VBS2 uses the "hiddenselections" set of parameters for varying clothing on the same model, hiding parts such as hat and scarf to give the appearance of different units from the same p3d model. Hiddenselections are also used for uniform swapping, e.g., between woodland and desert camo patterns.
hiddenSelections[] = {"swap_robe","hide_vest","hide_scarf", "hide_teamcolor"};
Selections to be hidden must be defined as **sections** in the model.cfg (in the sections[] array within cfgModels). Once set up,the texture of a hidden selection can be changed during run-time using scripting commands such as "setObjectTexture" and "setObjectTextureGlobal".
To make config.cpp files easier to read and write a number of defined strings have been provided. You can use the predefined string in place of the numerical value, e.g.,
hiddenSelections[] = {"swap_robe","hide_vest","hide_scarf", STANDARD_PEOPLE_SELECTIONS};
Predefined Strings [people_defines.hpp]:
STANDARD_PEOPLE_SELECTIONS = "hide_teamcolor"
STANDARD_SOLDIER_SELECTIONS = "swap_bdu","hide_teamcolor","hide_medic"
Note: the actual selections need to be named in the p3d model, i.e., "hide_teamcolor" is the named selection in the model, not STANDARD_PEOPLE_SELECTIONS.
Known bug: After restoring a saved SP game, all hiddenSelections revert to their original texture
====== hiddenSelectionsTextures[] ======
CfgVehicles
Allows you to assign a texture to a hidden selection which will be visible once the simulation is started (instead of being hidden). The ordering matches that of the hiddenSelections[] array. (So, the first hidden selection will take the first texture listed in the hiddenSelectionsTexture[] array, and so on. HiddenSelections elements without a corresponding entry in the hiddenSelectionsTextures array will remain hidden.).
hiddenSelections[] = {"swap_bdu", "hide_teamcolor"};
hiddenSelectionsTextures[] = {__CurrentDir__\data\civ_suit_black_co};
In the example above, the hiddenSelectionsTextures applies the first listed texture to the first selection in the hiddenSelections array, i.e., the "swap_bdu" selection is textured with the "civ_suit_black_co.paa" texture. "hide_teamcolor" remains hidden since there is only one texture listed in hiddenSelectionsTextures.
Where this parameter is powerful is the ability to now add another person class with a different colored suit, using the same p3d model, e.g.,
hiddenSelectionsTextures[] = {__CurrentDir__\data\civ_suit_greystripes_co};
====== hiddenSelectionsRandomTextures[] ======
CfgVehicles
Randomly assigns a texture to a hidden selection. Similar to the hiddenSelectionsTextures[] array, only it is an array of arrays of textures, each "sub" array applies to the corresponding element in the hiddenSelections array.
hiddenSelections[] = {"swap_robe","hide_vest","hide_scarf"};
hiddenSelectionsTextures[] = {__CurrentDir__\data\afg_robeblack_co,"",""};
hiddenSelectionsRandomTextures[] =
{
//robe
{
__CurrentDir__\data\afg_robeblack_co,
__CurrentDir__\data\afg_robeblue_co,
__CurrentDir__\data\afg_robebrown_co,
__CurrentDir__\data\afg_robepink_co,
},
//vest
{
__CurrentDir__\data\afg_equip_co,
"", //hide selection entirely - hide vest 1/2 of the time
},
//scarf
{
__CurrentDir__\data\afg_scarfblack_co,
__CurrentDir__\data\afg_scarfblue_co,
__CurrentDir__\data\afg_scarfbrown_co,
"",
"",
"" //hide scarf 1/2 of the time
}
};
Empty quotes ("") can be used to hide the selection entirely. Each "sub" array of random textures can have a different number of different textures.
====== Soldier hiddenSelections ======
hiddenSelectionsTextures[] =
{
"\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_1_co.paa"
};
class EventHandlers: EventHandlers
{
init = "(_this select 0) setObjectTexture
[
0,
[
""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_1_co.paa"",
""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_2_co.paa"",
""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_3_co.paa"",
""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_4_co.paa"",
""\CA\characters_E\civil\Tak_civil01\Data\Tak_civil01_5_co.paa""
]
select floor random 5
]";
};