2022-11-01 20:31:22 +00:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-11-15 14:40:07 +00:00
<class name= "LimboHSM" inherits= "LimboState" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../../../doc/class.xsd" >
2022-11-01 20:31:22 +00:00
<brief_description >
2022-11-04 12:27:09 +00:00
Event-based Hierarchical State Machine (HSM).
2022-11-01 20:31:22 +00:00
</brief_description>
<description >
2023-10-26 14:16:00 +00:00
Event-based Hierarchical State Machine (HSM) that manages [LimboState] instances and facilitates transitions between them. LimboHSM is a [LimboState] in itself and can also serve as a child of another LimboHSM node.
2022-11-01 20:31:22 +00:00
</description>
<tutorials >
</tutorials>
<methods >
<method name= "add_transition" >
<return type= "void" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_from_state" type= "Node" />
<param index= "1" name= "p_to_state" type= "Node" />
<param index= "2" name= "p_event" type= "String" />
2022-11-01 20:31:22 +00:00
<description >
2023-10-26 14:16:00 +00:00
Establishes a transition from one state to another when [code]p_event[/code] is dispatched. Both [code]p_from_state[/code] and [code]p_to_state[/code] must be immediate children of this state.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "get_active_state" qualifiers= "const" >
<return type= "LimboState" />
<description >
2023-10-26 14:16:00 +00:00
Returns the currently active substate.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "get_leaf_state" qualifiers= "const" >
<return type= "LimboState" />
<description >
2023-10-26 14:16:00 +00:00
Returns the currently active leaf state within the state machine.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "initialize" >
<return type= "void" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_agent" type= "Node" />
<param index= "1" name= "p_parent_scope" type= "Blackboard" default= "null" />
2022-11-01 20:31:22 +00:00
<description >
2023-10-26 14:16:00 +00:00
Initiates the state and calls [code]_setup[/code] for both itself and all substates.
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "set_active" >
<return type= "void" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_active" type= "bool" />
2022-11-01 20:31:22 +00:00
<description >
2023-10-26 14:16:00 +00:00
When set to [code]true[/code], switches the state to [member initial_state] and activates state processing according to [member update_mode].
2022-11-01 20:31:22 +00:00
</description>
</method>
<method name= "update" >
<return type= "void" />
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_delta" type= "float" />
2022-11-01 20:31:22 +00:00
<description >
2023-10-26 14:16:00 +00:00
Calls [method LimboState._update] on itself and the active substate, with the call cascading down to the leaf state. This method is automatically triggered if [member update_mode] is not set to [constant MANUAL].
2022-11-01 20:31:22 +00:00
</description>
</method>
</methods>
<members >
<member name= "ANYSTATE" type= "LimboState" setter= "" getter= "anystate" >
2023-10-26 14:16:00 +00:00
Useful for defining a transition from any state.
2022-11-01 20:31:22 +00:00
</member>
<member name= "initial_state" type= "LimboState" setter= "set_initial_state" getter= "get_initial_state" >
2023-10-26 14:16:00 +00:00
The substate that becomes active when the state machine is activated using the [method set_active] method. If not explicitly set, the first child of the LimboHSM will be considered the initial state.
2022-11-01 20:31:22 +00:00
</member>
2023-04-10 14:57:36 +00:00
<member name= "update_mode" type= "int" setter= "set_update_mode" getter= "get_update_mode" enum= "LimboHSM.UpdateMode" default= "1" >
2023-10-26 14:16:00 +00:00
Specifies when the state machine should be updated. See [enum UpdateMode].
2022-11-01 20:31:22 +00:00
</member>
</members>
<signals >
<signal name= "state_changed" >
2023-04-10 14:57:36 +00:00
<param index= "0" name= "p_state" type= "LimboState" />
2022-11-01 20:31:22 +00:00
<description >
2023-10-26 14:16:00 +00:00
Emitted when the currently active substate is switched to a different substate.
2022-11-01 20:31:22 +00:00
</description>
</signal>
</signals>
<constants >
<constant name= "IDLE" value= "0" enum= "UpdateMode" >
2023-10-26 14:16:00 +00:00
Update the state machine during the idle process.
2022-11-01 20:31:22 +00:00
</constant>
<constant name= "PHYSICS" value= "1" enum= "UpdateMode" >
2023-10-26 14:16:00 +00:00
Update the state machine during the physics process.
2022-11-01 20:31:22 +00:00
</constant>
<constant name= "MANUAL" value= "2" enum= "UpdateMode" >
2023-10-26 14:16:00 +00:00
Manually update the state machine by calling [method update] from a script.
2022-11-01 20:31:22 +00:00
</constant>
</constants>
</class>