Manages placement of objects in the game world. Handles preview, placement validation, and placement actions. Uses tile collision indicators to show valid/invalid spots before placement. Checks all rules before adding objects to the world and emits signals for placement success or failure. @deprecated Will be removed in 6.1. Add a GridPlacementHost to your scene, set a PlacementSession on a GridPositioner2D, and the positioner will register the session with the host. The host owns runtime input. See the 6.0 migration guide for the path.
Source: addons/grid_placement/systems/building/placement_system.gd
Syntax
class PlacementSystem extends PlacementSystemBaseMembers
| Name | Kind | Summary |
|---|---|---|
PlaceMode | Field | Explicit build mode for the building system (5.2+) NONE: No build mode active OBJECT: Placing scene objects via ScenePlacementEntry resources TERRAIN: Painting terrain tiles by terrain name, resolved against the TileSet SSOT DECORATION: Kept for backward compatibility but aliases OBJECT Canonical name for the placement mode enum. Use [PlaceMode.OBJECT] etc. in new code — `BuildMode` is kept as a backward-compatible alias for the same enum (the names are interchangeable; values are identical). |
build_mode_changed | Event | Router-facing submode inside global PLACE mode. NONE means the user is in PLACE but has not chosen terrain or objects yet. Emitted when the build mode changes |
place_submode_changed | Event | Emitted when the router-facing place submode changes (see PlaceSubmode). |
create_with_injection | Method | |
system | Property | |
issues | Property | |
logger | Property | |
create_with_session | Method | |
system | Property | |
issues | Property | |
placement_polygons | Property | Collision polygons for placement indicators. |
preview_layer | Property | Preview layer index for buildable/unbuildable tiles. |
selected_placeable | Property | Currently selected placeable resource. Proxy to [member PlacementSession.selected_placeable] when wired through a [PlacementContainer]. Reads and writes both legs so legacy scenes and session-built variants behave identically. The session is the canonical home: writes trigger [signal PlacementSession.placeable_selected] which the host observes in [method GridPlacementHost.configure]. The backup backing field handles tests/legacy paths that run without a [PlacementContainer]. This closes the terrain/object cross-leak where a smithy pick persisted into a fence placement because the system field was the divergent source — the band-aid revert target. |
selected_terrain_name | Property | Currently selected terrain name (new path). Empty when no terrain is selected. Resolved against the target TileMapLayer's TileSet at paint-time. Proxy to [member PlacementSession.selected_terrain_name] when wired through a [PlacementContainer], else falls back to [member _selected_terrain_name_backing]. Symmetric to [member selected_placeable] — also closes the dual-write band-aid where the system wrote to both itself and the session on every select. |
selected_terrain_entry | Property | The currently selected terrain entry (if any). |
selected_terrain_palette | Property | The currently selected terrain palette (if any). |
current_mode | Property | Current explicit build mode (5.2+) Computed from [member _place_machine]. |
current_place_submode | Property | Current router-facing submode inside global PLACE mode. Computed from [member _place_machine]. |
brush_state | Property | Brush state accessor (read-only). The actual [BrushState] is owned by [member _brush_coordinator] (P4 god-class extraction); this property preserves the public test-facing API that pre-existed the extraction so test code can still read `building_system.brush_state` to introspect drag/pending state. Returns null if the coordinator has not been constructed yet (e.g. before [method resolve_placement_dependencies]). |
indicators_group | Property | Parent node for collision indicators. |
get_building_state | Method | |
get_targeting_state | Method | |
get_states | Method | |
get_logger | Method | |
set_logger | Method | |
get_actions | Method | |
get_indicator_context | Method | |
set_states | Method | |
set_actions | Method | |
set_indicator_context | Method | |
WARNING_INVALID_PLACEABLE | Field | |
WARNING_NO_PREVIEW | Field | |
is_ready_to_place | Method | |
r_ctx | Property | |
is_ready_to_paint_terrain | Method | |
r_ctx | Property | |
get_terrain_preview_cells | Method | |
host_cells | Property | |
positioner | Property | |
current_cell | Property | |
get_host_terrain_preview_cells | Method | |
host_brush | Property | |
positioner | Property | |
current_cell | Property | |
report | Property | |
try_place_terrain_brush | Method | |
target_map | Property | |
positioner | Property | |
cell | Property | |
report | Property | |
target_map | Property | |
report | Property | |
positioner | Property | |
report | Property | |
current_cell | Property | |
cells | Property | |
report | Property | |
placed_count | Property | |
skipped_count | Property | |
skipped_reasons | Property | |
MAX_SKIPPED_REASONS | Field | |
world_pos | Property | |
cell_report | Property | |
issues | Property | |
report | Property | |
summary_report | Property | |
set_brush_shape | Method | |
exit_build_mode | Method | |
get_terrain_service | Method | |
get_terrain_context | Method | |
set_host | Method | |
get_host | Method | |
get_manipulation_service | Method | |
manip_settings | Property | |
get_grid_targeting_service | Method | |
enter_place_router | Method | |
set_place_submode | Method | |
resolve_placement_dependencies | Method | |
settings | Property | |
settings | Property |
Source
addons/grid_placement/systems/building/placement_system.gd
Plugin docs root:gdscript/plugins/grid_placement_dev/docs