Skip to main content

building.copy_object

Overview

  • [Build Mode Only] Duplicates a placed object at an offset, through the build undo/redo stack (revert with building.undo). The copy's price is charged to the household wallet. offset_x/y/z are a SITE-RELATIVE displacement, yaw is an extra rotation, and floor_delta is a RELATIVE floor change (not an absolute floor level). grid_dx/grid_dy shift the wall grid cell the object is attached to; leaving them at 0 is only safe for free-standing objects - stairs, ladders and wall-mounted objects will end up detached from their wall if the grid offset does not match the world offset. Requires phase == 'ready' (see build.get_mode_state).

Metadata

FieldValue
DisplayCopy Object
Categorybuilding
AccessScriptCheat
ScopeB1Standalone
TagsExperimental
Aliases—

Parameters

NameTypeRequiredDefaultDescription
entity_identityIdyes—Source game object entity ID (from build.scan_objects)
offset_xfloatno0Site-relative X displacement of the copy
offset_yfloatno0Site-relative Y displacement of the copy
offset_zfloatno0Site-relative Z displacement of the copy
grid_dxintno0Wall grid cell offset in X (must match offset_x for wall-attached objects)
grid_dyintno0Wall grid cell offset in Y (must match offset_y for wall-attached objects)
yawfloatno0Additional yaw rotation in degrees applied to the copy
floor_deltaintno0Floor level DELTA relative to the source object's floor

Usage

await inzoi.cli.execute('building.copy_object', {
entity_id: 0,
offset_x: 0, // optional
offset_y: 0, // optional
offset_z: 0, // optional
grid_dx: 0, // optional
grid_dy: 0, // optional
yaw: 0, // optional
floor_delta: 0, // optional
});