Skip to content

Live liveries & baking ​

A build's application mode decides how its design reaches the car. Two modes put the rendered design on the car at runtime (a live livery, drawn through a DUI); the others use what the model already ships.

Mode Shown in the console as How the car shows it Live
native_livery Native livery One of the model's built-in livery slots
runtime_texture Runtime texture The design replaces one texture target of the model yes
runtime_slot Per car Every car gets its own design through a pool of prepared livery slots yes
prebuilt Prebuilt An adapter resource applies a texture it ships
draft_only Design only Nothing painted; the design is stored and the parts are fitted

Both live modes are off by default, and each one needs two things: the server switch, and the np_manufacturing.runtime_livery permission for the player. Designs that are meant to stay can later be baked into real liveries, so they cost nothing at runtime.

Not verified in game yet

DUI textures, the slot index sync and the render distances have only run against the test harness. Test live liveries on your server and game build before you offer them to players.

Permission ​

Grant the np_admin node np_manufacturing.runtime_livery to a group or player in np_admin (Permissions). The node name is authorization.runtimeLiveryPermission. It is checked on top of the server switches (a disabled mode still answers runtime_texture_not_approved / runtime_slot_disabled), and only for the two live modes:

Action Who needs the permission
Submit or clone a live build The submitter
Approve or request changes Nobody: reviewing doesn't put anything on a car. An approver without it can approve a live build but not apply it
Apply (instantly or by creating a production job) The player applying. The mechanic who completes the job is not checked
Launch a rollout of a live build The player launching it. Queued cars that get the build later when they park are not checked
Preview on the real car The player previewing (only they see it)

Without it, the release screen shows the live modes as locked and the server answers runtime_livery_not_permitted. allowAllPlayers = true grants it like every other permission. Give it only to people you trust with textures that every nearby player sees.

Runtime texture ​

lua
allowRuntimeTexturePreview = true,

Needs a template with capabilities.runtimeTexture and a tested textureTargets entry (dictionary and texture name from OpenIV or CodeWalker). The switch also enables the live draft preview in the studio.

The engine replaces a texture for every car that uses it on a client, not one car's copy. When two nearby cars of the same model have different runtime builds, the closest one wins. That is fine for a model only one design uses; for different designs at the same time, use runtime_slot.

Per car (runtime slots) ​

runtime_slot uses a model with several prepared livery slots, each with its own texture name. The server gives every car a slot (cars with the same design share one), and each client replaces the slot textures of the cars near it with their designs. A design with {unit}, {plate} or {callsign} counts as a separate design per value, so Unit 12 and Unit 14 need two slots.

lua
runtimeSlots = {
  enabled = false,
  renderDistance = 80.0,
  releaseDistance = 100.0,
  maxActiveTextures = 16,
  conflictRadius = 400.0,
  reassignIntervalSeconds = 5,
},
Option Default Description
enabled false Master switch. Off: submitting or applying a per-car build fails with runtime_slot_disabled
renderDistance 80.0 A client renders a slot's design when a car using that slot is this close (metres). Capped at 100 m, the radius in which clients report cars to the server
releaseDistance 100.0 ...and releases it beyond this distance (also capped at 100 m). Out of range, the car shows the slot's stock texture
maxActiveTextures 16 Slot textures (one DUI each) a client keeps at once, nearest first
conflictRadius 400.0 One slot may show different designs only on cars farther apart than this. Keep it larger than releaseDistance
reassignIntervalSeconds 5 Server pass that releases cars that are gone, moves the newer of two designs that meet on one slot, and gives waiting cars a freed slot

How the server hands out slots:

  • A car keeps its slot while it can. Otherwise it gets a slot that already shows its design, then a free slot, then a slot whose cars are all farther away than conflictRadius.
  • When no slot is free nearby, the car shows the template's baseIndex until one frees up. This is logged and audited as slot.pool_full.
  • A car gives its slot back when its build is reverted, revoked or replaced, when the entity is gone, or when no client has reported it for 120 seconds.
  • Slot changes are sent to every client. Assignments are kept in memory only and rebuilt from the next syncs after a restart.

Preparing a model ​

The template needs capabilities.runtimeSlot, supportedLiveryModes.runtime_slot and a liverySlots pool:

lua
liverySlots = {
  system = 'livery',            -- 'livery': SetVehicleLivery (sign liveries), 'mod': SetVehicleMod(vehicle, 48, index)
  dictionary = 'police',        -- texture dictionary that holds the slot textures
  hiDictionary = 'police+hi',   -- optional, replaced as well
  baseIndex = 0,                -- look of cars without a slot (pool full); must not be a slot
  width = 1024, height = 1024,  -- optional render size, clamped 256..2048
  slots = {                     -- explicit index -> texture name, at most 64
    { index = 1, texture = 'police_sign_2' },
    { index = 2, texture = 'police_sign_3' },
  },
},
  • The pool size is the number of slots: it caps how many different designs can be close to each other.
  • Texture names are always listed, never generated. Every slot needs its own texture; two templates must not share slot textures.
  • The server validates the pool strictly (runtime_slot_invalid, params { field }): names [A-Za-z0-9_-] (+ only in hiDictionary), at most 64 characters, unique indices and textures, index 0..63 for livery and 0..255 for mod, 1 to 64 slots. registerTemplate refuses templates with an invalid pool.
  • Admins can enter the pool in game: Admin → Onboarding, step Live livery (Administration), with a row generator for names like police_sign_%d.

Which index shows which texture differs per model. The resource repository includes a small standalone test resource, tools/np_mf_slot_poc, that puts a numbered test pattern on each slot of spawned cars (/mfpoc_info, /mfpoc_spawn, /mfpoc_apply), so you can confirm the index ↔ texture mapping (and that a second player sees the same) before you approve a template. It is a test tool: run it on a test server, not next to np_manufacturing in production. Its examples/ folder has reference carcols.meta / carvariations.meta templates for a mod-kit (mod 48) livery pool.

Baking live designs ​

Bake tab

Every live design costs a slot (runtime_slot) and, near players, a DUI per client. Designs that stay for good, such as a fleet's standard livery or a long event, can be baked into real liveries of the model during a planned restart. A baked build uses the native livery index: no slot, no DUI, no texture download.

FiveM can't create livery assets at runtime, so baking is an export, a manual asset step and a registration. All of it is in Admin → Bake (np_manufacturing.admin):

  1. Export. Pick the template and press Export for baking (every approved runtime_slot / runtime_texture build of the template, or the selected ones, at most 32). The server writes into the resource folder bake/<templateId>/:
    • <NN>_<buildId>.png: the render the build stored when it was submitted,
    • manifest.json: system and dictionary, reserved indices, and per build the file, size, suggested index and texture name, plus variablesNotBaked for designs with {unit} / {plate} / {callsign},
    • carvariations.snippet.meta / carcols.snippet.meta: starting points, marked as not verified,
    • README.txt: the exact steps for this export.
  2. Asset step (by hand). Convert the PNGs to DDS (DXT5, mipmaps, the size of the model's other livery textures), add them to <model>.ytd under the suggested names in OpenIV or CodeWalker, update the meta, put everything into the resource that streams the vehicle and restart it.
  3. Register. Check the index in game, then Mark as baked with that system and index. Cars with the build switch to it at once and give their slot back.

Unbake returns a build to its live mode.

  • System and names come from the template's liverySlots (otherwise the first texture target, otherwise the model, as sign liveries). With sign liveries, index i usually shows <model>_sign_<i + 1>. With mod 48, index i is the i-th VMT_LIVERY_MOD entry, and <model>_bake_<NN> is suggested as the texture name.
  • Suggested indices follow the highest index known to be in use (slot and base indices, the template's liveryCount, earlier baked builds). They assume new liveries are appended without gaps. Always verify them.
  • Validation: index 0..63 (livery) or 0..255 (mod), not a slot or the base index of the template's pool, and not used by another baked build of the template.
  • Variables are not baked. A design with {unit} / {plate} / {callsign} is baked from its stored render, so every car shows the same image. The tab flags those builds; bake variable-free designs, or accept it.
  • Baked runtime_slot builds still apply when runtimeSlots.enabled is off.
  • After Unbake, a car with a runtime_texture build keeps the baked index until another build is applied or the entity respawns.
  • bake/ is not part of the persisted state. Back it up with your vehicle assets if you want to keep the exports. If the server can't create bake/<templateId>/, it writes flat files named <templateId>__<file> into bake/ instead; bake_write_failed means bake/ itself isn't writable.

The mapping is stored per template and build, not on the template, so it also works for fixture and registered templates. Other resources can read it with getBakedLivery(templateId, buildId).