limboai/doc/source/classes/class_btevaluateexpression.rst

200 lines
9.4 KiB
ReStructuredText
Raw Permalink Normal View History

2024-02-18 19:25:53 +00:00
:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
2024-09-30 09:17:01 +00:00
.. 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.
2024-02-18 19:25:53 +00:00
.. _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
2024-07-20 15:25:24 +00:00
+----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+
| ``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>` | ``&""`` |
+----------------------------------------------------------------+-------------------------------------------------------------------------------------+-------------------------+
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-reftable-group
Methods
-------
.. table::
:widths: auto
2024-07-20 15:25:24 +00:00
+---------------------------------------+-------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`parse<class_BTEvaluateExpression_method_parse>`\ (\ ) |
+---------------------------------------+-------------------------------------------------------------+
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-section-separator
----
.. rst-class:: classref-descriptions-group
Property Descriptions
---------------------
.. _class_BTEvaluateExpression_property_expression_string:
.. rst-class:: classref-property
2024-07-20 15:25:24 +00:00
``String`` **expression_string** = ``""`` :ref:`🔗<class_BTEvaluateExpression_property_expression_string>`
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-property-setget
2024-07-20 15:25:24 +00:00
- |void| **set_expression_string**\ (\ value\: ``String``\ )
- ``String`` **get_expression_string**\ (\ )
2024-02-18 19:25:53 +00:00
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
2024-07-20 15:25:24 +00:00
``bool`` **input_include_delta** = ``false`` :ref:`🔗<class_BTEvaluateExpression_property_input_include_delta>`
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-property-setget
2024-07-20 15:25:24 +00:00
- |void| **set_input_include_delta**\ (\ value\: ``bool``\ )
- ``bool`` **is_input_delta_included**\ (\ )
2024-02-18 19:25:53 +00:00
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
2024-07-20 15:25:24 +00:00
``PackedStringArray`` **input_names** = ``PackedStringArray()`` :ref:`🔗<class_BTEvaluateExpression_property_input_names>`
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-property-setget
2024-07-20 15:25:24 +00:00
- |void| **set_input_names**\ (\ value\: ``PackedStringArray``\ )
- ``PackedStringArray`` **get_input_names**\ (\ )
2024-02-18 19:25:53 +00:00
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.
2024-07-20 15:25:24 +00:00
**Note:** The returned array is *copied* and any changes to it will not update the original property value. See ``PackedStringArray`` for more details.
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-item-separator
----
.. _class_BTEvaluateExpression_property_input_values:
.. rst-class:: classref-property
2024-07-20 15:25:24 +00:00
:ref:`Array<class_Array>`\[:ref:`BBVariant<class_BBVariant>`\] **input_values** = ``[]`` :ref:`🔗<class_BTEvaluateExpression_property_input_values>`
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-property-setget
2024-07-20 15:25:24 +00:00
- |void| **set_input_values**\ (\ value\: :ref:`Array<class_Array>`\[:ref:`BBVariant<class_BBVariant>`\]\ )
- :ref:`Array<class_Array>`\[:ref:`BBVariant<class_BBVariant>`\] **get_input_values**\ (\ )
2024-02-18 19:25:53 +00:00
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
2024-07-20 15:25:24 +00:00
:ref:`BBNode<class_BBNode>` **node** :ref:`🔗<class_BTEvaluateExpression_property_node>`
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-property-setget
2024-07-20 15:25:24 +00:00
- |void| **set_node_param**\ (\ value\: :ref:`BBNode<class_BBNode>`\ )
- :ref:`BBNode<class_BBNode>` **get_node_param**\ (\ )
2024-02-18 19:25:53 +00:00
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
2024-07-20 15:25:24 +00:00
``StringName`` **result_var** = ``&""`` :ref:`🔗<class_BTEvaluateExpression_property_result_var>`
2024-02-18 19:25:53 +00:00
.. rst-class:: classref-property-setget
2024-07-20 15:25:24 +00:00
- |void| **set_result_var**\ (\ value\: ``StringName``\ )
- ``StringName`` **get_result_var**\ (\ )
2024-02-18 19:25:53 +00:00
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
2024-07-20 15:25:24 +00:00
:ref:`Error<enum_@GlobalScope_Error>` **parse**\ (\ ) :ref:`🔗<class_BTEvaluateExpression_method_parse>`
2024-02-18 19:25:53 +00:00
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.)`
2024-07-20 15:25:24 +00:00
.. |void| replace:: :abbr:`void (No return value.)`