Per-player states, contexts, settings and entry catalog. GridPlacementHost owns runtime composition and the shared placement world. Usage: var session := PlacementSession.new() session.grid_placement_bundle = preload("res://bundle.tres") var host := GridPlacementHost.new() host.configure(session) host.bind_scene_consumers(scene_root, session) # Additional players join the same host through register_session.
Source: addons/grid_placement/resources/placement_session.gd
Syntax
class PlacementSession extends ResourceMembers
| Name | Kind | Summary |
|---|---|---|
grid_placement_bundle | Property | Configuration resource for the grid building system. When set, get_settings(), get_templates(), get_actions(), get_debug_settings(), get_runtime_checks(), and other config-layer accessors read through this resource. This is the scene-composed on-ramp: editor-authored .tres files assign a GridPlacementBundle here. |
settings | Property | Main settings configuration resource. When null, get_settings() falls back to grid_placement_bundle.settings. |
actions | Property | Input action definitions used by host, input, manipulation, and drag services. When null, get_actions() falls back to grid_placement_bundle.actions. |
catalog | Property | Catalog of available placement entries (objects + terrains). |
states | Property | Shared states for plugin systems. |
contexts | Property | Context for resolving references to current objects. |
terrain_selected | Signal | Emitted when selected_terrain_name changes. The host connects to this signal in GridPlacementHost.configure() to enter terrain paint mode automatically when the UI selects a terrain. |
placeable_selected | Signal | Emitted when selected_placeable changes. The host connects to this signal for parity with terrain_selected — drag service, preview builder, and host observers all react to per-session placeable changes without polling the field. |
coordinate_mode_changed | Signal | Emitted when placement_coordinate_mode changes. |
placement_coordinate_mode | Property | Coordinate mode for placement targeting. GRID (default) snaps to cell centers; SMOOTH uses exact world positions. Session-scoped, explicit — no heuristic auto-detection. Changing this clears any active preview and resets targeting state so grid and smooth state never bleed. |
selected_terrain_name | Property | Runtime terrain selection for this session (NOT serialized — transient per-player state). The terrain palette UI writes the user's pick here; GridPlacementHost reads it from the device-resolved active session when dispatching PLACE_SINGLE_TERRAIN / terrain-brush paint. Empty means no terrain is selected and terrain dispatch is a no-op. Keeping it on the session (the one object both the UI and the host already hold) is what lets split-screen sessions each carry their own selection. |
selected_terrain_entry | Property | Optional catalog metadata for the selected terrain. These transient fields keep terrain rule/cost validation session-owned without requiring the compatibility building system to mirror UI state. |
selected_terrain_palette | Property | |
selected_placeable | Property | Runtime placeable selection for this session (NOT serialized — transient per-player state). The placeable UI writes the user's pick here; GridPlacementHost reads it from the device-resolved active session when dispatching PLACE_SINGLE_OBJECT / object-drag intents. Null means no placeable is selected and object dispatch is a no-op. Symmetric to selected_terrain_name — this is the object-mode counterpart that fixes the terrain/object cross-leak where a smithy pick drove fence placement. |
logger | Property | Centralized logger instance. Lazily initialized from config.debug when first accessed, so .tres-loaded sessions get the correct log level after grid_placement_bundle is deserialized. Construction delegates through PlacementLogger.initialize() which is the canonical composition-time factory. The direct construction call site lives in placement_logger.gd (the only module where the guard-allowed bootstrap is permitted). |
get_contexts | Method | |
get_states | Method | |
get_logger | Method | |
get_mode_state | Method | |
get_targeting_state | Method | |
get_building_state | Method | |
get_manipulation_state | Method | |
get_placement_rules | Method | |
get_runtime_issues | Method | |
get_settings | Method | |
get_actions | Method | |
get_templates | Method | |
get_visual_settings | Method | |
get_manipulation_settings | Method | |
get_debug_settings | Method | |
get_runtime_checks | Method | |
get_indicator_context | Method | |
set_states | Method |