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
| Field | Value |
|---|---|
| Display | Copy Object |
| Category | building |
| Access | ScriptCheat |
| Scope | B1Standalone |
| Tags | Experimental |
| Aliases | — |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| entity_id | entityId | yes | — | Source game object entity ID (from build.scan_objects) |
| offset_x | float | no | 0 | Site-relative X displacement of the copy |
| offset_y | float | no | 0 | Site-relative Y displacement of the copy |
| offset_z | float | no | 0 | Site-relative Z displacement of the copy |
| grid_dx | int | no | 0 | Wall grid cell offset in X (must match offset_x for wall-attached objects) |
| grid_dy | int | no | 0 | Wall grid cell offset in Y (must match offset_y for wall-attached objects) |
| yaw | float | no | 0 | Additional yaw rotation in degrees applied to the copy |
| floor_delta | int | no | 0 | Floor 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
});