Jump to content

Recommended Posts

Hey all. Perhaps you can help me with a problem. I've used the setObjectTexture command to great success on vehicles placed in EDEN, placing them and then putting something like setObjectTexture [0, "textures\police_heli.paa"]; in their init field. Bingo, the (in this case) helicopter is there, and it is wearing it's appropriate skin/texture. The problem is respawning. When the vehicle is destroyed, it respawns just fine (I am using the BIS respawn module in EDEN, linked to the vehicle in question). The problem is, that when the vehicle respawns, it respawns with a random skin/texture. Sometimes it's black, sometimes it's tiger-stripe, etc. I've searched the forums and google to no avail to try to fix this. All I want, is for when the vehicle is respawned, to have the same (custom) textures it started with. 

Share this post


Link to post
Share on other sites

I'm an idiot. I figured it out. Thanks!

 

For others:

 

In the respawn module EXPRESSION (not init) field I have:

(_this select 0) spawn Fnc_Set_Textures;  

 

then in init.sqf I have:

Fnc_Set_Textures =
    {
        if (
            (_this iskindof "C_Heli_Light_01_civil_F") 
        or 
            (_this iskindof "B_Heli_Light_01_dynamicLoadout_F")
        ) 
        then {
             _this setObjectTexture [0,"textures\police_heli.paa"];   
                };
    }
;

 

  • Like 2

Share this post


Link to post
Share on other sites

I have never used such respawn/fnc style, but in case it is really no longer working, you can use those same codes in some trigger at the spawning/respawnin area of the desired vehicles. So every time one of them appears there, its textures would be instantly changed.

It would be something without the brackets and in the activation field, not exactly requiring more code on external SQFs, like
 

 if (
        (_this iskindof "C_Heli_Light_01_civil_F") 
        or 
        (_this iskindof "B_Heli_Light_01_dynamicLoadout_F")
     ) 
 
  then {
         _this setObjectTexture [0,"textures\police_heli.paa"];   
        };

 

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

×