Project Zomboid

Project Zomboid

CarWanna
Glytch3r 26 Aug, 2022 @ 11:46am
i have a couple of question
1st question how do i create a recipe that sells pinkslips?
its supposed to be straight forward

just create recipe that results to the pinkslip right?
but whenver i try to. somehow the game doesnt load the entire pinkslip module for some reason

i just want to be able to price the vehicle dpending on their value

this will be used for our server if i can manage to modify it

2nd question
how do i directly do a command without relying on the pinkslip
or to rephrase this
i want to be able to spawn vehicle using oncreate recipe functions
but when i try to do this i always end up with having a vehicle that cannot move or doesnt have key

i would love to learn how to spawn specific vehicles that are fully repaired and contains gas plus gives key
this is all i need really

addvehicledebug() seems to only produce client sided vehicle that arent seen by other players i think
but using this i cn spawn a vehicle thats fully repaired with keys but it wont move

using the sendservercommand()
allows me to spawn the vehicle but dont know how to auto repair it on one function

if you can pls advise sir
greatly appreciate the effort

thank you verymuch
< >
Showing 1-5 of 5 comments
Xyberviri  [developer] 27 Aug, 2022 @ 2:53pm 
The one thing that tends to catch people, including my self, is the casing and module name "PinkSlip.CarLights"
module Base { recipe Buy Chevalier Nyala (Police) $500 { Money=500, Result: PinkSlip.CarLightsPolice, Time: 100, keep HamRadio1/HamRadio2/HamRadioMakeShift, Category: Repo Man, CanBeDoneFromFloor:true, } }

If you are using Shops by Noir then the formate is as follows:
Shop.Items["PinkSlip.CarLightsPolice"] = { tab = Tab.Vehicles, price = 500, }

CarWanna contains all of the vanilla vehicles already, If you need a list you can copy them out of in raw format look in the mod root folder for "PinkSlipList.txt", which contains the full item name along with the vehicle English name and the vehicle in game vehicle id.

If you need help generating the configs to buy vehicles in mass you can try the following power shell script i created: https://github.com/xyberviri/CarWanna/blob/main/Tools/CSV2Recipe/_make_recipeshop_config.ps1

This will output a file in the format of the first example, this is expecting a comma seperated listed with no header row like so
Base,CarLights,Chevalier Nyala,10 Base,CarLightsPolice,Chevalier Nyala (Police),10
This is how i would maintain my recipe shop before moving to Noir's shops mod.

For the second question here is where CarWanna really shines, bare minimum you just need to send the vehicle id with the sendClientCommand to the CW module, which is what you are getting. Everything not sent is handled on the back end to be a little closer to vanilla.

so bare bones spawn is this:
local requestedVehicle = { type = "Base.Van" } sendClientCommand(player, "CW", "spawnVehicle", requestedVehicle )

and spawning with all available options.
local requestedVehicle = { type = "Base.Van" } requestedVehicle.condition = 100 requestedVehicle.gastank = 100 requestedVehicle.fueltank = 100 requestedVehicle.makekey = true requestedVehicle.upgrade = true requestedVehicle.dir = player:getDir() or IsoDirections.S requestedVehicle.clear = true requestedVehicle.battery = 1 sendClientCommand(player, "CW", "spawnVehicle", requestedVehicle )

Most of the values are self explanatory,
".gastank" is for Vehicles fuel amounts,
".fueltank" is for fuel trailers or in the rare case a vehicle that has two places to store fuel.

.fueltank can also fill water tanks if you add the appropriate part name to the global table CW_fueltankPartNames, It already has "1000FuelTank","500FuelTank" for Ki5's trailers.


".upgrade" will repair all the parts on a vehicle to 100%,
BUT it is called BEFORE ".condition" so if you set it to true and then the condition to anything it will lower the overall vehicle condition. This is useful for AutoTsars and Ki5 vehicles that come with optional parts.

when ".upgrade" is false i attempt to only set the condition on parts that have at least 1 hit point which is usually true for vehicles with no upgrades. it's not 100% but it seems to work for the most part with the occasional upgrade slipping though.

".battery" is the charge of the battery. ".clear" will remove all the random items that spawn along with the vehicle.

At this time Skins are still random when a vehicle has more than one texture, along with tire pressure.

Its also worth mentioning you can nil out of a value off a pinkslip's moddata() if you want to sell for example a pinkslip to a broken car.
Last edited by Xyberviri; 27 Aug, 2022 @ 3:01pm
Glytch3r 1 Sep, 2022 @ 11:04am 
hi again
can i get your discord?
i want to show you my script pls
Glytch3r#2892
Xyberviri  [developer] 7 Sep, 2022 @ 3:17pm 
Originally posted by Glytch3r:
hi again
can i get your discord?
i want to show you my script pls
Glytch3r#2892
Xyberviri#5609
Darryl Diamond 14 Dec, 2022 @ 10:06pm 
How do I create pink slip it’s not working
Xyberviri  [developer] 3 Jan, 2023 @ 5:18pm 
Originally posted by Darryl Diamond:
How do I create pink slip it’s not working

Hey there, you just need to create a item that uses the following template, these are all of the options for pinkslips:
module PinkSlip {
imports
{
Base
}

item ItemNameWhatever
{
DisplayCategory = CarWanna,
Weight = 0.1,
Type = Normal,
Icon = AutoTitle,
DisplayName = PinkSlip: NameOfVehicle,
VehicleID = VehicleIDofVehicle,
Skin = 0,
WorldStaticModel = CW.AutoTitle,
Tooltip = Tooltip_ClaimOutSide,
Condition = 100,
EngineQuality = 100,
GasTank = 100,
TirePSI = 100,
Battery = 1,
HasKey = true,
Tags = PinkSlip,
isBlacklisted = true,
}
}

The only lines you need to change are:

item ItemNameWhatever
DisplayName = PinkSlip: NameOfVehicle,
VehicleID = VehicleIDofVehicle,
isBlacklisted = true,

If you want pinkslips to be found in world then the module the item is created in must be "module PinkSlip" and you need to remove the line that reads "isBlacklisted = true,"

the only line that absolutely matters is the VehicleID which should be the full vehicle id with module like "Base.Car"

If you want the skin on the car to be randomized then remove the line that reads "Skin = 0,"
Last edited by Xyberviri; 3 Jan, 2023 @ 5:19pm
< >
Showing 1-5 of 5 comments
Per page: 1530 50