Project Zomboid

Project Zomboid

Vehicle Tweaker API
58 Comments
Davi GO Jun 24 @ 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 Jul 23, 2024 @ 2:29am 
Is it somehow possible to change how much a car can pull?
hakob Jul 18, 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 Aug 16, 2023 @ 5:26pm 
Thanks for the reply, if I test it out I'll come by with the results :)
soulfilcher  [author] Aug 16, 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 Aug 16, 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 Jun 18, 2023 @ 10:29am 
What mods use this?
Kitsune May 15, 2023 @ 11:07am 
i get tis, any idea how to fix it? https://gyazo.com/eec94f8caede926b942c6766c44e599d
Rodahtnov Feb 12, 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] Feb 12, 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 Feb 12, 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] Feb 2, 2023 @ 8:04am 
Hoods have their health defined by the item, so you can't do that using this mod.
Brynjar Feb 1, 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 Feb 1, 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 Jan 21, 2023 @ 2:05pm 
Yep. Much appreciated. Keep up the great work my man.
soulfilcher  [author] Jan 21, 2023 @ 1:58pm 
Hi, I will try to test that and update when I can.
Jack Rossman Jan 21, 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 Oct 5, 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 Oct 5, 2022 @ 7:37am 
*It is now broken
JxmmyJxmes Oct 5, 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] Oct 5, 2022 @ 7:18am 
I guess all you need to do is to subscribe to the mod.
JxmmyJxmes Oct 4, 2022 @ 8:28pm 
I don't want to tweak any of them though. I'm coming here from STP vehicles.
soulfilcher  [author] Oct 4, 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 Oct 4, 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] Sep 26, 2022 @ 12:58pm 
Fixed!
Jack Rossman Sep 26, 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] Sep 23, 2022 @ 6:37pm 
Mod updated, thank you for your suggestions.
Jack Rossman Sep 21, 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 Sep 21, 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 Sep 19, 2022 @ 4:11pm 
Np my guy. Keep up the great work!
soulfilcher  [author] Sep 19, 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 Sep 19, 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 Sep 3, 2022 @ 12:54pm 
or is it just those 4, color, mass, maxSpeed, machinicType?
Zudakas Sep 3, 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 Aug 29, 2022 @ 2:19pm 
alright. Sounds good
Keep up the great work!
soulfilcher  [author] Aug 29, 2022 @ 1:38pm 
Most probably a limitation due to how I coded it. I will have to take a look.
Jack Rossman Aug 29, 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 Jul 29, 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] Jul 29, 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 Jul 28, 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 Jun 8, 2022 @ 7:02pm 
Could this be used to make a mod that allows you to remove rust off of cars?
soulfilcher  [author] May 15, 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 May 15, 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] Feb 1, 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 Sep 28, 2020 @ 11:22am 
Wrote some extension on modify areas. Maybe will be interesting (Raw code) - https://pastebin.com/9NYP3c9B
geras Sep 27, 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] Aug 31, 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 Aug 15, 2020 @ 2:16pm 
Does this Mod still work?
soulfilcher  [author] Apr 28, 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 Apr 27, 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