Project Zomboid

Project Zomboid

Tk's Tuners
 This topic has been pinned, so it's probably important
tkonrye  [developer] 8 Nov, 2024 @ 11:21am
Modding
As of right now, as much as I wish it did, this mod will not change the graphics for the vehicle you are modifying.

Due to the way vehicles are "built" in game, the models are tied to the vehicle itself, and that includes the tires and exhaust, hoods etc..

At some point in the more distant future I may look at ways of setting tires to carry some model information (if that is even possible), and suspension that can lift or lower the vehicle without messing the thing up horribly, but unfortunately that moment is not now.

That said if anyone out there has an idea on how that could be done, I am all ears!
< >
Showing 1-3 of 3 comments
Filibuster Rhymes 10 Nov, 2024 @ 8:47am 
Hey, you can set the models for individual parts in the scripts pretty easy.
part DoorFrontLeft { model FrontCarDoor { file = Door_do_ram_90_FL, } }

When the part's removed, the model will disappear from the car.

Having it change visuals based on the item type is more complicated, and you gotta do it through some lua code.
In the scripts, you'd have multiple models loaded in the part with different model names, for example:

part FRAttachmentBed { model FRLargeBedFRRollcage { file = FR_Rollcage3, } model FRLargeBedFRBedCapHard { file = FR_BedLongAttachCapHard_80C10, } }
This will make all the models load at once, so you've gotta give the parts custom init and install functions.
This will hide all the models for the specific part.
part:setAllModelsVisible(false)
Then you can show individual models with this.
part:setModelVisible(model_name, true)
The way I did this was get the current installed item type with this.
part:getInventoryItem():getType()
Then I named the models after the item type in the scripts.
If you've got any questions, feel free to hit me up on discord if you're in my server.
tkonrye  [developer] 10 Nov, 2024 @ 8:57am 
@Filibuster Rhymes, first off thanks for taking an interest! I have used FRUsed cars since day one, and its always the first mod I create any compatibility for. Plus your little 91 crx is my test model for EVERYTHING lol.

Next, sadly the key here is not to change the model info for the vehicle script, but the base vehicle instance, so that one instance of a 91CRX and another instance of a 91 CRX could have different tire models.

EDIT: which from re-reading your post you have answered to some degree with that lua example!

That means I have to tie the 3D model for the tire and shaders and what not to the tire itself, and then allow that tire to be installed on every vehicle in the game, and still look right.

Its WAY tricky. Possible, but it will take a ton of work to do.

Even if I did create a tire that carried the display information, when the game builds the vehicle, it does that from the vehicle script when the instance is instantiated, this would require altering that instance, and reloading the images...? maybe, this is where I get pretty fuzzy.

EDIT: Perhaps with multiple part templates this could be possible, but that would still involve editing a crap ton of vehicle files, which I was hoping to avoid, as I dont think I can overlap multiple types and have them occupy the same mechanics space?

However I will hit you up in discord, whats your server name?
Last edited by tkonrye; 10 Nov, 2024 @ 9:04am
Filibuster Rhymes 10 Nov, 2024 @ 9:05am 
Hey, no problem, dude! What I posted should work fine for the tires too, but I might be misunderstanding what ya mean. We can figure it more one on one, haha.
I got it set up to accept DM's from people with shared servers, here's a link to mine. https://discord.gg/WKjTuqW
If you're already in the official PZ discord, you should be able to DM me, too. It's filibusterrhymes.
< >
Showing 1-3 of 3 comments
Per page: 1530 50