fxmanifest data_file reference for vehicles

By Nilo3D · Updated:

A data_file line in fxmanifest.lua tells FiveM to load a file from the resource into the game as a specific type of game data. Vehicles use HANDLING_FILE for handling.meta, VEHICLE_METADATA_FILE for vehicles.meta, CARCOLS_FILE for carcols.meta, VEHICLE_VARIATION_FILE for carvariations.meta and VEHICLE_LAYOUTS_FILE for vehiclelayouts.meta. Every file must also be listed in files.

What does data_file do?

The FiveM documentation describes data_file as adding "a data file of a specified type to the game extra content system". In practice it is the same mechanism the game uses for its own DLC packs: each type is handled by a loader that knows how to read that kind of file.

The line has two strings: the type and the path inside the resource.

fx_version 'cerulean'
game 'gta5'

files {
  'data/handling.meta',
  'data/vehicles.meta',
  'data/carcols.meta',
  'data/carvariations.meta',
}

data_file 'HANDLING_FILE'          'data/handling.meta'
data_file 'VEHICLE_METADATA_FILE'  'data/vehicles.meta'
data_file 'CARCOLS_FILE'           'data/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/carvariations.meta'

The file also has to appear in files. files makes the server send the file to players, and data_file makes the game read it. One without the other does nothing.

Which data_file type goes with which vehicle file?

These are the types that matter for vehicles, taken from the FiveM data files reference.

data_file typeFileRoot elementPurpose
HANDLING_FILEhandling.metaCHandlingDataMgrPhysics profiles. Guide
VEHICLE_METADATA_FILEvehicles.metaCVehicleModelInfo__InitDataListRegisters vehicle models. Guide
CARCOLS_FILEcarcols.metaCVehicleModelInfoVarGlobalMod kits, sirens, lights. Guide
VEHICLE_VARIATION_FILEcarvariations.metaCVehicleModelInfoVariationColors, kits and light settings per model.
VEHICLE_LAYOUTS_FILEvehiclelayouts.metaCVehicleMetadataMgrSeats, entry points, animations. Guide
CLIP_SETS_FILEclip_sets.xmlfwClipSetManagerClip sets for custom animations.
EXPLOSION_INFO_FILEexplosion.metaCExplosionInfoManagerCustom explosion setups.
VFXVEHICLEINFO_FILEvfxvehicleinfo.metaVehicle visual effects sets.
PTFXASSETINFO_FILEptfxassetinfo.metaParticle effect asset info.
AUDIO_GAMEDATA, AUDIO_SOUNDDATA, AUDIO_WAVEPACK.dat151.rel, .dat54.rel, folder of .awc filesCustom engine sounds.
VEHICLE_SHOP_DLC_FILEshop_vehicle.metaVehicle shop data of DLC packs.
CONTENT_UNLOCKING_META_FILEListed in the reference with no description. Not needed for an add-on vehicle.

The type must be spelled exactly and in capitals.

Does the order of data_file lines matter?

Partly. FiveM always loads HANDLING_FILE and VEHICLE_LAYOUTS_FILE entries before every other type, whatever order you wrote them in. All other types keep the order of the manifest. This comes from the FiveM client code, which sorts the list that way before loading.

The reason is on the game side: when vehicles.meta is read, the game looks up the vehicle's handling entry and its layout by name right then. If they are not loaded yet, the vehicle is registered without them.

For the remaining types, write them in dependency order, with the thing being referenced first:

fx_version 'cerulean'
game 'gta5'

files {
  'data/handling.meta',
  'data/vehiclelayouts.meta',
  'data/clip_sets.xml',
  'data/vehicles.meta',
  'data/carcols.meta',
  'data/carvariations.meta',
}

-- 1. things vehicles.meta points at
data_file 'HANDLING_FILE'          'data/handling.meta'
data_file 'CLIP_SETS_FILE'         'data/clip_sets.xml'
data_file 'VEHICLE_LAYOUTS_FILE'   'data/vehiclelayouts.meta'
-- 2. the vehicle itself
data_file 'VEHICLE_METADATA_FILE'  'data/vehicles.meta'
-- 3. kits, then the variations that reference them
data_file 'CARCOLS_FILE'           'data/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/carvariations.meta'
  • CLIP_SETS_FILE near the top, since layouts refer to clip sets by name.
  • VEHICLE_METADATA_FILE next.
  • CARCOLS_FILE before VEHICLE_VARIATION_FILE, because carvariations.meta refers to kits that carcols.meta defines.

Can I load many vehicles with one line?

Yes. Both files and data_file accept glob patterns in the path. * matches within one folder and ** matches any depth. A vehicle pack with one subfolder per vehicle can be declared once:

files {
  'data/**/handling.meta',
  'data/**/vehicles.meta',
  'data/**/carcols.meta',
  'data/**/carvariations.meta',
}

data_file 'HANDLING_FILE'          'data/**/handling.meta'
data_file 'VEHICLE_METADATA_FILE'  'data/**/vehicles.meta'
data_file 'CARCOLS_FILE'           'data/**/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/**/carvariations.meta'

New vehicles dropped into data/ are then picked up without editing the manifest.

Why are .yft and .ytd files not in the manifest?

Files in a folder named stream are registered automatically by file name and extension, so models, textures and animation dictionaries need no manifest entry. Subfolders inside stream are fine. Two things FiveM refuses there: files without an extension, and .rpf archives, which have to be extracted first.

Unpacking a single-player dlc.rpf and sorting its files into a resource is in converting a single-player car mod to a FiveM add-on.

Can metas be edited in an escrowed resource?

Paid resources delivered through Cfx.re Asset Escrow have their scripts and model files protected, and the manifest entry escrow_ignore lists files that the escrow system leaves untouched. Which files stay open is the author's choice, so check the product page. The metas a server owner most often wants to edit are:

  • handling.meta, to change speed, grip and braking.
  • carvariations.meta, to change the color combinations.
  • vehicles.meta, to change flags, class or the display name key.

On Nilo3D vehicles such as the Coil S-Cooter the handling and vehicle metas stay open. How escrowed resources are installed is in installing a FiveM resource from Cfx.re Escrow.

If an escrowed resource refuses to start with "You lack the required entitlement", see how to fix the entitlement error.

What are the common manifest mistakes?

MistakeResultFix
Meta in data_file but not in filesThe file never reaches the player.Add the same path to files.
Wrong path or folder nameNothing is loaded.Paths are relative to the resource folder and use forward slashes.
Wrong type for the fileThe file is handed to the wrong loader and its data is not applied.Use the type from the table above.
Metas placed in stream/They are not loaded as data files.Keep metas outside stream and declare them.
Missing fx_version or gameThe resource does not load correctly.Start the manifest with fx_version 'cerulean' and game 'gta5'.

The whole process, from folders to spawning, is in how to add an add-on vehicle to FiveM.

Frequently asked questions

What is the data_file for handling.meta?
data_file 'HANDLING_FILE' followed by the path to handling.meta, with the same path listed under files.
What is the data_file for carcols.meta and carvariations.meta?
carcols.meta uses CARCOLS_FILE and carvariations.meta uses VEHICLE_VARIATION_FILE.
Do I have to list meta files in files as well as data_file?
Yes. files makes the server send the file to players and data_file makes the game load it. A meta that is missing from files is never downloaded.
Does data_file support wildcards?
Yes. The FiveM manifest reference states that data_file supports globbing in the file name, for example data/**/handling.meta.
In what order does FiveM load vehicle data files?
HANDLING_FILE and VEHICLE_LAYOUTS_FILE entries are loaded first. Every other type is loaded in the order it appears in the manifest.

Sources

Products from this guide

All guides