Scene-free terrain placement service: terrain-name -> TileSet-ID resolution, plan building/gating/application, and signal emission. Keeps the terrain paint path directly unit-testable. Usage: var service := TerrainPlacementService2D.new() service.configure(building_state, building_settings) var report := service.try_place_terrain_by_name(&"dungeon_floor", cell, map, owner)
Source: addons/grid_placement/systems/building/terrain/terrain_placement_service_2d.gd
Syntax
class TerrainPlacementService2D extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
map | Property | The map and terrain id a paint resolves to, or the precondition failure that stopped it. |
terrain | Property | |
failure | Property | |
resolve_placement_dependencies | Method | |
try_place_terrain_by_name | Method | |
try_place_terrain_brush | Method | |
first_cell | Property | |
target | Property | |
resolved_map | Property | |
issues | Property | |
cell_issue_map | Property | |
owner | Property | |
paint_data | Property | |
gone | Property | |
failure | Property | |
terrain_painter | Property | |
plan | Property | |
before | Property | |
changed | Property | |
noop | Property | |
success_report | Property | |
target | Property | |
map | Property | |
message | Property | |
failure_map | Property | |
failure_name | Property | |
erase_cells | Method | |
resolved_map | Property | |
owner | Property | |
report | Property | |
tile_set | Property | |
tile_data | Property | |
terrain_name | Property | |
t_set | Property | |
t_id | Property | |
erase_cells_batch | Property | |
remove_data | Property | |
try_demolish_terrain | Method | |
resolved_map | Property | |
candidate_maps | Property | |
owner | Property | |
tile_set | Property | |
resolved_terrain_name | Property | |
demolish_data | Property | |
erase_order | Property | |
demolish_by_map | Property | |
demolishable_cells | Property | |
cost_entry | Property | |
erased_count | Property | |
erase_map | Property | |
erase_batch | Property | |
by_map | Property | |
td | Property | |
terrain_name | Property | |
entry | Property | |
validate_terrain_cells | Method | |
out | Property | |
shared | Property | |
seed_ctx | Property | |
rules | Property | |
ctx | Property | |
results | Property | |
issues | Property | |
validate_terrain_cell | Method | |
ctx | Property | |
results | Property | |
maps | Property | |
owner | Property | |
report | Property | |
resolve_terrain_collision_polygons | Method | |
polys | Property | |
tile_set | Property | |
resolved_tile_data | Property | |
source | Property | |
tile_data | Property | |
layer_mask | Property | |
layer_col | Property | |
points | Property | |
TERRAIN_QUERY_INSET_PX | Field | Boundary-contact tolerance (pixels per side) for terrain collision queries. Physics overlap tests report boundary-touching shapes as hits, and resting rigid bodies penetrate cell boundaries by fractions of a pixel — without tolerance, a box merely touching a cell's edge blocks painting there (platformer: box at rest overlaps the neighbor cell by ~0.0001px on one side and ~0.27px below, both read as blocked). The inset keeps hairline contact from counting as occupancy while genuine overlaps still block. Mirrors the precedent in [method TilePaintCollisionRule._cell_query_shape], which insets its feature-layer query for the same reason. |
inset_polygon_points | Method | |
min_p | Property | |
max_p | Property | |
size | Property | |
centroid | Property | |
factor | Property | |
out | Property | |
cell_collides_with_polygons | Method | |
world_2d | Property | |
space_state | Property | |
cell_local_pos | Property | |
xform | Property | |
shape | Property | |
query | Property | |
collider | Property | |
save_terrain | Method | |
load_terrain | Method | |
save_all_terrain | Method | |
load_all_terrain | Method | |
supported_dimensions | Method |