Chris' Tutorials
Docs/Grid Placement

Class

ValidPlacementTileRule

Generated GDScript class reference for GridPlacement.ValidPlacementTileRule.

StatusDraft
Versionv6.0
UpdatedDevelopment docs generated from GDScript source

This is unreleased documentation in active development. APIs, class names, and behavior may change before the final release.

Draft — Unreleased:This page is in active development. APIs, class names, and behavior may change before the release is finalized. Use it as a preview of what's coming — not as a stable integration target.

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 PlacementContainer 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
rule_settingsProperty
invalid_tile_countProperty
failing_indicatorsProperty
tear_downMethod
does_tile_have_valid_dataMethod
required_matchesProperty
match_countProperty
tile_posProperty
tile_dataProperty
matchedProperty
layer_countPropertyMake sure the tile data has the custom_data requirements
issuesProperty

Source

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

Plugin docs root:gdscript/plugins/grid_placement_dev/docs