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

Returns

Returns a JSON object with the following fields:

FieldTypeRequiredDescription
committedboolyesWhether the command entered the undo history
undoableboolyesWhether building.undo can revert it - the whole room is ONE step
has_undoboolyesUndo available after execution
has_redoboolyesRedo available after execution
sides_createdintyesHow many of the 4 sides really exist afterwards, read back from the wall graph. 4 means success.
sidesarray<object>yesPer-side result, in order: (min,min)->(max,min)->(max,max)->(min,max)->close
sides[].sideintyesSide index 0-3
sides[].createdboolyesWhether a wall exists along this side
sides[].wall_countintyesHow many wall edges exist along this side (may be split at intersections)
floor_levelintyesFloor level the room was built on
inherited_heightsboolyesWhether the heights were taken from an existing wall graph the rectangle touches
derived_floor_heightboolyesWhether floor_height was derived automatically from the top of the floor below
applied_base_heightfloatyesbase_height requested from the engine. Normally 0 - this is the ground-floor foundation field, not the storey elevation.
applied_floor_heightfloatyesfloor_height requested from the engine. THIS is the storey elevation.
applied_wall_heightfloatyeswall_height requested from the engine
result_base_heightfloatyesbase_height the wall graph actually kept afterwards. Expect 0: the engine resets it.
result_floor_heightfloatyesfloor_height the wall graph actually kept afterwards
result_wall_heightfloatyeswall_height the wall graph actually kept afterwards
minobjectyesLower corner actually used
min.xfloatyesX in cm
min.yfloatyesY in cm
maxobjectyesUpper corner actually used
max.xfloatyesX in cm
max.yfloatyesY in cm

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
});