Project Zomboid

Project Zomboid

Vehicle Tweaker API
58 Comments
Davi GO 24 Jun @ 2:59pm 
soul mano me salva ai meu game b42 e chapado de mods nesta ultima atualizaçao meu mini map e painel de veiculos sumirao nao sei q fazer entao talvez eles esteja dimencionados fora da tela se este for o cazo como posso trazelos novamente q arquivos devo procura por favor me ajuda ai
]
Elentári 23 Jul, 2024 @ 2:29am 
Is it somehow possible to change how much a car can pull?
hakob 18 Jul, 2024 @ 7:55am 
couldnt figure out what mod needs this, checked mod I installed same time as this (Expanded Hotwire and Autotsar Dadge), but neither of them needed this or maybe they updated back then
Jacques the Crab 16 Aug, 2023 @ 5:26pm 
Thanks for the reply, if I test it out I'll come by with the results :)
soulfilcher  [author] 16 Aug, 2023 @ 9:51am 
@Kitsune: I have no idea what the link was supposed to show me.

@Kyrox: I don't know, I do have an example mod called Paint it Black.

@Percyrus: Yes, it is possible to add templates, but I have not tested that in a very long time.
Jacques the Crab 16 Aug, 2023 @ 12:14am 
Hi, does this allow inserting values besides changing existing ones? Imagine I want to add the capability to craft amor and such, would this allow me to insert templates into the vehicle txt file? Thanks!
Kyrox 18 Jun, 2023 @ 10:29am 
What mods use this?
Kitsune 15 May, 2023 @ 11:07am 
i get tis, any idea how to fix it? https://gyazo.com/eec94f8caede926b942c6766c44e599d
Rodahtnov 12 Feb, 2023 @ 5:57pm 
Changing the particular truckbed item may work, thing is it would apply to all cars using it instead of a particular one (in theory)
May have to think a diff solution ^^
soulfilcher  [author] 12 Feb, 2023 @ 5:17pm 
Did you try changing the item? I remember that at some point trying to change that value from inside a vehicle script was bugged. You always got the value set in the item. I can't say what is the current situation as I have not tried that for a long time.
Rodahtnov 12 Feb, 2023 @ 5:14pm 
Hey soulfilcher, is it possible to alter the truckbed? tried with something like
TweakVehicle("Base.Van", "part TruckBed", "container", "capacity", "130");
and
TweakVehicle("Base.Van", "part TruckBed", "container { capacity = 130 }");
etc at no avail

Or is it not possible to edit it at all?
PD: Reference:
part TruckBed
{
container
{
conditionAffectsCapacity = false,
capacity = 125,
}
}
soulfilcher  [author] 2 Feb, 2023 @ 8:04am 
Hoods have their health defined by the item, so you can't do that using this mod.
Brynjar 1 Feb, 2023 @ 8:33pm 
Is it possible to modify hoods and engines to have more health / take less damage? MP server has it set to as low as possible for damage to cars, just isn't enough. thx for your work !
Brynjar 1 Feb, 2023 @ 8:30pm 
is it possible to increase the health of hoods with this that will retain the health after being installed. Low damage on MP is just not enough.
Jack Rossman 21 Jan, 2023 @ 2:05pm 
Yep. Much appreciated. Keep up the great work my man.
soulfilcher  [author] 21 Jan, 2023 @ 1:58pm 
Hi, I will try to test that and update when I can.
Jack Rossman 21 Jan, 2023 @ 1:52pm 
Hey Soulfilcher. How's life been treating you? Hope things have been well.
So anyways, I did discover something VTAPI's missing: The ability to redefine horns!
Here's what I found works. Though it's exclusively for horns, and could probably be refined later?
Note: I just shoved this right underneath "part" in the tweakVehicles function.

elseif t == "horn" then
vehicle:Load(name, "{".."sound".."{ horn ="..y..",}".."}");
Jack Rossman 5 Oct, 2022 @ 10:00am 
ok, so. It's very rude to go to other people's mods with issues in a mod that depends on said mod. You are aware it's STR doing it, so why bother poor Soulfilcher?
Also, I just got back to my PC, so I wasn't ignoring you. Does the spam still occur when you make a new save after enabling VTAPI? If not, then it's the fact you didn't enable it in your save file.
Anyways, this isn't the place to continue this, so please move back to STR's page or maybe the discord?
JxmmyJxmes 5 Oct, 2022 @ 7:37am 
*It is now broken
JxmmyJxmes 5 Oct, 2022 @ 7:37am 
and yet here we are. It is not broken due to the fact that it constantly flashes in my face that I need to use the API tweaker
soulfilcher  [author] 5 Oct, 2022 @ 7:18am 
I guess all you need to do is to subscribe to the mod.
JxmmyJxmes 4 Oct, 2022 @ 8:28pm 
I don't want to tweak any of them though. I'm coming here from STP vehicles.
soulfilcher  [author] 4 Oct, 2022 @ 8:01am 
You need a lua file in your media/shared/ folder that follows the example in the description. Then you add a line for each vehicle's stat you want to tweak.
JxmmyJxmes 4 Oct, 2022 @ 6:02am 
Nice, so now I will be forced into eternal spamming because I have no clue how to implement this API...
soulfilcher  [author] 26 Sep, 2022 @ 12:58pm 
Fixed!
Jack Rossman 26 Sep, 2022 @ 11:06am 
Welp. I feel a bit stupid. Remember the method for multiple skins? Guess who forgot to mention using "t" in *vehicle:Load(name, "{"..t.."{ texture ="..y..",}".."}");* needs to be changed to *vehicle:Load(name, "{".."skin".."{ texture ="..y..",}".."}");*... Otherwise it'll put "skin1" into that field. My apologies man...
soulfilcher  [author] 23 Sep, 2022 @ 6:37pm 
Mod updated, thank you for your suggestions.
Jack Rossman 21 Sep, 2022 @ 6:41pm 
Ok, found the cause for it doing nothing on servers. The "VehicleTweaker_Core" file needs to be moved to "shared" instead of "client". Just thought you should know. Keep up the great work my friend :)
Jack Rossman 21 Sep, 2022 @ 9:25am 
Odd. Seems the mod doesn't do anything in MP anymore... No errors, just seems the server isn't registering the changes.
Jack Rossman 19 Sep, 2022 @ 4:11pm 
Np my guy. Keep up the great work!
soulfilcher  [author] 19 Sep, 2022 @ 4:03pm 
@Zudakas: I don't have a list but it is a matter of trying to see what happens, because some values seem to be recalculated once the vehicle is spawned and the changed value doesn't seem to take effect. One thing I know is problematic right now is adding parts.

@NightScale5755: Thank you for testing that. I will try to check your suggestion and update the mod.
Jack Rossman 19 Sep, 2022 @ 3:25pm 
Heyo, after messing around with the code, I figured out a method for adding multiple skins to a vehicle.
Instead of: *if t == "skin" then*
Use: *if t:contains("skin")*

Therefore one could specify multiple entries, like "skin1, skin2, etc" or even more complex entries like "skincool, skinawesome, etc".
Hope this helps, as this mod's a lifesaver. Have a wonderful day!
Zudakas 3 Sep, 2022 @ 12:54pm 
or is it just those 4, color, mass, maxSpeed, machinicType?
Zudakas 3 Sep, 2022 @ 12:53pm 
So out of curiosity, is there a list of possible variables I could change with this? e.g. mass, hp, etc

I run a small dedicated server, and I'd love people to be able to actually make it from one town to the next without swapping vehicles 3-4 times. Zed population is rather high ;)
Jack Rossman 29 Aug, 2022 @ 2:19pm 
alright. Sounds good
Keep up the great work!
soulfilcher  [author] 29 Aug, 2022 @ 1:38pm 
Most probably a limitation due to how I coded it. I will have to take a look.
Jack Rossman 29 Aug, 2022 @ 12:59pm 
Hi there. So uhhh, I've encountered a minor issue. Say I want to add several textures to a car using this. If I use the logical route of 1 TweakVehicle() entry per texture, it'll only add the one at the end of the list. Is there something I'm doing wrong, or is that a limitation?
KV Productions 29 Jul, 2022 @ 12:11pm 
Which mods? because i haven't found any (apart from "paint your ride" maybe, which doesn't work in MP)
soulfilcher  [author] 29 Jul, 2022 @ 9:25am 
@Gas.Pimienta: You have permission for that.

@KV Productions: There is no need to use this mod for that. I think there are mods that do that already.
AndyLoco 28 Jul, 2022 @ 8:53pm 
Permission Request:
Hi, @soulfilcher ! I would like to ask your permission to use your mod in our server modpack. I will give you full credit for your mod in every media I can. If you allow us to do this our community would be very grateful. Thank you!
KV Productions 8 Jun, 2022 @ 7:02pm 
Could this be used to make a mod that allows you to remove rust off of cars?
soulfilcher  [author] 15 May, 2022 @ 3:12pm 
As far as I know this is still working. It isn't used for specific cars but all cars of a certain type. I don't remember if I did any tests for changing skins though.
Axebeard 15 May, 2022 @ 1:31pm 
Is this still working in 41 and if so, is there a property to change a vehicle's skin? (if skin =1 change to skin 2 for example). Thanks!
soulfilcher  [author] 1 Feb, 2021 @ 11:25am 
Thank you Aiteron for the code, I hadn't seen it yet. I will add it in the next update.

@geras: Currently adding parts doesn't work as it should.
Aiteron 28 Sep, 2020 @ 11:22am 
Wrote some extension on modify areas. Maybe will be interesting (Raw code) - https://pastebin.com/9NYP3c9B
geras 27 Sep, 2020 @ 7:02am 
Is it possible to add more seats or add additional doors to cars with this? Is it possible to edit "area SeatFrontLeft" or "area SeatFrontRight" values?
soulfilcher  [author] 31 Aug, 2020 @ 10:00am 
I have not tested it with build 41 if that's what you want to know. It most probably still works with build 40.
TurtleShroom 15 Aug, 2020 @ 2:16pm 
Does this Mod still work?
soulfilcher  [author] 28 Apr, 2020 @ 10:21am 
This mod will not help you with that, it is meant to change stats for a car type when they are spawned, not for existing cars on the map.
Öysterboi 27 Apr, 2020 @ 2:10am 
Could you please help me understand how to change the color of a car? I'm using Filibuster Rhymes' Used Cars and my favorite car which appears to be the only one in the map, has such an ugly color that I NEED to change it.

Thanks in advance but I don't really know nothing about modding and barely know what's an API lol