4.3.1: Tile Positions Access, RuleResult updates, Readiness Guard


Here’s a fast rundown of what I’ve added to my Grid Builder plugin—better rules, tile position access, and passing rules to each RuleResult for signal use.

RuleResult now includes a reference to the Rule (PlacementRule) that was being validated for. This gives you direct access receiving signals like success and failed on the BuildingState to the rules at the time the validation finished so you can use any relevant rule data like checking the RuleCheckIndicators for each rule or calling get_tile_positions() on a TileCheckRule to know the positions that were used in placing an object.

Grid Builder Highlights

Rule Readiness:

  • Added guard_ready() to PlacementRule to check if rules are set up.
  • Used in classes like ValidPlacementTileRule for reliable logic.

Tile Positions:

  • New get_tile_positions() in TileCheckRule gives indicator tile coords (Vector2i).
  • RuleCheckIndicator.get_tile_position() converts global positions to tiles.
  • Protected by guard_ready() for safety.

Build Data:

  • Updated RuleResult to link rules with results.
  • Added tests for indicator positions in build action data.

Cleanup:

  • tear_down() in PlacementRule resets _ready.
  • TileCheckRule.tear_down() clears indicators and _ready.

Better Validation Data:

  • RuleResult includes a reference to the Rule tested in the result data. This shows up in BuildActionData for signals as a way to access individual Rule properties and methods in your signal callbacks.
  • Removed redundant vars for cleaner code.

Grid Builder Inventory Integration:

  • Updated SpendMaterialsRule to match RuleResult object init change.

Dependencies:

  • Requires Godot 4.4.0+ and Grid Builder v4.3.1+ (per README).

Files

Grid Building v4.3.1 & Demo - Godot 4.4+ 26 MB
3 days ago

Get Grid Building Plugin for Godot 4

Buy Now
On Sale!
15% Off
$40.00 $34.00 USD or more

Leave a comment

Log in with itch.io to leave a comment.