diff --git a/doc/source/classes/class_bbparam.rst b/doc/source/classes/class_bbparam.rst index af4eef6..e6002aa 100644 --- a/doc/source/classes/class_bbparam.rst +++ b/doc/source/classes/class_bbparam.rst @@ -49,11 +49,11 @@ Methods .. table:: :widths: auto - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Variant.Type` | :ref:`get_type` **(** **)** |const| | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ - | Variant | :ref:`get_value` **(** Object agent, :ref:`Blackboard` blackboard, Variant default=null **)** | - +-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Variant.Type` | :ref:`get_type` **(** **)** |const| | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + | Variant | :ref:`get_value` **(** Node scene_root, :ref:`Blackboard` blackboard, Variant default=null **)** | + +-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -167,7 +167,7 @@ Returns the expected data type of the parameter. .. rst-class:: classref-method -Variant **get_value** **(** Object agent, :ref:`Blackboard` blackboard, Variant default=null **)** +Variant **get_value** **(** Node scene_root, :ref:`Blackboard` blackboard, Variant default=null **)** Returns the value of the parameter. diff --git a/doc/source/classes/class_behaviortree.rst b/doc/source/classes/class_behaviortree.rst index b91f662..a97d85c 100644 --- a/doc/source/classes/class_behaviortree.rst +++ b/doc/source/classes/class_behaviortree.rst @@ -55,17 +55,17 @@ Methods .. table:: :widths: auto - +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BehaviorTree` | :ref:`clone` **(** **)** |const| | - +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`copy_other` **(** :ref:`BehaviorTree` other **)** | - +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`get_root_task` **(** **)** |const| | - +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`instantiate` **(** Node agent, :ref:`Blackboard` blackboard **)** |const| | - +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_root_task` **(** :ref:`BTTask` task **)** | - +-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+ + +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BehaviorTree` | :ref:`clone` **(** **)** |const| | + +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`copy_other` **(** :ref:`BehaviorTree` other **)** | + +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`get_root_task` **(** **)** |const| | + +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`instantiate` **(** Node agent, :ref:`Blackboard` blackboard, Node scene_root **)** |const| | + +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_root_task` **(** :ref:`BTTask` task **)** | + +-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -172,9 +172,9 @@ Returns the root task of the BehaviorTree resource. .. rst-class:: classref-method -:ref:`BTTask` **instantiate** **(** Node agent, :ref:`Blackboard` blackboard **)** |const| +:ref:`BTTask` **instantiate** **(** Node agent, :ref:`Blackboard` blackboard, Node scene_root **)** |const| -Instantiates the Behavior Tree and returns the root :ref:`BTTask`. +Instantiates the behavior tree and returns the root :ref:`BTTask`. ``scene_root`` should be the root node of the scene that the Behavior Tree will be used in (e.g., the owner of the node that contains the behavior tree). .. rst-class:: classref-item-separator diff --git a/doc/source/classes/class_blackboard.rst b/doc/source/classes/class_blackboard.rst index 8661ca4..824480f 100644 --- a/doc/source/classes/class_blackboard.rst +++ b/doc/source/classes/class_blackboard.rst @@ -33,27 +33,27 @@ Methods .. table:: :widths: auto - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`bind_var_to_property` **(** StringName var_name, Object object, StringName property, bool create **)** | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`erase_var` **(** StringName var_name **)** | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Blackboard` | :ref:`get_parent` **(** **)** |const| | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | Variant | :ref:`get_var` **(** StringName var_name, Variant default=null, bool complain=true **)** |const| | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | bool | :ref:`has_var` **(** StringName var_name **)** |const| | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`link_var` **(** StringName var_name, :ref:`Blackboard` target_blackboard, StringName target_var, bool create **)** | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_parent` **(** :ref:`Blackboard` blackboard **)** | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`set_var` **(** StringName var_name, Variant value **)** | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Blackboard` | :ref:`top` **(** **)** |const| | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`unbind_var` **(** StringName var_name **)** | - +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`bind_var_to_property` **(** StringName var_name, Object object, StringName property, bool create=false **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`erase_var` **(** StringName var_name **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Blackboard` | :ref:`get_parent` **(** **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Variant | :ref:`get_var` **(** StringName var_name, Variant default=null, bool complain=true **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | bool | :ref:`has_var` **(** StringName var_name **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`link_var` **(** StringName var_name, :ref:`Blackboard` target_blackboard, StringName target_var, bool create=false **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_parent` **(** :ref:`Blackboard` blackboard **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`set_var` **(** StringName var_name, Variant value **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Blackboard` | :ref:`top` **(** **)** |const| | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`unbind_var` **(** StringName var_name **)** | + +-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -68,7 +68,7 @@ Method Descriptions .. rst-class:: classref-method -void **bind_var_to_property** **(** StringName var_name, Object object, StringName property, bool create **)** +void **bind_var_to_property** **(** StringName var_name, Object object, StringName property, bool create=false **)** Establish a binding between a variable and the object's property specified by ``property`` and ``object``. Changes to the variable update the property, and vice versa. If ``create`` is ``true``, the variable will be created if it doesn't exist. @@ -128,7 +128,7 @@ Returns ``true`` if the Blackboard contains the ``var_name`` variable, including .. rst-class:: classref-method -void **link_var** **(** StringName var_name, :ref:`Blackboard` target_blackboard, StringName target_var, bool create **)** +void **link_var** **(** StringName var_name, :ref:`Blackboard` target_blackboard, StringName target_var, bool create=false **)** Links a variable to another Blackboard variable. If a variable is linked to another variable, their state will always be identical, and any change to one will be reflected in the other. If ``create`` is ``true``, the variable will be created if it doesn't exist. diff --git a/doc/source/classes/class_btplayer.rst b/doc/source/classes/class_btplayer.rst index 8678139..067940e 100644 --- a/doc/source/classes/class_btplayer.rst +++ b/doc/source/classes/class_btplayer.rst @@ -31,19 +31,21 @@ Properties .. table:: :widths: auto - +---------------------------------------------+-------------------------------------------------------------------------+-----------+ - | bool | :ref:`active` | ``true`` | - +---------------------------------------------+-------------------------------------------------------------------------+-----------+ - | :ref:`BehaviorTree` | :ref:`behavior_tree` | | - +---------------------------------------------+-------------------------------------------------------------------------+-----------+ - | :ref:`Blackboard` | :ref:`blackboard` | | - +---------------------------------------------+-------------------------------------------------------------------------+-----------+ - | :ref:`BlackboardPlan` | :ref:`blackboard_plan` | | - +---------------------------------------------+-------------------------------------------------------------------------+-----------+ - | bool | :ref:`monitor_performance` | ``false`` | - +---------------------------------------------+-------------------------------------------------------------------------+-----------+ - | :ref:`UpdateMode` | :ref:`update_mode` | ``1`` | - +---------------------------------------------+-------------------------------------------------------------------------+-----------+ + +---------------------------------------------+-------------------------------------------------------------------------+--------------------+ + | bool | :ref:`active` | ``true`` | + +---------------------------------------------+-------------------------------------------------------------------------+--------------------+ + | NodePath | :ref:`agent_node` | ``NodePath("..")`` | + +---------------------------------------------+-------------------------------------------------------------------------+--------------------+ + | :ref:`BehaviorTree` | :ref:`behavior_tree` | | + +---------------------------------------------+-------------------------------------------------------------------------+--------------------+ + | :ref:`Blackboard` | :ref:`blackboard` | | + +---------------------------------------------+-------------------------------------------------------------------------+--------------------+ + | :ref:`BlackboardPlan` | :ref:`blackboard_plan` | | + +---------------------------------------------+-------------------------------------------------------------------------+--------------------+ + | bool | :ref:`monitor_performance` | ``false`` | + +---------------------------------------------+-------------------------------------------------------------------------+--------------------+ + | :ref:`UpdateMode` | :ref:`update_mode` | ``1`` | + +---------------------------------------------+-------------------------------------------------------------------------+--------------------+ .. rst-class:: classref-reftable-group @@ -161,6 +163,23 @@ If ``true``, the behavior tree will be executed during update. ---- +.. _class_BTPlayer_property_agent_node: + +.. rst-class:: classref-property + +NodePath **agent_node** = ``NodePath("..")`` + +.. rst-class:: classref-property-setget + +- void **set_agent_node** **(** NodePath value **)** +- NodePath **get_agent_node** **(** **)** + +Path to the node that will be used as the agent. Setting it after instantiation will have no effect. + +.. rst-class:: classref-item-separator + +---- + .. _class_BTPlayer_property_behavior_tree: .. rst-class:: classref-property diff --git a/doc/source/classes/class_bttask.rst b/doc/source/classes/class_bttask.rst index b448e87..cc9b4ea 100644 --- a/doc/source/classes/class_bttask.rst +++ b/doc/source/classes/class_bttask.rst @@ -46,6 +46,8 @@ Properties +-------------------------------------+---------------------------------------------------------+--------+ | float | :ref:`elapsed_time` | | +-------------------------------------+---------------------------------------------------------+--------+ + | Node | :ref:`scene_root` | | + +-------------------------------------+---------------------------------------------------------+--------+ | :ref:`Status` | :ref:`status` | | +-------------------------------------+---------------------------------------------------------+--------+ @@ -57,59 +59,59 @@ Methods .. table:: :widths: auto - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_enter` **(** **)** |virtual| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_exit` **(** **)** |virtual| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | String | :ref:`_generate_name` **(** **)** |virtual| |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | PackedStringArray | :ref:`_get_configuration_warnings` **(** **)** |virtual| |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`_setup` **(** **)** |virtual| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Status` | :ref:`_tick` **(** float delta **)** |virtual| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`abort` **(** **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`add_child` **(** :ref:`BTTask` task **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`add_child_at_index` **(** :ref:`BTTask` task, int idx **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`clone` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | :ref:`Status` | :ref:`execute` **(** float delta **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`get_child` **(** int idx **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | int | :ref:`get_child_count` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | int | :ref:`get_child_count_excluding_comments` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | int | :ref:`get_index` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`get_parent` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`get_root` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | String | :ref:`get_task_name` **(** **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | bool | :ref:`has_child` **(** :ref:`BTTask` task **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`initialize` **(** Node agent, :ref:`Blackboard` blackboard **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | bool | :ref:`is_descendant_of` **(** :ref:`BTTask` task **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | bool | :ref:`is_root` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | :ref:`BTTask` | :ref:`next_sibling` **(** **)** |const| | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`print_tree` **(** int initial_tabs=0 **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`remove_child` **(** :ref:`BTTask` task **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ - | void | :ref:`remove_child_at_index` **(** int idx **)** | - +-------------------------------+---------------------------------------------------------------------------------------------------------------------------+ + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_enter` **(** **)** |virtual| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_exit` **(** **)** |virtual| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | String | :ref:`_generate_name` **(** **)** |virtual| |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | PackedStringArray | :ref:`_get_configuration_warnings` **(** **)** |virtual| |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`_setup` **(** **)** |virtual| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Status` | :ref:`_tick` **(** float delta **)** |virtual| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`abort` **(** **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_child` **(** :ref:`BTTask` task **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`add_child_at_index` **(** :ref:`BTTask` task, int idx **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`clone` **(** **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`Status` | :ref:`execute` **(** float delta **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`get_child` **(** int idx **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | int | :ref:`get_child_count` **(** **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | int | :ref:`get_child_count_excluding_comments` **(** **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | int | :ref:`get_index` **(** **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`get_parent` **(** **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`get_root` **(** **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | String | :ref:`get_task_name` **(** **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | bool | :ref:`has_child` **(** :ref:`BTTask` task **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`initialize` **(** Node agent, :ref:`Blackboard` blackboard, Node scene_root **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | bool | :ref:`is_descendant_of` **(** :ref:`BTTask` task **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | bool | :ref:`is_root` **(** **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | :ref:`BTTask` | :ref:`next_sibling` **(** **)** |const| | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`print_tree` **(** int initial_tabs=0 **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_child` **(** :ref:`BTTask` task **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + | void | :ref:`remove_child_at_index` **(** int idx **)** | + +-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator @@ -190,6 +192,33 @@ Returns ``0`` when task is not ``RUNNING``. ---- +.. _class_BTTask_property_scene_root: + +.. rst-class:: classref-property + +Node **scene_root** + +.. rst-class:: classref-property-setget + +- Node **get_scene_root** **(** **)** + +Root node of the scene the behavior tree is used in (e.g., the owner of the node that contains the behavior tree). Can be uses to retrieve ``NodePath`` references. + +\ **Example:**\ + +:: + + extends BTAction + + @export var node_path: NodePath + + func _setup(): + var node: Node = scene_root.get_node(node_path) + +.. rst-class:: classref-item-separator + +---- + .. _class_BTTask_property_status: .. rst-class:: classref-property @@ -457,11 +486,11 @@ Returns ``true`` if ``task`` is a child of this task. .. rst-class:: classref-method -void **initialize** **(** Node agent, :ref:`Blackboard` blackboard **)** +void **initialize** **(** Node agent, :ref:`Blackboard` blackboard, Node scene_root **)** Initilizes the task. Assigns :ref:`agent` and :ref:`blackboard`, and calls :ref:`_setup` for the task and its children. -The method is called recursively for each child task. +The method is called recursively for each child task. ``scene_root`` should be the root node of the scene the behavior tree is used in (e.g., the owner of the node that contains the behavior tree). .. rst-class:: classref-item-separator diff --git a/doc_classes/BBParam.xml b/doc_classes/BBParam.xml index 85e015a..cfd8e76 100644 --- a/doc_classes/BBParam.xml +++ b/doc_classes/BBParam.xml @@ -18,7 +18,7 @@ - + diff --git a/doc_classes/BTPlayer.xml b/doc_classes/BTPlayer.xml index ee232ca..2829e5a 100644 --- a/doc_classes/BTPlayer.xml +++ b/doc_classes/BTPlayer.xml @@ -40,6 +40,9 @@ If [code]true[/code], the behavior tree will be executed during update. + + Path to the node that will be used as the agent. Setting it after instantiation will have no effect. + [BehaviorTree] resource to instantiate and execute at runtime. diff --git a/doc_classes/BTTask.xml b/doc_classes/BTTask.xml index 60f1ae9..0c6720b 100644 --- a/doc_classes/BTTask.xml +++ b/doc_classes/BTTask.xml @@ -144,9 +144,10 @@ + Initilizes the task. Assigns [member agent] and [member blackboard], and calls [method _setup] for the task and its children. - The method is called recursively for each child task. + The method is called recursively for each child task. [param scene_root] should be the root node of the scene the behavior tree is used in (e.g., the owner of the node that contains the behavior tree). @@ -206,6 +207,18 @@ Elapsed time since the task was "entered". See [method _enter]. Returns [code]0[/code] when task is not [code]RUNNING[/code]. + + Root node of the scene the behavior tree is used in (e.g., the owner of the node that contains the behavior tree). Can be uses to retrieve [NodePath] references. + [b]Example:[/b] + [codeblock] + extends BTAction + + @export var node_path: NodePath + + func _setup(): + var node: Node = scene_root.get_node(node_path) + [/codeblock] + Last execution [enum BT.Status] returned by [method _tick]. diff --git a/doc_classes/BehaviorTree.xml b/doc_classes/BehaviorTree.xml index e5f9645..7cd61fc 100644 --- a/doc_classes/BehaviorTree.xml +++ b/doc_classes/BehaviorTree.xml @@ -38,8 +38,9 @@ + - Instantiates the Behavior Tree and returns the root [BTTask]. + Instantiates the behavior tree and returns the root [BTTask]. [param scene_root] should be the root node of the scene that the Behavior Tree will be used in (e.g., the owner of the node that contains the behavior tree). diff --git a/doc_classes/Blackboard.xml b/doc_classes/Blackboard.xml index b50e562..bde4856 100644 --- a/doc_classes/Blackboard.xml +++ b/doc_classes/Blackboard.xml @@ -16,7 +16,7 @@ - + Establish a binding between a variable and the object's property specified by [param property] and [param object]. Changes to the variable update the property, and vice versa. If [param create] is [code]true[/code], the variable will be created if it doesn't exist. @@ -55,7 +55,7 @@ - + Links a variable to another Blackboard variable. If a variable is linked to another variable, their state will always be identical, and any change to one will be reflected in the other. If [param create] is [code]true[/code], the variable will be created if it doesn't exist. You can use this method to link a variable in the current scope to a variable in another scope, or in another Blackboard instance. A variable can only be linked to one other variable. Calling this method again will overwrite the previous link. However, it is possible to link to the same variable from multiple different variables.