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
Get Grid Building Plugin for Godot 4
Grid Building Plugin for Godot 4
Place, manipulate, and demolish objects on TileMapLayer grids with previews and customizable rules.
Status | In development |
Category | Assets |
Author | Chris' Tutorials |
Tags | 2D, City Builder, Godot, godot4, Metroidvania, Side Scroller, Tilemap, Top-Down, User Interface (UI) |
More posts
- 4.3.0 Rule Improvements & Validation Overhaul9 days ago
- 4.2.0 Object Info & Mode Selection Hotbar87 days ago
- 4.1.0 Manipulate with Move & Demolish ModesSep 15, 2024
- Upcoming Grid Builder Updates for Godot 4.3Aug 18, 2024
- 4.0.3 Compatibility Fix for Godot 4.2.2Jun 09, 2024
- 4.0.2 Small Enhancements & Bug FixesJun 09, 2024
- 4.0.1 File Path HotfixJun 07, 2024
- 4.0.0 - Shared BuildingState, Save / Load HelperJun 07, 2024
- 3.2.2 Bug FixesMar 06, 2024
Leave a comment
Log in with itch.io to leave a comment.