Explains one placement outcome in one place. Every surface that answers "why did this fail" renders from this function: the player action log, the console trace, and the headless trace CLI. One function means those surfaces cannot drift apart. The explanation is derived from the canonical PlacementLifecycleResult and the PlacementReport that carries it. It never changes placement state. Usage: var why := PlacementExplain.explain(host.get_last_dispatch_result()) print(why["human"]) # "Rejected: rule_validation (2 issues)" print(why["failed_rules"]) # [{rule_id = "collisions_check", issues = [...]}]
Source: addons/grid_placement/utils/placement_explain.gd
Syntax
class PlacementExplain extends RefCountedMembers
| Name | Kind | Summary |
|---|---|---|
REASON_GUIDE | Field | Per-reason guidance. `next_step` says what to do, `where_to_look` names the files that own the behaviour, so an agent can act on the answer without grepping the tree. |
NO_DISPATCH_GUIDE | Field | Guidance for host sentinels that do not represent a terminal lifecycle result. These reasons must never be reported as caller cancellations. |
explain | Method | |
explain_lifecycle | Method | |
placer_evidence | Method | |
stamp_occupancy_conflict | Method | |
instance_id | Property | |
root | Property |
Guides that use this class
Tutorials built on Grid Placement
- Godot multiplayer grid placement: one host, four sessions
- Godot 2D grid building system: paint, place, save
- Godot 3D grid building system: the runtime loop
- Godot 4 grid-building plugins: build mode vs editor tools
- 3D room placement in Godot: build rooms and stack storeys
- 3D grid placement in Godot 4: full setup tutorial
- Snap to a TileMap in Godot: 2D grid placement
- How to make a farming system in Godot
- How to snap objects to a 3D grid in Godot