Placer
The standard placement tool for GR1M resources. It saves nothing: the calling resource stores each point and re-checks it on the server.
Two styles, picked per player:
- Builder camera (players with
gr1m.placer.builderorcommand): the body stays put, a free camera flies up to 60 m away (Config.CamRange), the mouse clicks a surface to drop a draft, and a gizmo fine-tunes it (arrows move on one axis, the gold ring turns, edge handles resize areas). E / Enter / Place saves it. Markers of placed points can be clicked, Shift+clicked for groups, moved, copied and deleted when the caller passeshooks.move/hooks.remove. Ctrl+Z / Ctrl+Y undo and redo everything in the session. - Hold in front (everyone else, or
opts.style = 'hold'): the ghost floats in front of you and goes where you walk, within 3 m (Config.HoldReach). Scroll turns it both ways, arrows nudge, PgUp/PgDn lift, X locks it in place, hold R stamps a row.
local res = exports.GR1M_Placer:Start({
title = 'Kivo Dispensary', kind = 'bench', kindLabel = 'Packaging bench',
model = 'prop_table_01', -- false = marker only, set footprint = { w, d }
once = false, used = 2, max = 8,
bounds = { poly = { { x = 0.0, y = 0.0 } }, minZ = 20.0, maxZ = 26.0 }, -- optional
points = { { id = 1, kind = 'bench', label = 'Bench 1', x = 0.0, y = 0.0, z = 0.0, heading = 90.0, model = 'prop_table_01' } },
}, {
stamp = function(coords, heading, model) return { ok = true, pointId = 3, used = 3 } end,
undo = function(pointId) return { ok = true, used = 2 } end, -- optional
move = function(pointId, t) return { ok = true } end, -- optional: t = { x, y, z, heading, w, d }
remove = function(pointId) return { ok = true, used = 1 } end, -- optional
})
Start blocks until the session ends and returns { ok, placed, error }. Coordinates are the prop's origin, or the surface for marker-only sessions and areas. Full option list: top of client/main.lua.
#Areas
mode = 'area' draws boxes instead of props (e.g. a grill top inside an MLO). Builder: click and drag on a surface. Hold: the box floats in front, Shift+Scroll width, Ctrl+Scroll depth. Options minSize, maxSize, slots (spreads that many spots across the box). hooks.stamp(area) gets { x, y, z, heading, w, d, spots }.
exports.GR1M_Placer:StartArea(opts) is the one-shot form and returns { ok, x, y, z, heading, w, d, spots } or { ok = false, error = 'cancelled' }.
#Other exports
IsActive(), Stop(), GetAim() (this frame's { x, y, z, heading, state } or nil, for drawing extra guides during a session).
#Builder keys
WASD fly, Space / C up and down, Shift fast, right mouse drag look, click drop or select, Shift+Click add to selection, Scroll or Q / Z rotate, arrows nudge, PgUp / PgDn height, 1 2 3 precision, G snap, L world or own axes, F focus, E place, Ctrl+D copy, Del delete, Ctrl+Z / Ctrl+Y undo and redo, Esc back out (draft, then selection, then done).
GR1M