User Tools

Site Tools


arma2:texturing:hiddenselectionstextures

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
arma2:texturing:hiddenselectionstextures [2011-07-01 13:47]
arma2:texturing:hiddenselectionstextures [2011-07-01 13:47]
snakeman added soldier hiddenselectionstextures header.
Line 1: Line 1:
 +====== hiddenSelectionsTextures ======
  
 +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.
 +<code cpp>
 +hiddenSelections[] = {"​swap_robe","​hide_vest","​hide_scarf",​ "​hide_teamcolor"​};​
 +</​code>​
 +
 +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.,
 +<code cpp>
 +hiddenSelections[] = {"​swap_robe","​hide_vest","​hide_scarf",​ STANDARD_PEOPLE_SELECTIONS};​
 +</​code>​
 +
 +Predefined Strings [people_defines.hpp]:​
 +<code cpp>
 +STANDARD_PEOPLE_SELECTIONS = "​hide_teamcolor"​
 +STANDARD_SOLDIER_SELECTIONS = "​swap_bdu","​hide_teamcolor","​hide_medic"​
 +</​code>​
 +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.).
 +<code cpp>
 +hiddenSelections[] = {"​swap_bdu",​ "​hide_teamcolor"​};​
 +
 +hiddenSelectionsTextures[] = {__CurrentDir__\data\civ_suit_black_co};​
 +</​code>​
 +
 +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.,
 +<code cpp>
 +hiddenSelectionsTextures[] = {__CurrentDir__\data\civ_suit_greystripes_co};​
 +</​code>​
 +
 +
 +====== 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.
 +<code cpp>
 +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
 + }
 +};
 +</​code>​
 +
 +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 ======
 +
 +<code cpp>
 +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
 + ]";
 +};
 +</​code>​
arma2/texturing/hiddenselectionstextures.txt ยท Last modified: 2011-07-01 13:47 (external edit)