flatten_landscape_in_box
Sets every heightmap vertex inside a world-space box to one absolute height so bases, roads, or building pads sit flat. Use target_z or raw height; blend edges after.
Instructions
Level the terrain under a footprint: snap every heightmap vertex inside a world-space box to ONE absolute height, so a base, road or building pad sits flat. Give the height either as target_z in world units (converted using the landscape scale) or as a raw uint16 target_height (0..65535, where 32768 is the midpoint). Absolute, unlike set_landscape_height_in_box which adds a delta; follow with smooth_landscape_in_box to blend the hard rim it leaves. vertices_modified = 0 means the box never touched the terrain.
Returns: { landscape_actor_name: string, target_height: int, applied: bool, vertices_modified: int, region_width: int, region_height: int, region: [int] }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| center | No | Optional [x, y, z] box center (alternative to box_min/box_max) | |
| extent | No | Optional [x, y, z] box half-extents (alternative to box_min/box_max) | |
| box_max | No | Optional [x, y, z] world-space box maximum | |
| box_min | No | Optional [x, y, z] world-space box minimum | |
| target_z | No | Optional target world Z, converted to uint16 using landscape scale | |
| target_height | No | Optional uint16 heightmap value 0 to 65535 | |
| landscape_actor_name | No | Optional landscape actor name, defaults to first found |