Jump to content
bumyplum

SetObjectTexture Checks

Recommended Posts

Is there away know to where you check if your Cursortarget Object Is retexturable, for example buildings aren't but vehicles are... Is an if statement which checks this? Also is there a way to set a vehicles' textures back to the orignals?
I've attempted: 

_textures = getObjectTextures cursorobject;
if!(_textures == "") then {hint "textureable";} else {hint "nottexturable";};

Share this post


Link to post
Share on other sites
isEqualTo []

If there are no textures then an empty [] array is returned which means none are supported. Therefore just simply perform check like so:

if (getObjectTextures cursorObject isEqualTo []) then {hintSilent "Not supported.";} else {hintSilent "Supported."};

You can also use count and other methods.

https://community.bistudio.com/wiki/isEqualTo

https://community.bistudio.com/wiki/count

https://community.bistudio.com/wiki/getObjectTextures

Quote

Array of Strings - array of textures

Not sure what happens on simple objects. I mean, I assume it will return empty array also but we are talking about ArmA here lol.

Quote

Doesn't work on simple objects

 

  • Like 2

Share this post


Link to post
Share on other sites
_count = count getArray (configFile >> "CfgVehicles" >> typeOf _vehicle >> "hiddenSelections") ;
if (_count == 0) then {
    hint "This vehicle doesn't have texurable selection" ;
} else {
    hint format ["This vehicle has %1 (#0 ~ #%2) texturable selections",_count,_count-1] ;
} ;

This should work.

1 hour ago, HazJ said:

Not sure what happens on simple objects. I mean, I assume it will return empty array also but we are talking about ArmA here lol.

Simple Objects made by .p3d path directly (Super Simple Objects) don't have classNames as well as hiddenSelections so can't be retextured.

  • Like 3

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

×