Jump to content

Complete Vehicle Modding Tutorial

Recommended Posts

Hello and welcome to my tutorial. It covers full workflow of vehicle creation for PZ. If you are a complete beginner in 3D modelling, you'll have to watch/read additional tutorials, I won't cover every aspect of model creation and 'where this button is located'.

I divide vehicle creation in these stages:

1) Modelling

2) Wheels texture and modelling

3) Texturing

4) Packing files in folders

5) Editing scripts and .lua

6) In-game editing and tests

7) Workshop publish



Today I am creating a 1960 Ford Falcon



I prefer using blender as it is my everyday 3d modelling software. Now, find references for your vehicle and ideally it will be a blueprint/outline scheme, like this one:




There are some tips in modelling for PZ:

1) Do not care too much about topology and good shading. There is no actual shading in game, only windows have reflections. 

2) Avoid n-gons or triangulate them before export

3) DO NOT make edges to outline body panels/parts. All dividing of parts will be done with texture mask. You can do it in UVs if there will be a point for that.

4) Place spindiel imitations in wheel wells to hide rear part of wheel models

5) In the UVs  parts of body have to be straight-oriented without any non-90 degrees rotation, so pixels in texture will lay parallel with polygon flow.

6) To avoid physics artifacts in game import model of one of vanilla game cars models to your scene and model in consistent scale. Or import mine, that is available in the end of topic.



This is what I consider a well done model




There is nothing special in UV unwrapping process, just remember to place the least amount of seams possible and keep island aligned. Here are the UVs of my model:




I've unwrapped the model without applied mirror modifier, so now we will have to texture just one half of the car. I'll fix mirroring later.







There are many ways to make a wheel and texture it, but I'll show the most efficient one. Make the wheel's face with simple materials, but unwrap the 'road touching part' to flat surface, like this:





 Then place an orthographic camera facing the wheel, scale it to fit the whole wheel-dish. Place a ring with emission material to light the wheel. Switch your renderer to Cycles and go to camera view, now use a rendered shading mode to adjust materials and lights to your taste. 





Set rendering resolution to something like 120x120-175-175 for best results

Check the 'transparent' box in film settings to have alpha backround in texture:



Now increase the sample count to something like 512-1024 and hit render. You will end up with a result of a ready-to-go wheel texture:




The example file with scene for rendering and the model of this wheel you can download here: *google drive .blend file*

Now make a lowpoly model of the wheel to use this texture on. I prefer using 18-24 edge circles for wheels. The unwrapping will be later, but eventually you'll end up with this:




This method takes 10-15 minutes when you get used to it and gives a stunning and clear result.





NOTE: I use a pretty complicated way of texturing and adding light to model. All rules of using textures the default way are covered in "HOW TO CREATE NEW VEHICLE MODS" topic by RingoD123, one of PZ devs. You can access it here: *boop*


I'll show you my way, using Substance Painter to apply lighting and fake chrome parts to model. But first comes the base color and details of the car, so let's dive into it.

Create a texture with 0 alpha and resolution 256x256. You can go for 512x512, but personally I like pixelated look of lo-res texture. Here are the settings for initial image:




To preview the texture you are painting with different car colors, use this node setup. But switch filtering mode from "Linear" to "Closest", I forgot to do it on screenshot.




There are two types of texture details: somewhat transparent and absolutely opaque. Half-transparent parts will be affected by car color, so they are mostly shadow/highlight details. Headlights, fixtures and things like that have to be opaque and painted with 100% brush hardness. 

It is easier to keep 3d view just to see what are you doing and paint texture in image editing mode, right there:




First, paint the outlines of doors and other opening parts. Here are some brush hardness values:

0.2 - Outline shadow

0.5 - Outline

1.0 - Fake chrome and rubber window sealing


Some work in progress screenshots




Now when you have windows frames, save the image you just painted and go to photoshop and mask out glass sections like that



Well, time for Substance Painter. You can use photoshop gradients for windows and blender lighting for lighting of the body, but I'll use SP "Baked lighting" filter for that, and for chrome especially. I will briefly describe what I've done in SP:

1) Mask out windows, give them mirror metal material and add a filter to them

2) Mask out chrome parts, made them mirror metal and added the same filter with slightly different settings.

3) Apply the same filter to all body parts left.

4) Add a position gradient to the windows

Now I have this result, it is not shaded model, just basecolor:




Also export the AO map you baked in SP.


You can download file with this scene to look through and get ideas using this link: *boop*



Now paint additional details you want on the car and open Photoshop. This is your layers layout:




Now save it as .psd for future color editing and as .png to see what the you've done. Plug .png direcly as BaseColor in shader settings. Set your shading setting like this:




And check if everything looks ok. This is my result:





And this is the vehicle's look with wheels that we made before




Sweet, isn't it?


Now, it is time to get rid of mirroring. You can make new UV, bake it and... get A LOT of offset artifacts resulting in jagged pixel edges. There is a lazy but effective method:


1) In the UV editor place cursor in the 0,0 coordinates. 




2) Set Pivot to 2D cursor:




3) Scale all UV islands to 0.5 EXACTLY




4) Apply mirror modifier to your model. Now select FACES of any half of the model and move it in UVs on Y by value 0.5 EXACTLY or you'll eventually mess everything up.




5) In Photoshop expand canvas of your PSD file we made before




6) Duplicate everything and move to the upper left corner, like in UVs. You can merge color layer(s) to operate color on export more easily. Now you have half of the texture empty... You do not want to waste it, right? Then drop in the wheel texture here without scaling, and you won't need additional texture file for it!




7) Create a layer beneath all others and paint it black or grey to cover alpha-holes in the textures.




8 ) Now unwrap the wheel to this new texture and let it shine! We painted the car and fixed mirroring.




There are 3 more types of textures to make:

1) Rust

2) Damage (1 or 2 levels, I'm lazy, I prefer using single one)

3) ID Color Mask or just Mask


It wasn't possible to make them right with mirroring. 

Everything about these textures are explained clearly in Ringo's guide, again: *boop* I'll just show results I ended up with. 

Now you have to use 512x512 clear images for these textures, do not forget it.




Painted it with jitter brush and 0.2 hardness. To see what I am doing used the same node setup, as for base texture. 






Painted gradients with black and white with 0.1 hardess with repetitive strokes.







Mask texture tells game where are separate parts of car: doors, windows, lights and others. Every part has it's own color in palette, you can find color table in Ringo's guide. Copy and paste color HEX to use it in blender brush or fill tools. I've missed some of the parts because they do not really matter.








Texturing is finished. Go to photoshop and make all color variations you want and save them as .png, name them     Vehicles_[vehicle name]_

Vehicle name mustn't containt spaces

These are color palettes of my car:




Now you have to export your vehicle body and wheel models. Copy them to an empty scene and save as separate file. 

If you used blender default orientations (front, back, right, left, top), then rotate the car on Z axis by 180 degrees. Game rotates it for some reason, so you'll have to do it.

Now position everything in scene like this and continue to export settings.




Export body and wheel separately with these settings:




STAGE 5 - Packing files in folders


The folder hierarchy and naming the files you can find in Ringo's guide. The mod file and all of my project files you will be able to download in the end of this topic.


make up an Id name for your car. It has to be short, but unique and do not contain spaces. For this car I use '60falcon'.



properties of the mod for Steam Workshop





properties of the mod for in-game mod menu




models_X folder -> vehicles

this folder contains 3d meshes of the vehicle - body and wheel



textures -> vehicles

easy to guess, all vehicle textures are placed here

null.png - completely transparent image, used as placeholder later on



scripts -> vehicles

there shoud be a .txt file named with you vehicle's ID name.


Open it up and follow these instructions:




change invertX to 'TRUE' if vehicle appears to be mirrored by left and right in game.




Do not care about scale, offset and other geometric parameters.


Insert all your color variation textures as shown below:





All vehicle driving parameters are self-explanatory. Remember to set seats count, I'm creating a car with 4 seats.

If you want to make less seats or add new, delete passenger[Seat code] records or add new.

Also remember Seat[position] records down below.

Add or delete the templates, loaded from Game default files:







lua -> server -> vehicles -> [car id name]dis.lua


Vehicle trunk type distribution file. There is a file with all vehicle distribution types in game files, I'll put it in project folder in the end if the article.

This is game files distibution types, select one of them in respect to the vehicle type you are creating.




I'll use CarNormal type for Ford Falcon. This is what distribution lua file has to be:






lua -> shared -> [car id name]SpawnList.lua


This file describes spawn zones of your car in game world with certain chance. I've typed in all default zones of spawn, you just have to change the chance and

set [Base.60falcon]

to [Base.(your car id name)]



lua -> shared -> Translate -> EN -> IG_UI_EN.txt




This is the name of the car in UI - keys name, mechanics window name and such.


STAGE 6 - In-game editing and tests


Launch PZ and disable all mod exept the one you will be debugging. Now close the game and go to Steam. In application setting set startup parameter to -debug

It enables many debug options in-game.


Now launch the Game again and, if menu doesn't appear, you've done something wrong in lua scripts. Check them for probles, and I hope, you'll figure out what is wrong.

Now start a new game in world with no zombies and big amount of cars. 

Leave the house and find any car vibing in the street. Right click, -> Vehicle -> Set Script -> [your car ID name]. Car will switch to yours.

This is what I've got on first time in-game spawning:




YEET, it is all coming along. But wheel positions are a bit off, and we have to place the entering areas of doors. Go to Right click on car -> [DEBUG] Vehicle -> Vehicle Editor.






Place extents and physics shape to outline the car




These are access areas to different parts of the car. There is nothing to describe, really, just place them where you can explain it and continue to next section









Right click in mechanics tab to enable cheat options for the car. Now right click in mechanics panel. Here you can get key for that car or repair it. 


Final result in different variations






Make a suitable preview image for your mod and crop it in Photoshop to 256x256. Place it in mod folder as preview.png


In game menu go WORKSHOP -> create or update mod -> 



Go to your profile workshop items and find the new mod.



Add the description, more screenshots and set visibility to 'Public'






Congratulations if you followed my guide to this point.


Comment any issues or mistakes I've made.






Edited by tubetarakan
Link to comment
Share on other sites

  • 9 months later...
  • 3 months later...
  • 1 month later...
  • 4 months later...
  • 4 weeks later...

Приветствую всех! Надеюсь, эта тема по-прежнему актуальна. Я столкнулся с рядом проблем, которые я не мог решить в течение 2 дней. Я сделал все как в инструкции, но при входе в меню модов постер не отображается. При входе в игру автомобиль имеет только тень и все функции (модели и текстуры не видны) А при включении меню редактирования (F7) модель автомобиля становится черной. Я в растерянности, все текстовые файлы являются точной копией примера, но с заменой на уникальное название мода. Пожалуйста, мне очень нужна ваша помощь... 




Link to comment
Share on other sites

  • 4 weeks later...
  • 1 year later...

This is great to see, I just joined these pages, as I was interested in creating a car myself. Your step by step guide looks like it will give me a lot of answers. But I have few questions 

you mention Ringo's tutorial, is that something on these pages as well ?

and the texture coverage and tips, I was wondering if you can utilize the area of the texture better. Although i suppose it would be more manual. 
I suppose the non-mirrored UV's are something that's to do with shading in game ? or perhaps with the things like the procedural blood and so on , ( as the blood would show up on both sides if the UVs were shared) , but I was curious if you can't map more of the entire car, something like this , although perhaps with the method you described, you get a bigger pixel coverage ( smaller pixels when in game) 

Can't wait to try this ! and get bit more into it 


Link to comment
Share on other sites

ok, so I did get it to work in the end, after looking around for another mods, but I came across something strange 
the car I imported to the game, appears to be bit bigger than it should be 

it almost feels like the game is not done in actual correct scale 
I've imported the 60 Falcon, and it should have been about 4.5 meters long, but it was more like 3.4 meters, which feels like 75% of the actual scale, does that number sound about right ? is there some scale coeficient that needs to be applied?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...