A state node for Hierarchical State Machines (HSM).
A LimboAI state node for Hierarchical State Machines (HSM).
You can create your state behavior by extending this class. To implement your state logic, you can override [method _enter], [method _exit], [method _setup], and [method _update]. Alternatively, you can delegate state implementation to external methods using the [code]call_on_*[/code] methods.
For additional details on state machines, refer to [LimboHSM].
Called when the state is entered.
Called when the state is exited. This happens on a transition to another state, and when the state machine is removed from the scene tree (e.g., when the node is freed with [method Node.queue_free] or the scene changes). Due to implementation details, [method _exit] will not be called on [method Object.free]!
Called once during initialization. Use this method to initialize your state.
Called during the update. Implement your state's behavior with this method.
Registers a [param handler] to be called when [param event] is dispatched. The handler function should have the following signature:
[codeblock]
func my_event_handler(cargo=null) -> bool:
[/codeblock]
If the handler returns [code]true[/code], the event will be consumed. Cargo is an optional parameter that can be passed to the handler. See also [method dispatch].
A chained method that connects the [signal entered] signal to a [param callable].
A chained method that connects the [signal exited] signal to a [param callable].
A chained method that connects the [signal updated] signal to a [param callable].
Clears the guard function, removing the [Callable] previously set by [method set_guard].
Recursively dispatches a state machine event named [param event] with an optional argument [param cargo]. Returns [code]true[/code] if the event was consumed.
Events propagate from the leaf state to the root state, and propagation stops as soon as any state consumes the event. States will consume the event if they have a related transition or event handler. For more information on event handlers, see [method add_event_handler].
Returns the root [LimboState].
Returns [code]true[/code] if it is currently active, meaning it is the active substate of the parent [LimboHSM].
A chained method for setting the name of this state.
Sets the guard function, which is a function called each time a transition to this state is considered. If the function returns [code]false[/code], the transition will be disallowed.
A commonly used event that indicates that the state has finished its work.
An agent associated with the state, assigned during initialization.
A key/value data store shared by states within the state machine to which this state belongs.
Stores and manages variables that will be used in constructing new [Blackboard] instances.
Emitted when the state is entered.
Emitted when the state is exited.
Emitted when the state is initialized.
Emitted when the state is updated.