Jump to content
Sign in to follow this  

Configuring an object with switchable textures with setObjectTexture

Recommended Posts

Hi all,

I've recently taken my first steps in arma modding and have successfully created an object in blender, added textures and materials, imported to the game etc etc. Consists of 7 components and 4 different textures. I'm attaching a picture of it below:


It's basically an airport taxiway direction sign, for immersion. These 3 "displays" with letters on them are their own components in the custom LOD (display_L, display_M, display_R) and have an emissive material applied to them (no texture in the material), which works pretty great. However, I would like to be able to switch the textures on those displays with scripting (setObjectTexture command), and I''ve been trying to use hiddenSections for that with no luck so far. 


When I run getObjectTextures on the object, it returns the ones that are set in the config.
If I run setObjectTexture and then getObjectTextures, it gets updated, but nothing changes on the model.


Model has these 7 components and display_L, display_M and display_R have the same textures assigned to them in the object editor as the ones mentioned in the config.


Here's my configs:


class CfgModels
    class Default 
        skeletonName = "";
        sectionsInherit = "";
        sections[] = {};

    class VAP_DTD_SIGN : Default 
        skeletonName = "VAP_DTD_SIGN_Skeleton";

        sections[] = {

class CfgSkeletons {
    class Default 
        isDiscrete = 1;
        skeletonInherit = "";
        skeletonBones[] = {};

    class VAP_DTD_SIGN_Skeleton : Default 
	    skeletonBones[] = {
            "display_L", "",
            "display_M", "",
            "display_R", ""


class CfgPatches
		requiredAddons[] = {"A3_Structures_F"};
        name = "Name";
		author = "Vestarr";
		url = "";
		requiredVersion = 0.1;
		units[] = {"VAP_DTD_SIGN"};
		weapons[] = {};

class CfgVehicles {
    class Thing;

    class VAP_DTD_SIGN : Thing {
        displayName = "D-T-D Taxiway Sign";
        author = "Vestarr";
        editorPreview = "\airportshit\data\dtd_sign\icons\dtd_sign_icon.paa";
        scope = 2;

        mapSize = 0.9;
        accuracy = 1;
        destrType = "DestructNo";

        model = "\airportshit\data\dtd_sign\objects\dtd_sign.p3d";
        hiddenSelections[] = {"display_L","display_M","display_R"};
        hiddenSelectionsTextures[] = {"\airportshit\data\common\textures\taxiway_dir_b_9_ca.paa", "\airportshit\data\common\textures\taxiway_mark_a_ca.paa", "\airportshit\data\common\textures\taxiway_dir_b_9_ca.paa"};

Also my material, in case it matters:

emmisive[]={100, 80, 28,0.2};



Can anyone shed some light how does this thing work and how to use it properly? I'm really confused.

Share this post

Link to post
Share on other sites

Entry in CfgModels needs to match p3d name. Either try to rename in model.cfg



class dtd_sign

Or change name of p3d to VAP_DTD_SIGN

  • Like 1

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