Jump to content
Sign in to follow this  
Double Doppler

Reskin by classname

Recommended Posts

I want to retexture my units in my mission by classname so that they are retextured automatically whenever any script calls them (be it buying a unit, or respawning as one). I know in a way that this might be possible, but I do not know what parameters to set. I am hoping to make it in a trigger, that is JIP compatable. Like if "BAF_Soldier_DDPM" was set to retexture automatically using SetObjectTexture, so that it would never show its original textures for the duration of the MP mission.

I really need to be pointed in the right direction, I have been trying this for some time and getting it to work :confused:

Share this post


Link to post
Share on other sites

Put this into the unit's init:

nul = [this] execVM "skin.sqf";

skin.sqf:

_Vehicle = _this select 0;

if (_Vehicle isKindOf "BAF_Soldier_DDPM") then {
while {true} do {
	waitUntil {alive _Vehicle};
	_Vehicle setObjectTexture [0,"blah.paa"];
	waitUntil {!alive _Vehicle};
};
};

if (_Vehicle isKindOf "someotherclass") then {
while {true} do {
	waitUntil {alive _Vehicle};
	_Vehicle setObjectTexture [0,"blah.paa"];
	waitUntil {!alive _Vehicle};
};
};

Unit init lines are also executed by JIPs.

waitUntil {alive _Vehicle}; waitUntil {!alive _Vehicle}; <--- these lines are = respawn

Share this post


Link to post
Share on other sites

The thing is that the unit I want to retexture doesn't have an init (I want to set a command in the mission, perhaps by trigger, so that if that unit is called in when bought by a player, it automatically reskins it).

What I am trying to do is reskin normal vehicles to be ,say woodland LAVs into Desert LAVs for a warfare mission. Then If I buy them in the game, they turn into desert ones as the command automatically retextures them by the paa in the mission file.

Edited by Double Doppler

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  

×