2024-01-12 20:05:50 +00:00
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.2/modules/limboai/doc_classes/LimboHSM.xml.
.. _class_LimboHSM:
LimboHSM
========
**Inherits:** :ref: `LimboState<class_LimboState>`
Event-based Hierarchical State Machine (HSM).
.. rst-class :: classref-introduction-group
Description
-----------
Event-based Hierarchical State Machine (HSM) that manages :ref: `LimboState<class_LimboState>` instances and facilitates transitions between them. LimboHSM is a :ref: `LimboState<class_LimboState>` in itself and can also serve as a child of another LimboHSM node.
.. rst-class :: classref-reftable-group
Properties
----------
.. table ::
:widths: auto
+---------------------------------------------+-------------------------------------------------------------+-------+
| :ref: `LimboState<class_LimboState>` | :ref: `ANYSTATE<class_LimboHSM_property_ANYSTATE>` | |
+---------------------------------------------+-------------------------------------------------------------+-------+
| :ref: `LimboState<class_LimboState>` | :ref: `initial_state<class_LimboHSM_property_initial_state>` | |
+---------------------------------------------+-------------------------------------------------------------+-------+
| :ref: `UpdateMode<enum_LimboHSM_UpdateMode>` | :ref: `update_mode<class_LimboHSM_property_update_mode>` | `` 1 `` |
+---------------------------------------------+-------------------------------------------------------------+-------+
.. rst-class :: classref-reftable-group
Methods
-------
.. table ::
:widths: auto
2024-03-04 20:36:16 +00:00
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref: `add_transition<class_LimboHSM_method_add_transition>` **(** :ref: `LimboState<class_LimboState>` from_state, :ref: `LimboState<class_LimboState>` to_state, StringName event **)** |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref: `LimboState<class_LimboState>` | :ref: `get_active_state<class_LimboHSM_method_get_active_state>` **(** **)** |const| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref: `LimboState<class_LimboState>` | :ref: `get_leaf_state<class_LimboHSM_method_get_leaf_state>` **(** **)** |const| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2024-03-05 11:58:55 +00:00
| :ref: `LimboState<class_LimboState>` | :ref: `get_previous_active_state<class_LimboHSM_method_get_previous_active_state>` **(** **)** |const| |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2024-03-04 20:36:16 +00:00
| void | :ref: `initialize<class_LimboHSM_method_initialize>` **(** Node agent, :ref: `Blackboard<class_Blackboard>` parent_scope=null **)** |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref: `set_active<class_LimboHSM_method_set_active>` **(** bool active **)** |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| void | :ref: `update<class_LimboHSM_method_update>` **(** float delta **)** |
+-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2024-01-12 20:05:50 +00:00
.. rst-class :: classref-section-separator
----
.. rst-class :: classref-descriptions-group
Signals
-------
2024-03-05 11:58:55 +00:00
.. _class_LimboHSM_signal_active_state_changed:
2024-01-12 20:05:50 +00:00
.. rst-class :: classref-signal
2024-03-05 11:58:55 +00:00
**active_state_changed** **(** :ref: `LimboState<class_LimboState>` current, :ref: `LimboState<class_LimboState>` previous **)**
2024-01-12 20:05:50 +00:00
Emitted when the currently active substate is switched to a different substate.
.. rst-class :: classref-section-separator
----
.. rst-class :: classref-descriptions-group
Enumerations
------------
.. _enum_LimboHSM_UpdateMode:
.. rst-class :: classref-enumeration
enum **UpdateMode** :
.. _class_LimboHSM_constant_IDLE:
.. rst-class :: classref-enumeration-constant
:ref: `UpdateMode<enum_LimboHSM_UpdateMode>` **IDLE** = `` 0 ``
Update the state machine during the idle process.
.. _class_LimboHSM_constant_PHYSICS:
.. rst-class :: classref-enumeration-constant
:ref: `UpdateMode<enum_LimboHSM_UpdateMode>` **PHYSICS** = `` 1 ``
Update the state machine during the physics process.
.. _class_LimboHSM_constant_MANUAL:
.. rst-class :: classref-enumeration-constant
:ref: `UpdateMode<enum_LimboHSM_UpdateMode>` **MANUAL** = `` 2 ``
Manually update the state machine by calling :ref: `update<class_LimboHSM_method_update>` from a script.
.. rst-class :: classref-section-separator
----
.. rst-class :: classref-descriptions-group
Property Descriptions
---------------------
.. _class_LimboHSM_property_ANYSTATE:
.. rst-class :: classref-property
:ref: `LimboState<class_LimboState>` **ANYSTATE**
.. rst-class :: classref-property-setget
- :ref: `LimboState<class_LimboState>` **anystate** **(** **)**
Useful for defining a transition from any state.
.. rst-class :: classref-item-separator
----
.. _class_LimboHSM_property_initial_state:
.. rst-class :: classref-property
:ref: `LimboState<class_LimboState>` **initial_state**
.. rst-class :: classref-property-setget
- void **set_initial_state** **(** :ref: `LimboState<class_LimboState>` value **)**
- :ref: `LimboState<class_LimboState>` **get_initial_state** **(** **)**
The substate that becomes active when the state machine is activated using the :ref: `set_active<class_LimboHSM_method_set_active>` method. If not explicitly set, the first child of the LimboHSM will be considered the initial state.
.. rst-class :: classref-item-separator
----
.. _class_LimboHSM_property_update_mode:
.. rst-class :: classref-property
:ref: `UpdateMode<enum_LimboHSM_UpdateMode>` **update_mode** = `` 1 ``
.. rst-class :: classref-property-setget
- void **set_update_mode** **(** :ref: `UpdateMode<enum_LimboHSM_UpdateMode>` value **)**
- :ref: `UpdateMode<enum_LimboHSM_UpdateMode>` **get_update_mode** **(** **)**
Specifies when the state machine should be updated. See :ref: `UpdateMode<enum_LimboHSM_UpdateMode>` .
.. rst-class :: classref-section-separator
----
.. rst-class :: classref-descriptions-group
Method Descriptions
-------------------
.. _class_LimboHSM_method_add_transition:
.. rst-class :: classref-method
2024-03-04 20:36:16 +00:00
void **add_transition** **(** :ref: `LimboState<class_LimboState>` from_state, :ref: `LimboState<class_LimboState>` to_state, StringName event **)**
2024-01-12 20:05:50 +00:00
2024-03-04 20:36:16 +00:00
Establishes a transition from one state to another when `` event `` is dispatched. Both `` from_state `` and `` to_state `` must be immediate children of this state.
2024-01-12 20:05:50 +00:00
.. rst-class :: classref-item-separator
----
.. _class_LimboHSM_method_get_active_state:
.. rst-class :: classref-method
:ref: `LimboState<class_LimboState>` **get_active_state** **(** **)** |const|
Returns the currently active substate.
.. rst-class :: classref-item-separator
----
.. _class_LimboHSM_method_get_leaf_state:
.. rst-class :: classref-method
:ref: `LimboState<class_LimboState>` **get_leaf_state** **(** **)** |const|
Returns the currently active leaf state within the state machine.
.. rst-class :: classref-item-separator
----
2024-03-05 11:58:55 +00:00
.. _class_LimboHSM_method_get_previous_active_state:
.. rst-class :: classref-method
:ref: `LimboState<class_LimboState>` **get_previous_active_state** **(** **)** |const|
Returns the previously active substate.
.. rst-class :: classref-item-separator
----
2024-01-12 20:05:50 +00:00
.. _class_LimboHSM_method_initialize:
.. rst-class :: classref-method
2024-03-04 20:36:16 +00:00
void **initialize** **(** Node agent, :ref: `Blackboard<class_Blackboard>` parent_scope=null **)**
2024-01-12 20:05:50 +00:00
Initiates the state and calls :ref: `LimboState._setup<class_LimboState_private_method__setup>` for both itself and all substates.
.. rst-class :: classref-item-separator
----
.. _class_LimboHSM_method_set_active:
.. rst-class :: classref-method
2024-03-04 20:36:16 +00:00
void **set_active** **(** bool active **)**
2024-01-12 20:05:50 +00:00
When set to `` true `` , switches the state to :ref: `initial_state<class_LimboHSM_property_initial_state>` and activates state processing according to :ref: `update_mode<class_LimboHSM_property_update_mode>` .
.. rst-class :: classref-item-separator
----
.. _class_LimboHSM_method_update:
.. rst-class :: classref-method
2024-03-04 20:36:16 +00:00
void **update** **(** float delta **)**
2024-01-12 20:05:50 +00:00
Calls :ref: `LimboState._update<class_LimboState_private_method__update>` on itself and the active substate, with the call cascading down to the leaf state. This method is automatically triggered if :ref: `update_mode<class_LimboHSM_property_update_mode>` is not set to :ref: `MANUAL<class_LimboHSM_constant_MANUAL>` .
.. |virtual| replace :: :abbr: `virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace :: :abbr: `const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace :: :abbr: `vararg (This method accepts any number of arguments after the ones described here.)`
.. |constructor| replace :: :abbr: `constructor (This method is used to construct a type.)`
.. |static| replace :: :abbr: `static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
.. |operator| replace :: :abbr: `operator (This method describes a valid operator to use with this type as left-hand operand.)`
.. |bitfield| replace :: :abbr: `BitField (This value is an integer composed as a bitmask of the following flags.)`