Merge branch 'doc-work'

This commit is contained in:
Serhii Snitsaruk 2023-10-27 14:26:19 +02:00
commit e05a6fd6ea
87 changed files with 323 additions and 280 deletions

View File

@ -90,7 +90,7 @@ void BTPlayer::update(double p_delta) {
}
void BTPlayer::restart() {
tree_instance->cancel();
tree_instance->abort();
set_active(true);
}
@ -187,7 +187,7 @@ void BTPlayer::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "behavior_tree", PROPERTY_HINT_RESOURCE_TYPE, "BehaviorTree"), "set_behavior_tree", "get_behavior_tree");
ADD_PROPERTY(PropertyInfo(Variant::INT, "update_mode", PROPERTY_HINT_ENUM, "Idle,Physics,Manual"), "set_update_mode", "get_update_mode");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "active"), "set_active", "get_active");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "blackboard", PROPERTY_HINT_NONE, "Blackboard", 0), "", "get_blackboard");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "blackboard", PROPERTY_HINT_NONE, "Blackboard", 0), "set_blackboard", "get_blackboard");
ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "_blackboard_data", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_INTERNAL), "_set_blackboard_data", "_get_blackboard_data");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "prefetch_nodepath_vars"), "set_prefetch_nodepath_vars", "get_prefetch_nodepath_vars");

View File

@ -30,7 +30,7 @@ void BTState::_setup() {
void BTState::_exit() {
ERR_FAIL_COND(tree_instance == nullptr);
tree_instance->cancel();
tree_instance->abort();
}
void BTState::_update(double p_delta) {

View File

@ -161,7 +161,7 @@ BT::Status BTTask::execute(double p_delta) {
// Reset children status.
if (data.status != FRESH) {
for (int i = 0; i < get_child_count(); i++) {
data.children.get(i)->cancel();
data.children.get(i)->abort();
}
}
if (!GDVIRTUAL_CALL(_enter)) {
@ -184,9 +184,9 @@ BT::Status BTTask::execute(double p_delta) {
return data.status;
}
void BTTask::cancel() {
void BTTask::abort() {
for (int i = 0; i < data.children.size(); i++) {
get_child(i)->cancel();
get_child(i)->abort();
}
if (data.status == RUNNING) {
if (!GDVIRTUAL_CALL(_exit)) {
@ -320,8 +320,7 @@ void BTTask::_bind_methods() {
ClassDB::bind_method(D_METHOD("next_sibling"), &BTTask::next_sibling);
ClassDB::bind_method(D_METHOD("print_tree", "p_initial_tabs"), &BTTask::print_tree, Variant(0));
ClassDB::bind_method(D_METHOD("get_task_name"), &BTTask::get_task_name);
ClassDB::bind_method(D_METHOD("get_custom_name"), &BTTask::get_custom_name);
ClassDB::bind_method(D_METHOD("set_custom_name", "p_name"), &BTTask::set_custom_name);
ClassDB::bind_method(D_METHOD("abort"), &BTTask::abort);
// Properties, setters and getters.
ClassDB::bind_method(D_METHOD("get_agent"), &BTTask::get_agent);
@ -332,6 +331,8 @@ void BTTask::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_parent"), &BTTask::get_parent);
ClassDB::bind_method(D_METHOD("get_status"), &BTTask::get_status);
ClassDB::bind_method(D_METHOD("get_elapsed_time"), &BTTask::get_elapsed_time);
ClassDB::bind_method(D_METHOD("get_custom_name"), &BTTask::get_custom_name);
ClassDB::bind_method(D_METHOD("set_custom_name", "p_name"), &BTTask::set_custom_name);
ADD_PROPERTY(PropertyInfo(Variant::STRING, "custom_name"), "set_custom_name", "get_custom_name");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "agent", PROPERTY_HINT_RESOURCE_TYPE, "Node", PROPERTY_USAGE_NONE), "set_agent", "get_agent");

View File

@ -103,7 +103,7 @@ public:
virtual PackedStringArray get_configuration_warnings() const;
Status execute(double p_delta);
void cancel();
void abort();
Status get_status() const { return data.status; }
double get_elapsed_time() const { return data.elapsed; };

View File

@ -27,7 +27,7 @@ BT::Status BTDynamicSelector::_tick(double p_delta) {
// If the last node ticked is earlier in the tree than the previous runner,
// cancel previous runner.
if (last_running_idx > i && get_child(last_running_idx)->get_status() == RUNNING) {
get_child(last_running_idx)->cancel();
get_child(last_running_idx)->abort();
}
last_running_idx = i;
return status;

View File

@ -27,7 +27,7 @@ BT::Status BTDynamicSequence::_tick(double p_delta) {
// If the last node ticked is earlier in the tree than the previous runner,
// cancel previous runner.
if (last_running_idx > i && get_child(last_running_idx)->get_status() == RUNNING) {
get_child(last_running_idx)->cancel();
get_child(last_running_idx)->abort();
}
last_running_idx = i;
return status;

View File

@ -15,7 +15,7 @@
void BTParallel::_enter() {
for (int i = 0; i < get_child_count(); i++) {
get_child(i)->cancel();
get_child(i)->abort();
}
}

View File

@ -26,7 +26,7 @@ BT::Status BTTimeLimit::_tick(double p_delta) {
ERR_FAIL_COND_V_MSG(get_child_count() == 0, FAILURE, "BT decorator has no child.");
Status status = get_child(0)->execute(p_delta);
if (status == RUNNING && get_elapsed_time() >= time_limit) {
get_child(0)->cancel();
get_child(0)->abort();
return FAILURE;
}
return status;

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBAabb" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
AABB-type parameter to be used with BT tasks. See [BBParam].
AABB-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBArray" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Array-type parameter to be used with BT tasks. See [BBParam].
Array-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBBasis" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Basis-type parameter to be used with BT tasks. See [BBParam].
Basis-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBBool" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Bool-type parameter to be used with BT tasks. See [BBParam].
Bool-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBByteArray" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
ByteArray-type parameter to be used with BT tasks. See [BBParam].
ByteArray-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBColor" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Color-type parameter to be used with BT tasks. See [BBParam].
Color-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBColorArray" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
ColorArray-type parameter to be used with BT tasks. See [BBParam].
ColorArray-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBDictionary" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Dictionary-type parameter to be used with BT tasks. See [BBParam].
Dictionary-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBFloat" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Float-type parameter to be used with BT tasks. See [BBParam].
Float-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBFloatArray" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
FloatArray-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBInt" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Integer-type parameter to be used with BT tasks. See [BBParam].
Integer-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBIntArray" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
IntArray-type parameter to be used with BT tasks. See [BBParam].
IntArray-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBNode" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Node-type parameter to be used with BT tasks. See [BBParam].
Node-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
Node-type parameter to be used with BT tasks. See [BBParam].
If blackboard is chosen as source, it allows any [Object]-extended type.
Node-type parameter intended for use with [BehaviorTree] tasks. See [BBParam].
If the source is a blackboard variable, it allows any type extended from [Object].
</description>
<tutorials>
</tutorials>

View File

@ -1,12 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBParam" inherits="Resource" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A base class for typed parameters to be used with BT tasks.
A base class for LimboAI typed parameters.
</brief_description>
<description>
A base class for typed parameters.
BBParam can store a blackboard variable name or a raw value of specific type.
*Note*: Don't instantiate. Use specific subclasses instead.
A base class for LimboAI typed parameters, with the ability to reference a [Blackboard] variable or hold a raw value of a specific [enum Variant.Type].
[b]Note[/b]: Don't instantiate. Use specific subtypes instead.
</description>
<tutorials>
</tutorials>
@ -14,7 +13,7 @@
<method name="get_type" qualifiers="const">
<return type="int" enum="Variant.Type" />
<description>
Returns expected type of the parameter.
Returns the expected data type of the parameter.
</description>
</method>
<method name="get_value">
@ -23,27 +22,27 @@
<param index="1" name="p_blackboard" type="Blackboard" />
<param index="2" name="p_default" type="Variant" default="null" />
<description>
Returns value of the parameter.
Returns the value of the parameter.
</description>
</method>
</methods>
<members>
<member name="saved_value" type="Variant" setter="set_saved_value" getter="get_saved_value" default="null">
A value that is saved with BBParam resource. The type of value is defined by [method get_type]. Provides the parameter's value, if [member value_source] is [constant SAVED_VALUE].
Stores the parameter value when [member value_source] is set to [constant SAVED_VALUE]. The data type of the value is determined by [method get_type].
</member>
<member name="value_source" type="int" setter="set_value_source" getter="get_value_source" enum="BBParam.ValueSource" default="0">
A source for the value of BBParam. See [enum ValueSource].
Specifies the source of the value for BBParam. See [enum ValueSource].
</member>
<member name="variable" type="String" setter="set_variable" getter="get_variable">
A name of [Blackboard] variable. It is used to retrieve the parameter's value, if [member value_source] is [constant BLACKBOARD_VAR].
Stores the name of a [Blackboard] variable when [member value_source] is set to [constant BLACKBOARD_VAR].
</member>
</members>
<constants>
<constant name="SAVED_VALUE" value="0" enum="ValueSource">
Value is stored directly with BBParam resource.
The value is stored directly within the BBParam resource.
</constant>
<constant name="BLACKBOARD_VAR" value="1" enum="ValueSource">
Value is referenced by a variable name and retrieved from the [Blackboard]. A variable name is stored with BBParam resource.
The value is referenced by a variable name and retrieved from the [Blackboard]. The variable name is stored within the BBParam resource.
</constant>
</constants>
</class>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBPlane" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Plane-type parameter to be used with BT tasks. See [BBParam].
Plane-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBQuaternion" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Quaternion-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBRect2" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Rect2-type parameter to be used with BT tasks. See [BBParam].
Rect2-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBRect2i" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Rect2i-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBString" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
String-type parameter to be used with BT tasks. See [BBParam].
String-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBStringArray" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
StringArray-type parameter to be used with BT tasks. See [BBParam].
StringArray-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBStringName" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
StringName-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBTransform2D" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Transform2D-type parameter to be used with BT tasks. See [BBParam].
Transform2D-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBTransform3D" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Transform3D-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVariant" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Variant-type parameter to be used with BT tasks. See [BBParam].
Variant-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
Variant-type parameter intended for use with [BehaviorTree] tasks. See [BBParam].
The data type is specified by [member type].
</description>
<tutorials>
</tutorials>
<members>
<member name="type" type="int" setter="set_type" getter="get_type" enum="Variant.Type" default="0">
Specified [enum Variant.Type] for the parameter value.
</member>
</members>
</class>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVector2" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vector2-type parameter to be used with BT tasks. See [BBParam].
Vector2-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVector2Array" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vector2Array-type parameter to be used with BT tasks. See [BBParam].
Vector2Array-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVector2i" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vector2i-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVector3" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vector3-type parameter to be used with BT tasks. See [BBParam].
Vector3-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVector3Array" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vector3Array-type parameter to be used with BT tasks. See [BBParam].
Vector3Array-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVector3i" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vector3i-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVector4" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vector4-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BBVector4i" inherits="BBParam" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Vector4i-type parameter for [BehaviorTree] tasks. See [BBParam].
</brief_description>
<description>
</description>

View File

@ -9,7 +9,7 @@
</tutorials>
<constants>
<constant name="FRESH" value="0" enum="Status">
Task wasn't executed yet or execution was cancelled.
Task wasn't executed yet or it was aborted and reset.
</constant>
<constant name="RUNNING" value="1" enum="Status">
Task is being performed and hasn't finished yet.

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTAction" inherits="BTTask" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Base class for BT actions.
Base class for all [BehaviorTree] actions.
</brief_description>
<description>
Base class for all behavior tree actions. Extend [code]BTAction[/code] to create your own actions.
Represents a specific action or behavior in a [BehaviorTree] that the agent should perform. It is the lowest level of the [BehaviorTree] hierarchy and is responsible for carrying out the actual work required to achieve a goal. Actions cannot have child tasks.
Actions performs a task in one or multiple ticks. Actions return [code]RUNNING[/code] status, when it takes more than one tick to perform a task. When a task is finished an action returns [code]SUCCESS[/code] or [code]FAILURE[/code].
Base class for all actions within a [BehaviorTree]. You can create your own actions by extending the [code]BTAction[/code] class.
Represents a specific behavior or action in a [BehaviorTree] that an agent should execute. Actions are the lowest level of the [BehaviorTree] hierarchy and are responsible for performing the actual work required to achieve a goal. Actions do not have child tasks.
A single action can perform a task within one or multiple ticks. If it takes more than one tick to complete the task, the action should return [code]RUNNING[/code] status. When the task is finished, the action returns either [code]SUCCESS[/code] or [code]FAILURE[/code] to indicate the outcome.
</description>
<tutorials>
</tutorials>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTAlwaysFail" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that turns SUCCESS into FAILURE.
BT decorator that converts [code]SUCCESS[/code] into [code]FAILURE[/code].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTAlwaysSucceed" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that turns FAILURE into SUCCESS.
BT decorator that converts [code]FAILURE[/code] into [code]SUCCESS[/code].
</brief_description>
<description>
</description>

View File

@ -4,9 +4,9 @@
BT action that waits for an animation to finish playing.
</brief_description>
<description>
BTAwaitAnimation waits for an animation on the specified [AnimationPlayer] node to finish playing and returns [code]SUCCESS[/code].
Returns [code]SUCCESS[/code] if the specified animation finished playing or if the specified animation is not currently playing.
Returns [code]FAILURE[/code] if the specified animation doesn't exist or the action failed to get [AnimationPlayer] instance.
BTAwaitAnimation action waits for an animation on the specified [AnimationPlayer] node to finish playing and returns [code]SUCCESS[/code].
Returns [code]SUCCESS[/code] if the specified animation has finished playing or if the specified animation is not currently playing.
Returns [code]FAILURE[/code] if the specified animation doesn't exist or if the action fails to get the [AnimationPlayer] node.
</description>
<tutorials>
</tutorials>
@ -18,7 +18,7 @@
Parameter that specifies the [AnimationPlayer] node.
</member>
<member name="max_time" type="float" setter="set_max_time" getter="get_max_time" default="1.0">
Maximum duration to wait for the animation to finish (in seconds).
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTAwaitAnimation will return [code]FAILURE[/code].
</member>
</members>
</class>

View File

@ -4,20 +4,20 @@
BT action that calls a method on a specified [Node] or [Object].
</brief_description>
<description>
BTCallMethod calls a method on a specified [Node] or [Object] and returns [code]SUCCESS[/code].
Returns [code]FAILURE[/code] if the action fails executing the method.
BTCallMethod action calls a [member method] on the specified [Node] or [Object] instance and returns [code]SUCCESS[/code].
Returns [code]FAILURE[/code] if the action encounters an issue during the method execution.
</description>
<tutorials>
</tutorials>
<members>
<member name="args" type="Array" setter="set_args" getter="get_args" default="[]">
Arguments to pass to the method call.
The arguments to be passed when calling the method.
</member>
<member name="method" type="StringName" setter="set_method" getter="get_method" default="&amp;&quot;&quot;">
Method that will be called.
The name of the method to be called.
</member>
<member name="node" type="BBNode" setter="set_node_param" getter="get_node_param">
Parameter that will be used to get the node/object instance.
Specifies the [Node] or [Object] instance containing the method to be called.
</member>
</members>
</class>

View File

@ -4,19 +4,20 @@
BT condition that checks agent's property value.
</brief_description>
<description>
BTCheckAgentProperty checks agent's property value against [member value] and returns [code]SUCCESS[/code] or [code]FAILURE[/code] based on the [member check_type].
BTCheckAgentProperty examines the agent's property value and compares it to [member value].
Returns [code]SUCCESS[/code] or [code]FAILURE[/code] based on the [member check_type].
</description>
<tutorials>
</tutorials>
<members>
<member name="check_type" type="int" setter="set_check_type" getter="get_check_type" enum="LimboUtility.CheckType" default="0">
Type of check to perform.
The type of check to be performed.
</member>
<member name="property" type="StringName" setter="set_property" getter="get_property" default="&amp;&quot;&quot;">
Parameter that specifies the agent's property which will be compared.
Parameter that specifies the agent's property to be compared.
</member>
<member name="value" type="BBVariant" setter="set_value" getter="get_value">
Parameter that specifies the value to which an agent's property will be compared.
Parameter that specifies the value against which an agent's property will be compared.
</member>
</members>
</class>

View File

@ -4,14 +4,16 @@
BT condition that checks a trigger (a boolean variable).
</brief_description>
<description>
BTCheckTrigger verifies whether the [member variable] is set to [code]true[/code]. If it is, the task changes it to [code]false[/code] and returns [code]SUCCESS[/code]. Otherwise, it returns [code]FAILURE[/code].
BTCheckTrigger verifies whether the [member variable] is set to [code]true[/code]. If it is, the task switches it to [code]false[/code] and returns [code]SUCCESS[/code]. Otherwise, it returns [code]FAILURE[/code].
BTCheckTrigger can function as a "gate" within a [BTSequence]: when the trigger variable is set to [code]true[/code], it permits the execution of subsequent tasks and then changes the variable to [code]false[/code].
</description>
<tutorials>
</tutorials>
<members>
<member name="variable" type="String" setter="set_variable" getter="get_variable" default="&quot;&quot;">
A boolean variable on the blackboard that is used as a trigger.
When it is set to [code]true[/code], BTCheckTrigger will flip it to [code]false[/code] and return [code]SUCCESS[/code]. Otherwise, it will return [code]FAILURE[/code].
A boolean variable on the [member blackboard] used as a trigger.
If variable's value is [code]true[/code], BTCheckTrigger will switch it to [code]false[/code] and return [code]SUCCESS[/code].
If variable's value is [code]false[/code], BTCheckTrigger will return [code]FAILURE[/code].
</member>
</members>
</class>

View File

@ -4,19 +4,19 @@
BT condition that checks a variable on the blackboard.
</brief_description>
<description>
BTCheckVar checks [member variable] against [member value] and returns [code]SUCCESS[/code] or [code]FAILURE[/code] based on the [member check_type].
BTCheckVar evaluates the [member variable] against [member value] and returns [code]SUCCESS[/code] or [code]FAILURE[/code] based on the [member check_type].
</description>
<tutorials>
</tutorials>
<members>
<member name="check_type" type="int" setter="set_check_type" getter="get_check_type" enum="LimboUtility.CheckType" default="0">
Type of check to perform.
The type of check to be performed.
</member>
<member name="value" type="BBVariant" setter="set_value" getter="get_value">
Parameter that specifies the value to which the [member variable] will be compared.
A parameter that specifies the value against which the [member variable] will be compared.
</member>
<member name="variable" type="String" setter="set_variable" getter="get_variable" default="&quot;&quot;">
Variable name to check its value.
The name of the variable to check its value.
</member>
</members>
</class>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTComment" inherits="BTTask" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BTComment adds annotations or explanatory notes to the [BehaviorTree].
BTComment adds annotations or explanatory notes to a [BehaviorTree].
</brief_description>
<description>
BTComment adds annotations or explanatory notes to the [BehaviorTree].
Comments are not executed as part of the tree. They are removed from runtime instances of the [BehaviorTree].
BTComment is used to add annotations or explanatory notes to a [BehaviorTree].
Comments are not executed as part of the tree and are removed from runtime instances of the [BehaviorTree].
</description>
<tutorials>
</tutorials>

View File

@ -4,8 +4,8 @@
Base class for BT composite tasks.
</brief_description>
<description>
Base class for all behavior tree composite tasks. Extend [code]BTComposite[/code] to create your own.
Composite is a control task in a [BehaviorTree] that contains one or more child tasks. It defines the structure and flow of the [BehaviorTree] by specifying how child tasks are executed. It can be used to group related tasks into a single unit, making it easier to manage and maintain the [BehaviorTree]. Examples of [BehaviorTree] composites include [BTSelector], [BTSequence], and [BTParallel].
Base class for all [BehaviorTree] composite tasks. You can create your own composite tasks by extending the BTComposite class.
Composite is a control task within a [BehaviorTree] that contains one or more child tasks. It defines the structure and flow of the [BehaviorTree] by specifying how child tasks are executed. Composites can be used to group related tasks into a single unit, making it easier to manage and maintain the [BehaviorTree]. Examples of [BehaviorTree] composites include [BTSelector], [BTSequence], and [BTParallel].
</description>
<tutorials>
</tutorials>

View File

@ -4,9 +4,9 @@
Base class for BT conditions.
</brief_description>
<description>
Base class for all [BehaviorTree] conditions. Extend [code]BTCondition[/code] to create your own conditions.
Condition is a task in a [BehaviorTree] that checks for a specific condition before executing subsequent tasks and often used inside composite tasks to control the execution flow. It is used to verify the state of the environment, check for the presence of an enemy, or evaluate the health status of the agent. The use of [BehaviorTree] condition tasks can improve the efficiency of the system and avoid unnecessary actions. However, it may not be suitable for complex decision-making processes, and too many condition tasks can make the [BehaviorTree] difficult to read.
Conditions usually don't take multiple ticks to finish and return [code]SUCCESS[/code] or [code]BT.FAILURE[/code] immeditely.
Base class for all [BehaviorTree] conditions. You can create your own conditions by extending the [code]BTCondition[/code] class.
Condition is a task within a [BehaviorTree] that checks for a specific condition before executing subsequent tasks. It is often used inside composite tasks to control the execution flow. Conditions are used to verify the state of the environment, check for the presence of an enemy, or evaluate the health status of the agent. The use of condition tasks in a [BehaviorTree] can improve system efficiency and prevent unnecessary actions. However, they may not be suitable for complex decision-making processes, and too many condition tasks can make the [BehaviorTree] difficult to read.
Conditions typically don't take multiple ticks to finish and return either [code]SUCCESS[/code] or [code]FAILURE[/code] immediately.
</description>
<tutorials>
</tutorials>

View File

@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTConsolePrint" inherits="BTAction" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT action task that prints text to console.
BT action task that outputs text to the console.
</brief_description>
<description>
BT action task that prints text to console. Can contain placeholders for format arguments as in GDScript's % operator.
BTConsolePrint action outputs text to the console and returns [code]SUCCESS[/code]. It can include placeholders for format arguments similar to GDScript's % operator.
</description>
<tutorials>
</tutorials>
<members>
<member name="bb_format_parameters" type="PackedStringArray" setter="set_bb_format_parameters" getter="get_bb_format_parameters" default="PackedStringArray()">
The values of format parameters are used as format arguments for the text that will be printed.
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
Text to print. Can contain multiple placeholders to be replaced with format arguments. Same as GDScript's % operator, placeholders start with '%' followed by a format specifier. For example: %s - string, %d - integer, %f - real.
The text to be printed, which can include multiple placeholders to be substituted with format arguments. These placeholders follow the same format as GDScript's % operator and typically start with '%' followed by a format specifier. For instance: %s for string, %d for integer, %f for real.
</member>
</members>
</class>

View File

@ -1,34 +1,32 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTCooldown" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that executes child only if [member duration] time passed since previous execution.
BT decorator that executes its child task only if [member duration] time has passed since the previous execution.
</brief_description>
<description>
BT decorator that executes child only if [member duration] time passed since previous child task execution.
Returns [code]RUNNING[/code], when the child returns [code]RUNNING[/code].
Returns [code]SUCCESS[/code], when the child returns [code]SUCCESS[/code], and triggers the cooldown.
Returns [code]FAILURE[/code], if the child returns [code]FAILURE[/code] or [member duration] time didn't pass since previous execution.
BTCooldown runs its child task only if [member duration] time has passed since the last successful child task execution. It will only consider successful executions unless [member trigger_on_failure] is set to [code]true[/code].
Returns [code]RUNNING[/code], if the child task results in [code]RUNNING[/code].
Returns [code]SUCCESS[/code], if the child task results in [code]SUCCESS[/code], and triggers the cooldown timer.
Returns [code]FAILURE[/code], if the child task results in [code]FAILURE[/code] or if [member duration] time didn't pass since the previous execution.
</description>
<tutorials>
</tutorials>
<members>
<member name="cooldown_state_var" type="String" setter="set_cooldown_state_var" getter="get_cooldown_state_var" default="&quot;&quot;">
Boolean variable to save cooldown state in the [Blackboard]. If empty, the variable will be automatically created and assigned.
If variable value is [code]true[/code], the cooldown is triggered.
Useful to check on cooldown state at a different place in the tree or to share a cooldown state between different parts of the behavior tree.
A boolean variable used to store the cooldown state in the [Blackboard]. If left empty, the variable will be automatically generated and assigned.
If the variable's value is set to [code]true[/code], it indicates that the cooldown is activated. This feature is useful for checking the cooldown state from other parts of the tree or sharing it among different sections of the [BehaviorTree].
</member>
<member name="duration" type="float" setter="set_duration" getter="get_duration" default="10.0">
Time to wait before child's another execution is allowed.
Time to wait before permitting another child's execution.
</member>
<member name="process_pause" type="bool" setter="set_process_pause" getter="get_process_pause" default="false">
Process cooldown time when [SceneTree] is paused.
If [code]true[/code], process cooldown when the [SceneTree] is paused.
</member>
<member name="start_cooled" type="bool" setter="set_start_cooled" getter="get_start_cooled" default="false">
Start on a cooldown, as if the child was executed before the first BT tick.
If [code]true[/code], initiate a cooldown as if the child had been executed before the first BT tick.
</member>
<member name="trigger_on_failure" type="bool" setter="set_trigger_on_failure" getter="get_trigger_on_failure" default="false">
Trigger cooldown, if the child also returns [code]FAILURE[/code].
Otherwise, cooldown will only be triggered when the child returns [code]SUCCESS[/code]
If [code]true[/code], the cooldown will be activated if the child task also returns [code]FAILURE[/code]. Otherwise, the cooldown will only be triggered when the child task returns [code]SUCCESS[/code].
</member>
</members>
</class>

View File

@ -4,9 +4,9 @@
Base class for BT decorators.
</brief_description>
<description>
Base class for all behavior tree decorators. Extend [code]BTDecorator[/code] to create your own decorators.
Decorator is a task in a [BehaviorTree] that alters the behavior of its child task. Can only have a single child.
It can be used to add conditions, limits, or other constraints to the execution of a task. Examples of [BehaviorTree] decorators include [BTInvert], [BTRepeat], and [BTCooldown]. The use of [BehaviorTree] decorators can help to simplify the design and implementation of complex behaviors by adding additional logic to existing tasks.
Base class for all [BehaviorTree] decorators. You can create your own decorators by extending the BTDecorator class.
A decorator is a task within a [BehaviorTree] that alters the behavior of its child task. Decorators can have only one child task.
Decorators can be used to add conditions, limits, or other constraints to the execution of a task. Examples of [BehaviorTree] decorators include [BTInvert], [BTRepeat], and [BTCooldown]. The use of [BehaviorTree] decorators can simplify the design and implementation of complex behaviors by adding additional logic to existing tasks.
</description>
<tutorials>
</tutorials>

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTDelay" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that delays execution of its child.
BT decorator that introduces a delay before executing its child task.
</brief_description>
<description>
BT decorator that delays execution of its child by [member seconds]. Returns [code]RUNNING[/code] during a period of delay.
BTDelay introduces a delay of [member seconds] before executing its child task. Returns [code]RUNNING[/code] during the delay period.
</description>
<tutorials>
</tutorials>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTFail" inherits="BTAction" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT action that returns FAILURE.
BT action that always returns [code]FAILURE[/code].
</brief_description>
<description>
</description>

View File

@ -1,19 +1,22 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTForEach" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that executes child for each element of an [Array].
BT decorator that executes its child task for each element of an [Array].
</brief_description>
<description>
BT decorator that executes child for each element of an [Array]. On each iteration an element is saved to a [Blackboard] variable.
BTForEach executes its child task for each element of an [Array]. During each iteration, the next element is stored in the specified [Blackboard] variable.
Returns [code]RUNNING[/code] if the child task results in [code]RUNNING[/code] or if the child task results in [code]SUCCESS[/code] on a non-last iteration.
Returns [code]FAILURE[/code] if the child task results in [code]FAILURE[/code].
Returns [code]SUCCESS[/code] if the child task results in [code]SUCCESS[/code] on the last iteration.
</description>
<tutorials>
</tutorials>
<members>
<member name="array_var" type="String" setter="set_array_var" getter="get_array_var" default="&quot;&quot;">
An [Array] stored in the [Blackboard] to iterate over.
A variable within the [Blackboard] that holds an [Array], which is used for the iteration process.
</member>
<member name="save_var" type="String" setter="set_save_var" getter="get_save_var" default="&quot;&quot;">
[Blackboard] variable to store an element of array, referenced by [member array_var].
A [Blackboard] variable used to store an element of the array referenced by [member array_var].
</member>
</members>
</class>

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTInvert" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that inverts FAILURE to SUCCESS and SUCCESS to FAILURE.
BT decorator that transforms [code]FAILURE[/code] into [code]SUCCESS[/code] and [code]SUCCESS[/code] into [code]FAILURE[/code].
</brief_description>
<description>
BTInvert transforms [code]FAILURE[/code] into [code]SUCCESS[/code] and [code]SUCCESS[/code] into [code]FAILURE[/code].
</description>
<tutorials>
</tutorials>

View File

@ -4,8 +4,8 @@
BT decorator that creates a new [Blackboard] scope.
</brief_description>
<description>
BT decorator that creates a new [Blackboard] scope during initialization and fills it with data. See [Blackboard].
Returns status of the child execution.
BTNewScope creates a new [Blackboard] scope during initialization and populates it with data. See [Blackboard].
Returns the status of the child task execution.
</description>
<tutorials>
</tutorials>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTPauseAnimation" inherits="BTAction" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT action that pauses playback of an animation on the specified [AnimationPlayer] node.
BT action that pauses the playback of an animation on the specified [AnimationPlayer] node.
</brief_description>
<description>
BTPauseAnimation action pauses playback of an animation on the specified [AnimationPlayer] node and returns [code]SUCCESS[/code].
Returns [code]FAILURE[/code] if the action fails to acquire [AnimationPlayer] node.
BTPauseAnimation action pauses the playback of an animation on the specified [AnimationPlayer] node and returns [code]SUCCESS[/code].
Returns [code]FAILURE[/code] if the action fails to get the [AnimationPlayer] node.
</description>
<tutorials>
</tutorials>

View File

@ -4,7 +4,7 @@
BT action that plays an animation on the specified [AnimationPlayer] node.
</brief_description>
<description>
BTPlayAnimation action plays an animation on the specified [AnimationPlayer] node. If the [member await_completion] is greater than [code]0[/code], the action will wait for the animation to complete, with a maximum waiting time equal to [member await_completion].
BTPlayAnimation action plays an animation on the specified [AnimationPlayer] node. If the [member await_completion] is greater than [code]0[/code], the action will wait for the animation to complete, with the maximum waiting time equal to [member await_completion].
Returns [code]SUCCESS[/code] if the animation finishes playing or if the elapsed time exceeds [member await_completion]. When [member await_completion] is set to [code]0[/code], BTPlayAnimation doesn't wait for the animation to finish and immediately returns [code]SUCCESS[/code].
Returns [code]RUNNING[/code] if the animation is still playing and the elapsed time is less than [member await_completion].
Returns [code]FAILURE[/code] if the action fails to play the requested animation.
@ -13,22 +13,22 @@
</tutorials>
<members>
<member name="animation_name" type="StringName" setter="set_animation_name" getter="get_animation_name" default="&amp;&quot;&quot;">
Animation's key within the [AnimationPlayer] node. If empty, BTPlayAnimation will resume the last played animation if [AnimationPlayer] was paused.
Animation's key within the [AnimationPlayer] node. If empty, BTPlayAnimation will resume the last played animation if the [AnimationPlayer] was previously paused.
</member>
<member name="animation_player" type="BBNode" setter="set_animation_player" getter="get_animation_player">
Parameter that specifies the [AnimationPlayer] node.
</member>
<member name="await_completion" type="float" setter="set_await_completion" getter="get_await_completion" default="0.0">
Duration to wait for the animation to finish (in seconds).
The maximum duration to wait for the animation to complete (in seconds). If the animation doesn't finish within this time, BTAwaitAnimation will return [code]FAILURE[/code]. If set to [code]0[/code], BTPlayAnimation doesn't wait for the animation to finish and immediately returns [code]SUCCESS[/code].
</member>
<member name="blend" type="float" setter="set_blend" getter="get_blend" default="-1.0">
Custom blend time (in seconds).
Custom blend time (in seconds). See [method AnimationPlayer.play].
</member>
<member name="from_end" type="bool" setter="set_from_end" getter="get_from_end" default="false">
Play animation from the end. Used in combination with negative [member speed] to play animation in reverse.
Play animation from the end. Used in combination with negative [member speed] to play animation in reverse. See [method AnimationPlayer.play].
</member>
<member name="speed" type="float" setter="set_speed" getter="get_speed" default="1.0">
Custom playback speed scaling ratio.
Custom playback speed scaling ratio. See [method AnimationPlayer.play].
</member>
</members>
</class>

View File

@ -4,7 +4,8 @@
Player of [BehaviorTree] resources.
</brief_description>
<description>
BTPlayer is used for instantiation and playback of [BehaviorTree] resources at run time.
BTPlayer node is used for the instantiation and playback of [BehaviorTree] resources at runtime. During instantiation, the behavior tree instance is initialized with a reference to the agent and the [member blackboard]. Agent is the owner of the BTPlayer node (see [member Node.owner]).
For an introduction to behavior trees, see [BehaviorTree].
</description>
<tutorials>
</tutorials>
@ -12,74 +13,68 @@
<method name="get_last_status" qualifiers="const">
<return type="int" />
<description>
Returns last execution status. See [enum BT.Status].
Returns the behavior tree's last execution status. See [enum BT.Status].
</description>
</method>
<method name="restart">
<return type="void" />
<description>
Cancel execution of the tree and start anew. This method does not reset [Blackboard].
</description>
</method>
<method name="set_blackboard">
<return type="void" />
<param index="0" name="p_blackboard" type="Blackboard" />
<description>
Assign a [Blackboard] instance.
Resets the behavior tree's execution. Each running task will be aborted and the next tree execution will start anew. This method does not reset [Blackboard].
</description>
</method>
<method name="update">
<return type="void" />
<param index="0" name="p_delta" type="float" />
<description>
Updates the tree by executing the root task. Call this method when [member update_mode] is set to [constant MANUAL]. When [member update_mode] is not set to [constant MANUAL], the tree is updated automatically. See [enum UpdateMode].
Executes the root task of the behavior tree instance if [member active] is [code]true[/code]. Call this method when [member update_mode] is set to [constant MANUAL]. When [member update_mode] is not [constant MANUAL], the [method update] will be called automatically. See [enum UpdateMode].
</description>
</method>
</methods>
<members>
<member name="active" type="bool" setter="set_active" getter="get_active" default="true">
If [code]true[/code], tree is active and will be processed.
If [code]true[/code], the behavior tree will be executed during update.
</member>
<member name="behavior_tree" type="BehaviorTree" setter="set_behavior_tree" getter="get_behavior_tree">
[BehaviorTree] resource to instantiate and process at run time.
[BehaviorTree] resource to instantiate and execute at runtime.
</member>
<member name="blackboard" type="Blackboard" setter="" getter="get_blackboard">
[Blackboard] instance that contains data shared by the tasks in [BehaviorTree].
<member name="blackboard" type="Blackboard" setter="set_blackboard" getter="get_blackboard">
Holds data shared by the behavior tree tasks. See [Blackboard].
</member>
<member name="monitor_performance" type="bool" setter="_set_monitor_performance" getter="_get_monitor_performance" default="false">
Add a performance monitor to "Debugger-&gt;Monitors" for each instance of this [BTPlayer].
If [code]true[/code], adds a performance monitor to "Debugger-&gt;Monitors" for each instance of this [BTPlayer] node.
</member>
<member name="prefetch_nodepath_vars" type="bool" setter="set_prefetch_nodepath_vars" getter="get_prefetch_nodepath_vars" default="true">
If [code]true[/code], any NodePath variables in the [Blackboard] are replaced with references during tree instantiation. References are retrieved by calling [method Node.get_node] of BTPlayer.
If [code]true[/code], any [NodePath] variables in the [Blackboard] are replaced with [Node] references when the tree is instantiated. References are retrieved by calling [method Node.get_node] on the agent instance (agent is the owner of the BTPlayer node).
</member>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="BTPlayer.UpdateMode" default="1">
Defines when BehaviorTree is executed. See [enum UpdateMode].
Determines when the behavior tree is executed. See [enum UpdateMode].
</member>
</members>
<signals>
<signal name="behavior_tree_finished">
<param index="0" name="p_status" type="int" />
<description>
Notifies when behavior tree finishes executing and returns [code]SUCCESS[/code] or [code]FAILURE[/code].
Argument [code]p_status[/code] holds the status returned by the behavior tree.
Emitted when the behavior tree has finished executing and returned [code]SUCCESS[/code] or [code]FAILURE[/code].
Argument [code]p_status[/code] holds the status returned by the behavior tree. See [enum BT.Status].
</description>
</signal>
<signal name="updated">
<param index="0" name="p_status" type="int" />
<description>
Emitted when BTPlayer has finished updating/ticking the tree.
Emitted when BTPlayer has finished the behavior tree update.
Argument [code]p_status[/code] holds the status returned by the behavior tree. See [enum BT.Status].
</description>
</signal>
</signals>
<constants>
<constant name="IDLE" value="0" enum="UpdateMode">
Process tree during the idle process.
Execute behavior tree during the idle process.
</constant>
<constant name="PHYSICS" value="1" enum="UpdateMode">
Process tree during the physics process.
Execute behavior tree during the physics process.
</constant>
<constant name="MANUAL" value="2" enum="UpdateMode">
Tree is processed manually by calling [method update].
Behavior tree is executed manually by calling [method update].
</constant>
</constants>
</class>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTProbability" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that executes child with a given probability.
BT decorator that executes its child task with a given probability.
</brief_description>
<description>
BT decorator that executes child with a given probability defined by [member run_chance].
Returns the result of the child task if it was executed, otherwise returns [code]FAILURE[/code].
BTProbability executes its child task with a given probability defined by [member run_chance].
Returns the result of the child task if it was executed; otherwise, it returns [code]FAILURE[/code].
</description>
<tutorials>
</tutorials>

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTRandomWait" inherits="BTAction" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT action that waits for a randomized duration to pass and returns [code]SUCCESS[/code].
BT action that waits for a randomized duration to elapse and then returns [code]SUCCESS[/code].
</brief_description>
<description>
BT action that waits for a randomized duration to pass and returns [code]SUCCESS[/code]. Actual duration is randomized. The minimum wait time is defined by [code]min_duration[/code], and the maximum is defined by [code]max_duration[/code].
BTRandomWait action waits for a randomized duration to elapse and then returns [code]SUCCESS[/code]. The duration is randomized within the specified range, defined by [code]min_duration[/code] and [code]max_duration[/code].
</description>
<tutorials>
</tutorials>
<members>
<member name="max_duration" type="float" setter="set_max_duration" getter="get_max_duration" default="2.0">
Maximum duration to wait.
Maximum duration for the wait.
</member>
<member name="min_duration" type="float" setter="set_min_duration" getter="get_min_duration" default="1.0">
Minimum duration to wait.
Minimum duration for the wait.
</member>
</members>
</class>

View File

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTRepeat" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that repeats its child specified number of [member times].
BT decorator that repeats its child a specified number of [member times].
</brief_description>
<description>
BT decorator that repeats execution of the child task specified number of [member times].
Returns [code]RUNNING[/code] if the child returns [code]RUNNING[/code]. If [member forever] is [code]true[/code], BTRepeat will always return [code]RUNNING[/code].
Returns [code]SUCCESS[/code] when specified number of successfully finished executions is reached. When [member abort_on_failure] is [code]false[/code], [code]FAILURE[/code] status returned by the child is also considered a successfully finished execution.
Returns [code]FAILURE[/code] when [member abort_on_failure] is set and the child returns [code]FAILURE[/code].
BTRepeat iterates its child task a specified number of times, as defined by [member times]. If [member forever] is [code]true[/code], the child's execution will be repeated indefinitely.
Returns [code]RUNNING[/code] if the child task results in [code]RUNNING[/code]. If [member forever] is [code]true[/code], BTRepeat will always return [code]RUNNING[/code].
Returns [code]SUCCESS[/code] if the specified number of successful executions is reached. If [member abort_on_failure] is [code]false[/code], a [code]FAILURE[/code] status returned by the child is also considered a successful execution.
Returns [code]FAILURE[/code] if the child task results in [code]FAILURE[/code] when [member abort_on_failure] is [code]true[/code].
</description>
<tutorials>
</tutorials>
<members>
<member name="abort_on_failure" type="bool" setter="set_abort_on_failure" getter="get_abort_on_failure" default="false">
If [code]false[/code], [code]FAILURE[/code] status returned by the child is also considered a successfully finished execution.
If [code]false[/code], [code]FAILURE[/code] status returned by the child task is also considered as a successful execution.
</member>
<member name="forever" type="bool" setter="set_forever" getter="get_forever" default="false">
If [code]true[/code], the child's execution will be repeated indefinitely, always returning [code]RUNNING[/code].
</member>
<member name="times" type="int" setter="set_times" getter="get_times" default="1">
A number of times to repeat an execution of the child task.
The number of times to repeat execution of the child task.
</member>
</members>
</class>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTRepeatUntilFailure" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that repeats child until [code]FAILURE[/code].
BT decorator that repeats its child task until [code]FAILURE[/code].
</brief_description>
<description>
BT decorator that repeats the child until [code]FAILURE[/code] status is returned.
Returns [code]RUNNING[/code] when the child returns [code]RUNNING[/code] or [code]SUCCESS[/code].
Returns [code]SUCCESS[/code] when the child returns [code]FAILURE[/code].
BTRepeatUntilFailure repeats its child task until it results in [code]FAILURE[/code].
Returns [code]RUNNING[/code] if the child task results in [code]RUNNING[/code] or [code]SUCCESS[/code].
Returns [code]SUCCESS[/code] if the child task results in [code]FAILURE[/code].
</description>
<tutorials>
</tutorials>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTRepeatUntilSuccess" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that repeats child until [code]SUCCESS[/code].
BT decorator that repeats its child task until [code]SUCCESS[/code].
</brief_description>
<description>
BT decorator that repeats the child until [code]SUCCESS[/code] status is returned.
Returns [code]RUNNING[/code] when the child returns [code]RUNNING[/code] or [code]FAILURE[/code].
Returns [code]SUCCESS[/code] when the child returns [code]SUCCESS[/code].
BTRepeatUntilSuccess repeats its child task until it results in [code]SUCCESS[/code].
Returns [code]RUNNING[/code] if the child task results in [code]RUNNING[/code] or [code]FAILURE[/code].
Returns [code]SUCCESS[/code] if the child task results in [code]SUCCESS[/code].
</description>
<tutorials>
</tutorials>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTRunLimit" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that allows child's execution a limited number of times.
BT decorator that restricts the execution of its child a limited number of times.
</brief_description>
<description>
BT decorator that allows child's execution a limited number of times defined by [member run_limit].
Returns [code]FAILURE[/code], if a limit on executions is exceeded. Otherwise, returns child's status.
BTRunLimit restricts the execution of the child task to a maximum number of times, defined by [member run_limit].
Returns [code]FAILURE[/code] if the limit on executions is exceeded; otherwise, it returns the status of the child task.
</description>
<tutorials>
</tutorials>
<members>
<member name="run_limit" type="int" setter="set_run_limit" getter="get_run_limit" default="1">
A limit on number of times the child is allowed to be executed.
The maximum number of times the child is permitted to be executed.
</member>
</members>
</class>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTSetAgentProperty" inherits="BTAction" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT action that assigns a value to agent's property.
BT action that assigns a value to the specified agent's property.
</brief_description>
<description>
BTSetAgentProperty assigns the specified [member value] to the agent's property identified by the [member property] and returns [code]SUCCESS[/code].

View File

@ -4,6 +4,8 @@
BT action that assigns [member value] to the [member variable] and then returns [code]SUCCESS[/code].
</brief_description>
<description>
BTSetVar assigns [member value] to the [member variable] and then returns [code]SUCCESS[/code].
Returns [code]FAILURE[/code] if it fails to set the [member variable].
</description>
<tutorials>
</tutorials>
@ -12,7 +14,7 @@
Parameter that specifies the value to be assigned to the variable.
</member>
<member name="variable" type="String" setter="set_variable" getter="get_variable" default="&quot;&quot;">
Variable name whose value is to be assigned.
Name of the variable to which the value will be assigned.
</member>
</members>
</class>

View File

@ -4,20 +4,19 @@
A state node for [LimboHSM] that hosts a [BehaviorTree].
</brief_description>
<description>
This state node instantiates and executes a [BehaviorTree] resource. Dispatches state machine event, when the task tree returns [code]SUCCESS[/code] or [code]FAILURE[/code]. Event names can be specified by [member success_event] and [member failure_event].
For more information about state machine events see [method LimboState.dispatch].
BTState is a [LimboState] node that manages a [BehaviorTree] to provide behavior logic for the state. It instantiates and runs the [BehaviorTree] resource, dispatching a state machine event upon [code]SUCCESS[/code] or [code]FAILURE[/code]. Event names are customizable through [member success_event] and [member failure_event]. For further details on state machine events, see [method LimboState.dispatch].
</description>
<tutorials>
</tutorials>
<members>
<member name="behavior_tree" type="BehaviorTree" setter="set_behavior_tree" getter="get_behavior_tree">
A [BehaviorTree] resource that contains state behavior.
A [BehaviorTree] resource that defines state behavior.
</member>
<member name="failure_event" type="String" setter="set_failure_event" getter="get_failure_event" default="&quot;failure&quot;">
HSM event that will be dispatched when the behavior tree returns [code]FAILURE[/code].
HSM event that will be dispatched when the behavior tree results in [code]FAILURE[/code]. See [method LimboState.dispatch].
</member>
<member name="success_event" type="String" setter="set_success_event" getter="get_success_event" default="&quot;success&quot;">
HSM event that will be dispatched when the behavior tree returns [code]SUCCESS[/code].
HSM event that will be dispatched when the behavior tree results in [code]SUCCESS[/code]. See [method LimboState.dispatch].
</member>
</members>
</class>

View File

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTStopAnimation" inherits="BTAction" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT action that stops playback of an animation on the specified [AnimationPlayer] node.
BT action that stops the playback of an animation on the specified [AnimationPlayer] node.
</brief_description>
<description>
BTStopAnimation action stops playback of an animation on the specified [AnimationPlayer] node and returns [code]SUCCESS[/code]. If [member animation_name] is set, it will only stop playback if the specified animation is currently playing.
Returns [code]FAILURE[/code] if the action fails to acquire [AnimationPlayer] node.
BTStopAnimation action stops the playback of an animation on the specified [AnimationPlayer] node and returns [code]SUCCESS[/code]. If [member animation_name] is set, it will only stop the playback if the specified animation is currently playing.
Returns [code]FAILURE[/code] if the action fails to get the [AnimationPlayer] node.
</description>
<tutorials>
</tutorials>
<members>
<member name="animation_name" type="StringName" setter="set_animation_name" getter="get_animation_name" default="&amp;&quot;&quot;">
Animation's key within the [AnimationPlayer] node. If not empty, BTStopAnimation will only stop playback if the specified animation is currently playing.
Animation's key within the [AnimationPlayer] node. If not empty, BTStopAnimation will only stop the playback if the specified animation is currently playing.
</member>
<member name="animation_player" type="BBNode" setter="set_animation_player" getter="get_animation_player">
Parameter that specifies the [AnimationPlayer] node.

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTSubtree" inherits="BTNewScope" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that instantiates a subtree.
BT decorator that instantiates and runs a subtree within the larger tree.
</brief_description>
<description>
Instantiates a behavior tree as a child of this task during initialization and creates a new [Blackboard] scope.
Returns status of the child execution.
BTSubtree instantiates a [BehaviorTree] and includes its root task as a child during initialization, while also creating a new [Blackboard] scope.
Returns the status of the subtree's execution.
</description>
<tutorials>
</tutorials>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTTask" inherits="BT" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
Base class for [BehaviorTree] tasks.
Base class for all [BehaviorTree] tasks.
</brief_description>
<description>
Base class for all [BehaviorTree] tasks. A task is a building block in a [BehaviorTree] that represents a specific behavior or control flow. It is the basic unit of the Behavior Tree (BT) and is used to create complex behaviors by combining and nesting tasks in a hierarchy.
Tasks perform work and return their status with [method _tick]. See [enum BT.Status].
A Task can be an action, a condition, a composite, or a decorator. Each type of task has its own corresponding subclass: [BTAction], [BTCondition], [BTDecorator], [BTComposite].
[b]Note:[/b] Do not extend [code]BTTask[/code] directly for your own tasks, instead extend one of the subtypes above.
Base class for all [BehaviorTree] tasks. A task is a basic building block in a [BehaviorTree] that represents a specific behavior or control flow. Tasks are used to create complex behaviors by combining and nesting them in a hierarchy.
A task can be one of the following types: action, condition, composite, or decorator. Each type of task has its own corresponding subclass: [BTAction], [BTCondition], [BTDecorator], [BTComposite].
Tasks perform their work and return their status using the [method _tick] method. Status values are defined in [enum BT.Status]. Tasks can be initialized using the [method _setup] method. See also [method _enter] &amp; [method _exit].
[b]Note:[/b] Do not extend [code]BTTask[/code] directly for your own tasks. Instead, extend one of the subtypes mentioned above.
</description>
<tutorials>
</tutorials>
@ -15,41 +15,47 @@
<method name="_enter" qualifiers="virtual">
<return type="void" />
<description>
Called when task is "entered", i.e. when task is executed while not having a [constant BT.RUNNING] [member status].
It is called before [method _tick] in the execution order. This method is used when preparation is needed before main work begins, usually when it takes more than one tick to finish the task.
Called when task is "entered", i.e. when task is executed while not having a [code]RUNNING[/code] [member status].
It is called before [method _tick] in the execution order. This method is used when preparation is needed before main work begins, usually when it takes more than one tick to finish the task. See also [method execute].
</description>
</method>
<method name="_exit" qualifiers="virtual">
<return type="void" />
<description>
Called when task is "exited", i.e. after [method _tick] returns [constant BT.SUCCESS] or [constant BT.FAILURE] status.
Called when task is "exited", i.e. after [method _tick] returns [code]SUCCESS[/code] or [code]FAILURE[/code] status. See also [method execute].
</description>
</method>
<method name="_generate_name" qualifiers="virtual const">
<return type="String" />
<description>
When [member custom_name] is empty, the string returned by this method is used to display the task by the editor. See [method get_task_name].
Called to generate a display name for the task unless [member custom_name] is set. See [method get_task_name].
</description>
</method>
<method name="_get_configuration_warning" qualifiers="virtual const">
<return type="PackedStringArray" />
<description>
The string returned by this method is displayed as a warning in the BT editor if the script that overrides it is a [code]tool[/code] script.
The string returned by this method is shown as a warning message in the behavior tree editor. Any task script that overrides this method must include [code]@tool[/code] annotation at the top of the file.
</description>
</method>
<method name="_setup" qualifiers="virtual">
<return type="void" />
<description>
Called when task is initialized during behavior tree initialization.
Called to initialize a task during initialization step. It is called only once before the task's first execution tick. This method allows you to set up any necessary state or configurations for the task before it begins executing.
</description>
</method>
<method name="_tick" qualifiers="virtual">
<return type="int" enum="BT.Status" />
<param index="0" name="p_delta" type="float" />
<description>
Called when task is "ticked", i.e. executed by [BTPlayer] or [BTState] during update.
Returns [enum BT.Status].
*Note:* Tasks perform their main function by implementing this method.
Called when task is "ticked", i.e. executed by [BTPlayer] or [BTState] during an update.
Returns execution status as defined in [enum BT.Status].
[b]Note:[/b] Tasks perform their main function by implementing this method.
</description>
</method>
<method name="abort">
<return type="void" />
<description>
Resets the task and its children recursively. If a task is in the [code]RUNNING[/code] state, it is exited and its status is reset to [code]FRESH[/code].
</description>
</method>
<method name="add_child">
@ -70,21 +76,24 @@
<method name="clone" qualifiers="const">
<return type="BTTask" />
<description>
Clones the task and its children with the exported members copied. Sub-resources are shared for efficiency, except for [BBParam] subtypes, which are always copied.
Duplicates the task and its children, copying the exported members. Sub-resources are shared for efficiency, except for [BBParam] subtypes, which are always copied. Used by the editor to instantiate [BehaviorTree] and copy-paste tasks.
</description>
</method>
<method name="execute">
<return type="int" enum="BT.Status" />
<param index="0" name="p_delta" type="float" />
<description>
Performs task's execution. During execution [method _enter] is called first, unless current task [member status] is [code]RUNNING[/code]. [method _tick] is called next to perform task's main function. If [constant BT.SUCCESS] or [constant BT.FAILURE] status is returned by [method _tick], [method _exit] will be called next.
Performs task's execution. The execution follows a specific sequence:
- If task's current [member status] is not [code]RUNNING[/code], the [method _enter] method is called first.
- Next, the [method _tick] method is called next to perform the task's work.
- If the [method _tick] method returns [code]SUCCESS[/code] or [code]FAILURE[/code] status, the [method _exit] method will be called next as part of the execution cleanup.
</description>
</method>
<method name="get_child" qualifiers="const">
<return type="BTTask" />
<param index="0" name="p_idx" type="int" />
<description>
Returns a child task by its index.
Returns a child task by specifying its index.
</description>
</method>
<method name="get_child_count" qualifiers="const">
@ -109,7 +118,7 @@
<method name="get_parent" qualifiers="const">
<return type="BTTask" />
<description>
Returns task's parent.
Returns the task's parent.
</description>
</method>
<method name="get_root" qualifiers="const">
@ -122,7 +131,7 @@
<return type="String" />
<description>
The string returned by this method is used to represent the task in the editor.
[member custom_name] value is returned when it is not empty. Otherwise, the string constructed by [method _generate_name] is returned instead.
Method [method _generate_name] is called to generate a display name for the task unless [member custom_name] is set.
</description>
</method>
<method name="has_child" qualifiers="const">
@ -145,19 +154,19 @@
<return type="bool" />
<param index="0" name="p_task" type="BTTask" />
<description>
Returns [code]true[/code] if this task is descendant of [code]p_task[/code]. I.e. this task must be a child of [code]p_task[/code] or one of its children or grandchildren.
Returns [code]true[/code] if this task is a descendant of [code]p_task[/code]. In other words, this task must be a child of [code]p_task[/code] or one of its children or grandchildren.
</description>
</method>
<method name="is_root" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if this task is the root task of the tree. A behavior tree can have only one root task.
Returns [code]true[/code] if this task is the root task of its behavior tree. A behavior tree can have only one root task.
</description>
</method>
<method name="next_sibling" qualifiers="const">
<return type="BTTask" />
<description>
Returns the next task after this task in the children list of the parent.
Returns the next task after this task in the parent's children list.
Returns [code]null[/code] if this task has no parent or it is the last child in the parent's children list.
</description>
</method>
@ -165,7 +174,7 @@
<return type="void" />
<param index="0" name="p_initial_tabs" type="int" default="0" />
<description>
Prints the subtree that starts with this task to console.
Prints the subtree that starts with this task to the console.
</description>
</method>
<method name="remove_child">
@ -179,24 +188,24 @@
<return type="void" />
<param index="0" name="p_idx" type="int" />
<description>
Removes a child task by index.
Removes a child task at a specified index from children.
</description>
</method>
</methods>
<members>
<member name="agent" type="Node" setter="set_agent" getter="get_agent">
The agent is a contextual object for the task's behavior tree instance. Usually, agent is the owner of a node with the [BehaviorTree] resource.
The agent is a contextual object for the task's [BehaviorTree] instance. Usually, agent is the owner of the [BTPlayer] node containing the [BehaviorTree] resource.
</member>
<member name="blackboard" type="Blackboard" setter="" getter="get_blackboard">
Provides access to the blackboard for this task and behavior tree. Blackboard is used to share data among tasks of the associated behavior tree.
Provides access to the [Blackboard]. Blackboard is used to share data among tasks of the associated [BehaviorTree].
See [Blackboard] for additional info.
</member>
<member name="custom_name" type="String" setter="set_custom_name" getter="get_custom_name" default="&quot;&quot;">
User provided name for the task. If not empty, [code]custom_name[/code] is used by the editor to display the task. See [method get_task_name].
User-provided name for the task. If not empty, [code]custom_name[/code] is used by the editor to represent the task. See [method get_task_name].
</member>
<member name="elapsed_time" type="float" setter="" getter="get_elapsed_time">
Elapsed time since the task was entered.
Returns 0 when task is not [code]RUNNING[/code].
Elapsed time since the task was "entered". See [method _enter].
Returns [code]0[/code] when task is not [code]RUNNING[/code].
</member>
<member name="status" type="int" setter="" getter="get_status" enum="BT.Status">
Last execution [enum BT.Status] returned by [method _tick].

View File

@ -1,16 +1,17 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTTimeLimit" inherits="BTDecorator" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT decorator that allots a limited time for child's execution.
BT decorator that sets a time limit for its child's execution.
</brief_description>
<description>
BT decorator that allots a limited time for child's execution. Cancels execution and returns [code]FAILURE[/code] if [member time_limit] is exceeded.
BTTimeLimit allocates a limited time for the child's execution and aborts it, returning [code]FAILURE[/code] if the [member time_limit] is exceeded.
Returns [code]FAILURE[/code] if the [member time_limit] is exceeded; otherwise, it returns the status of the child task.
</description>
<tutorials>
</tutorials>
<members>
<member name="time_limit" type="float" setter="set_time_limit" getter="get_time_limit" default="5.0">
Time allotted for a child task's execution.
Time allocated for the child task's execution.
</member>
</members>
</class>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTWait" inherits="BTAction" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT action that waits for a [member duration] to pass and then returns [code]SUCCESS[/code].
BT action that waits for a specified [member duration] to elapse and then returns [code]SUCCESS[/code].
</brief_description>
<description>
</description>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="BTWaitTicks" inherits="BTAction" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
BT action that waits for a specified number of ticks to pass and then returns [code]SUCCESS[/code].
BT action that waits for a specified number of ticks to elapse and then returns [code]SUCCESS[/code].
</brief_description>
<description>
</description>
@ -9,7 +9,7 @@
</tutorials>
<members>
<member name="num_ticks" type="int" setter="set_num_ticks" getter="get_num_ticks" default="1">
Number of ticks to wait before returning [code]SUCCESS[/code].
The number of ticks to wait before returning [code]SUCCESS[/code].
</member>
</members>
</class>

View File

@ -4,8 +4,13 @@
Contains Behavior Tree data.
</brief_description>
<description>
[BehaviorTree] is a hierarchical structure used to model and control the behavior of agents in a game. It is composed of tasks that represent specific actions or decision-making rules. The [BehaviorTree] is executed from the root task down to the leaf tasks, which represent the actual actions or behaviors that the agent should perform.
See also [BTTask] class.
Behavior Trees are hierarchical structures used to model and control the behavior of agents in a game (e.g., characters, enemies, entities). They are designed to make it easier to create complex and highly modular behaviors for your games.
Behavior Trees are composed of tasks that represent specific actions or decision-making rules. Tasks can be broadly categorized into two main types: control tasks and leaf tasks. Control tasks determine the execution flow within the tree. They include [BTSequence], [BTSelector], and [BTInvert]. Leaf tasks represent specific actions to perform, like moving or attacking, or conditions that need to be checked. The [BTTask] class provides the foundation for various building blocks of the Behavior Trees. BT tasks can share data with the help of [Blackboard]. See [member BTTask.blackboard] and [Blackboard].
[b]Note:[/b] To create your own actions, extend the [BTAction] class.
The BehaviorTree is executed from the root task and follows the rules specified by the control tasks, all the way down to the leaf tasks, which represent the actual actions that the agent should perform or conditions that should be checked. Each task returns a status when it is executed. It can be [code]SUCCESS[/code], [code]RUNNING[/code], or [code]FAILURE[/code]. These statuses determine how the tree progresses. They are defined in [enum BT.Status].
Behavior Trees handle conditional logic using condition tasks. These tasks check for specific conditions and return either [code]SUCCESS[/code] or [code]FAILURE[/code] based on the state of the agent or its environment (e.g., "IsLowOnHealth", "IsTargetInSight"). Conditions can be used together with [BTSequence] and [BTSelector] to craft your decision-making logic.
[b]Note[/b]: To create your own conditions, extend the [BTCondition] class.
Check out the [BTTask] class, which provides the foundation for various building blocks of Behavior Trees.
</description>
<tutorials>
</tutorials>
@ -13,13 +18,13 @@
<method name="clone" qualifiers="const">
<return type="BehaviorTree" />
<description>
Makes a copy of behavior tree.
Makes a copy of the BehaviorTree resource.
</description>
</method>
<method name="get_root_task" qualifiers="const">
<return type="BTTask" />
<description>
Returns root task of the [BehaviorTree] resource.
Returns the root task of the BehaviorTree resource.
</description>
</method>
<method name="instantiate" qualifiers="const">
@ -27,20 +32,20 @@
<param index="0" name="p_agent" type="Node" />
<param index="1" name="p_blackboard" type="Blackboard" />
<description>
Instantiates behavior tree and returns the root [BTTask].
Instantiates the Behavior Tree and returns the root [BTTask].
</description>
</method>
<method name="set_root_task">
<return type="void" />
<param index="0" name="p_value" type="BTTask" />
<description>
Assign new root task to [BehaviorTree] resource.
Assigns a new root task to the [BehaviorTree] resource.
</description>
</method>
</methods>
<members>
<member name="description" type="String" setter="set_description" getter="get_description" default="&quot;&quot;">
User-provided description of BehaviorTree.
User-provided description of the BehaviorTree.
</member>
</members>
</class>

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Blackboard" inherits="RefCounted" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A key/value store to hold data shared by BT tasks.
A key/value storage for sharing among [LimboHSM] states and [BehaviorTree] tasks.
</brief_description>
<description>
A key/value store to hold data shared by tasks of a behavior tree.
Blackboard can serve as a parent scope for another blackboard. In this way, if a value is not found in the active scope, a parent scope Blackboard is asked to return a value. A parent scope Blackboard can have its own parent scope. This structure is called Blackboard scope chain. There is no limit on how many Blackboards can take part in a chain. Blackboard never overwrites parent scope values.
A new scope can be created by [BTNewScope] or [BTSubtree] tasks. It is automatically created for any [LimboState] that has a non-empty Blackboard data defined, or for any root [LimboHSM].
Blackboard is where data is stored and shared between states in the [LimboHSM] system and tasks in a [BehaviorTree]. Each state and task in the [BehaviorTree] can access this Blackboard, allowing them to read and write data. This makes it easy to share information between different actions and behaviors.
Blackboard can also act as a parent scope for another Blackboard. If a specific variable is not found in the active scope, it looks in the parent Blackboard to find it. A parent Blackboard can itself have its own parent scope, forming what we call a "blackboard scope chain." Importantly, there is no limit to how many Blackboards can be in this chain, and the Blackboard doesn't modify values in the parent scopes.
New scopes can be created using the [BTNewScope] and [BTSubtree] decorators. Additionally, a new scope is automatically created for any [LimboState] that has defined non-empty Blackboard data or for any root-level [LimboHSM] node.
</description>
<tutorials>
</tutorials>
@ -15,19 +15,19 @@
<return type="void" />
<param index="0" name="p_key" type="Variant" />
<description>
Removes variable by name.
Removes a variable by its name.
</description>
</method>
<method name="get_data" qualifiers="const">
<return type="Dictionary" />
<description>
Returns [Blackboard] data as a [Dictionary].
Returns Blackboard data as a [Dictionary].
</description>
</method>
<method name="get_parent_scope" qualifiers="const">
<return type="Blackboard" />
<description>
Returns a [Blackboard] that serves as a parent scope for this instance.
Returns a Blackboard that serves as the parent scope for this instance.
</description>
</method>
<method name="get_var" qualifiers="const">
@ -42,28 +42,28 @@
<return type="bool" />
<param index="0" name="p_key" type="Variant" />
<description>
Returns [code]true[/code] if Blackboard contains [code]p_key[/code] variable. Parent scope included.
Returns [code]true[/code] if the Blackboard contains the [code]p_key[/code] variable, including the parent scopes.
</description>
</method>
<method name="prefetch_nodepath_vars">
<return type="void" />
<param index="0" name="p_node" type="Node" />
<description>
Replaces NodePath variables in the [Blackboard] with references that are retrieved by calling [method Node.get_node] on a [code]p_node[/code] argument.
If [code]true[/code], any [NodePath] variables in the [Blackboard] are replaced with [Node] references when the tree is instantiated. References are retrieved by calling [method Node.get_node] on the agent instance.
</description>
</method>
<method name="set_data">
<return type="void" />
<param index="0" name="p_data" type="Dictionary" />
<description>
Overrides Blackboard data, discarding anything that was stored at this scope. Use with caution.
Overwrites Blackboard data, replacing any previously stored variables within current scope. Use with caution.
</description>
</method>
<method name="set_parent_scope">
<return type="void" />
<param index="0" name="p_blackboard" type="Blackboard" />
<description>
Sets the parent scope. If a value is not found in the Blackboard's active scope, the parent scope Blackboard will be asked to retrieve it.
Assigns the parent scope. If a value isn't in the current Blackboard scope, it will look in the parent scope Blackboard to find it.
</description>
</method>
<method name="set_var">
@ -71,13 +71,13 @@
<param index="0" name="p_key" type="Variant" />
<param index="1" name="p_value" type="Variant" />
<description>
Sets value of blackboard variable.
Assigns a value to a Blackboard variable.
</description>
</method>
<method name="top" qualifiers="const">
<return type="Blackboard" />
<description>
Returns topmost [Blackboard] in the scope chain.
Returns the topmost [Blackboard] in the scope chain.
</description>
</method>
</methods>

View File

@ -4,8 +4,7 @@
Event-based Hierarchical State Machine (HSM).
</brief_description>
<description>
Event-based Hierarchical State Machine (HSM).
Manages [LimboState] instances and transitions between them. LimboHSM is a [LimboState] itself, and can be a child of another LimboHSM instance.
Event-based Hierarchical State Machine (HSM) that manages [LimboState] instances and facilitates transitions between them. LimboHSM is a [LimboState] in itself and can also serve as a child of another LimboHSM node.
</description>
<tutorials>
</tutorials>
@ -16,19 +15,19 @@
<param index="1" name="p_to_state" type="Node" />
<param index="2" name="p_event" type="String" />
<description>
Adds a transition from one state to another when [code]p_event[/code] is dispatched.
Establishes a transition from one state to another when [code]p_event[/code] is dispatched. Both [code]p_from_state[/code] and [code]p_to_state[/code] must be immediate children of this state.
</description>
</method>
<method name="get_active_state" qualifiers="const">
<return type="LimboState" />
<description>
Returns active state.
Returns the currently active substate.
</description>
</method>
<method name="get_leaf_state" qualifiers="const">
<return type="LimboState" />
<description>
Returns the leaf state that is currently active in HSM.
Returns the currently active leaf state within the state machine.
</description>
</method>
<method name="initialize">
@ -36,53 +35,52 @@
<param index="0" name="p_agent" type="Node" />
<param index="1" name="p_parent_scope" type="Blackboard" default="null" />
<description>
Initializes state and calls [code]_setup[/code] for itself and every substate.
Initiates the state and calls [code]_setup[/code] for both itself and all substates.
</description>
</method>
<method name="set_active">
<return type="void" />
<param index="0" name="p_active" type="bool" />
<description>
If [code]true[/code], changes state to [member initial_state] and enables state processing depending on [member update_mode].
When set to [code]true[/code], switches the state to [member initial_state] and activates state processing according to [member update_mode].
</description>
</method>
<method name="update">
<return type="void" />
<param index="0" name="p_delta" type="float" />
<description>
Calls [method LimboState._update] on itself and on the active substate. Call propagates down to the leaf state.
It is called automatically, if [member update_mode] is not set to [constant MANUAL].
Calls [method LimboState._update] on itself and the active substate, with the call cascading down to the leaf state. This method is automatically triggered if [member update_mode] is not set to [constant MANUAL].
</description>
</method>
</methods>
<members>
<member name="ANYSTATE" type="LimboState" setter="" getter="anystate">
Useful to define a transition from any state.
Useful for defining a transition from any state.
</member>
<member name="initial_state" type="LimboState" setter="set_initial_state" getter="get_initial_state">
A state that becomes active when state machine is activated by [method set_active] method.
The substate that becomes active when the state machine is activated using the [method set_active] method. If not explicitly set, the first child of the LimboHSM will be considered the initial state.
</member>
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="LimboHSM.UpdateMode" default="1">
Determines when state machine is updated. See [enum UpdateMode].
Specifies when the state machine should be updated. See [enum UpdateMode].
</member>
</members>
<signals>
<signal name="state_changed">
<param index="0" name="p_state" type="LimboState" />
<description>
Emitted when state is changed.
Emitted when the currently active substate is switched to a different substate.
</description>
</signal>
</signals>
<constants>
<constant name="IDLE" value="0" enum="UpdateMode">
Update state machine during idle process.
Update the state machine during the idle process.
</constant>
<constant name="PHYSICS" value="1" enum="UpdateMode">
Update state machine during physics process.
Update the state machine during the physics process.
</constant>
<constant name="MANUAL" value="2" enum="UpdateMode">
Update state machine manually by calling [method update] from a script.
Manually update the state machine by calling [method update] from a script.
</constant>
</constants>
</class>

View File

@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="LimboState" inherits="Node" version="4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
<brief_description>
A State node for Hierarchical State Machine (HSM).
A state node for Hierarchical State Machines (HSM).
</brief_description>
<description>
A LimboAI state node for Hierarchical State Machines (HSM).
You can create your state behavior by extending this class. To implement your state logic, you can override [method _enter], [method _exit], [method _setup], and [method _update]. Alternatively, you can delegate state implementation to external methods using the [code]call_on_*[/code] methods.
For additional details on state machines, refer to [LimboHSM].
</description>
<tutorials>
</tutorials>
@ -11,26 +14,26 @@
<method name="_enter" qualifiers="virtual">
<return type="void" />
<description>
Called when state is entered.
Called when the state is entered.
</description>
</method>
<method name="_exit" qualifiers="virtual">
<return type="void" />
<description>
Called when state is exited.
Called when the state is exited.
</description>
</method>
<method name="_setup" qualifiers="virtual">
<return type="void" />
<description>
Called once during intialization.
Called once during initialization. Use this method to initialize your state.
</description>
</method>
<method name="_update" qualifiers="virtual">
<return type="void" />
<param index="0" name="p_delta" type="float" />
<description>
Called during update.
Called during the update. Implement your state's behavior with this method.
</description>
</method>
<method name="add_event_handler">
@ -38,34 +41,34 @@
<param index="0" name="p_event" type="String" />
<param index="1" name="p_handler" type="Callable" />
<description>
Register [code]p_method[/code] that will be called when [code]p_event[/code] happens. Method must belong to the state.
Registers a [code]p_method[/code] to be called when [code]p_event[/code] is dispatched. The method must belong to the state.
</description>
</method>
<method name="call_on_enter">
<return type="LimboState" />
<param index="0" name="p_callable" type="Callable" />
<description>
A chained method that connects [signal entered] signal to a [code]p_method[/code] on a [p_object].
A chained method that connects the [signal entered] signal to a [code]p_callable[/code].
</description>
</method>
<method name="call_on_exit">
<return type="LimboState" />
<param index="0" name="p_callable" type="Callable" />
<description>
A chained method that connects [signal exited] signal to a [code]p_method[/code] on a [p_object].
A chained method that connects the [signal exited] signal to a [code]p_callable[/code].
</description>
</method>
<method name="call_on_update">
<return type="LimboState" />
<param index="0" name="p_callable" type="Callable" />
<description>
A chained method that connects [signal updated] signal to a [code]p_method[/code] on a [p_object].
A chained method that connects the [signal updated] signal to a [code]p_callable[/code].
</description>
</method>
<method name="clear_guard">
<return type="void" />
<description>
Removes state's guard function that was set by [method set_guard].
Clears the guard function, removing the [Callable] previously set by [method set_guard].
</description>
</method>
<method name="dispatch">
@ -73,8 +76,8 @@
<param index="0" name="p_event" type="String" />
<param index="1" name="p_cargo" type="Variant" default="null" />
<description>
Dispatches recursively a state machine event named [code]p_event[/code] with an optional argument [code]p_cargo[/code]. Returns [code]true[/code] if event was consumed.
Events propagate from the leaf state to the root. Propagation stops as soon as some state consumes the event. States will consume event if they have a transition associated with it, or an event handler. See also [method add_event_handler].
Recursively dispatches a state machine event named [code]p_event[/code] with an optional argument [code]p_cargo[/code]. Returns [code]true[/code] if the event was consumed.
Events propagate from the leaf state to the root state, and propagation stops as soon as any state consumes the event. States will consume the event if they have a related transition or event handler. For more information on event handlers, see [method add_event_handler].
</description>
</method>
<method name="get_root" qualifiers="const">
@ -86,33 +89,33 @@
<method name="is_active" qualifiers="const">
<return type="bool" />
<description>
Returns [code]true[/code] if it is currently active, i.e. it is the active substate of the parent [LimboHSM].
Returns [code]true[/code] if it is currently active, meaning it is the active substate of the parent [LimboHSM].
</description>
</method>
<method name="named">
<return type="LimboState" />
<param index="0" name="p_name" type="String" />
<description>
A chained method that sets the name of this state.
A chained method for setting the name of this state.
</description>
</method>
<method name="set_guard">
<return type="void" />
<param index="0" name="p_guard_callable" type="Callable" />
<description>
Sets the guard function. It is a function that will be called each time a transition to this state should happen. If that function returns [code]false[/code], the transition will not be allowed.
Sets the guard function, which is a function called each time a transition to this state is considered. If the function returns [code]false[/code], the transition will be disallowed.
</description>
</method>
</methods>
<members>
<member name="EVENT_FINISHED" type="String" setter="" getter="event_finished">
A commonly used event that signifies that the state has finished work.
A commonly used event that indicates that the state has finished its work.
</member>
<member name="agent" type="Node" setter="set_agent" getter="get_agent">
An agent that is associated with the state. Assinged by initialization.
An agent associated with the state, assigned during initialization.
</member>
<member name="blackboard" type="Blackboard" setter="" getter="get_blackboard">
A key/value data store shared by states of the state machine this state belongs to.
A key/value data store shared by states within the state machine to which this state belongs.
</member>
</members>
<signals>

View File

@ -12,36 +12,42 @@
<return type="String" />
<param index="0" name="p_variable" type="String" />
<description>
Returns a string with a [Blackboard] variable name ready to be displayed or printed to console.
Produces a string with a [Blackboard] variable name that is formatted for display or console output.
</description>
</method>
<method name="get_status_name" qualifiers="const">
<return type="String" />
<param index="0" name="p_status" type="int" />
<description>
Returns name of a [BTTask] status code.
Returns a name of a [BTTask] status code.
</description>
</method>
<method name="get_task_icon" qualifiers="const">
<return type="Texture2D" />
<param index="0" name="p_class_or_script_path" type="String" />
<description>
Returns the icon texture associated with a task, given its class name or script resource path.
Returns the icon texture associated with a task based on its class name or script resource path.
</description>
</method>
</methods>
<constants>
<constant name="CHECK_EQUAL" value="0" enum="CheckType">
Equality Check.
</constant>
<constant name="CHECK_LESS_THAN" value="1" enum="CheckType">
Less Than Check.
</constant>
<constant name="CHECK_LESS_THAN_OR_EQUAL" value="2" enum="CheckType">
Less Than or Equal To Check.
</constant>
<constant name="CHECK_GREATER_THAN" value="3" enum="CheckType">
Greater Than Check.
</constant>
<constant name="CHECK_GREATER_THAN_OR_EQUAL" value="4" enum="CheckType">
Greater Than or Equal To Check
</constant>
<constant name="CHECK_NOT_EQUAL" value="5" enum="CheckType">
Inequality Check.
</constant>
</constants>
</class>

View File

@ -479,6 +479,10 @@ void LimboAIEditor::_probability_popup_closed() {
void LimboAIEditor::_misc_option_selected(int p_id) {
switch (p_id) {
case MISC_INTRODUCTION: {
ScriptEditor::get_singleton()->goto_help("class_name:BehaviorTree");
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
} break;
case MISC_OPEN_DEBUGGER: {
ERR_FAIL_COND(LimboDebuggerPlugin::get_singleton() == nullptr);
if (LimboDebuggerPlugin::get_singleton()->get_session_tab()->get_window_enabled()) {
@ -540,7 +544,6 @@ void LimboAIEditor::_misc_option_selected(int p_id) {
}
ScriptEditor::get_singleton()->open_file(template_path);
} break;
}
}
@ -746,6 +749,9 @@ void LimboAIEditor::_update_misc_menu() {
misc_menu->clear();
misc_menu->add_icon_item(theme_cache.open_doc_icon, TTR("Introduction"), MISC_INTRODUCTION);
misc_menu->add_separator();
misc_menu->add_icon_shortcut(theme_cache.open_debugger_icon, ED_GET_SHORTCUT("limbo_ai/open_debugger"), MISC_OPEN_DEBUGGER);
misc_menu->add_item(TTR("Project Settings..."), MISC_PROJECT_SETTINGS);

View File

@ -53,6 +53,7 @@ private:
};
enum MiscMenu {
MISC_INTRODUCTION,
MISC_OPEN_DEBUGGER,
MISC_PROJECT_SETTINGS,
MISC_CREATE_SCRIPT_TEMPLATE,

View File

@ -185,7 +185,7 @@ TEST_CASE("[Modules][LimboAI] BTTask") {
CHECK(task->get_elapsed_time() == 0.0);
}
SUBCASE("When cancelled") {
task->cancel();
task->abort();
CHECK(task->get_elapsed_time() == 0.0);
}
}

View File

@ -102,7 +102,7 @@ TEST_CASE("[Modules][LimboAI] BTRandomWait") {
num_undefined += 1;
} break;
}
wait->cancel();
wait->abort();
}
// * Expected ~500/500 SUCCESS/RUNNING.