Reference
Mlo Bake Export
01Bake, MLO and Standalone export
All three live in the cube button on a shell card in the library.
One-click bake
Press Bake now. The server merges the pieces (a fraction of a second) and hands the model to uqsc_baked, which writes it into its own folder and restarts. Players get one object plus its doors instead of hundreds of pieces (a showcase villa goes from 1,450 objects to 14). Materials, doors, props, lights and renovation keep working; a renovated house uses pieces. Shell IDs 1-300 can be baked.
Config.Bake = { enabled = true, resource = 'uqsc_baked', -- folder name of the companion mapResource = 'uqsc_baked_map', -- folder name of the map switch rebakeOnSave = true, -- a baked shell that is saved again is baked again rebakeDelay = 20, -- seconds after the last save refresh = true, -- run `refresh` before uqsc_baked restarts}refresh = true needs add_ace resource.uniqers-shellcreator command.refresh allow. Without it the console says so and you run refresh and restart uqsc_baked yourself. Applying a bake restarts uqsc_baked; players inside a baked shell switch to pieces for a moment, so bake big changes when few players are online.
MLO on the map
Stand where the entrance should be, pick the facing (any angle) and press Place here, or use Place with preview: a free camera flies over the map with the building shown see-through, Enter places it, Backspace leaves. The shell becomes a real interior with its entry point at your feet.
What is made: the inside as one model (its collision tells the game which room you are in), the outside (walls in the facade material, the roof of the Roof tool or a flat roof, slab joints), the interior manifest and the files for the map. Every door, window and glass wall to the outside, and the open sides and sky of terraces, are portals. Hinged doors are real game doors, so a door lock script can lock them. Sliding and garage (roll-up) doors cannot be game doors: their openings stay open in the MLO and the script spawns the door in them when a player comes close, as in a shell (E or your target script, the same for everyone, not seen by a door lock script); movingDoors = false makes them part of the walls, shut. Who opens them (anyone, a script asked first, or none: another script puts its own) is picked in the MLO window; see INTEGRATION.md, Shutters. Items, lamps and lights are part of the MLO too (0.00 ms near it with baked lights).
Config.Mlo = { enabled = true, radius = 120.0, doors = 'game', -- 'own' or 'game' as the default kind gameDoor = 'v_ilev_bl_door_l', bakeLights = true, lightScale = 1.0, maxLights = 16, -- lights baked into one MLO (a lamp with a shadow counts twice) movingDoors = true, -- sliding / garage doors spawned by the script; false: shut in the walls liveReload = false, mloDoors = true, mloItems = true, roomGuard = false, -- true: the wall check below runs all the time fitGround = true, -- the house goes up over the ground under it, with a plinth maxLift = 3.0, -- Place here: the most it may go up for that}Walls that vanish by the camera's angle
A player who walks into an MLO through a doorway is put in its room by the game itself: nothing runs for that. A player who is teleported inside before the interior is ready (a teleport script, a spawn or relog inside) is held outside the room by the game, and walls and items vanish by the camera's angle until the player walks out and back in. This happens with every MLO, not only these.
The script fixes it only when it can happen: when an MLO's interior gets ready around the player, after its own teleports (the library's Go, lifts, places, the live reload) and when another script asks right after its own teleport:
exports['uniqers-shellcreator']:FixMloRoom() -- or TriggerEvent('uniqers-shellcreator:fixRoom')uniqers-warehouse does this after each of its teleports. A short check then runs and stops by itself once the game holds the player in the room. Set roomGuard = true if a teleport script you use does not call it (a cheap check once a second near the MLOs).
Inside means on a room of the house's own plan, on the floor at that height. A player next to the house under a balcony, a terrace or an upper floor that sticks out is outside, and is never put in the room. A player the game (or another script) holds in the room while standing clearly outside it, on the street next to it or on its roof, is let out again: otherwise first person shows the house from inside there (its outside walls gone, its rooms seen from behind), because in first person the camera takes the player's room. Other scripts that put a player in a room themselves can ask the same plan: exports['uniqers-shellcreator']:MloPlanAt(x, y, z) gives 'in', 'near' (by a wall or in a doorway), 'out', or nil outside every MLO.
On the game's ground
The game's own ground cannot be cut away: where it is higher than a floor it comes up through the rooms, and a player standing on it there is outside the interior for the game. So when an MLO is placed the ground under the house is measured first (a ray straight down about every metre along the ground floor's outline, every two metres inside it, under every upper floor that sticks out, and on a ring 0.3 m outside its walls; a lone post or kerb stone is left out; where this shell's own MLO stands already the ring still finds the ground, so placing it again on the same spot works):
- the house goes up so its floor stays at least 10 cm over the highest point of that ground (in 5 cm steps; a floor at the ground's height flickers with it, the ground showing through the tiles, and a player there stands on the game's ground, outside the interior for the game), and
- the outside walls of the ground floor go on down as a plinth in the facade material, with corner posts, down to the lowest ground round the house (at least half a metre, at most 8 m). It has collision, so nobody walks in under a house that stands higher on its low side. Where a basement is under the ground floor its own outside walls are there already.
Place with preview shows it live: the panel says how far the house goes up and how deep the plinth is, grey lines show the plinth. G turns the lift off (the house stays where you put it); red lines then show where the ground comes into the house. Place here measures the spot at your feet and tells you how far it went up; on ground steeper than maxLift (3 m by default) it is refused, place it with the preview there. The plinth is kept when the MLO is built again (other doors, saved again). Rebuild in the MLO window looks at the ground again when you stand near the MLO: an MLO placed before this, or on ground that came up into it, goes up over the ground where it stands, with its plinth. fitGround = false places houses as before, without a plinth.
Next to the house
- Items outside the house (a bench in the garden, a plant by the door, something on the roof) are entities of the map next to the MLO, seen from the street like its outside walls. In its room they were drawn only while an opening of the house was on screen: invisible, with their collision there. Add-on items the script spawns there are left outside the room the same way.
- The collision of the eaves and of the plinth counts as outside (room 0), and the room's box is the house itself (its plan), not the eaves and the margin round it.
- When the game still holds the view in the house's room while the camera is outside it (first person behind it, a camera script), the view is put outside (the interior's limbo) until the camera goes in through an opening, into another interior or away. Without this the game draws the house from inside there and leaves the street out: its walls seen from behind, water and a grey plain where the ground was.
MLOs built by an older version are built again by themselves at the next server start (format 10).
Files you need
uqsc_baked1.6.0 or newer (itsfxmanifest.luahasuqsc_mlo_manifest 'yes'anduqsc_mlo_reload 'yes'and nothis_is_a_map)uqsc_baked_mapnext to it (onlythis_is_a_map 'yes', no files)
If either is missing or old, no MLO is placed and the console tells you what to copy. Do not add this_is_a_map to uqsc_baked: a map resource that starts during play has its map read before its manifest, the interior is missing and the game crashes as soon as it loads.
When do MLO changes go in?
liveReload = false(default, recommended): while players are online a placed, moved, rebuilt or removed MLO is saved and goes into the game at the next server restart. The MLO window shows After the server restart. With nobody online it goes in at once.liveReload = true: the change goes in right away. Everyone within 400 m of an MLO is moved far away in the dark,uqsc_bakedrestarts, every player's game says it has the files, thenuqsc_baked_maprestarts and the map is read; players are put back where they stood. It needs therefreshright, can take up to about half a minute and moves players; try it on a test server first.
Never type restart uqsc_baked yourself with players online.
Facing and limits
Collision boxes are merged where they line up (a 24-unit storage facility: 854 boxes before, 171 now); GTA crashes next to an interior with many hundreds, so a shell with more than 400 even merged is refused with a message. Any angle: the shell is turned in 90° steps and the MLO itself takes the rest, so doors, items and lights stay exactly in place. A pool in an MLO that is not on a 90° step stays a dry pit. One MLO per shell. Without a roof from the Roof tool the top is flat. In F8, uqscmlo shows what the game knows about every MLO.
Door fitting
Each single door opening is fitted to the game door you pick in the MLO window: if the door does not go in, the opening grows to the next size there is (1.5 m wide, 2.5 m or 3 m high), the casing is stretched, the rest is closed with wall. Rebuild reads the door size again. Door list shows every door's model, position and heading as a list, as qb-doorlock entries or as JSON; with ox_doorlock open /doorlock and pick the door in the world.
Standalone export
Press Export. The game draws the shell's materials into textures, the server builds the files and uqsc_baked writes them into uqsc_baked/export/uqscx_<name>_<id>/. Nothing is restarted.
The folder holds the model (walls, floors, ceilings, stairs, windows, railings and collision), its textures, extra models for the moving parts, the .ytyp, fxmanifest.lua, client.lua, server.lua and a README.txt with the model name, entrance offset, size and counts. Doors, items and lights are put around the model by client.lua and kept in sync by server.lua. Copy the folder into resources/ and ensure it; spawn the model like any shell and use the entrance offset from the README.
Not part of an export: pool water, the weather lock, per-room light moods. Settings: Config.Export.textureSize (256 default; 512 is sharper and four times heavier). If FiveM does not let uqsc_baked write .lua files, they come out as .txt: remove the .txt before use.
Server load of these tools
Writing a baked model takes about 50 ms; a big villa's MLO about 0.2 s (the first one after a start about 0.6 s). Do big bakes and MLO changes at a quiet hour; with liveReload off they go in at the next restart anyway.
Still stuck? Send us your server log on Discord and we will sort it out with you.
Ask on Discord