Jump to content

[HOW-TO] Reskin/Retexture Vehicles


Brockie

Recommended Posts

Sure, less thinking^^.

The next and better step depends on saving information in the db.

 

But what you could do, instead of writing 55 lines of if-conditions, try

if (_target isKindOf "SUV_Camo") then { _testVehicleTexture = ['\z\addons\dayz_epoch\textures\suv_body_pink_co.paa']; };

With this, only SUV_Camo and all its subclasses are triggered, like SUV_Camo_DZE1 etc.

Link to comment
Share on other sites

The hiddenselection Array for the Mi24_D has 2 elements.

So this format

if ((typeOf _target) == "Mi24_D") then { _testVehicleTexture = ["\ca\air2\mi35\data\mi35_001_vehicleskins\mi24D.jpg", "\ca\air2\mi35\data\mi35_002_vehicleskins\mi24D.jpg"]; };

is correct, for my methode. But i think you mixed something up with the texture paths here.

 

If a vehicle has only one texture you use:

_object setVehicleInit "this setObjectTexture [0, ""vehicleskins\texture0.jpg""]";

Important here is the 0.

 

If a vehicle has more than one texture in the hiddenselection Array, the second texture to set needs an 1 at the position of the previous 0.

_object setVehicleInit "this setObjectTexture [0, ""vehicleskins\texture0.jpg""]; this setObjectTexture [1, ""vehicleskins\texture1.jpg""];";

The for-loop in my methode creates this string

"this setObjectTexture [0, ""vehicleskins\texture0.jpg""]; this setObjectTexture [1, ""vehicleskins\texture1.jpg""];"

out of the textures-Array _testVehicleTexture.

_testVehicleTexture = ["vehicleskins\texture0.jpg", "vehicleskins\texture1.jpg"];

Important the first position begins with an 0 and then upwards, the more textures in the hiddenselection array.

 

 

Thank you for your reply and all of your assistance. However,  I am still sort of at a loss as to how to write in the 2nd and 3rd textures. This is doing nothing.  

Any thoughts?

if (_object isKindOf "Mi24_D") then {
_object setVehicleInit "this setObjectTexture [0, ""vehicleskins\mi24D0.jpg""]; this setObjectTexture [1, ""vehicleskins\mi24D1.jpg""];"; 
Link to comment
Share on other sites

Did you perform the processInitCommands; after setting the setVehicleInit?

 

Tested it with the Mi24, for me it works, with your line of code. Wings and Tail are retextured.

 

Perhaps something with your paths to your textures wrong, or the textures itself.

 

I did this:

if (_target isKindOf "Mi24_D") then {
	_target setVehicleInit "this setObjectTexture [0, ""\z\addons\dayz_epoch\textures\suv_body_pink_co.paa""]; this setObjectTexture [1, ""\z\addons\dayz_epoch\textures\suv_body_pink_co.paa""];";
};
processInitCommands;

Pink SUV texture, doesn't fit this Heli, means, it looks somewhat crazy :D, but everything retextured^^.

Link to comment
Share on other sites

Well this worked,sorta, as you can see below ,now there's no texture showing.

if (_object isKindOf "Mi24_D") then {
_object setVehicleInit "this setObjectTexture [0, ""vehicleskins\mi24D0.jpg""]; this setObjectTexture [1, ""vehicleskins\mi24D1.jpg""];";
};
processInitCommands; 

 Somehow I don't think this type of Stealth technology will impress my players 8) 

 

 I'm using a jpg image 1024x1024  

Any ideas where the texture fix could lie? Is my image size wrong or should it be something other than a jpg?                           Although the SUV's work fine in jpg format 

The file pathing is set the same as my suv's and they are working just fine. It's in the main Mission PBO in a folder called "vehicleskins" and the photo's name is mi24D

 

Wait a second, I think I just realized something. Are you placing your textures into your addons folder  with all the other DayZ addons PBO's? Because I'm just trying to call mine out of a folder in the main  root Mission PBO and creating my vehicle skins folder in there.

 

So then  I tried it with my pathing and still getting a see-through chopper. https://www.youtube.com/watch?v=zO601Fv_l9E

if (_object isKindOf "Mi24_D") then {
_object setVehicleInit "this setObjectTexture [0, ""X:\Epoch_Napf\MPMissions\DayZ_Epoch_24.Napf\vehicleskins\mi24D0.jpg""]; this setObjectTexture [1, ""X:\Epoch_Napf\MPMissions\DayZ_Epoch_24.Napf\vehicleskins\mi24D1.jpg""];";
};
processInitCommands;

 

GCDg5Z6.jpg

Link to comment
Share on other sites

The Textures, which I used, were NOT custom. Standard Arma textures, misused for testing.

You can't put them in the addon folder, so far I know.

 

Theres definitely something wrong with your textures.

The seethrough textures is the result of it. You gain the same look by using an empty String instead of a texture path, "".

 

Did you take the right template? The original textures, of the Mi24_P and Mi24_D looks quite different. I never made a custom texture myself, don't know exactly if this matters.

But the background of the Mi24_P is black and of the Mi24_D all camoflage. And the Mi24_V texture is different, too^^...

Link to comment
Share on other sites

Hello i tried to add my skin serverside to my server 

I did everything like in the Tutorial.

After serverrestart the vehicle doesnt change its texture can someone help me please. 

My server_publishVehicle2.sqf

http://pastebin.com/GAcSET7E

My Server_publishVehicle3.sqf

http://pastebin.com/ShbeA59t

My Server_monitor.sqf

http://pastebin.com/kv3FCPDb

 

Someone please have a look its like in the Tutorial 

 

the Skin is here free 4 u to use 

19587937zf.jpg

Link to comment
Share on other sites

  • 3 weeks later...

@ Rusty/Mark88: (to your post here: )

 

If you want to use several textures for the same class/model you could use a switch/case method to randomly select one and nothing will break (took me hours as always to get this to work...but ok, I hate this scripting language ,) ).

 

So the texture will look different for every vehicle you spawn from this class.

Link to comment
Share on other sites

I've seen this post today for the first time and I really like changing textures a bit.

But what does it help if you need to put everything into the mission file which get's easily oversized then (also true for custom sounds).

 

How difficult is it or who has experience with creating a mod (is this the right word) which just contains additional texture/sound files.

 

If someone wants to use it, he needs to download it and load it via an additional start parameter. If someone does not know or don't want to download it, the normal textures (and/or no sound) should be used.

 

I guess this is not possible.

 

Or is there a way to automatically download stuff client side from server if it's needed (like in counterstrike long ago)? I know this can be a security issue...but maybe only possible for specific types of files (jpg, ogg somthing like that).

 

Does anybody has experience with stuff like this?

Link to comment
Share on other sites

  • 2 weeks later...
server_publishVehicle2

if (_class == "SUV_TK_CIV_EP1") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\SUV.jpg''];';};
    if (_class == "SUV_Silver") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\SilverSUV.jpg''];';};
    if (_class == "SUV_Yellow") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\YellowSUV.jpg''];';};
    if (_class == "SUV_Pink") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\PinkSUV.jpg''];';};
	if (_class == "SUV_White") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\WhiteSUV.jpg''];';};
	if (_class == "SUV_Green") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\GreenSUV.jpg''];';};
	if (_class == "VWGolf") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\VWGolf.jpg''];';};
	if (_class == "Volha_1_TK_CIV_EP1") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\BlueVolha.jpg''];';};
	if(!_donotusekey) then {
		// Lock vehicle
		_object setvehiclelock "locked";
	};

server_publishVehicle3

if (_class == "SUV_TK_CIV_EP1") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\SUV.jpg''];';};						
	if (_class == "SUV_Silver") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\SilverSUV.jpg''];';};
	if (_class == "SUV_Yellow") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\YellowSUV.jpg''];';};
	if (_class == "SUV_Pink") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\PinkSUV.jpg''];';};
	if (_class == "SUV_White") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\WhiteSUV.jpg''];';};
	if (_class == "SUV_Green") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\GreenSUV.jpg''];';};
	if (_class == "VWGolf") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\VWGolf.jpg''];';};
	if (_class == "Volha_1_TK_CIV_EP1") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\BlueVolha.jpg''];';};
	//Add weapons

server_monitor

if (_type == "SUV_TK_CIV_EP1") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\SUV.jpg''];';};
			if (_type == "SUV_Silver") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\SilverSUV.jpg''];';};
			if (_type == "SUV_Yellow") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\YellowSUV.jpg''];';};
			if (_type == "SUV_Pink") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\PinkSUV.jpg''];';};
			if (_type == "SUV_White") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\WhiteSUV.jpg''];';};
			if (_type == "SUV_Green") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\GreenSUV.jpg''];';};
			if (_type == "VWGolf") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\VWGolf.jpg''];';};
			if (_type == "Volha_1_TK_CIV_EP1") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\BlueVolha.jpg''];';};
			_lockable = 0;
			if(isNumber (configFile >> "CfgVehicles" >> _type >> "lockable")) then {
				_lockable = getNumber(configFile >> "CfgVehicles" >> _type >> "lockable");
			};

run into a little problem adding extra skins on my server. I have four different skins running just fine, I tried to add four more and they are not working. Here is the way I have the files setup and I can't seem to find why the last four added will not work, any help would be greatly appreciated.

Link to comment
Share on other sites

  • 3 weeks later...

I'll install the paa plugin into photoshop and give it a go.

 

So basically I use either one or the other scripts you posted and put whichever one I want to use into "admin_start.sqf"

From there - execute it through ALT+F11 in Infistar ( after logging in via #login mypassword ) 

 

What happens from here?    

 

If you are making it a permanent change, would it be easy for you to add in a selection, so I can choose which one of my textures to apply?

 

Thanks for the script and all your help.  Much appreciated !

SAD Thing the para plugin only works 32 bit versions of photoshop, doesn't work in CS6 64 bit , but arma is 32bit so .. figures 

see here on way to get around if you have 64bit version

http://www.armaholic.com/forums.php?m=posts&q=26083

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

I get those error in RPT:

It spams around 10000 times

if (_class == "SUV_Yellow_DZE4") then {_obje>
 0:19:19   Error position: <_class == "SUV_Yellow_DZE4") then {_obje>
 0:19:19   Error Undefined variable in expression: _class
 0:19:19 File z\addons\dayz_server\system\server_monitor.sqf, line 144
 0:19:19 Error in expression <riable ["ObjectID", _idKey, true];


And it wont work ingame...

Link to comment
Share on other sites

For those who don't use Infistar and run a missionpbo Admin Tool and want to change the vehicle textures on the run.

I recommend the following code, because the one above is producing tons of failures in my Server .RPT AND the texture is the old one again, if YOU Admin have relogged!

With this it is permanent UNTIL RESTART.

private ["_target","_testVehicleTexture","_texturing"];

_target = cursorTarget;

_testVehicleTexture = ["\z\addons\dayz_epoch\textures\suv_body_pink_co.paa"];

if ((typeOf _target) == "Mi17_Civilian_DZ") then { _testVehicleTexture = ["\CA\air\data\mi8_body_g_CHDKZ_CO.paa", "ca\air\data\mi8_det_g_co.paa", "ca\air\data\clear_empty.paa", "ca\air\data\mi8_decals_ca.paa"]; };
if ((typeOf _target) == "Mi17_DZE") then { _testVehicleTexture = ["\CA\air_E\data\mi17_body_UN_CO.paa", "\CA\air_E\data\mi17_det_UN_CO.paa", "\ca\air_E\Data\mi17_decals2_UN_CA.paa", "\ca\air_E\Data\mi17_decals_UN_CA.paa"]; };

_texturing = "";
for "_i" from 0 to (count _testVehicleTexture) - 1 do {
	_texturing = _texturing + format ["this setObjectTexture [%1, '%2'];", _i, (_testVehicleTexture select _i)];
};
/* executing _Texturing */
diag_log _texturing;
_target setVehicleInit _texturing;
processInitCommands;

This code will change the texture always to the one of the Pink SUV, on every Vehicle. Regardless if this texture suits the targeted vehicle or not. (its kind of funny on some vehicles...)

Because the default texture to set is always the Pink SUV one:

_testVehicleTexture = ['\z\addons\dayz_epoch\textures\suv_body_pink_co.paa'];

Here you can specify the texture for specific vehicles, just add another line with your vehicle and textures:

if ((typeOf _target) == "Mi17_Civilian_DZ") then { _testVehicleTexture = ["\CA\air\data\mi8_body_g_CHDKZ_CO.paa", "ca\air\data\mi8_det_g_co.paa", "ca\air\data\clear_empty.paa", "ca\air\data\mi8_decals_ca.paa"]; };
if ((typeOf _target) == "Mi17_DZE") then { _testVehicleTexture = ["\CA\air_E\data\mi17_body_UN_CO.paa", "\CA\air_E\data\mi17_det_UN_CO.paa", "\ca\air_E\Data\mi17_decals2_UN_CA.paa", "\ca\air_E\Data\mi17_decals_UN_CA.paa"]; };

These ones are for Helicopters, which need more than one texture!

 

The second one for "Mi17_DZE" unfortunately doesn't work! Because the chosen vehicle NEEDs to have something written in this class array hiddenselectionstextures!

 

You can check this here http://browser.six-projects.net/cfg_vehicles/tree?utf8=%E2%9C%93&version=66&commit=Change

Click on the vehicle class of the vehicle you want to retexture and then on CONFIG. The vehicle class will open, if you cant find hiddenselectionstextures then press on SHOW FULL at the top or use a Top-class of your vehicle.

 

Also here you can find textures from Arma Vehicles, which are not implemented in Epoch to change in. Just copy the hiddenselectionstextures array in the _testVehicleTexture array.

 

You WILL NOT find the Epoch vehicles here! The "Mi17_DZE" Epoch Helicopter has the Top-class "Mi17_base" and the hiddenselectionstextures array is empty for this, so the texture can't be changed.

 

At least with this methode, perhaps someone knows how it works in another way?!

 

 

Hope this was understandable ^^.

 

regards

This did not work for me.

Link to comment
Share on other sites

  • 2 weeks later...

I tried testing it with this:

 

private ["_target","_testVehicleTexture","_texturing"];

_target = cursorTarget;

_testVehicleTexture = ["\z\addons\dayz_epoch\textures\suv_body_pink_co.paa"];

if ((typeOf _target) == "SUV_Yellow_DZE4") then { _testVehicleTexture = ["gui\suvMonster.jpg"]; };
if ((typeOf _target) == "SUV_Silver_DZE4") then { _testVehicleTexture = ["gui\suvWhite.jpg"]; };

_texturing = "";
for "_i" from 0 to (count _testVehicleTexture) - 1 do {
	_texturing = _texturing + format ["this setObjectTexture [%1, '%2'];", _i, (_testVehicleTexture select _i)];
};
/* executing _Texturing */
diag_log _texturing;
_target setVehicleInit _texturing;
processInitCommands;

It does not work. Does not change texture at all :(

Link to comment
Share on other sites

  • 7 months later...

still need help with this...

you have to make changes in 3 server sided files.  The server monitor, server_publishvehicle2 and server_publishvehicle3 like explained here

you also need to make a mission sided file, name it "skins.sqf" and call it in the init.sqf

add this

 

if (isServer) exitwith {};
waitUntil {sleep 1; count vehicles > 1};
sleep 1;
{
    If (typeOf _x in ["SUV_TK_CIV_EP1_DZE1"]) then 
    {
        nul = _x setObjectTexture [0,"graphics\SUV.jpg"]
    };
    If (typeOf _x in ["SUV_TK_CIV_EP1_DZE2"]) then
    {
        nul = _x setObjectTexture [0,"graphics\SUVCA.jpg"]
    };

 

 change the paths and file names to yours, while also making sure the class name of the vehicle ex: SUV_TK_CIV_EP1_DZE1 is the same as in your 3 server sided files.

this is the link i used to get this working for me.  Oddly enough it only worked for me when i did both ways (this thread and this link)

http://epochmod.com/forum/index.php?/topic/15095-retexture-vehicles-server-side/

and also dont forget that you MUST buy the vehicle from the trader. Spawning it in wont work for the skins.

Edited by theduke
Link to comment
Share on other sites

  • 2 weeks later...

Is it possible to Rename the vehicles? So i can rename SUV blue to SUV blue carmo!?

No, as far as i know in order to rename them you would need to edit the PBO file of the SUVs and change the name, but every player would need to download it as a addon.  Which is why i was glad to see it actually worked with the custom skins..  VASP that is

Edited by theduke
Link to comment
Share on other sites

  • 11 months later...

Hey everyone.  

On 06/01/2015 at 10:06 PM, FragZ said:
Spoiler

I get those error in RPT:

It spams around 10000 times

if (_class == "SUV_Yellow_DZE4") then {_obje>
 0:19:19   Error position: <_class == "SUV_Yellow_DZE4") then {_obje>
 0:19:19   Error Undefined variable in expression: _class
 0:19:19 File z\addons\dayz_server\system\server_monitor.sqf, line 144
 0:19:19 Error in expression <riable ["ObjectID", _idKey, true];


And it wont work ingame...

 

 

Ok, firstly... sorry I have been away for ages...  beyond that the problem was pretty clear by your RPT:

problem was you copied the wrong line of code into server_monitor.sqf.

Step 4 said _type not _class. 

Spoiler
On 04/08/2014 at 3:51 AM, Brockie said:

      Step 4.  In your server_monitor.sqf find this:



			_lockable = 0;
			if(isNumber (configFile >> "CfgVehicles" >> _type >> "lockable")) then { 

                   And ABOVE it put this



			if (_type == "SUV_TK_CIV_EP1") then {_object setVehicleInit 'this setObjectTexture [0, ''custom\SUV.jpg''];';};

                 Change the Vehicle Classname and the texture pathing for your texture and vehicle.  Keep adding more lines like this for each texture that you need.

 

I also made a note in step 6 because I knew some people wouldn't get it right.

Spoiler
On 04/08/2014 at 3:51 AM, Brockie said:

      Step 6. In server_publishVehicle:

                 Notice the only difference is _class instead of _type.  Again  keep adding more lines like this for each texture that you need.

 

 

Sorry you had problems getting this to work but you just needed to read the instructions better.

After I was away for nearly 2 years and now being very rusty at this, I was still able to follow my own instructions and I'm happy to say it still works the same in 1.0.5.1 that it did in 1.0.4.2.

If anyone has difficulty with this feel free to message me and I'll try to help.  

Link to comment
Share on other sites

15 hours ago, Brockie said:

Sorry you had problems getting this to work but you just needed to read the instructions better.

After I was away for nearly 2 years and now being very rusty at this, I was still able to follow my own instructions and I'm happy to say it still works the same in 1.0.5.1 that it did in 1.0.4.2.

If anyone has difficulty with this feel free to message me and I'll try to help.  

Haha this made me laugh.  Glad to see you are "somewhat" back lol

Quick question, I have managed to retexture flags.  But the only way i can place them ingame, is with the editor and creating a sqf server sided that tells that flag to change its texture.

Spoiler

_vehicle_1 = objNull;
if (true) then
{
  _this = createVehicle ["FlagCarrierWhite_EP1", [2846.93, 12029, 1.98599], [], 0, "CAN_COLLIDE"];
  _vehicle_1 = _this;
  _this setDir 77.6359;
  _this setPos [2846.93, 12029, 1.98599];
  _this setFlagTexture "graphics\eagleflag.jpg";
};

I would like to change the flags texture, the same way the suvs are.  I tried a few things

From
if (_class == "SUV_Orange_DZE4") then {_object setVehicleInit 'this setObjectTexture [0, ''graphics\suvweed.jpg''];';};

to
if (_class == "FlagCarrierWhite_EP1") then {_object setVehicleInit 'this setFalgTexture [''graphics\flag.jpg''];';};

Also removed the 0 from the line of code right before graphics\suvweed. For the SUV 0 means the skin.

Other numbers represent the rims and such. (wish i knew that number haha)

As for the flags there is non as far as i know

I did the edits in all the same files of the SUVs.

I even tried changing the _class to _type (not sure if it would make a difference.)

So any shed of light on this would be awesome. Even if you say "DUKE, its not possible... its better than me still wondering if it is possible lol

Thanks

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...