Water¶
15 tools for water bodies, rivers and water zones: splines, waves, materials and settings.
Back to the index.
add_water_body_to_zone¶
Destructive Idempotent
Link a water body to a water zone for good by pointing the body's WaterZoneOverride at it (UWaterBodyComponent::SetWaterZoneOverride), replacing any override it had: a saved property the engine prefers over spatial overlap, so the body stays in that zone wherever it lies, and the zone rebuilds its water info and mesh around it; both are found by editor label in the editor world. linked is read back: the override and the body's owning zone both name the zone, which is what get_water_body_info (water_zone_label) and get_water_zone_info (linked_body_count) then report; owning_zone_label and previous_zone_label say where it is and was. One undo step; the level is marked dirty, not saved (save_level). Idempotent: a body already linked this way changes nothing (changed=false). Inverse: remove_water_body_from_zone. An unknown body or zone label, or a body without a UWaterBodyComponent, is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Editor label (not the object name) of the AWaterBody actor -- lake, river, ocean or custom -- e.g. "Lake_Main", as create_water_body set it; whole label, case-insensitive, first match |
water_zone_label |
string | yes | Editor label of the AWaterZone actor, e.g. "WaterZone_1"; spawn_actor with type="WaterZone" places one |
Returns: { water_body_label: string, water_zone_label: string, linked: bool, changed: bool, water_zone_override: string (the override's object path, read back), owning_zone_label: string, previous_zone_label: string }
create_water_body¶
Destructive
Spawn a water body actor -- a lake, an ocean or a river, by body_type -- through the Water plugin's own actor factory, optionally link it to a WaterZone, and READ BACK the wave height the factory attached (a lake is born with the ocean's waves and nothing else reveals it; disable_waves removes them and proves it). affects_landscape carves the landscape with the water brush (off by default). The actor exists in memory: save_level puts it on disk. Shape a river or lake with the spline tools; set_water_body_properties sets per-point velocity and audio, set_properties the rest.
| Parameter | Type | Required | Description |
|---|---|---|---|
body_type |
string | yes | One of lake, ocean, river |
actor_label |
string | yes | Label to assign to the new water body actor |
location |
array | no | Optional [X, Y, Z] world location (defaults to origin) |
water_zone_label |
string | no | Optional editor label of an existing AWaterZone to link the body to, through its WaterZoneOverride as add_water_body_to_zone does (saved with the level, kept wherever the body lies); linked_to_zone and owning_zone_label are read back from the body. If the zone is not found, success is false while the body is still spawned |
affects_landscape |
boolean | no | When true the body carves the existing landscape via the water landscape brush; defaults to false (non-destructive) |
disable_waves |
boolean | no | Opt-in, default false: sets the water waves to none right after the spawn and re-reads the max wave height to prove it is 0 |
Returns: { actor_label: string, actor_name: string, body_type: string, water_zone_label: string, linked_to_zone: bool, water_zone_override: string, owning_zone_label: string, affects_landscape: bool, max_wave_height: number, max_wave_height_on_spawn: number, has_waves: bool, waves_disabled: bool, warning?: string, requested: object }
create_water_body_exclusion_volume¶
Additive
Spawn an AWaterBodyExclusionVolume (a brush volume that excludes water bodies), build its cube brush, set the exclusion mode, and optionally bind specific water bodies by label.
| Parameter | Type | Required | Description |
|---|---|---|---|
actor_label |
string | yes | Label to assign to the new exclusion volume actor |
location |
array | no | Optional [X, Y, Z] world location (defaults to origin) |
size |
number | no | Optional cube brush size in uu (defaults to 200) |
exclusion_mode |
string | no | Optional "remove" (default) or "add": whether water_body_labels are removed from or added to the exclusion |
water_body_labels |
array | no | Optional array of AWaterBody labels to bind into the volume's WaterBodies list |
Returns: { actor_label: string, actor_name: string, exclusion_mode: string, water_body_count: int, brush_built: bool }
get_water_body_gerstner_wave_detail¶
Read-only
Read the individual Gerstner waves a water body holds (found by actor label in the editor world), as last generated and cached on its waves object: per wave the wavelength and amplitude in cm, the steepness, and the horizontal direction vector. A body without Gerstner waves -- a river, a body with another waves class, or one whose generator produced none -- is a success with wave_count 0 and an empty list. Read-only; an unknown label is an error. For the summary (waves class, count, max height) use get_water_body_info; author waves with set_water_body_gerstner_waves.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Actor label of the AWaterBody in the editor world (case-insensitive; the object name does not match). |
Returns: { water_body_label: string, wave_count: int, waves: [{ wavelength: number, amplitude: number, steepness: number, direction: [number, number, number] }] }
get_water_body_info¶
Read-only
Read back a water body's type, linked zone, surface material and wave state: whether waves are supported and present, the max wave height, the active waves class with its wave count and, for Gerstner waves, the generator class. Read-only; an unknown label is an error. Per-wave detail is get_water_body_gerstner_wave_detail.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Label of the AWaterBody actor |
Returns: { actor_label: string, actor_name: string, body_type: string, water_zone_label: string, material: string, max_wave_height: number, wave_supported: bool, has_waves: bool, waves_class: string, num_waves: int, generator_class: string }
get_water_body_spline_points¶
Read-only
Read the spline control points of any water body -- river, lake, ocean or custom, found by actor label in the editor world -- as world-space [x, y, z] positions in cm, in spline order. Only point locations come back: no tangents, widths, depths or closed-loop flag. Read-only. An unknown label, or a body without a water spline, is an error. Write them with set_water_body_spline_points; per-point river width and depth: set_river_width_depth_at_point; a generic actor's USplineComponent in local space, with its closed-loop flag: get_spline_points; body type, zone and material: get_water_body_info.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Actor label of the AWaterBody in the editor world (case-insensitive; the object name does not match). |
Returns: { water_body_label: string, point_count: int, points: [[number, number, number]] }
get_water_zone_info¶
Read-only
Read a water zone of the editor world, found by editor label: actor_label, actor_name, has_water_mesh, zone_extent [X, Y] in cm (the complete extent times the actor scale, not a half-extent), overlap_priority, and linked_body_count, the number of water bodies whose own owning zone is this one (by spatial overlap, or by the WaterZoneOverride add_water_body_to_zone sets). Use it before and after set_water_zone_settings, which also reports render-target resolution, world bounds and texel size; for one body's zone, type and waves use get_water_body_info. Read-only and idempotent. A label no AWaterZone has is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_zone_label |
string | yes | Editor label (not the object name) of the AWaterZone actor, e.g. "WaterZone_1"; whole label, case-insensitive, first match. find_actors_by_name with match='label' lists labels |
Returns: { actor_label: string, actor_name: string, has_water_mesh: bool, linked_body_count: number, zone_extent: [number, number], overlap_priority: int }
remove_water_body_from_zone¶
Destructive Idempotent
Unlink a water body from a water zone (inverse of add_water_body_to_zone): a WaterZoneOverride naming that zone is cleared, in one undo step that marks the level dirty, so the body falls back to the zone its bounds overlap, if any; owning_zone_label reads that back. A body inside the zone's bounds belongs to it by overlap whatever its override says, so that case is refused before anything changes. Idempotent: a body not linked to the zone is a success with already_unlinked=true and nothing changed. Read the result with get_water_body_info (water_zone_label). An unknown body or zone label is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Editor label of the AWaterBody actor to unlink, e.g. "Lake_Main" |
water_zone_label |
string | yes | Editor label of the AWaterZone actor to unlink from, e.g. "WaterZone_1" |
Returns: { water_body_label: string, water_zone_label: string, removed: bool, override_cleared: bool, already_unlinked: bool, owning_zone_label: string }
set_river_width_depth_at_point¶
Destructive Idempotent
Set the width and/or depth of a river water body, found by actor label in the editor world, at the spline point at or before input_key (point i sits at key i; past the last point, the last one), then synchronize the spline so the river rebuilds; nothing is saved. A value below 0.0001 is stored as 0.0001, as the engine's sync does. width and depth are read back from that point, named by point_index. A value already held is not written: applied is false with a note and nothing changes; otherwise the call is one undo step that dirties the actor's package. Neither width nor depth, a non-river body, an unknown label, a spline without points or a key before the first point is an error and nothing changes. All points at once: set_river_widths_depths; point positions: get_water_body_spline_points.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Label of the AWaterBodyRiver actor |
input_key |
number | yes | Spline input key at which to set width/depth; a key before the first spline point (below 0) is an error and nothing is changed |
width |
number | no | Optional new river width at the point at or before the key (give width, depth or both) |
depth |
number | no | Optional new river depth at the point at or before the key (give width, depth or both) |
Returns: { water_body_label: string, input_key: number, point_index: int, width: number, depth: number, applied: bool, note: string? }
set_river_widths_depths¶
Destructive Idempotent
Set the width and/or depth of every spline point of a river water body, found by actor label: the arrays are indexed by point (point i at key i), each given one with point_count entries. A value below 0.0001 is stored as 0.0001, as the spline sync does. The points are written in one undo step dirtying the actor's package, then the spline is synchronized once to rebuild the river; nothing is saved. widths and depths are read back from the points; applied_widths or applied_depths is true when that array changed a point and every point holds it, and success is false when one does not. Arrays already held change nothing: both false, a note, no undo step. Neither array, a wrong length, a non-river body or an unknown label is an error. One point: set_river_width_depth_at_point.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Label of the AWaterBodyRiver actor |
widths |
array | no | Optional array of per-point river widths (length must equal point_count) |
depths |
array | no | Optional array of per-point river depths (length must equal point_count) |
Returns: { water_body_label: string, point_count: int, applied_widths: bool, applied_depths: bool, widths: [number], depths: [number], note: string? }
set_water_body_gerstner_waves¶
Destructive Idempotent
Build a Gerstner wave set (UGerstnerWaterWaves + simple parametric generator) and apply it to a wave-supporting water body (Lake/Ocean; rivers are rejected). The generator ramps per-wave Steepness from large_wave_steepness to small_wave_steepness; the no-self-intersection (no fold, no black-crest) criterion is total_steepness (returned) <= 1 — lower the two steepness params and/or num_waves if it exceeds 1.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Label of the AWaterBody actor (must support waves: Lake or Ocean) |
num_waves |
number | no | Optional wave count for the generator (>= 1; default 16) |
min_wavelength |
number | no | Optional minimum wavelength in uu |
max_wavelength |
number | no | Optional maximum wavelength in uu |
min_amplitude |
number | no | Optional minimum wave amplitude in uu |
max_amplitude |
number | no | Optional maximum wave amplitude in uu |
wind_angle |
number | no | Optional dominant wind angle in degrees |
small_wave_steepness |
number | no | Optional steepness of the smallest wave (generator default 0.4) |
large_wave_steepness |
number | no | Optional steepness of the largest wave (generator default 0.2) |
steepness_falloff |
number | no | Optional exponent shaping the small->large steepness ramp (generator default 1.0) |
Returns: { water_body_label: string, wave_supported: bool, has_waves: bool, num_waves: int, max_wave_height: number, total_steepness: number, applied: bool }
set_water_body_material¶
Destructive Idempotent
Set the surface water material on a water body's UWaterBodyComponent (body found by actor label in the editor world, material loaded by asset path) and rebuild its material instances. The change is one undo step and dirties the level; nothing is saved. The material it already has changes nothing, adds no undo step and still answers set=true; set confirms the component now holds the requested material, and material is that material's short name, not its path. An unknown label, a body without a water body component, or a path that does not load as a UMaterialInterface is an error. Read it back with get_water_body_info; other body settings: set_water_body_properties; waves: set_water_body_gerstner_waves.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Actor label of the AWaterBody in the editor world (case-insensitive; the object name does not match). |
material_path |
string | yes | Asset path of the UMaterialInterface (a material or material instance), e.g. "/Game/Water/M_Water" (the object path form also works). |
Returns: { water_body_label: string, material: string, set: bool }
set_water_body_properties¶
Destructive Idempotent
Set only the given settings of a lake, ocean or river water body, found by actor label in the editor world, reading each back with already_set; nothing is saved. Use it over set_properties for water_velocity/audio_intensity, which live per spline point: they go to the point at or before input_key, are read back from it and synchronize the spline. water_height_offset is ocean-only; the ocean's setter clamps it to >= 0 and rebuilds the body. Every other field that changes gets the editor's change notification, updating the water mesh and landscape. All checks run before any write: a spline value without input_key, a key before the first spline point, water_height_offset on a non-ocean body or an unknown label is an error that changes nothing. A value held exactly is not written (already_set true); otherwise the call is one undo step dirtying the actor's package. River width/depth: set_river_width_depth_at_point; waves: set_water_body_gerstner_waves.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Label of the AWaterBody actor (Lake/Ocean/River) |
water_velocity |
number | no | River/spline water velocity to set at input_key (requires input_key) |
audio_intensity |
number | no | Spline audio intensity to set at input_key (requires input_key) |
input_key |
number | no | Spline input key for water_velocity/audio_intensity (required only when either is set); a key before the first spline point (below 0) is an error and nothing is changed |
target_wave_mask_depth |
number | no | Water depth at which waves start being attenuated |
max_wave_height_offset |
number | no | Offset added to the automatically calculated max wave height bounds |
collision_height_offset |
number | no | Distance above the water surface where collision checks still occur |
shape_dilation |
number | no | Shape dilation in uu |
affects_landscape |
boolean | no | Whether the landscape is deformed by this water body |
post_process_blend_weight |
number | no | Underwater post-process blend weight (0..1) |
water_height_offset |
number | no | Ocean-only additional water height (errors on non-ocean bodies) |
Returns: { water_body_label: string, body_type: string, applied: [string], fields: { <name>: { value, already_set } } }
set_water_body_spline_points¶
Destructive Idempotent
Set ANY water body's spline path from world points, then synchronize the water spline metadata and RE-READ the spline (point count + closed-loop) to prove it landed.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_body_label |
string | yes | Label of the AWaterBody actor. DESPITE THE COMMAND NAME THIS IS NOT RIVER-ONLY: it works on any water body that has a UWaterSplineComponent -- lake, ocean, river, custom -- and it is the only way to give a LAKE its real shoreline, because the spline the actor factory creates is an arbitrary CLOSED triangle (3 points) that has nothing to do with the basin. closed_loop is a property of the spline and is NOT touched here: set 12 points on a factory-made lake and you get 12 points still closed. |
points |
array | yes | Array of [X, Y, Z] WORLD points (>= 2) defining the spline. Entries that are not a >= 3-element numeric array are skipped silently; requested_point_count reports how many survived parsing. |
Returns: { water_body_label: string, point_count: int (RE-READ), spline_point_count_actual: int (RE-READ, same value, unambiguously named), closed_loop_actual: bool (RE-READ), requested_point_count: int, applied: bool (DERIVED: read-back count == requested count) }
set_water_zone_settings¶
Destructive Idempotent
Set a water zone's planar extent and/or its water-info render-target resolution, then RE-READ both from the actor (extent, world bounds, texel density) instead of echoing the request back. For a read without changing anything use get_water_zone_info; place a zone with spawn_actor (type="WaterZone"). Only the values passed are written, and one the zone already holds is skipped, so a repeat call changes nothing. One undo step; the level is marked dirty, not saved (save_level). applied is derived from the read-back: false, with an error, when the extent read back differs (GetZoneExtent multiplies by the actor scale; see actor_scale) or the resolution does. water_info_texel_size_uu (extent / resolution) tells whether shorelines can resolve. A label no AWaterZone has is an error.
| Parameter | Type | Required | Description |
|---|---|---|---|
water_zone_label |
string | yes | Editor label (not the object name) of the AWaterZone actor in the editor world, e.g. "WaterZone_1"; whole label, case-insensitive, first match |
extent |
array | no | Optional [X, Y] planar zone extent. !!! THIS IS THE COMPLETE EXTENT, NOT THE HALF-EXTENT / SEMI-AXIS !!! The engine halves it itself (AWaterZone::GetZoneBounds2D: "GetZoneExtents returns the full extent of the zone but BoxSphereBounds expects a half-extent"), so passing 4000000 gives world bounds of [-2000000, +2000000] around the actor -- a 40 km sea, not 80 km. Reading it as a semi-axis gives a sea of DOUBLE the intended size with bounds off the map; the world_bounds_extent field in the response is what disambiguates it (half of zone_extent_actual). |
render_target_resolution |
array | no | Optional [X, Y] water-info render target resolution in texels, whole numbers, e.g. [2048, 2048]. Read back by reflection as render_target_resolution_actual (the getter is not exported, so this is the raw UPROPERTY, i.e. BEFORE the r.Water.WaterInfo.RenderTargetResolutionMax clamp). |
Returns: { water_zone_label: string, zone_extent: [x,y] (RE-READ, kept for compatibility), zone_extent_actual: [x,y] (RE-READ, COMPLETE extent), world_bounds_extent: [x,y,z] (HALF-extent of the real actor bounds), world_bounds_origin: [x,y,z], world_bounds_min: [x,y,z], world_bounds_max: [x,y,z], actor_scale: [x,y,z], render_target_resolution_actual: [x,y] (omitted if unreadable), render_target_resolution_verified: bool, water_info_texel_size_uu: number (zone_extent / render_target_resolution; omitted if the resolution is unreadable or zero), applied: bool (DERIVED from read-back == request), requested: { extent, render_target_resolution } }