User Tools

Site Tools


Custom Texture

Custom texture by Mateck

That custom texture is a very interesting thing, pretty nice and saves quite some megabytes.

Any details on how its done?

Yes it saves megabytes as we don't need to create .p3d models for every paint scheme in our addon.

The way to do this is very simple.

1) select all faces that are using single texture
2) create new selection

3) in config.cpp under vehicle class put something like this

hiddenSelections[] = {"01_co","02_co","03_co","04_co"};

where *_co are selections used by our T-72

4) now those selections will be invisible in game, to avoid this we need to use setObjectTexture command under Init EventHandlers of our addon or later in game

For our T-72 we used following code

class Extended_Init_EventHandlers
     class CH_T72 {
          init = CH_Textures = [_this select 0, ""BIS""] execVM ""\ch_t72\scripts\textures.sqf"";";

and here is example code for textures.sqf

_tex = _this select 0;
switch (_this select 1) do
case "BIS" :
_tex setObjectTexture [1,"\ch_t72\data\t72_1_co.paa"];
_tex setObjectTexture [2,"\ch_t72\data\t72_2_co.paa"];
_tex setObjectTexture [3,"\ch_t72\data\t72_3_co.paa"];
_tex setObjectTexture [4,"\ch_t72\data\t72_4_co.paa"];

And that will be all. Fell free to use this code or change it whatever you like ;)

We still need to test this feature to ensure that there is no negative impact on performance and it works fine in multiplayer.

Need to say that this hole idea of custom textures is inspired by Dune Buggy addon by Sebastian Muller from OFP


That was really the original purpose, but with ArmA you can also change textures on “hiddenSelections” using “hiddenSelectionsTextures”.

arma/texturing/custom_texture.txt · Last modified: 2015-08-22 01:44 (external edit)