Repository navigation
Car Mods
A car mod does one of three things:
- replaces a vehicle the game ships ("Replacing a shipped car");
- adds a new vehicle built on a shipped "donor" car ("Adding a car");
- adds parts to a vehicle the game ships, leaving the rest of it as it is ("Adding parts to a shipped car").
Source: src/mc_engine/modloader/modloader.cpp (the vehicles/ scan, parts.txt reader, BuildVehicleMods, BuildDonorCar, ShipGarageLines), src/mc_engine/modloader/rsc5.cpp (bones, manifest, driver packs) and src/mc_engine/hooks/mods.cpp. Read Mod Loader first for the folder rules and reload behavior. To make parts of the car move or glow, see Car Rigs.
A car is not one asset. A player car ships as many resources (the code comment gives "around a hundred and seventy"), one per part, so a mod states which of its own parts fills which slot. That statement is parts.txt.
<mod folder>/<mod>/
vehicles/
<car>/ name of the car; see the three sections below
<model>.glb the first .glb, .gltf or .obj found in the folder
parts.txt required
textures/ optional loose images, one per material name
files/ optional raw files (roster, garage lists, string tables, car config)
- Each folder directly under
vehicles/is one car. Plain files there are ignored. - The mesh is the first regular file with extension
.obj,.gltfor.glbfound in the car folder. Keep one mesh per car folder. (Withverbatim = 1, no mesh is needed.) - A missing or empty
parts.txtis logged asparts.txt maps no slots(orcannot open parts.txt) and the car is skipped. -
textures/works as for characters: one file per material name, accepted extensions in priority order.dds,.png,.jpg,.jpeg,.tga,.bmp. It only fills materials that have no image.
One key = value per line (ReadPartsFile).
- A comment starts at a
#at the start of a line or after a space or tab. A#inside a token is kept, becauseInteriorTrim#3names the fourth drawnInteriorTrim. - Lines without
=are ignored. - The value is split on commas into groups; spaces around groups are trimmed; empty groups are dropped. A line with no groups is dropped.
- A key that is not a reserved key (below) is a part slot:
slot = group[, group...]. The groups name glTF nodes,.objobjects (o), or materials of the model. Naming materials is how a car exported with its shell collapsed into one node can still be split (for exampleinterior0 = MAT_1, MAT_2).
A slot is a name from the table below followed by an index 0 to 9, for example hood0, door_l0, bumper_f5. The game asks for <slot><index>_lod_<lod> for lod 0 to 2.
conv_top conv_topup hood bumper_r trunk_swap
intercooler bumper_f fenders skirts spoiler
spoiler_b headlight taillight taillight_b frontgrill
wheeliebar blower bike_tail bike_tank bike_cowl
door_l door_r conv_topdown exh_pipe exh_side
armfl armfr armrl armrr shockfl
shockfr shockrl shockrr guiderl guiderr
axle subbumf subbumr widebody spoiler_wide
hood_wide door_l_wide door_r_wide trunk_wide interior
seats_f seats_p door_l_int door_r_int stereo
stereo_l stereo_r steer_whl post_gauge occluder_
A slot with no line keeps the shipped part. That allows a partial swap.
The game keeps a car's parts in a table of 55 slots x 10 indices x 3 LODs, and the car's part manifest (<car>.xspm) says which of them exist. A car that ships five bumpers lists indices 0 to 4; indices 5 to 9 are free, and template. lines (below) fill them. Ten variants per slot is the game's limit.
Listed with the example values from the loader's comments. These keys are consumed by the loader and are not slots.
| Key | Value | Meaning |
|---|---|---|
donor |
car name | Marks the folder as a new car built from this shipped car. See "Adding a car". |
extend |
1 or 0
|
1: add parts to the shipped car the folder is named after. See "Adding parts to a shipped car". |
template.<slot><i> |
<slot><j> |
Builds a variant the car does not have (for example template.bumper_f5 = bumper_f4) on the car's own file of variant j, and switches it on in the part manifest. See "More variants than the car has". |
garage.<section> |
key brand price variant |
A line added to the car's garage list (Parts.gtun). See "Garage list". |
driver |
car name | Whose driver animations the car uses. Default: the donor. |
driver_offset |
dx dy dz |
Moves the driver, in metres of car space. See "Driver and bones". |
bone.<name> |
tx ty tz rx ry rz |
Rest pose of one bone of the body skeleton, in every LOD. See "Driver and bones". |
verbatim |
1 or 0
|
1: clone the donor and rewrite nothing (a control). |
scale |
number | Scale of the model. Also marks the placement as given. |
offset |
x y z |
Offset of the model, three numbers on one line. |
yaw, pitch, roll
|
degrees | Rotation of the model. Example in the comments: pitch = -90 for a Z-up file. |
silence |
slots | Slots left out of the car. |
keep |
effect names | Shader effects left exactly as the donor drew them. |
flat_uv |
effect names | Effects given flat UVs. |
weight.<effect> |
number | Scales the share of the body size budget given to the shader running that effect. Default 1.0. Example: weight.CarPaintCustomizable = 2.5. |
shader.<material> |
effect name, optionally #N
|
Which of the game's car shaders a material is drawn with. shader.* is a catch-all. shader.<slot>.<material> applies to one part only. See "Shaders". |
frame.<slot> |
tx ty tz rx ry rz [scale] [rigid] |
Rest pose of the bone that draws a slot. rigid means a body panel with no centring. See "Where a part is placed". |
license.<slot> |
12 numbers | The four corners (top-left, top-right, bottom-left, bottom-right, each x y z) of a licence plate quad. |
plate |
x y z |
Where the donor's plate moves to. |
exhaust.<slot> |
x y z [single] |
Where the smoke bones of that (rear bumper) part go, car space: the left pipe's mouth, the right one mirrored. single puts both at the one point given, for a car with one tail pipe. Needs a rigid frame.<slot>. The bones are found by name: extPrimary<i>/extSecondary<i> or exst_primary_<i>/exst_secondary_<i>. |
locator.<slot>.<prefix> |
x y z |
Moves every bone of that part named <prefix><digits> to this car-space point, x mirrored by the side the bone is on, rotation kept. Lamp parts carry their light sources this way (on vp_nsn_skyline_99: hl_low_, hl_hi_, fog_ in each headlight, brake_ in each taillight, amber_ in the stock front bumper, rev_ in each rear bumper); the halo and the beam start at these bones. A slot in its bone's space needs a rigid frame.<slot>. See "Lamps". |
body_m<N> |
groups | Groups written into model N of the body drawable; needs a rigid frame.body_m<N>. |
lamp_box |
<index> <material or *> xmin xmax ymin ymax zmin zmax |
Lamp index for the CarLight triangles of that material inside the box (x as absolute value); the first matching line wins. See "Lamps". |
lamp_from |
slots | Donor lamp slots whose lamps are sampled for lamp indices. |
band.<name>, dial.<clip>
|
numbers | Band weight, and a dial's pose and sweep (tx ty tz rx ry rz, frame degrees, ...). A malformed dial logs parts.txt: dial.<clip> wants 'tx ty tz rx ry rz, frame degrees, ...'. |
tune |
rename |
Rewrite the tune's embedded car name. Requires a new name no longer than the donor's. |
tune.<field> |
value | Change a field of the car tune after renaming. Fields named in the code comments: cFrontBumperMovement and the other bumper fields (NoMovement, AllowLoose, AllowBroken), hood and boot movement (NoMovement, NormalMovement, ReverseMovement). An unknown field logs tune.<field> is not a field this can change. |
paint_shade |
hex colour word | One colour word for all paint, for example F4000000. |
atlas_cell |
256, 512 or 1024 | Texel size kept per textured shader. Other values are ignored. |
Reserved keys are matched case-insensitively. Do not use them as slot names.
Name the folder after the shipped vehicle, for example vehicles/vp_nsn_skyline_99/, and give no donor or extend line. Rules:
-
parts.txtmust have awidebody0line. Without it the car is skipped:parts.txt has no 'widebody0' line, and without it there is nothing to size the car against. The body groups set one scale for the whole car, measured along its length, so every part is resized by the same factor. - Each slot line names the model's groups that fill that slot of the game's car. Parts are placed where the slot they replace sits, turned to face the way the game does, and scaled by the car's factor.
- Materials routed to a part slot leave the body; otherwise the body would be drawn twice.
- The car is turned about the vertical axis by
model_mods_car_yaw(default180.0) before parts are placed.
Example skeleton, using the form shown in the loader's comments:
widebody0 = mycar_body
hood0 = mycar_hood
door_l0 = mycar_door_FL
A parts.txt that names a donor builds a car the game does not ship, from a car it does. The roster is data: a tune/vehicle/vehicleNNNN.lst entry naming a car makes the showroom ask for resources under resources/vehicle/<name>/. A mod ships that list file as a raw file:
<mod>/files/tune/vehicle/vehicle0003.lst copied to tune/vehicle/vehicle0003.lst
Which numbers are free and what goes inside the file are in Roster lists. The names a donor = line can take are in Shipped vehicles.
What the game asks for per car: three LOD drawables (body_lod_0 to body_lod_2), two material packs (<name>.xtl, <name>.xtp), a tune (<name>.xct), a part manifest (<name>.xspm), and the slot drawables, each behind an existence check. A file the mod does not ship is simply not drawn. The donor supplies the non-geometry files (tune, packs, bound, manifest); the mod's mesh goes into the drawables. The whole model is placed with one transform that you write (scale, offset, yaw, pitch, roll). The loader does not measure it: without a scale or offset line the model goes in exactly as exported. See "Wheels and wheel arches".
Further behavior:
- The new name must not be longer than the donor's; otherwise the loader logs
the name is longer than the donor's (N). - A
bodyline names the model's groups that make the shell; without one the whole model is the shell. A body that matches no geometry logsthe 'body' line names no geometry in the modeland the car is not built. - Driver animations: the game files them under the car's name without
vp_. The loader aliases the new car's name to the donor's (ordriver) while the cars are built, through hooks on the three name formatters. The log line isdriver animations from <car>. Withdriver_offset, the car ships packs of its own instead (see "Driver and bones"). - The garage files of a new car (
tune/garage/<car>.Garage,<car>_Parts.gtun,<car>_exterior.gtun, ...) are raw files the mod ships underfiles/, usually copies of the donor's. - A car config (
.xcc) shipped as a raw file whose rim byte names a rim is resolved to the rim catalog index when archives are written, so the garage shows the wheels. The log line namesrim byte ... resolved to catalog index N. How a car finds its wheels, and how to ship wheels of its own, is in Wheel Mods. - A raw file that is an exact copy of another archive entry (header
LARC) is supported for entries that cannot be rebuilt, such as a per-car config. See The LARC header.
The most common fault in a new car is a wheel that does not sit in its arch: too far forward at the back, too high, or inside the bumper. The wheels are not part of your model. The game draws them on the donor's skeleton, at the bones axl_0 to axl_3. A new body does not move them, so the model has to be moved and sized so that its arches land on the donor's axles.
Three things that do not move a wheel forward or back:
-
model_mods_rim_offset_x, and the TIRE OFFSET garage row: both move a wheel sideways only (see Wheel Mods). - Shipping the donor's
.xctunderfiles/unchanged: it is the same tune the car would get anyway. - Reusing the
parts.txtof another car mod.scale,offset,frame.,license.anddial.numbers belong to one model on one donor. With noscaleoroffsetline the model goes in unplaced, whatever the comments in the copied file say.
The wheelbase is the distance between the front and rear axles. Pick the donor whose wheelbase is closest to your model's: then the car keeps its size. The new car's name must not be longer than the donor's.
Choose before writing the rest of parts.txt. Changing the donor later also changes the bones, the part slots and the shader numbers.
Values read from the axl_* bones of each shipped car's body_lod_0, in metres. z is front to back and the nose is at -z. Where one z is given the axles are at -z and +z.
Donor table: wheelbase, axles and track of the shipped cars (click to open)
| Donor | Name length | Wheelbase | Axle z (front / rear) | Hub height y | Track |
|---|---|---|---|---|---|
vp_dsn_280z_75 |
14 | 2.329 | ±1.165 | 0.328 | 1.425 |
vp_vw_golf_83 |
13 | 2.402 | ±1.201 | 0.356 | 1.328 |
vp_mit_3000gt_99 |
16 | 2.405 | ±1.203 | 0.325 | 1.530 |
vp_mzd_rx7_95 |
13 | 2.443 | ±1.221 | 0.314 | 1.454 |
vp_vw_scirocco_88 |
17 | 2.444 | ±1.222 | 0.305 | 1.342 |
vp_lam_miura_71 |
15 | 2.503 | ±1.251 | 0.336 | 1.418 |
vp_pon_solstice_06 |
18 | 2.508 | ±1.254 | 0.343 | 1.543 |
vp_lam_gallardo_06 |
18 | 2.547 | ±1.274 | 0.326 | 1.564 |
vp_nsn_240sx_98 |
15 | 2.553 | ±1.276 | 0.315 | 1.442 |
vp_mbz_sl65_07 |
14 | 2.560 | ±1.280 | 0.321 | 1.520 |
vp_mit_eclipse_99 |
17 | 2.560 | ±1.280 | 0.322 | 1.453 |
vp_frd_cobra_04 |
15 | 2.580 | ±1.290 | 0.315 | 1.507 |
vp_vw_golf_07 |
13 | 2.580 | ±1.290 | 0.326 | 1.484 |
vp_am_vantage_07 |
16 | 2.603 | ±1.301 | 0.326 | 1.564 |
vp_aud_rs4_07 |
13 | 2.613 | ±1.306 | 0.318 | 1.525 |
vp_frd_focus_04 |
15 | 2.622 | ±1.311 | 0.303 | 1.446 |
vp_chv_cobalt_05 |
16 | 2.624 | ±1.312 | 0.327 | 1.460 |
vp_lam_murcielago_06 (_dub) |
20 (24) | 2.626 | ±1.313 | 0.309 | 1.575 |
vp_mit_evo_06 |
13 | 2.628 | ±1.314 | 0.328 | 1.498 |
vp_nsn_350z_06 |
14 | 2.631 | ±1.315 | 0.324 | 1.532 |
vp_aud_r8_08 |
12 | 2.650 | ±1.325 | 0.343 | 1.564 |
vp_nsn_skyline_99 |
17 | 2.663 | ±1.331 | 0.326 | 1.460 |
vp_chv_corvettez06_07 |
21 | 2.689 | ±1.345 | 0.323 | 1.604 |
vp_mzd_rx8_06 |
13 | 2.706 | ±1.353 | 0.336 | 1.525 |
vp_sln_s7_06 |
12 | 2.709 | ±1.354 | 0.351 | 1.662 |
vp_frd_gt_06 |
12 | 2.710 | ±1.355 | 0.334 | 1.584 |
vp_frd_mustang_06 |
17 | 2.723 | ±1.362 | 0.346 | 1.544 |
vp_sln_s281_06 |
14 | 2.723 | ±1.362 | 0.346 | 1.544 |
vp_chv_camaross_69 |
18 | 2.763 | ±1.381 | 0.351 | 1.430 |
vp_frd_boss302_69 |
17 | 2.763 | ±1.381 | 0.319 | 1.524 |
vp_nsn_gtr_08 |
13 | 2.784 | -1.435 / +1.349 | 0.369 | 1.591 |
vp_buk_grandnational_87 |
23 | 2.788 | ±1.394 | 0.322 | 1.462 |
vp_chv_camaro_06 (_dub) |
16 (20) | 2.790 | ±1.395 | 0.334 | 1.613 |
vp_dge_challenger_70 |
20 | 2.828 | ±1.414 | 0.315 | 1.508 |
vp_pon_transam_79 |
17 | 2.829 | ±1.415 | 0.365 | 1.520 |
vp_chv_impala_96 |
16 | 2.945 | ±1.473 | 0.342 | 1.582 |
vp_dge_challenger_06 (_dub) |
20 (24) | 2.946 | ±1.473 | 0.377 | 1.651 |
vp_cry_300c_06 |
14 | 3.049 | ±1.524 | 0.361 | 1.550 |
vp_dge_charger_06 |
17 | 3.049 | ±1.524 | 0.361 | 1.550 |
vp_chv_police_96 |
16 | 3.081 | -1.569 / +1.512 | 0.337 | 1.588 |
vp_mbz_s600_07 (_dub) |
14 (18) | 3.149 | ±1.574 | 0.326 | 1.595 |
In your 3D editor, with the model facing the way it will face in the game (nose at -z), find the centre of each wheel:
- If the model came with wheels, use the centre of the front wheel and of the rear wheel. Delete the wheels from the export afterwards.
- If it has no wheels, use the centre of each wheel arch. A side view and a circle fitted inside the arch opening is enough. Brake discs left in the body are a second check.
Write down three numbers: front wheel z, rear wheel z, wheel centre height y. These are in the exported file's axes (y up). Blender shows z up, and its glTF export turns that into y up.
If the model faces +z, turn it with yaw = 180 and measure as if it were already turned (the sign of every z flips).
model_wheelbase = rear_z - front_z
model_middle = (front_z + rear_z) / 2
donor_middle = (donor_front_z + donor_rear_z) / 2 (0 for most donors)
scale = donor_wheelbase / model_wheelbase
offset_y = donor_hub_y - model_wheel_y * scale
offset_z = donor_middle - model_middle * scale
scale = 0.925
offset = 0 0.010 0.019
offset is three numbers on one line separated by spaces, not commas. It is in metres, applied after the scale and the turn. A positive z moves the body back, which makes the wheels sit further forward in the arches.
Worked example, with made-up measurements: a model with its wheel centres at z = -1.40 and z = +1.36, at height 0.33, on vp_nsn_240sx_98. With no scale or offset the front wheel sits about 12 cm behind the middle of its arch and the rear wheel about 8 cm ahead of it. The model's wheelbase is 2.76 against the donor's 2.553 and its middle is at -0.02, so scale = 2.553 / 2.76 = 0.925, offset_z = 0 - (-0.02 * 0.925) = 0.019 and offset_y = 0.315 - 0.33 * 0.925 = 0.010. Both lines above come from this.
The scale resizes the whole car, here by 7.5 percent. If that is too much, use a donor with a closer wheelbase: for a wheelbase of 2.76, vp_frd_boss302_69 or vp_chv_camaross_69 (2.763) need almost no scaling.
Look at the car from the side in the garage.
| What you see | Meaning | Change |
|---|---|---|
| Both wheels off by the same amount in the same direction | Wrong offset_z
|
Wheels too far toward the nose: lower offset_z. Too far toward the tail: raise it. |
| One end right and the other wrong, or the two off in opposite directions | Wrong wheelbase, so wrong scale (or wrong donor) |
Moving offset_z alone only trades one end for the other. Compute scale again, then offset_z. |
| Tyres into the top of the arch, or a large gap above them | Wrong offset_y
|
Tyre into the arch: raise offset_y. Gap: lower it. |
| Wheels buried in the body or standing far outside it | Track differs from the donor's | Compare your width at the arches with the donor's track. TIRE OFFSET can adjust a little per car. |
Restart the game after each change, and check in the log the line placed at scale ..., box (...) to (...). If that line is missing, the parts.txt has neither scale nor offset.
Lines that hold car-space points (license., plate, exhaust., locator., dial., driver_offset, lamp_box) must match the model after placement. Change scale or offset and they need to be measured again.
bone.<name> (see "Driver and bones") finds a body bone by name, and the axle bones are axl_0 and axl_1 (front, x negative and positive) and axl_2 and axl_3 (rear). Moving them has not been tested in game: whether the drawn wheels and the driving physics both follow is unknown. Use scale and offset.
A mod can ship a file under files/ at the same path as one the loader builds for a new car, for example the tune:
<mod>/files/resources/vehicle/<car>/<car>.xct
The mod's copy wins:
-
Tune, material packs and part manifest (
.xct,.xtl,.xtp,.xspm): the loader starts from your copy instead of the donor's and still applies what it would have applied, includingtune = renameandtune.<field>. Log:<file> is rewritten from the mod's files/ copy, not the donor's. The copy must be an archive resource with its RSC5 header, exactly as extracted. A decompressed dump is kept as shipped and logsfrom files/ kept as shipped, not rewritten (...). -
Body and part drawables (
.xrsc): the file is used as it is and the one from your model is not built. Log:<file> comes from the mod's files/, not built.
You only need such a file if you edited it. Do not ship an untouched copy of the donor's tune. The loader has no parts.txt key that moves wheels through the tune, and editing the tune by hand to move them has not been verified.
In builds made before 21 November 2026, a file shipped this way put the same path in the archive twice and the whole mod archive was refused, which removed every mod, not only this car. If that happens, update the game or remove the file.
It ships one archive entry as an archive holds it. All numbers are big-endian.
| Offset | Size | Content |
|---|---|---|
| 0 | 4 | The letters LARC. |
| 4 | 4 | Resource type of the entry. Only its low 8 bits are kept. For a plain file the value is ignored and 0 is used. |
| 8 | 4 | Flag word of the entry. |
| 12 | 4 | Not read. |
| 16 | the rest | The entry's bytes, as the source archive stores them. |
The loader takes off the 16 bytes and writes the rest into the mod archive unchanged, with that type and flag word. The file has to be longer than 16 bytes.
A compressed resource behind a LARC header has to keep its RSC5 header after the 16 bytes, and gets the same XCompress marker check as one shipped with its RSC5 header: a marker other than 0x0FF512EF over a stream that decodes whole is rewritten (XCompress marker ... rewritten to 0x0ff512ef); otherwise the file is left out (compressed resource with XCompress marker ... left out).
One kind is refused: a flag word with bit 31 set and bit 30 clear marks an uncompressed resource, which this route cannot lay out. The log says marks an uncompressed resource, which this path ships unchanged and so cannot lay out. Ship its segments behind an RSC5 header instead, and the loader packs them.
Source: src/mc_engine/modloader/modloader.cpp (kLarcMagic).
The garage shows each car as a picture: in the showroom, in the vehicle list and on reward screens. The pictures are raw files a mod ships under files/. A new car has none until the mod ships them, and a mod can ship its own for a shipped car.
Source: src/mc_engine/modloader/picture_dict.cpp (the checks), src/mc_engine/modloader/modloader.cpp (the refusal) and src/mc_engine/ui/mod_file_toast.cpp (the pop-up). The sizes and formats below were measured on the game's own 339 picture files.
All paths start with <mod>/files/resources/ui/textures/garage/dyntextures/:
| File | Size in pixels |
|---|---|
showroom/sh_<car>.xtd |
512 x 512 |
mini_showroom/msh_<car>.xtd |
128 x 64 |
managerides/mr_<car>.xtd |
512 x 128 |
rewardvehicles/<car>.xtd |
512 x 180 |
<car> is the car's name, for example vp_.... In the game's files, each of these dictionaries holds exactly one texture: DXT5, tiled for the Xbox 360, one mip level.
The game does not take the picture by the file name alone. Inside the dictionary, the texture must be named after the file's own path, from garage/ on, with .dds in place of .xtd:
| File | Texture name inside |
|---|---|
showroom/sh_<car>.xtd |
garage/dyntextures/showroom/sh_<car>.dds |
mini_showroom/msh_<car>.xtd |
garage/dyntextures/mini_showroom/msh_<car>.dds |
managerides/mr_<car>.xtd |
garage/dyntextures/managerides/mr_<car>.dds |
rewardvehicles/<car>.xtd |
garage/dyntextures/rewardvehicles/<car>.dds |
The name is stored twice: as text, and as a hash of that text in the dictionary's hash list. The game searches by the hash. The hash is the game's string hash (Jenkins one-at-a-time over the text, lower case, with / as the separator; RageHash in src/mc_engine/modloader/rpf3.cpp).
Renaming the .xtd is not enough. A picture copied from another car and renamed on disk still carries the other car's name and hash.
- Start from the game's own picture of the same kind (a showroom picture for a showroom picture, and so on). See Dumping Your Game for getting at the game's files.
- Open it with a tool that edits Xbox 360 texture dictionaries. LARecomp does not include one.
- Replace the image. Keep the size, the DXT5 format, the tiling and the single mip level.
- Rename the texture to the name in the table above. Check that your tool also updates the hash; if it does not, the name is only half changed.
- Save it under the matching file name.
Do not build the file from nothing, or with a converter that writes the texture object its own way. The second 32-bit word of the texture object (the block map pointer) is 0 in all of the game's pictures. Another value there that does not point into the file crashes the game with Invalid fixup, address is neither virtual nor physical when the garage loads the picture. If a tool writes such a file, its description of the texture for the GPU may be wrong too, so rebuild from the game's file instead of patching that one word.
A file can be shipped compressed, as extracted from an archive, or as bare segments behind a 16-byte RSC5 header with the compression bit clear; the loader packs the second kind.
The loader checks every .xtd under resources/ui/textures/garage/dyntextures/ when it builds the mod archives. A faulty one is left out: a shipped car then shows the game's own picture (unless a later mod ships a good one), and a new car shows none. The log has an error line, and a pop-up named MOD FILE REFUSED comes up when the game starts. It names the mod, each file (four at most, then a count) and the problem, and closes by itself after 15 seconds. It sits on the same side of the screen as the controller notification, at the other end.
| Pop-up text | Log line (abridged) | Fix |
|---|---|---|
Broken texture data: it would crash the game |
REFUSED, broken picture file: the texture object holds <value> where the block map pointer goes |
Rebuild from the game's picture of the same kind. |
Wrong texture name inside the file |
REFUSED, wrong texture name inside the picture dictionary: it holds "<name>" and the game looks up "<name>" |
Rename the texture inside the file, hash included. |
These two checks are not a full validation. A wrong size or format, a bad image, or a car name misspelled the same way outside and inside the file passes them. A compressed file that cannot be read is not checked. Builds without these checks load both faults without a message about the picture.
A new car is built inside the donor's files, so the donor's own geometry is still there. The loader hides it in three layers, and one more switch covers the rest. Knowing which layer a leftover piece belongs to is most of the work.
| What the donor drew | What happens to it | What you do |
|---|---|---|
The body shell (body_lod_0 to body_lod_2) |
The mod's mesh is written into the donor's body drawable, one shader (effect) at a time, over the donor's submeshes of that shader. For every donor shader that none of the mod's materials maps to, the loader silences all the donor's geometry drawn with it. Log: <effect> silenced (N submesh(es) the mod has no material for). |
Nothing: the donor's shell does not survive a build. Map the mod's materials with shader.<material> (see "Shaders") so they land on the effects you want. |
| Submeshes in bone-local models of the body (a bumper's paint, a lamp, a door window) | With model_mods_car_space_only on (the default), the donor's submeshes in models that are not in car space are silenced instead of being written into, because geometry in car space would land wherever that bone is. Log: N bone-local submesh(es) silenced. |
Nothing. Leave model_mods_car_space_only on. |
A part slot the parts.txt lists (hood0 = my_hood) |
The part file is rewritten with the mod's geometry. Again, any effect the part draws that none of its materials maps to is silenced. Log: <slot> <effect> silenced (N submesh(es)). |
Give the slot's materials a shader, or accept that the rest of the part is hidden. |
A part slot the parts.txt does not list |
The donor's shipped part stays and draws. This is the usual reason a donor's hood, bumper, spoiler, mirror or skirt shows up around the new car. | Map the slot to a group of the model, or hide it with silence. |
silence = hood0, skirts0, spoiler0
Each name in the list is a slot plus its index, written exactly as it is in the manifest (hood0, not hood). The part's three LOD files are left out of the car's archive, and the game, which opens every part path and treats a missing one as "nothing to draw", draws nothing. Log: <file> left out, the mod ships its own.
- One name hides one variant. A car that ships five bumpers needs
bumper_f0, bumper_f1, bumper_f2, bumper_f3, bumper_f4to hide all of them, or the donor's bumper appears when the player picks that variant in the garage. - What the garage menu offers comes from the car's garage list, not from
silence(see "Garage list"). A variant you silence but leave in the list is offered and draws nothing. -
silenceworks on a car with adonorand on anextendcar. With a donor, the file is left out of the mod archive (<file> left out (silence)). On anextendcar the game's own file stays in the game's archive, so the part is switched off in the car's part manifest instead (<file> switched off in <car>.xspm (silence)). A name that is not a part name is logged assilence: <name> is not a part name. The manifest the loader builds has been checked; the look of anextendcar with a silenced part has not been checked in game yet.
keep = LicensePlate leaves every submesh the donor draws with that effect exactly as the donor drew it, instead of silencing it. Use it for what a mod does not bring: the donor's plate is a four-vertex quad in the right place on any car of the same shape. plate = x y z moves it. Other effect names are in the list under "Shaders".
The log is the only reliable view. For each LOD 0 build it states donor <car> draws with 0=<effect>, 1=<effect>, ... and which of those the body renders, then one silenced line per effect it removed. A donor piece you still see is a slot the parts.txt left alone, or an effect on the keep line. If the whole car is missing instead, see "Failure modes" (body_lod_N took no geometry at all).
extend = 1 adds parts to a car the game ships, under its own name. Name the folder after the car, for example vehicles/vp_nsn_skyline_99/. Any shipped car works.
The car is its own donor:
- Every file of the car is copied as shipped: body, material packs, textures, tune, part manifest and every part the
parts.txtdoes not name. - Only the slots the
parts.txtlists are built. A listed slot the car has (bumper_f0) is replaced; a variant it lacks (bumper_f5) needs atemplate.line. - Nothing is renamed and no texture is written, so the car looks as it did. A new part draws with the car's own shaders and textures: paint, glass, black, chrome and the other untextured effects need nothing, and a textured effect shows the picture the car already has for it.
- Parts are authored in the car's own space (see "Where a part is placed"). Each one is written in the frame of the bone its slot hangs from, read off the car's skeleton, unless a
frame.line says otherwise. -
body_m<N>lines are refused: the body stays as shipped. -
bone.,dial.,plateanddriver_offsetdo nothing on an extended car: the first three change the body, which is copied as shipped, and moved driver packs ship under a name of the car's own. The loader logsan extended car keeps its body and its name, so these lines do nothing: .... - A
donorline is ignored (logged).
Example: a sixth front bumper on the game's R34, with its own name in the garage.
extend = 1
template.bumper_f5 = bumper_f4
bumper_f5 = my_bumper
shader.bumper_f5.PAINT = CarPaintCustomizable
shader.bumper_f5.BLACK = BlackMatte
garage.bumper_front = r34_my_bumper 0 1450 5
Step by step, for a new part on a shipped car:
- Name the folder after the car (
vehicles/vp_nsn_skyline_99/) and putextend = 1inparts.txt. - Pick the slot and a free index. Indices 0 to 9 exist; the ones the car's part manifest does not list need a
template.<slot><i> = <slot><j>line first, where<slot><j>is a variant the car has and whose shaders suit the new part. - Write the slot line (
bumper_f5 = my_bumper) naming the groups of your model. - Give the materials a shader of the ones that slot's file draws:
shader.bumper_f5.PAINT = CarPaintCustomizable. A shader the mould lacks only draws when the vertex layouts match (see "Shaders"). - Add the
garage.line whose last field is the index, or the part never appears in the garage menu:garage.bumper_front = my_key 0 1450 5. - Author the part in the car's own space. If it sits wrongly, add
frame.<slot>(see "Where a part is placed"). - Start the game and read the
[mods]lines for the car before changing anything.
Replacing one of the car's own parts needs steps 1, 3, 4 and 6 only.
Two mods that extend (or replace) the same car do not combine: each writes the car's files, and only one of them takes effect. Keep one mod per car.
template.<slot><i> = <slot><j> builds variant i, which the car (or donor) does not have, on its file of variant j. That file is the mould: its page layout, its shaders and the bone it hangs from. The part is written as <slot><i>_lod_<l> and its manifest entry is switched on, or the game would never ask for it. The log line is <car>.xspm lists N new part file(s).
- Pick a mould whose shaders the new part needs: a slot can only draw with the shaders its file has (see "Shaders"). On the R34,
bumper_f4draws paint, BlackMatte, Underbody and BumpSpec;spoiler0draws paint, BumpSpec and BumpSpecAlpha. - The new variant still has to be listed in the garage to be chosen: add a
garage.line whosevariantisi. - Indices go up to 9.
template.names that are not a slot plus one digit logtemplate.<name>: not a part name.
Works the same for a new car (donor) and for extend.
The roster is the set of tune/vehicle/vehicle*.lst files. At start the game reads vehicle.lst and then tries vehicle0001.lst to vehicle0008.lst; a numbered file that does not exist is skipped without a message. The game's own archive ships vehicle.lst, vehicle0001.lst and vehicle0002.lst. Whether any downloadable content package carries a higher number has not been checked.
A mod adds cars by shipping a numbered list that the game does not have, for example <mod>/files/tune/vehicle/vehicle0003.lst. One list can hold any number of Vehicle blocks. All mods share the numbers: when two ship the same file, the second is skipped (already shipped by another mod, skipped).
Source: the game's list reader (sub_823971D0 for the files, sub_823964C0 for one vehicle, sub_82396D18 for one manufacturer) and the three shipped files.
Plain text. The shipped files use CRLF line ends and are stored compressed in the archive; a mod's copy under files/ can be plain text. Each block is a keyword, {, its keys with their values, and }. The game reads words separated by spaces, tabs or line ends, so the line breaks are only for reading; a value with a space in it goes in double quotes, and ; starts a comment. The shipped files put one Key value pair on each line (some keys are a bare word):
Vehicle
{
Name vp_my_car
PoliceDesc vp_nsn_240sx_98
Class Tuner
Manufacturer Nissan
Group D0
UnlockingGroup D0
DistrictFilter Hollywood
DistrictFilter Beaches
Roof 0
PlayerOnly 0
Price 4500
BaseAccel 0.12
ModsAccel 0.20
BaseSpeed 130.00
ModsSpeed 172.00
BaseHndlg 0.174
ModsHndlg 0.285
}
All Manufacturer blocks of a file come before its first Vehicle block; a Manufacturer block after a Vehicle block, and anything following it, is not read.
The order of the keys matters. The game does not search the block: it looks for each key in turn, in the order of the table below. Reading stops at the first key that comes earlier in the table than one already read: that key and everything after it in the block is skipped, with nothing in the log. An optional key can be left out. Name, PoliceDesc, Class and Manufacturer must all be there: the game takes the next word as that key without checking it. Key names are compared without regard to case. All 69 shipped entries follow this order.
| Order | Key | Value | Meaning |
|---|---|---|---|
| 1 | DEVONLY |
none | The entry is skipped unless a flag inside the game is set. Going by the key's name, it is for development. |
| 2 | NOTFORSALE |
none | Marks the car as not for sale. |
| 3 | Name |
text | The car's name: its folder under resources/vehicle/. The game also forms <name>_shrt from it. |
| 4 | PoliceDesc |
car name | A car name. The shipped entries give the car itself or another shipped car. |
| 5 | Class |
see below | Vehicle class. |
| 6 | Manufacturer |
text | Must be the Name of a Manufacturer block; otherwise the game logs Unknown manufacturer <name> in vehicle list file. |
| 7 | Group |
see below | Performance group. |
| 8 | UnlockingGroup |
a group | Same values; equal to Group when left out. |
| 9 | DistrictFilter |
district | Repeat the line for each district. |
| 10 | ContentFlags |
integer | Content bits. Their meaning has not been traced. |
| 11 | ContentDownloadFlags |
integer | Equal to ContentFlags when left out. |
| 12 | PortalRewardIdx |
integer | Not traced. |
| 13 | TurboCharged |
integer | Not traced. |
| 14 | Roof |
integer | Not traced. |
| 15 | Transmission |
integer | Not traced. |
| 16 | ForceITZ |
none | Not traced. |
| 17 | SpecialEdition |
none | Marks a special edition. |
| 18 | PlayerOnly |
integer | Any value but 0 sets the flag. |
| 19 | Price |
integer | Price. |
| 20 to 22 |
BaseAccel, ModsAccel, ShowroomAccel
|
number | Acceleration figures: stock, with modifications, and for the showroom. |
| 23 to 25 |
BaseSpeed, ModsSpeed, ShowroomSpeed
|
number | Speed figures, same three. |
| 26 to 28 |
BaseHndlg, ModsHndlg, ShowroomHndlg
|
number | Handling figures, same three. |
A Showroom... figure left out is equal to its Base... figure.
Values are compared without regard to case:
-
Class:Tuner,Muscle,Exotic,SportBike,Luxury,Cop,SUV,LowRider,Misc1. -
GroupandUnlockingGroup:D0toD4,C0toC4,B0toB4,A0toA4. -
DistrictFilter:Hollywood,Beaches,Hills,Downtown,SouthCentral(alsoSC, or"South Central"in double quotes),Unknown,All.
A Manufacturer block has Name and then, optionally, CanBeOnFire with an integer. The shipped vehicle.lst declares these 33: Mercedes, Nissan, Dodge, Chevy, Hotmatch, Chrysler, Lamborghini, Datsun, Mitsubishi, Volkswagen, Pontiac, Buick, Audi, Ducati, Kawasaki, Saleen, Ford, Mazda, Cadillac, AstonMartin, LandRover, MC3, Other, Downloadable1, Downloadable2, Downloadable3, Downloadable4, Downloadable5, Downloadable6, Downloadable7, Downloadable8, Downloadable9, Downloadable10.
These are the 69 vehicles named by the three shipped lists, in file order. A Name is what goes in a vehicles/<car>/ folder name (to replace or extend that car) and in a donor = line.
The game's resources/vehicle/ has 107 folders, and they do not match the roster one to one:
- 64 of the roster's names have a folder of the same name.
- The 5
vp_se_...entries have none. Each has a car config (resources/vehicle/configs/<name>.xcc) and a garage file (tune/garage/<name>.Garage); which model they are drawn with has not been traced. - 41 folders start with
va_and are not in the roster; they are listed under Folders outside the roster. -
vp_nsn_gtr_08is not in the roster either. Its folder has 163 files, among them a tune and a body, and it has a garage file but no car config. Using it from a mod has not been tested. -
configsholds the car configs and is not a car.
The archive stores only a hash of each folder name. The names here were recovered by matching those hashes against names found in the game's own data; all 107 match.
Vehicles in vehicle.lst: 48 (click to open)
| Name | Class | Manufacturer | Group | Note |
|---|---|---|---|---|
vp_vw_golf_83 |
TUNER | Volkswagen | D0 | |
vp_nsn_240sx_98 |
TUNER | Nissan | D0 | |
vp_dsn_280z_75 |
TUNER | Datsun | D0 | |
vp_vw_scirocco_88 |
TUNER | Volkswagen | D0 | |
vp_chv_camaross_69 |
MUSCLE | Chevy | C0 | |
vp_frd_boss302_69 |
MUSCLE | Ford | C0 | |
vp_pon_transam_79 |
MUSCLE | Pontiac | C0 | |
vp_chv_impala_96 |
MUSCLE | Chevy | D0 | |
vp_buk_grandnational_87 |
MUSCLE | Buick | C0 | |
vp_dge_challenger_70 |
MUSCLE | Dodge | C0 | |
vp_frd_focus_04 |
TUNER | Ford | C0 | |
vp_pon_solstice_06 |
TUNER | Pontiac | C0 | |
vp_mit_eclipse_99 |
TUNER | Mitsubishi | C0 | |
vp_chv_cobalt_05 |
TUNER | Chevy | C0 | |
vp_mzd_rx8_06 |
TUNER | Mazda | C0 | |
vp_duc_monster_s4r_07 |
SPORTBIKE | Ducati | B0 | |
vp_frd_mustang_06 |
MUSCLE | Ford | C0 | |
vp_chv_camaro_06 |
MUSCLE | Chevy | C0 | |
vp_chv_camaro_06_DUB |
MUSCLE | Chevy | B0 | player only |
vp_dge_charger_06 |
MUSCLE | Dodge | C0 | |
vp_dge_challenger_06 |
MUSCLE | Dodge | C0 | |
vp_dge_challenger_06_DUB |
MUSCLE | Dodge | B0 | player only |
vp_cry_300c_06 |
LUXURY | Chrysler | C0 | |
vp_vw_golf_07 |
TUNER | Volkswagen | C0 | |
vp_nsn_350z_06 |
TUNER | Nissan | C0 | |
vp_mit_3000gt_99 |
TUNER | Mitsubishi | C0 | |
vp_mzd_rx7_95 |
TUNER | Mazda | B0 | |
vp_nsn_skyline_99 |
TUNER | Nissan | B0 | |
vp_aud_rs4_07 |
TUNER | Audi | B0 | |
vp_mit_evo_06 |
TUNER | Mitsubishi | B0 | |
vp_duc_999r_06 |
SPORTBIKE | Ducati | A0 | |
vp_mbz_s600_07 |
LUXURY | Mercedes | B0 | |
vp_mbz_s600_07_DUB |
LUXURY | Mercedes | B0 | player only |
vp_lam_miura_71 |
EXOTIC | Lamborghini | B0 | |
vp_aud_r8_08 |
EXOTIC | Audi | B0 | |
vp_am_vantage_07 |
EXOTIC | AstonMartin | B0 | |
vp_mbz_sl65_07 |
LUXURY | Mercedes | B0 | |
vp_chv_corvettez06_07 |
MUSCLE | Chevy | A0 | |
vp_sln_s281_06 |
MUSCLE | Saleen | B0 | |
vp_lam_gallardo_06 |
EXOTIC | Lamborghini | A0 | |
vp_lam_murcielago_06 |
EXOTIC | Lamborghini | A0 | |
vp_lam_murcielago_06_DUB |
EXOTIC | Lamborghini | A0 | player only |
vp_frd_cobra_04 |
EXOTIC | Ford | A0 | |
vp_frd_gt_06 |
EXOTIC | Ford | A0 | |
vp_sln_s7_06 |
EXOTIC | Saleen | A0 | |
vp_kaw_ninja_zx14_06 |
SPORTBIKE | Kawasaki | A0 | |
vp_chv_police_96 |
COP | Chevy | B0 | not for sale |
vp_citybus_07 |
COP | Other | C0 | not for sale |
Vehicles in vehicle0001.lst: 16 (click to open)
| Name | Class | Manufacturer | Group | Note |
|---|---|---|---|---|
vpd_chv_belair_55 |
LowRider | Chevy | D0 | |
vpd_buk_riviera_63 |
LowRider | Buick | D0 | |
vpd_chv_impala_64 |
LowRider | Chevy | D0 | |
vpd_chv_malibu_65 |
LowRider | Chevy | C0 | |
vpd_pon_gto_66 |
MUSCLE | Pontiac | C0 | |
vpd_chv_chevelle_70 |
MUSCLE | Chevy | C0 | |
vpd_lr_hse_08 |
SUV | LandRover | C0 | |
vpd_lr_sport_08 |
SUV | LandRover | C0 | |
vpd_mit_eclipse_09 |
TUNER | Mitsubishi | C0 | |
vpd_aud_s5_08 |
LUXURY | Audi | B0 | |
vpd_mit_evox_08 |
TUNER | Mitsubishi | B0 | |
vpd_cad_xlrv_08 |
LUXURY | Cadillac | B0 | |
vpd_mbz_clk63amg_08 |
LUXURY | Mercedes | B0 | |
vpd_mbz_cl65amg_08 |
LUXURY | Mercedes | B0 | |
vpd_am_db9_08 |
EXOTIC | AstonMartin | B0 | |
vpd_duc_1098_07 |
SPORTBIKE | Ducati | A0 |
Vehicles in vehicle0002.lst: 5 (click to open)
| Name | Class | Manufacturer | Group | Note |
|---|---|---|---|---|
vp_se_chv_plc_96 |
COP | Chevy | D0 | player only |
vp_se_chv_chp_96 |
COP | Chevy | B0 | player only |
vp_se_dge_plc_06 |
COP | Dodge | C0 | player only |
vp_se_dge_ubp_06 |
COP | Dodge | B0 | player only |
vp_se_dge_chp_06 |
COP | Dodge | B0 | player only |
The va_ folders: 41 (click to open)
va_350z_04va_cad_ctsv_04va_cad_escalade_03va_cad_ext_03va_cad_limo_07va_cad_xlr_04va_chr_300c_05va_chv_chevelle_70va_chv_cobalt_05va_chv_silverado_04va_chv_z28_69va_citybus_07va_citybus_711_1_07va_citybus_711_2_07va_citybus_jrdnw1_07va_citybus_tmob1_07va_citybus_tmob2_07va_dge_caravan_07va_gmc_yukon_05va_golfr32_04va_mb_eclipse_04va_mbz_cl500_04va_rstr_food_07va_rstr_garbagetruck_07va_rstr_servicevana_07va_rstr_servicevanb_07va_rstr_shipping711_1_07va_rstr_shippinga_07va_rstr_shippingb_07va_rstr_soda_07va_rstr_sodapitbull1_07va_semitruck_00_cabva_semitruck_00_flatbedva_semitruck_00_flatloadedva_semitruck_00_tankerva_semitruck_00_trailerva_semitruck_dub1_00_trailerva_taxi_96va_taxi_rust1_96va_taxi_zaxbys1_96va_vw_jetta_03
The garage menus read tune/garage/<car>_Parts.gtun. Each menu is a section headed <!-- name --> (bumper_front, bumper_rear, hood, spoiler, headlight, taillight, skirts, seats_f, ...), then the entry count, then four lines per entry:
| Line | Meaning |
|---|---|
| name key | A string-table key; the menu shows that key's text. |
| brand | The manufacturer logo shown on the line (0 none, 52 stock). |
| price | Price in the garage. |
| variant | The slot index the line selects. It is the variant the game loads, not the number in the name: skirts_3 with variant 4 loads skirts4. |
garage.<section> = key brand price variant adds a line to that section (raising its count), or appends the section when the car has none. The text amended is the one a mod already ships under files/tune/garage/ if there is one, else the car's own from the game's archive, else the donor's (for a new car that ships no list). The log line is N garage line(s) added to tune/garage/<car>_Parts.gtun.
The first field is a key, not the text. The game looks it up in its string tables: the shipped keys bumper_f_1 to bumper_f_4 read 1 OF 4 to 4 OF 4, spoiler_5 reads NO SPOILER. So:
- a line can reuse a shipped key, and shows that key's text; or
- the mod ships its own key with its own text in a string table of its own,
files/ui/mc4stringtable_000N.strtbl. The game loadsmc4stringtable_0004to_0008besides its own tables, so five such files exist for all mods together, and a mod that ships one owns that number. See String Replacement for the file format.
The loader does not write string tables.
The built-in garage fixes make side exhausts available on the Impala 64, Malibu 65, Bel Air 55 and Riviera 63, and add the missing CLK63 AMG exterior part variants and city bus performance list. The Impala 64 also gets a height fix for its second rear bumper.
A part file is authored relative to the bone that draws it (a bumper is centred on its bumper bone), except the few slots whose bone sits at the car's origin (cabin, seats and, on most cars, the lamps), which are in car space. The model arrives in car space, so each part is moved into its slot like this:
- A
frame.<slot>line: the part is taken into that bone pose (rigid: moved and turned only). Use it when you know the bone, or to override the automatic frame. - With
extend, a slot with noframe.line gets one from the car's skeleton: the bone its file hangs from (the file's+0x34), its rest pose composed down the parent chain. Logged as<slot> hangs from bone N (<name>) at (x y z), rotation (rx ry rz). A slot that hangs from the root gets the identity, so it stays in car space. - Otherwise a part whose shipped file straddles its bone on every axis is re-centred onto that file's box; a part whose shipped file is in car space stays where the model put it.
Car space: x lateral, y up, z back (the nose is at -z).
-
driver_offset = dx dy dzmoves the driver of a new car (donor, with a name of its own). The donor's four driver animation packs (player and opponent, male and female) are shipped again under the car's own name, with the root of every seated animation moved by the offset. Animations whose root sits on the car's centre line (facial expression sets, overlays) are left alone. The car then stops borrowing the donor's packs by name. The log line is<who>/<sex> driver moved by (dx dy dz): N of M animation(s) seated, ...; a failure logsdriver_offset: <pack>: <reason>and ships none. -
bone.<name> = tx ty tz rx ry rzsets the rest pose of one body skeleton bone in every LOD (car space, Euler radians in the skeleton's convention). Whatever hangs from the bone follows it:bone.strmoves the steering wheel the game turns,bone.seats_pass/bone.seatsmove every seat variant on that side. A bone that is not found, or a bone at the origin whose matrix copies are not where the loader reads them, logsbody_lod_N bone.<name>: the body has no bone of that name, or ...and stays as shipped. - A part hanging from a moved bone is written in the new pose with a matching
frame.<slot>line.
-
shader.<material> = <effect>maps a material to the first shader the body draws with that effect;<effect>#Npicks the Nth drawn one, and a bare#Npicks shader number N.shader.<slot>.<material>applies to one part only and beats the unqualified rule. - A
shader.<slot>.<material>rule naming an effect that part does not draw is borrowed: the material is written into the part's first spare submesh (one no other material of the part uses, in the file's order) and that submesh is repointed at the effect. The effect reads the vertices with the spare submesh's layout, so it only draws when the two layouts match: POSITION NORMAL COLOUR0 TEX0 TANGENT is the layout of paint, BumpSpec, CarbonFiber, Chrome, GrillOpaque and LicensePlate; BrushedMetal adds TEX1, EngineBay drops TANGENT, BlackMatte is POSITION only and never hosts. A mismatch draws nothing and logs nothing. Logged as<slot> <effect> <- N tris, borrowing the <effect> submesh. In the borrow,#Ncounts the effect's occurrences in the material pack. - A shader's texture is one picture for the whole car. Two drawables writing different pictures into one shader log
<file> and an earlier drawable both draw with <effect>, which stores one picture, and several shaders sharing one texture logshader N (<effect>) shares <texture> with a shader already written. Give each material its own shader, or give every writer the same picture. - Effects the loader knows (
kCarEffectsinrsc5.cpp):WheelRubber,WheelBrakeRotor,CarbonFiber,CarGlass,BrushedMetal,TexturedPlastic,BumpSpec,CarLight,BlackMatte,BumpedGlass,InteriorTrim,BrakeCaliper,BumpSpecSkinned,AnisotropicBilletMetal,Seam,InteriorTrimAlpha,InteriorTexturedEmissive,InteriorTexturedEmissiveAlpha,CarPaintCustomizable,RimMain,RimBadge,Grill,Underbody,RimNormalMapped,Chrome,BumpedAlphaChrome,LicensePlate,CarPaintNormalMapped,EngineBay,BumperSubframe,BumpSpecAlpha,GrillOpaque,BlackOpaqueGlass,BumpedBrushedMetal, plus generator and effect shaders that are not car surfaces. A car only draws the ones its pack and parts use; the loader logs the list for a donor (donor <car> draws with 0=..., 1=...) and which of them its body renders.
Lit surfaces are CarLight. CarLight has no colour map: the images given to its materials become the lamp's relief (its normal map) and glow mask, and the lamp's role and colour come from its lamp index (lamp_box). Those images are packed once into one atlas for every lamp drawable of the car (lamps share one ... atlas of N image(s) across every CarLight drawable).
The index is a lamp type. The names below are the game's own: its executable holds a list of 19 names starting at 0x827E9818. No code that reads that list has been found, so its order alone does not prove which index is which; it matches the indices measured on the shipped cars (below).
| Index | The game's name |
|---|---|
| 0 | brake light |
| 1 | taillight |
| 2 | turn signal |
| 3 | headlight |
| 4 | high beam |
| 5 | side marker |
| 6 | reverse light |
| 7 | interior light |
| 8 | fog light |
| 9 | red reflector |
| 10 | amber reflector |
| 11 | clear reflector |
| 12 | third brakelight |
| 13 | red coplight |
| 14 | blue coplight |
| 15 | turn signal FL |
| 16 | turn signal FR |
| 17 | turn signal BL |
| 18 | turn signal BR |
The car shader (xCarLight) takes the whole part of the second texture coordinate's x as the index, and uses it to read that lamp's colour and whether it is lit. On the game's police Caprice, the front lamps carry 2 and 3, the rear lamps 0 and 6, and the light bar 13 and 14.
A donor does not necessarily have every type in the part you replace, and copying the nearest donor lamp cannot produce a type that is not there. lamp_box states the index outright, and lamp_from adds other donor lamp slots to the ones that are sampled.
Lenses are BumpedGlass. Where the light itself starts (the halo and the beam on the road) is not the lamp's geometry but locator bones in the lamp parts; move them onto the new lamps with locator. lines, or the light stays where the donor's lamps were.
- Embedded glTF images, or a
textures/folder, are grouped by the shader their materials map to, packed into one atlas per shader, and written over that shader's colour map in the car's material packs (.xtl,.xtp). Paint, glass, matte and chrome effects read no texture, so those materials keep their UVs. Controlled bymodel_mods_car_textures(defaulttrue). Off ships the donor's packs exactly. Anextendcar never writes textures. - A shader that names the same picture as another shares one cell only when
model_mods_share_imagesis on (defaultfalse). - A texture written in place that does not fit its slot logs
shader N: no room to write <texture> in place.
All restart-only unless stated; full rows in Settings Reference.
| Option | Default | Effect |
|---|---|---|
model_mods_car_yaw |
180.0 |
Turn applied before parts are placed. |
model_mods_car_scale |
1.0 |
Size multiplier on top of the automatic fit. |
model_mods_car_budget |
16777216 |
Largest a replaced body may be grown to, bytes for LOD 0. |
model_mods_car_textures |
true |
Give the body its own textures. |
model_mods_car_space_only |
true |
Write a donor car's mesh only into the models the donor authors in car space. |
model_mods_car_lod1_copy |
true |
Ship LOD 1 as a copy of LOD 0 for the body and parts. |
model_mods_cabin_light |
true |
Give the cabin the donor's per-vertex interior lighting. |
model_mods_glass_band |
true |
Give body glass the donor's pane numbers. |
model_mods_part_growth |
8 |
How much larger than the donor's a part may be, as a multiple. |
model_mods_grow |
false |
Give a part buffers of its own instead of welding it down. |
model_mods_car_verbatim |
false |
Diagnostic: copy each part's shipped file exactly. |
model_mods_diag |
false |
Write the .diag folder. |
Messages carry the prefix [mods] <mod>/vehicles/<car>. See also Troubleshooting.
| Message (abridged) | Meaning |
|---|---|
no .glb, .gltf or .obj in the folder |
No mesh in the car folder. |
parts.txt maps no slots / cannot open parts.txt
|
Missing or empty parts.txt. |
parts.txt has no 'widebody0' line |
Replacement without a body line. |
slot <slot> names no geometry in the model / <slot> names no geometry in the model
|
The groups on that line match no node, object or material. |
the 'body' line names no geometry in the model |
Same for a donor car's body. |
donor <car> ships no <file> to build on |
The donor lacks a file the new car needs. |
cannot read the donor's material pack / cannot list the donor's folder
|
Donor resources could not be read. |
'<name>' is not one of the game's car ... |
A shader. rule names an effect the game does not have. |
'<name>' does not end in a shader number |
A #N suffix is malformed. |
the donor has N shaders, so '<rule>' has ... |
The shader index is out of range. |
the donor draws nothing with <effect> / the body draws NONE of them
|
A rule would write into a shader that has no geometry. Pick a shader the body renders. |
<slot> needs a rigid frame.<slot> |
A slot that needs a bone frame has none. |
template.<name>: not a part name |
A template. key is not a slot plus one digit. |
<car>.xspm: manifest slot table ... / no 30-byte presence array
|
The part manifest could not be amended; the new variants are not switched on. |
extend adds to the car the folder is named after; the 'donor = <car>' line is ignored |
extend and donor together. |
<slot> is a model of the body, which an extended car keeps as shipped |
A body_m<N> line on an extend car. |
an extended car keeps its body and its name, so these lines do nothing: ... |
bone., dial., plate or driver_offset on an extend car. |
cannot read the car's skeleton (...) |
extend could not read the body; parts without a frame. line are centred on their slot instead. |
no tune/garage/<car>_Parts.gtun to add garage lines to |
Neither the mod, the car nor the donor has a garage list. |
parts.txt: garage.<section> wants 'key brand price variant' |
A garage. line without four fields. |
parts.txt: bone.<name> wants 'tx ty tz rx ry rz' / driver_offset wants 'dx dy dz'
|
Malformed pose or offset. |
body_lod_N bone.<name>: the body has no bone of that name, or ... |
See "Driver and bones". |
<file> locator <prefix>: no bone of that name / locators: the slot is in its bone's space and needs a rigid frame
|
A locator. line names a bone the part does not have, or the slot has no rigid frame. |
driver_offset: <pack>: <reason> |
The driver packs could not be moved; the car borrows the donor's. |
tune.<field> = <value>: expected ... |
Bad tune value. |
body_lod_N took no geometry at all |
Nothing from the model fit the body. |
cannot measure the car body |
The body bounds could not be measured. |
| A wheel does not sit in its arch (no log message) | See "Wheels and wheel arches". |
<file> from files/ kept as shipped, not rewritten (...) |
The copy under files/ has no RSC5 header. See "Files shipped under files/". |
[mods] <mod>/files/<path>: REFUSED, ... |
A garage picture was left out. See "Garage pictures". |
| A car's garage picture is missing (no log message) | The mod ships no file for that folder, the file name does not match the car, or the file has a fault the checks do not cover. See "Garage pictures". |
LARecomp
Settings
Game Features
Mods
Content Modding
Development
Online
Server Hosting