:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/modules/limboai/doc_classes/BTState.xml. .. _class_BTState: BTState ======= **Inherits:** :ref:`LimboState` A state node for :ref:`LimboHSM` that hosts a :ref:`BehaviorTree`. .. rst-class:: classref-introduction-group Description ----------- BTState is a :ref:`LimboState` node that manages a :ref:`BehaviorTree` to provide behavior logic for the state. It instantiates and runs the :ref:`BehaviorTree` resource, dispatching a state machine event upon ``SUCCESS`` or ``FAILURE``. Event names are customizable through :ref:`success_event` and :ref:`failure_event`. For further details on state machine events, see :ref:`LimboState.dispatch`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-----------------------------------------+------------------------------------------------------------+----------------+ | :ref:`BehaviorTree` | :ref:`behavior_tree` | | +-----------------------------------------+------------------------------------------------------------+----------------+ | ``StringName`` | :ref:`failure_event` | ``&"failure"`` | +-----------------------------------------+------------------------------------------------------------+----------------+ | ``StringName`` | :ref:`success_event` | ``&"success"`` | +-----------------------------------------+------------------------------------------------------------+----------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-------------------------------------+----------------------------------------------------------------------------+ | :ref:`BTInstance` | :ref:`get_bt_instance`\ (\ ) |const| | +-------------------------------------+----------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_BTState_property_behavior_tree: .. rst-class:: classref-property :ref:`BehaviorTree` **behavior_tree** :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_behavior_tree**\ (\ value\: :ref:`BehaviorTree`\ ) - :ref:`BehaviorTree` **get_behavior_tree**\ (\ ) A :ref:`BehaviorTree` resource that defines state behavior. .. rst-class:: classref-item-separator ---- .. _class_BTState_property_failure_event: .. rst-class:: classref-property ``StringName`` **failure_event** = ``&"failure"`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_failure_event**\ (\ value\: ``StringName``\ ) - ``StringName`` **get_failure_event**\ (\ ) HSM event that will be dispatched when the behavior tree results in ``FAILURE``. See :ref:`LimboState.dispatch`. .. rst-class:: classref-item-separator ---- .. _class_BTState_property_success_event: .. rst-class:: classref-property ``StringName`` **success_event** = ``&"success"`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_success_event**\ (\ value\: ``StringName``\ ) - ``StringName`` **get_success_event**\ (\ ) HSM event that will be dispatched when the behavior tree results in ``SUCCESS``. See :ref:`LimboState.dispatch`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_BTState_method_get_bt_instance: .. rst-class:: classref-method :ref:`BTInstance` **get_bt_instance**\ (\ ) |const| :ref:`🔗` Returns the behavior tree instance. .. |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.)` .. |void| replace:: :abbr:`void (No return value.)`