Skip to content

Class

TerrainPlacementService2D

Generated GDScript class reference for GridPlacement.TerrainPlacementService2D.

Status
Current
Version
v6.3.0
Source updated
2026-10-29
Generated on
2026-10-29

6.3. These pages document the 6.3 release, where placeable is now entry (what changed) and PlacementOwner is deprecated (migration). Still on 6.2? Your version's guides ship inside the plugin itself, under addons/grid_placement/guides/; the 6.2 URLs on this site now redirect to this series.

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 RefCounted

Members

NameKindSummary
MSG_TERRAIN_NOT_READYFieldPlayer-facing paint failure reasons. Setup and plan details are written to the developer log instead of the action log.
MSG_TERRAIN_CANT_PAINTField
mapPropertyThe map and terrain id a paint resolves to, or the precondition failure that stopped it.
terrainProperty
failureProperty
resolve_placement_dependenciesMethod
try_place_terrain_by_nameMethod
try_place_terrain_brushMethod
first_cellProperty
targetProperty
resolved_mapProperty
issuesProperty
cell_issue_mapProperty
ownerProperty
paint_dataProperty
goneProperty
failureProperty
terrain_painterProperty
planProperty
beforeProperty
changedProperty
noopProperty
success_reportProperty
targetProperty
mapProperty
messageProperty
failure_mapProperty
failure_nameProperty
erase_cellsMethod
resolved_mapProperty
ownerProperty
reportProperty
tile_setProperty
tile_dataProperty
terrain_nameProperty
t_setProperty
t_idProperty
erase_cells_batchProperty
remove_dataProperty
try_demolish_terrainMethod
resolved_mapProperty
candidate_mapsProperty
ownerProperty
tile_setProperty
resolved_terrain_nameProperty
demolish_dataProperty
erase_orderProperty
demolish_by_mapProperty
demolishable_cellsProperty
cost_entryProperty
erased_countProperty
erase_mapProperty
erase_batchProperty
by_mapProperty
tdProperty
terrain_nameProperty
entryProperty
validate_terrain_cellsMethod
outProperty
sharedProperty
seed_ctxProperty
rulesProperty
ctxProperty
resultsProperty
issuesProperty
set_world_registry_2dMethod
validate_terrain_cellMethod
ctxProperty
resultsProperty
treeProperty
solvedProperty
triplesProperty
coversProperty
mapsProperty
ownerProperty
reportProperty
resolve_terrain_collision_polygonsMethod
polysProperty
tile_setProperty
resolved_tile_dataProperty
sourceProperty
tile_dataProperty
layer_maskProperty
layer_colProperty
pointsProperty
TERRAIN_QUERY_INSET_PXFieldBoundary-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 TilePaintCollisionRule._cell_query_shape(), which insets its feature-layer query for the same reason.
inset_polygon_pointsMethod
min_pProperty
max_pProperty
sizeProperty
centroidProperty
factorProperty
outProperty
cell_collides_with_polygonsMethod
world_2dProperty
space_stateProperty
cell_local_posProperty
xformProperty
shapeProperty
queryProperty
colliderProperty
save_terrainMethod
load_terrainMethod
save_all_terrainMethod
load_all_terrainMethod
supported_dimensionsMethod