Skip to content

Class

ValidPlacementTileRule

Generated GDScript class reference for GridPlacement.ValidPlacementTileRule.

Status
Current
Version
v6.0
Source updated
Active v6.0 guide line from Grid Placement repo
Generated on
2026-09-01

A rule that validates a tile position based on a tilemap's custom data fields. This rule checks if a tile at a potential placement position has all the required custom data fields and matching values defined in its expected_tile_custom_data dictionary. It's used to ensure that a tile can only be placed on a specific type of ground, such as "walkable" or "buildable" tiles. Usage:

  • Assign this rule to a PlacementSession for context wide injection or to a ScenePlacementEntry for placeable specific rule evaluation
  • Set the expected_tile_custom_data dictionary to define the required key-value pairs (e.g., { "type": "ground", "variant": "grass" }).
  • The rule will fail if the tile at the indicator's position does not contain all the required custom data or if any values do not match.

Source: addons/grid_placement/placement/placement_rules/template_rules/valid_placement_tile_rule.gd

Syntax

class ValidPlacementTileRule extends TileCheckRule

Members

NameKindSummary
expected_tile_custom_dataPropertyExpected custom data fields and values for valid tiles.
settingsPropertySettings for the valid placement tile rule. Defines custom messages for this rule's validation.
setupMethod
validate_placementMethod
tear_downMethod
does_tile_have_valid_dataMethod