Reference
Integration
01Integration
uniqers-house, uniqers-garage, uniqers-family
- uniqers-house: the new-shell screen has Ready shell / Shell creator tabs. The Shell creator tab opens the library in selection mode; design or pick a shell and press Use. The Uniqers tag in the ready list filters your designs. Listing photos taken here are used when a house has none of its own.
- uniqers-garage: the garage wizard's Custom > Shell Garage form has Design with Shell Creator. Each garage's shell instance is separate by garage name (door state and renovation too).
- uniqers-family: family houses have a Renovation (
renovate) permission; set its default rank inconfig_housing.lua.
Lists update the moment a shell is saved. No restart is needed.
Any other housing script (qb-houses, ps-housing, qs-housing, esx_property, ...)
Every shell has a model: uqsc_shell_<id> (1-300). Spawn it like any shell model; the design is built on it and removed when the model is deleted. A baked shell already is the whole house and only gets its doors, items and lights. In the library the chain button on a card shows the model name, the entry point and ready-made setting lines.
For a script on a server without this script, use Standalone export (MLO-BAKE-EXPORT.md).
Draft or published: the globe button on a card switches a shell. A draft is left out of every list housing scripts get, so half-finished designs are not offered to players. GetShells(kind, true) lists drafts too.
Renovation for other scripts' shells: Config.Renovation.anchors ('admin', 'everyone', 'none'), or add a provider:
-- in your scriptexports('CanRenovate', function(source, inst) return true end)-- in config.lua{ prefix = 'yourscript:', resource = 'your-script', export = 'CanRenovate' }Exports
Client
local anchor, job = exports['uniqers-shellcreator']:SpawnShellAsync('uqsc_5', vector3(0.0, 0.0, 500.0), 'house:12')while not exports['uniqers-shellcreator']:IsShellReady(job) do Wait(50) end-- a setup preview where an admin walks into every room: every door stands open and is not used (the way out stays)local job2 = exports['uniqers-shellcreator']:SpawnShell('uqsc_5', vector3(0.0, 0.0, 1000.0), 'myscript-editor:1', { openDoors = true })-- your script puts its own sliding / garage doors in: none of the shell's are spawned (see Shutters below)local job3 = exports['uniqers-shellcreator']:SpawnShell('uqsc_5', vector3(0.0, 0.0, 500.0), 'house:12', { doorControl = 'none', doorHinged = 'ask' })exports['uniqers-shellcreator']:GetShells('house') -- published; GetShells('house', true) with drafts -- kinds: 'house', 'garage', 'office', 'storage', 'any'exports['uniqers-shellcreator']:GetShellPoints('uqsc_5', vector3(0.0, 0.0, 500.0))exports['uniqers-shellcreator']:OpenLibrary()exports['uniqers-shellcreator']:PickShell('house', function(key, id) end, 'My Script') -- key is nil if closedexports['uniqers-shellcreator']:OpenRenovation('house:12')exports['uniqers-shellcreator']:AnchorModel('uqsc_5') -- 'uqsc_shell_5'exports['uniqers-shellcreator']:SetAnchorKey(entity, 'house:12')-- right after your script teleports the player: inside one of the MLOs, into its room once it is ready (else the game-- may hold the player outside it and its walls vanish by the camera's angle). Does nothing elsewhereexports['uniqers-shellcreator']:FixMloRoom()-- for a script that puts the player in a room of an MLO itself: where a point is in one of these MLOs by its own plan,-- 'in' (a room), 'near' (by a wall, in a doorway), 'out' (next to it, under its balcony, on its roof) or nil (none)exports['uniqers-shellcreator']:MloPlanAt(x, y, z)Server
exports['uniqers-shellcreator']:GetShells('garage') -- GetShells('garage', true) with draftsexports['uniqers-shellcreator']:GetShell(5)exports['uniqers-shellcreator']:CreateShellFromTemplate('apt21', 'New Apartment')exports['uniqers-shellcreator']:DeleteShell(5)exports['uniqers-shellcreator']:GetShellPhotoInfo() -- { [id] = { n, t } }exports['uniqers-shellcreator']:GetShellPhoto(5, 1) -- data:image/webp;base64,...exports['uniqers-shellcreator']:GetShellPhotos(5)exports['uniqers-shellcreator']:GetRenovation('house:12')exports['uniqers-shellcreator']:SetRenovation('house:12', 5, { rooms = { ['1:1:w'] = { t = 'g', k = 'cdec7a77' } } })exports['uniqers-shellcreator']:ClearRenovation('house:12')exports['uniqers-shellcreator']:CanRenovate(source, 'house:12')exports['uniqers-shellcreator']:GetPlaces()exports['uniqers-shellcreator']:GetEditRooms() -- who is editing whatexports['uniqers-shellcreator']:BakeShell(5) -- true, stats | false, messageexports['uniqers-shellcreator']:UnbakeShell(5)exports['uniqers-shellcreator']:GetBakes()exports['uniqers-shellcreator']:PlaceMlo(5, vector3(250.0, -820.0, 30.0), 90.0) -- shell origin, heading in degreesexports['uniqers-shellcreator']:RemoveMlo(5)exports['uniqers-shellcreator']:GetMlos()Shutters (sliding and garage doors)
Who opens a shell's or an MLO's sliding and garage doors, per instance key:
For an MLO the admin picks the mode in its window (library > MLO > Sliding and garage doors); it is kept apart from the MLO's files, so changing it builds nothing again and applies at once. For a shell instance your script sets it on the server (and passes doorControl = 'none' to SpawnShell on the client when it puts its own doors).
The hinged doors have the same three modes (doorHinged, the window's Normal (hinged) doors):
In an MLO the hinged doors are part of its files, so changing their mode builds it again (Apply doors). Always closed doors stay as they are (a wall). Unlocked doors lock again once everyone has left the key.
-- serverexports['uniqers-shellcreator']:SetDoorControl('house:12', 'ask', 5) -- key, mode, shell id; nil mode: back to 'self'exports['uniqers-shellcreator']:SetDoorControl('house:12', 'self', 5, 'ask') -- 4th: the hinged doors' modeexports['uniqers-shellcreator']:SetDoorHandler(function(src, info) -- from memory only (no database query: it runs on a key press, on the server thread) if info.unit and not MyUnits.CanOpen(src, info.unit) then return false, 'Not your unit' end return true -- or nil: no say about this doorend)exports['uniqers-shellcreator']:SetDoor('house:12', '1:5:g', true) -- open it for everyone in, nobody askedexports['uniqers-shellcreator']:SetDoorLock('house:12', '1:3:1', false) -- unlock a hinged door ('ask'), nobody askedlocal doors = exports['uniqers-shellcreator']:GetDoors(5) -- or GetDoors('mlo:5') for an MLO (world too)A door in info / GetDoors: door (its id), kind (garage / slide / hinged), ext (a door to the outside), lock (asked about a hinged door: true to lock it), locked (GetDoors, a hinged door), group (both leaves of a parting door), floor, unit (the number in the name of the room it leads into: Unit 7 is 7), room { code, name, unit, min, max } (the room's box in the shell's own frame), x y z heading width height model (shell frame), open (asked: the state wanted; GetDoors: the state now), and for an MLO mlo { x, y, z, angle, r } and world { x, y, z, heading }. Of the two rooms beside a door the smaller is the one it leads into (a unit, not the aisle). A handler is dropped when its resource stops. With ask and no handler, anyone opens them (the console says so once). Hinged doors are never asked about (in an MLO they are game doors for your door lock script). Cost: one function call per key press; the shutter list of a shell is made once per version.
uniqers-warehouse uses this: its units' roll-up doors open for the unit's renter, a free unit's for the owner, the aisle's for whoever may enter the warehouse, and always for an admin (its Config.ShellCreator.doorControl, default ask).
Event
uniqers-shellcreator:listChanged (server) fires with the new list whenever a shell is saved, deleted, published or set to draft.
Your own script
examples/uqsc_example_lab is a small resource that uses a design as a drug lab from its own code: /lab <id> builds the shell above the player in a private routing bucket and puts them at its entry point; /leavelab or an outside door takes them back. Copy it as a starting point.
Custom framework, prompt, target or notify
- Framework:
config.bridge.server.lua - Prompt, target and notify: set the mode to
'custom'and fill inconfig.interaction.client.lua(for notify:Notify = function(message, kind) ... end)
Still stuck? Send us your server log on Discord and we will sort it out with you.
Ask on Discord