BTEvaluateExpression

Inherits: BTAction < BTTask < BT

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

Description

BTEvaluateExpression action evaluates an 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.

Properties

String

expression_string

""

bool

input_include_delta

false

PackedStringArray

input_names

PackedStringArray()

BBVariant[]

input_values

[]

BBNode

node

StringName

result_var

&""

Methods

Error

parse ( )


Property Descriptions

String expression_string = ""

  • void set_expression_string ( String value )

  • String get_expression_string ( )

The expression string to be parsed and executed.

Warning: Call parse after updating expression_string to update the internal Expression as it won’t be updated automatically.


bool input_include_delta = false

  • void set_input_include_delta ( bool value )

  • bool is_input_delta_included ( )

If enabled, the input variable delta will be added to input_names and input_values.

Warning: Call parse after toggling input_include_delta to update the internal Expression as it won’t be updated automatically.


PackedStringArray input_names = PackedStringArray()

  • void set_input_names ( PackedStringArray value )

  • PackedStringArray get_input_names ( )

List of variable names within expression_string for which the user will provide values for through input_values.

Warning: Call parse after updating input_names to update the internal Expression as it won’t be updated automatically.


BBVariant[] input_values = []

List of values for variables specified in input_names. The values are mapped to the variables by their array index.


BBNode node

  • void set_node_param ( BBNode value )

  • BBNode get_node_param ( )

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


StringName result_var = &""

  • void set_result_var ( StringName value )

  • StringName get_result_var ( )

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


Method Descriptions

Error parse ( )

Calls Expression.parse considering input_include_delta and input_names and returns its error code.