Skip to content

CreateMapSeat

A place to sit or a bed to sleep in, on any object - players use it with the game’s own Sit and Sleep.

The game’s own seat: a player’s use key shows “Sit” (a bed: “Sit”, and held, “Sleep”) and their game sits, lies down or sleeps there as on the level’s own benches and beds - the other players see it like any sitting. The game’s furniture needs none: a chair, bench or bed of the game’s own meshes placed with CreateMapObject or the editor gets its seats by itself (while it stands upright at its own size; a chair sits the player on their own unless its params are "table" - the game’s sitting-at-a-table pose); a seat is for anything else - a log, a crate, a wagon’s bed, a mode’s own furniture. Put it on the floor where the sitter’s feet are, at the seat’s front edge; yaw is where the sitter looks (a bed’s: the way the bed lies). It is a map object (moved and deleted with SetMapObject / DeleteMapObject, persist as theirs); its params are the pose.

CreateMapSeat(pose, x, y, z [, opts])
Parameter Type
pose string "bench_low" (a stool, a low bench; the default), "bench_high" (a bench or chair with a back), "table_left" / "table_right" (a bench at a table), "chair_table" / "chair_table_low" (a chair at a table: the arms on it), "ground", "bed_high", "bed_low", "bed_ground" (a bedroll), "bed_bench" (sleeping on a bench), "bed_left" / "bed_right" (a double bed’s halves)
x number metres - where the sitter’s feet are
y number metres
z number metres; below 0 = on the ground
opts table CreateMapObject’s yaw (where the sitter looks), layer, group, persist (optional)

number - the seat’s id; nil and the reason

-- a campfire at 1300 1100: two places on the ground beside it, both looking at the fire, and a bedroll
CreateMapSeat("ground", 1298.8, 1100, -1, {yaw = -90})
CreateMapSeat("ground", 1301.2, 1100, -1, {yaw = 90})
CreateMapSeat("bed_ground", 1300, 1102.5, -1, {yaw = 90})

CreateMapObject · CreateMapDoor · GetMapObject · the The server’s map group of the index