Skip to content

GridTargetingState

State for targeting objects within the Grid Building System.

signal ready_changed( value: bool )

Emitted when the readiness status of the state has changed - usually after successful validation.

signal target_changed( new: Node2D, old: Node2D )

Emitted when the target node for the state is changed.

signal positioner_changed( positioner: Node2D )

Emitted when the node responsible for positioning grid building placement objects and indicators is changed on the BuildingState.

signal target_map_changed( target_map: TileMapLayer )

Emitted when the targeted map node is changed. This represents the main target TileMapLayer node on the state.

signal maps_changed( maps: Array[TileMapLayer] )

Emitted when the list of known maps is changed.

This is a list of maps that can be accessed without the need for any collision check calls.

ready: bool = false
target: Node2D :

The placed node currently being targeted

positioner: Node2D :

Parent node for positioning grid building objects onto the game world.

target_map: TileMapLayer :

The TileMapLayer or TileMap node to be used when determining grid distances in your game world

You could think of this as the main map node usually where characters stand on

maps: Array[TileMapLayer]:

All maps to be known by the targeting state for testing against without casting for collisions.

You can exclude any purely cosmetic maps that shouldn’t have gameplay impacts.

set_map_objects( p_target_map: TileMapLayer, p_maps: Array[TileMapLayer] ) -> void

Sets the target map and maps array for this targeting state

get_target_map_tile_shape( ) -> TileSet.TileShape

Get the shape of the currently targeted TileMapLayer’s tileset tiles

get_target_map_tile_set( ) -> TileSet

Gets the tileset of the currently targeted TileMapLayer

validate_runtime( logger: GBLogger ) -> bool

Ensures that the targeting state is ready for runtime operation and logs any issues found

get_owner( ) -> Node
get_owner_root( ) -> Node
get_editor_issues( ) -> Array[String]

Returns an array of issues found during editor validation

get_runtime_issues( ) -> Array[String]

Should be called AFTER necessary properties on the state have been set

addons/grid_building/systems/grid_targeting/grid_targeting_state.gd


This page was auto-generated from GDScript source. Edit the source file to improve documentation.

Generated on 2025-09-07