Skip to content

Class

TerrainDemolishData

Generated GDScript class reference for GridPlacement.TerrainDemolishData.

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.

Specialized ManipulationData for the terrain DEMOLISH action. Carries the terrain name, cells to erase, target map, and cell count for demolish operations. Exposes a veto() hook that listeners can call from the PlacementState.pre_terrain_demolish callback to cancel the demolition. Lifecycle (5.1.0-P): try_demolish_terrain: status = STARTED emit pre_terrain_demolish(data) # listeners may call data.veto() if data.vetoed: status = CANCELED return erase_cells() emit post_terrain_demolish(data) emit post_terrain_removed(data) status = FINISHED

Source: addons/grid_placement/placement/terrain/terrain_demolish_data.gd

Syntax

class TerrainDemolishData extends ManipulationData

Members

NameKindSummary
terrain_namePropertyThe terrain name being demolished (e.g. "dungeon_floor"). Resolved from the TileSet at erase time.
cellsPropertyThe grid cells to erase.
target_mapPropertyThe TileMapLayer where the terrain will be erased.
cells_3dProperty3D variant: the GridMap cells to erase. Populated instead of cells when the demolish targets a GridMap; build this shape with for_3d().
target_map_3dProperty3D variant: the GridMap where the terrain will be erased.
build_costPropertyBuildCost snapshot for the demolish — set by terrain_placement_service when the demolish is initiated, so refunder pool has a stable value at handler time. Null cost → no refund (legacy / no-cost terrains), per AGENTS.md non-blocking policy.
for_3dMethod
empty_2dProperty
dataProperty
is_3dMethod
cell_countMethod