:github_url: hide

.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/4.3/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/4.3/modules/limboai/doc_classes/BTEvaluateExpression.xml.

.. _class_BTEvaluateExpression:

BTEvaluateExpression
====================

**Inherits:** :ref:`BTAction<class_BTAction>` **<** :ref:`BTTask<class_BTTask>` **<** :ref:`BT<class_BT>`

BT action that evaluates an ``Expression`` against a specified ``Node`` or ``Object``.

.. rst-class:: classref-introduction-group

Description
-----------

BTEvaluateExpression action evaluates an :ref:`expression_string<class_BTEvaluateExpression_property_expression_string>` on the specified ``Node`` or ``Object`` instance and returns ``SUCCESS`` when the ``Expression`` executes successfully.

Returns ``FAILURE`` if the action encounters an issue during the ``Expression`` parsing or execution.

.. rst-class:: classref-reftable-group

Properties
----------

.. table::
   :widths: auto

   +----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+
   | ``String``                                                     | :ref:`expression_string<class_BTEvaluateExpression_property_expression_string>`     | ``""``                  |
   +----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+
   | ``bool``                                                       | :ref:`input_include_delta<class_BTEvaluateExpression_property_input_include_delta>` | ``false``               |
   +----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+
   | ``PackedStringArray``                                          | :ref:`input_names<class_BTEvaluateExpression_property_input_names>`                 | ``PackedStringArray()`` |
   +----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+
   | :ref:`Array<class_Array>`\[:ref:`BBVariant<class_BBVariant>`\] | :ref:`input_values<class_BTEvaluateExpression_property_input_values>`               | ``[]``                  |
   +----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+
   | :ref:`BBNode<class_BBNode>`                                    | :ref:`node<class_BTEvaluateExpression_property_node>`                               |                         |
   +----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+
   | ``StringName``                                                 | :ref:`result_var<class_BTEvaluateExpression_property_result_var>`                   | ``&""``                 |
   +----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+

.. rst-class:: classref-reftable-group

Methods
-------

.. table::
   :widths: auto

   +---------------------------------------+-------------------------------------------------------------+
   | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`parse<class_BTEvaluateExpression_method_parse>`\ (\ ) |
   +---------------------------------------+-------------------------------------------------------------+

.. rst-class:: classref-section-separator

----

.. rst-class:: classref-descriptions-group

Property Descriptions
---------------------

.. _class_BTEvaluateExpression_property_expression_string:

.. rst-class:: classref-property

``String`` **expression_string** = ``""`` :ref:`🔗<class_BTEvaluateExpression_property_expression_string>`

.. rst-class:: classref-property-setget

- |void| **set_expression_string**\ (\ value\: ``String``\ )
- ``String`` **get_expression_string**\ (\ )

The expression string to be parsed and executed.

\ **Warning:** Call :ref:`parse<class_BTEvaluateExpression_method_parse>` after updating :ref:`expression_string<class_BTEvaluateExpression_property_expression_string>` to update the internal ``Expression`` as it won't be updated automatically.

.. rst-class:: classref-item-separator

----

.. _class_BTEvaluateExpression_property_input_include_delta:

.. rst-class:: classref-property

``bool`` **input_include_delta** = ``false`` :ref:`🔗<class_BTEvaluateExpression_property_input_include_delta>`

.. rst-class:: classref-property-setget

- |void| **set_input_include_delta**\ (\ value\: ``bool``\ )
- ``bool`` **is_input_delta_included**\ (\ )

If enabled, the input variable ``delta`` will be added to :ref:`input_names<class_BTEvaluateExpression_property_input_names>` and :ref:`input_values<class_BTEvaluateExpression_property_input_values>`.

\ **Warning:** Call :ref:`parse<class_BTEvaluateExpression_method_parse>` after toggling :ref:`input_include_delta<class_BTEvaluateExpression_property_input_include_delta>` to update the internal ``Expression`` as it won't be updated automatically.

.. rst-class:: classref-item-separator

----

.. _class_BTEvaluateExpression_property_input_names:

.. rst-class:: classref-property

``PackedStringArray`` **input_names** = ``PackedStringArray()`` :ref:`🔗<class_BTEvaluateExpression_property_input_names>`

.. rst-class:: classref-property-setget

- |void| **set_input_names**\ (\ value\: ``PackedStringArray``\ )
- ``PackedStringArray`` **get_input_names**\ (\ )

List of variable names within :ref:`expression_string<class_BTEvaluateExpression_property_expression_string>` for which the user will provide values for through :ref:`input_values<class_BTEvaluateExpression_property_input_values>`.

\ **Warning:** Call :ref:`parse<class_BTEvaluateExpression_method_parse>` after updating :ref:`input_names<class_BTEvaluateExpression_property_input_names>` to update the internal ``Expression`` as it won't be updated automatically.

**Note:** The returned array is *copied* and any changes to it will not update the original property value. See ``PackedStringArray`` for more details.

.. rst-class:: classref-item-separator

----

.. _class_BTEvaluateExpression_property_input_values:

.. rst-class:: classref-property

:ref:`Array<class_Array>`\[:ref:`BBVariant<class_BBVariant>`\] **input_values** = ``[]`` :ref:`🔗<class_BTEvaluateExpression_property_input_values>`

.. rst-class:: classref-property-setget

- |void| **set_input_values**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`BBVariant<class_BBVariant>`\]\ )
- :ref:`Array<class_Array>`\[:ref:`BBVariant<class_BBVariant>`\] **get_input_values**\ (\ )

List of values for variables specified in :ref:`input_names<class_BTEvaluateExpression_property_input_names>`. The values are mapped to the variables by their array index.

.. rst-class:: classref-item-separator

----

.. _class_BTEvaluateExpression_property_node:

.. rst-class:: classref-property

:ref:`BBNode<class_BBNode>` **node** :ref:`🔗<class_BTEvaluateExpression_property_node>`

.. rst-class:: classref-property-setget

- |void| **set_node_param**\ (\ value\: :ref:`BBNode<class_BBNode>`\ )
- :ref:`BBNode<class_BBNode>` **get_node_param**\ (\ )

Specifies the ``Node`` or ``Object`` instance containing the method to be called.

.. rst-class:: classref-item-separator

----

.. _class_BTEvaluateExpression_property_result_var:

.. rst-class:: classref-property

``StringName`` **result_var** = ``&""`` :ref:`🔗<class_BTEvaluateExpression_property_result_var>`

.. rst-class:: classref-property-setget

- |void| **set_result_var**\ (\ value\: ``StringName``\ )
- ``StringName`` **get_result_var**\ (\ )

if non-empty, assign the result of the method call to the blackboard variable specified by this property.

.. rst-class:: classref-section-separator

----

.. rst-class:: classref-descriptions-group

Method Descriptions
-------------------

.. _class_BTEvaluateExpression_method_parse:

.. rst-class:: classref-method

:ref:`Error<enum_@GlobalScope_Error>` **parse**\ (\ ) :ref:`🔗<class_BTEvaluateExpression_method_parse>`

Calls :ref:`Expression.parse<class_Expression_method_parse>` considering :ref:`input_include_delta<class_BTEvaluateExpression_property_input_include_delta>` and :ref:`input_names<class_BTEvaluateExpression_property_input_names>` and returns its error code.

.. |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.)`