Finite State Machine Behavior (Construct 3)
A downloadable asset pack
Download NowName your own price
Finite State Machine Behavior
A powerful and versatile Construct 3 behavior that leverages a finite state machine to control the flow of logic for objects. This behavior enhances state management for your projects.
Current Features
- Trigger logic on-enter/ on-exit from states.
- Access the objects current / previous state.
- Setup trigger for specific state transitions.
- Compare states against list of states.
- Auto Complete, state strings.
- SDK v2.
Properties
Property Name | Description | Type |
---|---|---|
Enabled | Enable or disable the FSM | check |
Initial State | The initial state of the FSM | text |
Trigger Initial State | Trigger the initial OnStateEnter event | check |
Actions
Action | Description | Params |
---|---|---|
Go to state | Transition to a specific state | State (string) |
Set enabled | Enable or disable the FSM | Enabled (boolean) |
Conditions
Condition | Description | Params |
---|---|---|
Current state in list | Check if the current state is in a list of states | States (string) |
Current state is | Check if the current state is a specific state | State (string) |
Is enabled | Check if the FSM is enabled | |
On any state change | Triggered when state changes | |
On state enter | Triggered when entering a specific state | State (string) |
On state enter in list | Triggered when entering a state in a list of states | States (string) |
On state exit | Triggered when exiting a specific state | State (string) |
On state exit in list | Triggered when exiting a state in a list of states | States (string) |
On state transition | Triggered when transitioning from one state to another | From (string) To (string) |
Previous state in list | Check if the previous state is in a list of states | States (string) |
Previous state is | Check if the previous state was a specific state | State (string) |
Expressions
Expression | Description | Return Type | Params |
---|---|---|---|
CurrentState | Get the current state | string | |
PreviousState | Get the previous state | string |
Links
Updated | 1 day ago |
Status | Released |
Category | Assets |
Rating | Rated 5.0 out of 5 stars (3 total ratings) |
Author | Piranha305 |
Tags | behavior, c3, construct-3, construct3, fsm, state |
Download
Download NowName your own price
Click download now to get access to the following files:
fsm_examples.c3p 69 kB
piranha305_fsm-4.0.0.2.c3addon 6.6 kB
Development log
- Updated to SDK v2Aug 26, 2024
- Compare list of states v1.0.0.3Sep 03, 2023
- Minor bug fixes v1.0.0.2Aug 30, 2023
Comments
Log in with itch.io to leave a comment.
may we have the permission for do the rpg inventory
BIG issue --- when save game and load ... FSM lost current and pravious state... its bug ? or what ... please Help
I think you need to manage the save and load yourself for now, i will look into integrating it into the current save load system? there should be an expression to get state as JSON, you could save that to local storage. are you using the default save behavior in construct?
Yes, I used the built-in save/load construct. The bug is that if an object is created during the game... after loading the game from the save, the FSM (Finite State Machine) resets and does not remember the values of the current/previous state.
But if the objects are created at the beginning, then the FSM works correctly.
Can you please attach an example for the stable version of Construct?
added fsm_example for v350
will remove it when next stable release comes out
Thank you!