Forum Mod Bakery Docs

How to create a custom car

Please login to contribute to the conversation.
This tutorial will show you how to get started with custom cars (or cars that aren't in the phonebooth by default), without damaging original files.
The main reason I am writing this is to have a shortcut answer to the question "How do I make a custom car?".
Here is a list of tools you will need:
Also make sure you have your file extensions turned on, because I know many people don't and you'll be required to.
Step 1: Creating the mod
To make a custom car, you will need a mod directory first. Go inside your launcher directory and create a new folder inside /Mods.
In there, set up an ini file called Meta.ini
Here you have an example of what it should contain:
[Miscellaneous]
Title=My Car
Description=A description about my car
Version=1
InternalName=mycar
Category=Vehicle Mods
RequiredHack=CustomCarSupport		;only for custom vehicles, remove if you're not making a custom vehicle
RequiredHack=CustomFiles
RequiredHack=CustomText			;only for custom vehicles, remove if you're not making a custom vehicle

[Author]
Name=maz
Website=https://forum.donutteam.com/@[2399]

[Compile]
Decompilable=1
The following part of this step is no longer required if you're editing a car that is already in the game!
Once you're done with Meta.ini, you want to create CustomCarSupport.ini in the same directory.
Here's an example of what should be inside it:
[car]
Name=mycar	 ;this can be whatever you want your car to be called. Make sure it's less than 9 characters.
Index=107	 ;remember this number, you will need it on the next step. If you're making a custom car, it can only be a number from 97 to 255.
;the configurations below aren't needed unless you set them to 1. I have only added them because people oftenly wonder about them.
IsHusk=0	;set this to 1 if you want your car to be a husk
Recolourable=0 	;this is set to 1 for traffic cars and husks.
And lastly, you need a CustomText.ini file to give your vehicle a longer name in the phonebooth.
Here is an example for that file:
[CustomText]
MYCAR=maz' Tutorial Car	; Yes, the filename has to be UPPERCASE

More details about Meta.ini on this page.
More details about CustomCarSupport.ini on this page.
More details about CustomText.ini on this page.
Step 2: Creating The Car
This Step will show you how to create the car & make it compatible to the game. If you're editing a car that is already in the game, skip this step.
First, you will want to set up your main directories. Inside your mod, create a folder called CustomFiles.
Inside CustomFiles, you want to have the following:
  • art
    • cars
    • frontend
  • scripts
    • cars
  • sound
    • scripts

Art:

Inside this folder, we will go inside cars.
Here we need to place our vehicle's p3d file (mycar.p3d).
To get the p3d file, copy a car from the game (cHears.p3d in this example) and paste it in your cars folder, like so:
Now rename that file to whatever you have set for your car (mycar in this example)
Now, open the file with "Lucas' Pure 3D Editor" and go to the Tools tab. From there, go to Rename Car.. and type in the name of your car.
Now, find the two Follow Camera Data chunks and set the Car Index parameter to the index I mentioned back in step 1 (107 in this example) & save the file.
We should be done here.

scripts

Inside this folder, we will go inside cars and create the configurations. To get an original configuration file, go in the game's scripts/cars directory and copy the configurations of a car you like (cHears.con in this example) and paste it in your cars folder. Once there, rename it to whatever your car is called (mycar.con in this example).

sound

Inside this folder, we will go inside scripts and place car_tune.spt
Open this in a text editor & search for any car's sound parameters. Find one you like & copy its code block like so:
Copy this block and put it at the end of the file & change the name of the car
Here is the code block I used in my example
create carSoundParameters named mycar
{
    SetEngineClipName ( "cHears_car" )
    SetEngineIdleClipName ( "cHears_car" )
    SetDamagedEngineClipName ( "fire" )
    SetHornClipName ( "siren" )
    SetReversePitchCapKmh ( 50.000000 )
    SetReversePitchRange ( 0.500000 1.200000 )
    SetShiftPoint ( 1 0.010000 )
    SetShiftPoint ( 2 0.600000 )
    SetShiftPoint ( 3 0.940000 )
    SetShiftPoint ( 4 1.000000 )
    SetShiftPoint ( 5 1.000000 )
    SetGearPitchRange ( 1 0.360000 1.300000 )
    SetGearPitchRange ( 2 0.810000 1.430000 )
    SetGearPitchRange ( 3 1.090000 1.390000 )
    SetGearPitchRange ( 4 1.220000 1.390000 )
    SetGearPitchRange ( 5 1.280000 1.390000 )
    SetIdleEnginePitch ( 0.410000 )
    SetGearShiftPitchDrop ( 1 0.510000 )
    SetGearShiftPitchDrop ( 2 0.610000 )
    SetGearShiftPitchDrop ( 3 0.500000 )
    SetGearShiftPitchDrop ( 4 0.490000 )
    SetGearShiftPitchDrop ( 5 0.590000 )
    SetAttackTimeMsecs ( 163.000000 )
    SetDelayTimeMsecs ( 30 )
    SetDecayTimeMsecs ( 281.000000 )
    SetDecayFinishTrim ( 0.770000 )
    SetDownshiftDamperSize ( 0.060000 )
}
Everything should be done on this step now.
Step 3: Adding it to the phonebooth
This step is needed for both custom cars and cars already in the game.
Go inside art/frontend and inside create a folder named dynaload. Inside dynaload, create the folders cars & images.
Once done, go inside art/cars, copy the car's p3d file and paste the p3d file inside the newly created art/frontend/dynaload/cars, like so.
Now open this file with Lucas' Pure3D Editor, go to Tools tab and click Convert To Shop Preview and then save.
Now that we're done with this, we need the phonebooth sprites.
Go inside the original game directory & from there go to art/frontend/dynaload/images/cars2D & copy two p3d files (in my example, cHears.p3d & cHearsD.p3d).
Go inside your art/fronted/images file now & create cars2D and paste the two files inside.
Rename them to mycar.p3d & mycarD.p3d.
Now, open each and rename their sprites to mycar.png and mycarD.png
Everything should be done now, we just need to write a script that will add the car to your phonebooth list.
In the same directory as CustomFiles, create a new folder called AdditionalFiles.
Inside AdditionalFiles, create the folder scripts and inside scripts create missions.
Inside missions, create rewards.mfk and open it with a text editor and type the following code:
//BindReward( <name>, <filename>, <reward type>, "forsale", <level>, <coin cost>, <seller> );
BindReward( "mycar", "art\cars\mycar.p3d", "car", "forsale", 1, 0, "gil" );
//SetCarAttributes(<top speed>, <acceleration>, <toughness>, <handling>);
SetCarAttributes( "mycar", 0, 0, 0, 0 );
@Josh / Proddy and @Borb have came up with a slightly accurate formula to calculate car attributes, here is a pseudocode for that
Speed = 5 * ((TopSpeedKMH - 120) / 50)
Acceleration = 5 * ((GasScale * TireGrip) / 32)
Toughness = 5 * (((Mass / 100) + HitPoints) / 60)
Handling = 5 * ((NormalSteering - 50) / 50)
You can use this page to easily calculate the attributes of your con file.
Step 4: Adding it to the Minigame
This step is very easy to do!
First, go inside your mod /art/frontend/ & create a folder, call it scrooby.
Now, go in the main game directory, in the same folder /art/frontend/scrooby & copy the minigame.p3d file. Paste it in your scrooby.
Once that's done, open minigame.p3d and look for any car sprite (eg. cHears.png) inside it. Copy it and paste it anywhere in the file, call it mycar.png.
When you're done, go inside minigame.p3d's chunk 120 (D:\Radical\Projects\Simpsons2\game\exportart\frontend\scrooby\_pc\minigame.prj) and scroll down to it's subchunk 0 (MiniMenu.pag).
Inside that, copy a Frontend Image Resource chunk & paste it before S5 and rename it "mycar"
Then, edit the filename of the chunk in the Value Editor and set it to "images\minigame\vehicles\mycar.png"
As a last thing, look for the Foreground Frontend Layer chunk, and inside it look for Vehicles Frontend Group chunk.
Inside Vehicles, look for the following chunks:
  • Vehicle3_Value
  • Vehicle2_Value
  • Vehicle1_Value
  • Vehicle0_Value
For each of these, open the Value Editor & change the Number of Images to 44. Then just add your car's name at the end of the list.
I hope this tutorial helped you understand few things about making cars, if there is anything confusing about this tutorial, please let me know in the comments below!

YOUTUBE VIDEO: This video only covers steps 1 through 3.

ooooooooooooooooooooo weeeee - sick thanks for this.
is there anyway to add theme into the minigame?
is there anyway to add theme into the minigame?

Hey, I just edited the page now and added a 4th step explaining you how to do that!
is there a way how to recolor a traffic vehicle in paint. net?
Good afternoon friend, I have a question and it is if you can add more police vehicles in the levels. For example level 1 and 3 have only one patrol but the rest have two. Is there no possibility to add more?
Good afternoon friend, I have a question and it is if you can add more police vehicles in the levels. For example level 1 and 3 have only one patrol but the rest have two. Is there no possibility to add more?

Hello there, yes it is possible!
Simply edit the level's initialization script (i.e. scripts/missions/level01/leveli.mfk) and change the number in the "SetNumChaseCars()" command.

Also, since this question isn't quite related to the topic, I recommend you join our Discord for other questions like this.
I thank you very much friend, now I can have up to five patrols in a level. You are great, friend. :)
This post has been removed.
1 yr ago (Statistics)
Very helpful, thank-you very much!