Skip to main content

building.construct_room

Overview

  • [Build Mode Only] Builds all four walls of an axis-aligned rectangular room in ONE command and ONE undo step. PREFER THIS over four building.construct_wall calls, especially above floor_level 0. Building a room side by side does not work on upper floors: the engine resets the elevation of any room that is not closed yet, so the 2nd and 4th side silently fail to attach and you end up with 2 of 4 walls. This command runs all four sides inside one root command, so the room is already closed when that check runs. x0/y0 and x1/y1 are OPPOSITE CORNERS in centimetres, site-relative with the origin at the site's MINIMUM CORNER - the same space as build.scan_walls and building.place_object. Order does not matter; each side must be at least 50cm. Endpoints snap to the 25cm grid, so the resulting wall centre lines land on 25k+12.5. HEIGHTS: for floor_level above 0 the storey elevation goes into 'floor_height', NOT 'base_height' - the engine resets base_height to 0, so a room built that way silently lands at ground level. Just omit floor_height and it is derived from the top of the floor below. Heights are also inherited from a wall graph the rectangle touches. wall_height defaults to 300cm (3.0m). SUCCESS IS VERIFIED: 'sides_created' and 'sides' are read back from the wall graph afterwards, and 'result__height' reports what the graph actually kept. Anything less than 4 sides fails loudly. Walls are free - nothing is charged. Requires phase == 'ready' (see build.get_mode_state).

Metadata

FieldValue
DisplayConstruct Room
Categorybuilding
AccessScriptCheat
ScopeB1Standalone
TagsExperimental
Aliases—

Parameters

NameTypeRequiredDefaultDescription
x0floatyes—First corner X in cm from the site min corner
y0floatyes—First corner Y in cm from the site min corner
x1floatyes—Opposite corner X in cm
y1floatyes—Opposite corner Y in cm
floor_levelintno0Floor level to build on. 0 is the ground floor. Above 0 the storey elevation goes into floor_height, which is derived from the floor below when you omit it.
wall_heightfloatno—Wall height in CENTIMETRES. Default 300 (3.0m, the in-game default). In-game presets are 285/300/375/390/465/480/555/570; build.get_site_info lists them. Inherited when the room joins an existing wall.
base_heightfloatno—Ground-floor FOUNDATION height in cm (default 0). Do NOT use this for a storey elevation: the engine resets base_height to 0 on any room that is not closed yet, so an upper floor set this way ends up at ground level. Use floor_height.
floor_heightfloatno—STOREY ELEVATION in cm - the Z the walls stand on, and the field that actually carries height for floor_level above 0. Omit it and it is taken from the top of the floor below ('top_height' in build.scan_floors).
is_halfboolnofalseBuild half-height walls
is_railingboolnofalseBuild railings instead of walls
wall_deconamenoNoneWall decoration row id

Usage

await inzoi.cli.execute('building.construct_room', {
x0: 0.0,
y0: 0.0,
x1: 0.0,
y1: 0.0,
floor_level: 0, // optional
wall_height: 0.0, // optional
base_height: 0.0, // optional
floor_height: 0.0, // optional
is_half: false, // optional
is_railing: false, // optional
wall_deco: 'None', // optional
});