Data-driven state machine from a JSON transition table
In your harnessGodot componentMIT
Load states and event transitions from a Dictionary or JSON file, with wildcard rows, named guards and named actions registered in code, validation that refuses malformed tables, and signals for taken and ignored events.
ATTRIBUTION.mdLICENSEREADME.mdbaltor_test.gdcomponent.jsondoor_table.jsonevent_transition_table.gdinspect_gdscript.pyrun_tests.gdtest_package.pytests/test_event_transition_table.gdverification/native.json
Full files in your harness.
What it takes and gives
- Class
- BaltorTransitionTable, extends RefCounted
- Methods
- register_guard(guard_name: StringName, guard: Callable) -> void; register_action(action_name: StringName, action: Callable) -> void; load_table(table: Dictionary) -> bool; get_errors() -> PackedStringArray; fire(event: StringName, payload: Dictionary = {}) -> bool; get_state() -> StringName; reset() -> void; available_events() -> PackedStringArray
- Signals
- transitioned, event_ignored
- Placement
- res://baltor/godot_components/event_transition_table/
Limits. Flat states only. Guards and actions must be registered before load_table(). The first matching row wins; there are no priorities beyond table order and exact-before-wildcard. door_table.json is sample data. Verified with Godot 4.7.2 headless; written against the Godot 4.3 API.
Details
- Kind
- Godot component
- Engine
- Godot 4.3 or later
- Files
- 12 files, 80.5 KB
- Licence
- MIT
- Declared effects
- reads files, runs commands
- Checked with
- Godot 4.7.2, headless
- Checks
- godot parse check only, godot gdscript tests, godot tests reject gutted component, godot editor import, godot contract reflection, godot readme usage compiles
- Techniques
- table-driven finite state machine, event-condition-action rules
- Tags
- state machine, data driven, json, transition table, events, gameplay
- Identity
library.supply.creative_originals.7c3b79fafd0ace09c44708f8.1b2fe79a5e81c2ca- Version
1b2fe79a5e81c2ca43443dd34cc6622f0fd15d978acbb08de7152aa58b84a706
The version is the SHA-256 of the item your harness downloads; every file in it names its own checksum.
Something wrong with this item, its rights or its safety? Report it on the support page, or from your harness after a download.