carvariations.meta and carcols.meta explained

By Nilo3D · Updated:

carvariations.meta sets what one vehicle model can look like: its color combinations, liveries, mod kit, light settings and siren settings. carcols.meta is the library those settings point to: it defines the mod kits with their tuning parts, the siren setups and the light setups. A vehicle needs carcols.meta only when it brings its own kit, siren or lights.

What is the difference between carvariations.meta and carcols.meta?

carvariations.metacarcols.meta
Root elementCVehicleModelInfoVariationCVehicleModelInfoVarGlobal
ScopeOne entry per vehicle modelShared definitions any vehicle can reference
ContainsColor combinations, liveries, kit names, light and siren indexKits (tuning parts), Sirens, Lights, colors, wheels
FiveM data_fileVEHICLE_VARIATION_FILECARCOLS_FILE
Needed for an add-on?Recommended for every vehicleOnly with custom tuning parts, sirens or lights

How is a carvariations.meta entry built?

Each <Item> in variationData belongs to the vehicle named in modelName. It lists color combinations, the kits the vehicle can use, and two numbers that pick a light setup and a siren setup.

<?xml version="1.0" encoding="UTF-8"?>
<CVehicleModelInfoVariation>
  <variationData>
    <Item>
      <modelName>mycar</modelName>
      <colors>
        <Item>
          <indices content="char_array">
            1
            4
            4
            156
            111
            111
          </indices>
          <liveries>
            <Item value="false" />
            <Item value="false" />
          </liveries>
        </Item>
      </colors>
      <kits>
        <Item>0_default_modkit</Item>
      </kits>
      <windowsWithExposedEdges />
      <plateProbabilities>
        <Probabilities />
      </plateProbabilities>
      <lightSettings value="1" />
      <sirenSettings value="0" />
    </Item>
  </variationData>
</CVehicleModelInfoVariation>
FieldMeaning
modelNameThe vehicle this entry applies to. Must equal modelName in vehicles.meta.
colorsList of color combinations. One of them is picked when the vehicle spawns without a script setting colors.
kitsNames of the mod kits the vehicle uses, defined in carcols.meta.
windowsWithExposedEdgesWindow names whose edges are visible.
plateProbabilitiesChances for each license plate style.
lightSettingsID of a Lights entry in carcols.meta.
sirenSettingsID of a Sirens entry in carcols.meta. 0 for vehicles without sirens.

How do the color indices work?

Each color combination has six numbers. Every number is an index into the game's vehicle color list (0 is metallic black, 111 is metallic white and so on). The six slots are fixed:

PositionSlotGame native that sets it
1Primary colorSET_VEHICLE_COLOURS
2Secondary colorSET_VEHICLE_COLOURS
3PearlescentSET_VEHICLE_EXTRA_COLOURS
4Wheel colorSET_VEHICLE_EXTRA_COLOURS
5Interior colorSET_VEHICLE_EXTRA_COLOUR_5
6Dashboard colorSET_VEHICLE_EXTRA_COLOUR_6

The liveries list under each combination says which liveries that combination may spawn with. A vehicle can have up to 30 liveries. The Coil S-Cooter, for example, ships nine color combinations in this file, and they can be edited freely because the metas are left open.

How do liveries work?

The classic livery system swaps one texture. The vehicle needs FLAG_HAS_LIVERY in vehicles.meta and textures named with the suffix _sign_1, _sign_2 and so on in its texture dictionary; the game counts them when the model loads. Scripts switch between them with the SET_VEHICLE_LIVERY native.

The second system is a tuning slot: mod kit parts of type VMT_LIVERY_MOD, with display names listed in liveryNames of the kit.

What is a mod kit and why does the kit ID matter?

A mod kit is the list of tuning parts and performance upgrades a vehicle can receive. Kits live in the Kits section of carcols.meta. Each kit has a name, a numeric ID and a type.

<?xml version="1.0" encoding="UTF-8"?>
<CVehicleModelInfoVarGlobal>
  <Kits>
    <Item>
      <kitName>mycar_modkit</kitName>
      <id value="850" />
      <kitType>MKT_SPECIAL</kitType>
      <visibleMods>
        <Item>
          <modelName>mycar_spoiler_a</modelName>
          <modShopLabel>MYCAR_SPL_A</modShopLabel>
          <linkedModels />
          <turnOffBones />
          <type>VMT_SPOILER</type>
          <bone>chassis</bone>
          <collisionBone>chassis</collisionBone>
          <cameraPos>VMCP_DEFAULT</cameraPos>
          <audioApply value="1.000000" />
          <weight value="0" />
          <turnOffExtra value="false" />
          <disableBonnetCamera value="false" />
          <allowBonnetSlide value="true" />
        </Item>
      </visibleMods>
      <linkMods />
      <statMods>
        <Item>
          <identifier />
          <modifier value="25" />
          <audioApply value="1.000000" />
          <weight value="0" />
          <type>VMT_ENGINE</type>
        </Item>
      </statMods>
      <slotNames />
      <liveryNames />
    </Item>
  </Kits>
</CVehicleModelInfoVarGlobal>
FieldMeaning
kitNameName of the kit. This is what carvariations.meta references.
idNumeric kit ID. It must be unique among all kits loaded on the server.
kitTypeMKT_STANDARD, MKT_SPORT, MKT_SUV or MKT_SPECIAL.
visibleModsParts with a 3D model: spoilers, bumpers, skirts and so on.
linkModsModels that only appear together with another part.
statModsPerformance upgrades with no model: engine, brakes, gearbox, suspension, armour.
slotNamesRenames a tuning slot in the mod shop menu.
liveryNamesDisplay names for the kit's liveries.

The game keeps one table of kit IDs. When a second kit arrives with an ID that is already taken, the loader logs a duplicate kit ID and gives it another free ID. This is the usual reason tuning parts go missing after adding more vehicles: two resources ship the same id. Give every kit its own number.

To connect the kit to the vehicle, name it in carvariations.meta:

<!-- carvariations.meta -->
<kits>
  <Item>mycar_modkit</Item>
</kits>

A vehicle with no custom parts can use the stock 0_default_modkit, which gives it the standard performance upgrades. An empty <kits /> removes tuning from the vehicle.

To find which kit, siren and light IDs clash across all your resources, drop the files into the carcols ID conflict checker.

What are the fields of a tuning part?

Each item in visibleMods is one part. modelName is the name of the part's model file in the stream folder. type is the tuning slot it appears in, and bone is the vehicle bone it attaches to.

FieldMeaning
modelNameModel of the part.
modShopLabelText label shown in the mod shop.
linkedModelsLink mods that are attached together with this part.
turnOffBonesStock pieces to hide when the part is fitted (for example the stock bumper).
typeSlot: VMT_SPOILER, VMT_BUMPER_F, VMT_BUMPER_R, VMT_SKIRT, VMT_EXHAUST, VMT_CHASSIS, VMT_GRILL, VMT_BONNET, VMT_WING_L, VMT_WING_R, VMT_ROOF and more.
bone, collisionBoneBone the part attaches to, and the bone enabled for extra collision: chassis, bodyshell, bumper_f, bumper_r, bonnet, boot, misc_a and so on.
cameraPosWhere the mod shop camera goes: VMCP_DEFAULT, VMCP_FRONT, VMCP_REAR, VMCP_LEFT, VMCP_RIGHT, VMCP_TOP and others.
weightWeight change from the part, 0 to 100 percent.
turnOffExtraIf true, the part hides extras on the same bone.

Stat mods use the slots VMT_ENGINE, VMT_BRAKES, VMT_GEARBOX, VMT_SUSPENSION, VMT_ARMOUR and VMT_HORN, with modifier as the strength of the upgrade.

How do lightSettings and sirenSettings work?

lightSettings and sirenSettings in carvariations.meta are IDs. They select an entry with the same id in the Lights or Sirens section of a carcols.meta. If the number does not exist the game falls back to the first entry.

  • A Lights entry sets intensity, falloff, cone angles and color for the indicators, tail lights, headlights and reversing lights, and the size and intensity of their coronas.
  • A Sirens entry holds up to 20 siren lights. Each has a color, intensity, rotation and flash pattern (sequencer), and the entry sets the tempo with sequencerBpm.

Like kit IDs, siren and light IDs are shared across the whole server, so two emergency vehicles that both ship siren ID 1 will clash. Use a different ID per siren setup and put the same number in sirenSettings.

How are the two files loaded in FiveM?

Both files are listed under files in fxmanifest.lua. carcols.meta gets a data_file 'CARCOLS_FILE' line and carvariations.meta a data_file 'VEHICLE_VARIATION_FILE' line. Put the carcols line first, since carvariations refers to kits by name. The complete manifest is in how to add an add-on vehicle to FiveM, and the order rules in the data_file reference. If parts or colors do not show up in game, check the tuning section of the troubleshooting guide.

Frequently asked questions

Do I need carcols.meta for an add-on car?
Only when the car has its own tuning parts, siren setup or light setup. A car that uses a stock mod kit and stock light settings only needs carvariations.meta.
Why are my tuning parts missing or wrong in FiveM?
The usual cause is a duplicate kit ID: two carcols.meta files define a kit with the same id value. Change one of them to a number no other vehicle uses and keep the kit name in carvariations.meta the same.
How do I add more colors to a vehicle?
Add another Item with six indices to the colors list of the vehicle in carvariations.meta. The order is primary, secondary, pearlescent, wheels, interior and dashboard.
How many liveries can a vehicle have?
The game supports up to 30 liveries per vehicle in the texture-swap system.
What does sirenSettings 0 mean?
It selects siren entry 0, which is what vehicles without sirens use.

Sources

Products from this guide

All guides