From 9344bce9b1b0ed71ef55ba820787e6a89298db5e Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 10 Apr 2023 16:57:36 +0200 Subject: [PATCH] Update and improve class documentation --- doc_classes/BBAabb.xml | 8 +--- doc_classes/BBArray.xml | 8 +--- doc_classes/BBBasis.xml | 8 +--- doc_classes/BBBool.xml | 6 +-- doc_classes/BBByteArray.xml | 8 +--- doc_classes/BBColor.xml | 8 +--- doc_classes/BBColorArray.xml | 9 ++--- doc_classes/BBDictionary.xml | 6 +-- doc_classes/BBFloat.xml | 6 +-- doc_classes/BBFloatArray.xml | 12 ++++++ doc_classes/BBInt.xml | 9 +---- doc_classes/BBIntArray.xml | 8 +--- doc_classes/BBNode.xml | 6 +-- doc_classes/BBParam.xml | 10 ++--- doc_classes/BBPlane.xml | 8 +--- doc_classes/BBQuat.xml | 17 --------- doc_classes/BBQuaternion.xml | 12 ++++++ doc_classes/BBRealArray.xml | 17 --------- doc_classes/BBRect2.xml | 8 +--- doc_classes/BBRect2i.xml | 12 ++++++ doc_classes/BBString.xml | 6 +-- doc_classes/BBStringArray.xml | 8 +--- doc_classes/BBStringName.xml | 12 ++++++ doc_classes/BBTransform.xml | 17 --------- doc_classes/BBTransform2D.xml | 8 +--- doc_classes/BBTransform3D.xml | 12 ++++++ doc_classes/BBVariant.xml | 6 +-- doc_classes/BBVector2.xml | 8 +--- doc_classes/BBVector2Array.xml | 8 +--- doc_classes/BBVector2i.xml | 12 ++++++ doc_classes/BBVector3.xml | 8 +--- doc_classes/BBVector3Array.xml | 8 +--- doc_classes/BBVector3i.xml | 12 ++++++ doc_classes/BBVector4.xml | 12 ++++++ doc_classes/BBVector4i.xml | 12 ++++++ doc_classes/BTAction.xml | 9 ++--- doc_classes/BTAlwaysFail.xml | 6 +-- doc_classes/BTAlwaysSucceed.xml | 6 +-- doc_classes/BTComposite.xml | 8 +--- doc_classes/BTCondition.xml | 11 ++---- doc_classes/BTConsolePrint.xml | 9 +---- doc_classes/BTCooldown.xml | 6 +-- doc_classes/BTDecorator.xml | 9 ++--- doc_classes/BTDelay.xml | 6 +-- doc_classes/BTDynamicSelector.xml | 6 +-- doc_classes/BTDynamicSequence.xml | 6 +-- doc_classes/BTFail.xml | 6 +-- doc_classes/BTForEach.xml | 6 +-- doc_classes/BTInvert.xml | 6 +-- doc_classes/BTNewScope.xml | 6 +-- doc_classes/BTParallel.xml | 6 +-- doc_classes/BTPlayer.xml | 21 ++++++----- doc_classes/BTProbability.xml | 6 +-- doc_classes/BTRandomSelector.xml | 6 +-- doc_classes/BTRandomSequence.xml | 6 +-- doc_classes/BTRandomWait.xml | 14 +++---- doc_classes/BTRepeat.xml | 6 +-- doc_classes/BTRepeatUntilFailure.xml | 6 +-- doc_classes/BTRepeatUntilSuccess.xml | 6 +-- doc_classes/BTRunLimit.xml | 6 +-- doc_classes/BTSelector.xml | 6 +-- doc_classes/BTSequence.xml | 6 +-- doc_classes/BTState.xml | 11 ++---- doc_classes/BTSubtree.xml | 7 +--- doc_classes/BTTask.xml | 55 +++++++++++++++------------- doc_classes/BTTimeLimit.xml | 6 +-- doc_classes/BTWait.xml | 6 +-- doc_classes/BTWaitTicks.xml | 6 +-- doc_classes/BehaviorTree.xml | 30 ++++++++------- doc_classes/Blackboard.xml | 33 +++++++++++------ doc_classes/LimboHSM.xml | 20 +++++----- doc_classes/LimboState.xml | 43 +++++++++------------- doc_classes/LimboUtility.xml | 8 ++-- editor/limbo_ai_editor_plugin.cpp | 2 + 74 files changed, 313 insertions(+), 450 deletions(-) create mode 100644 doc_classes/BBFloatArray.xml delete mode 100644 doc_classes/BBQuat.xml create mode 100644 doc_classes/BBQuaternion.xml delete mode 100644 doc_classes/BBRealArray.xml create mode 100644 doc_classes/BBRect2i.xml create mode 100644 doc_classes/BBStringName.xml delete mode 100644 doc_classes/BBTransform.xml create mode 100644 doc_classes/BBTransform3D.xml create mode 100644 doc_classes/BBVector2i.xml create mode 100644 doc_classes/BBVector3i.xml create mode 100644 doc_classes/BBVector4.xml create mode 100644 doc_classes/BBVector4i.xml diff --git a/doc_classes/BBAabb.xml b/doc_classes/BBAabb.xml index d7a0616..55c3f88 100644 --- a/doc_classes/BBAabb.xml +++ b/doc_classes/BBAabb.xml @@ -1,5 +1,5 @@ - + AABB-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBArray.xml b/doc_classes/BBArray.xml index cca3a38..66afe7a 100644 --- a/doc_classes/BBArray.xml +++ b/doc_classes/BBArray.xml @@ -1,5 +1,5 @@ - + Array-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBBasis.xml b/doc_classes/BBBasis.xml index 93df8d9..7539fa1 100644 --- a/doc_classes/BBBasis.xml +++ b/doc_classes/BBBasis.xml @@ -1,5 +1,5 @@ - + Basis-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBBool.xml b/doc_classes/BBBool.xml index 2529d38..14c630f 100644 --- a/doc_classes/BBBool.xml +++ b/doc_classes/BBBool.xml @@ -1,5 +1,5 @@ - + Bool-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - - diff --git a/doc_classes/BBByteArray.xml b/doc_classes/BBByteArray.xml index 5a00ad9..d43447d 100644 --- a/doc_classes/BBByteArray.xml +++ b/doc_classes/BBByteArray.xml @@ -1,5 +1,5 @@ - + ByteArray-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBColor.xml b/doc_classes/BBColor.xml index cfe4814..e914c40 100644 --- a/doc_classes/BBColor.xml +++ b/doc_classes/BBColor.xml @@ -1,5 +1,5 @@ - + Color-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBColorArray.xml b/doc_classes/BBColorArray.xml index ece32a6..2be9f14 100644 --- a/doc_classes/BBColorArray.xml +++ b/doc_classes/BBColorArray.xml @@ -1,5 +1,5 @@ - + ColorArray-type parameter to be used with BT tasks. See [BBParam]. @@ -7,8 +7,7 @@ - - - - + + + diff --git a/doc_classes/BBDictionary.xml b/doc_classes/BBDictionary.xml index 9513bfc..69786b8 100644 --- a/doc_classes/BBDictionary.xml +++ b/doc_classes/BBDictionary.xml @@ -1,5 +1,5 @@ - + Dictionary-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - - diff --git a/doc_classes/BBFloat.xml b/doc_classes/BBFloat.xml index 376a510..df9f5a7 100644 --- a/doc_classes/BBFloat.xml +++ b/doc_classes/BBFloat.xml @@ -1,5 +1,5 @@ - + Float-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - - diff --git a/doc_classes/BBFloatArray.xml b/doc_classes/BBFloatArray.xml new file mode 100644 index 0000000..b30355f --- /dev/null +++ b/doc_classes/BBFloatArray.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BBInt.xml b/doc_classes/BBInt.xml index 52057f6..630031c 100644 --- a/doc_classes/BBInt.xml +++ b/doc_classes/BBInt.xml @@ -1,5 +1,5 @@ - + Integer-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,4 @@ - - - - - - - diff --git a/doc_classes/BBIntArray.xml b/doc_classes/BBIntArray.xml index 7dd3f42..765420a 100644 --- a/doc_classes/BBIntArray.xml +++ b/doc_classes/BBIntArray.xml @@ -1,5 +1,5 @@ - + IntArray-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBNode.xml b/doc_classes/BBNode.xml index 23d9e34..c53e9f6 100644 --- a/doc_classes/BBNode.xml +++ b/doc_classes/BBNode.xml @@ -1,5 +1,5 @@ - + Node-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - - diff --git a/doc_classes/BBParam.xml b/doc_classes/BBParam.xml index fb88bee..a1d546d 100644 --- a/doc_classes/BBParam.xml +++ b/doc_classes/BBParam.xml @@ -1,5 +1,5 @@ - + A base class for typed parameters to be used with BT tasks. @@ -19,16 +19,16 @@ - - - + + + Returns value of the parameter. - + 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]. diff --git a/doc_classes/BBPlane.xml b/doc_classes/BBPlane.xml index ec5700c..4cdc40d 100644 --- a/doc_classes/BBPlane.xml +++ b/doc_classes/BBPlane.xml @@ -1,5 +1,5 @@ - + Plane-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBQuat.xml b/doc_classes/BBQuat.xml deleted file mode 100644 index d73ef9a..0000000 --- a/doc_classes/BBQuat.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Quat-type parameter to be used with BT tasks. See [BBParam]. - - - - - - - - - - - - - diff --git a/doc_classes/BBQuaternion.xml b/doc_classes/BBQuaternion.xml new file mode 100644 index 0000000..04cf317 --- /dev/null +++ b/doc_classes/BBQuaternion.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BBRealArray.xml b/doc_classes/BBRealArray.xml deleted file mode 100644 index e59daad..0000000 --- a/doc_classes/BBRealArray.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - RealArray-type parameter to be used with BT tasks. See [BBParam]. - - - - - - - - - - - - - diff --git a/doc_classes/BBRect2.xml b/doc_classes/BBRect2.xml index 1d6ea5b..4105dc4 100644 --- a/doc_classes/BBRect2.xml +++ b/doc_classes/BBRect2.xml @@ -1,5 +1,5 @@ - + Rect2-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBRect2i.xml b/doc_classes/BBRect2i.xml new file mode 100644 index 0000000..f0551d6 --- /dev/null +++ b/doc_classes/BBRect2i.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BBString.xml b/doc_classes/BBString.xml index ba75e9b..96829aa 100644 --- a/doc_classes/BBString.xml +++ b/doc_classes/BBString.xml @@ -1,5 +1,5 @@ - + String-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - - diff --git a/doc_classes/BBStringArray.xml b/doc_classes/BBStringArray.xml index 103fc9d..11e1186 100644 --- a/doc_classes/BBStringArray.xml +++ b/doc_classes/BBStringArray.xml @@ -1,5 +1,5 @@ - + StringArray-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBStringName.xml b/doc_classes/BBStringName.xml new file mode 100644 index 0000000..fbd7676 --- /dev/null +++ b/doc_classes/BBStringName.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BBTransform.xml b/doc_classes/BBTransform.xml deleted file mode 100644 index 84c136d..0000000 --- a/doc_classes/BBTransform.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - Transform-type parameter to be used with BT tasks. See [BBParam]. - - - - - - - - - - - - - diff --git a/doc_classes/BBTransform2D.xml b/doc_classes/BBTransform2D.xml index 9f0d2c5..4496eb4 100644 --- a/doc_classes/BBTransform2D.xml +++ b/doc_classes/BBTransform2D.xml @@ -1,5 +1,5 @@ - + Transform2D-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBTransform3D.xml b/doc_classes/BBTransform3D.xml new file mode 100644 index 0000000..62edc71 --- /dev/null +++ b/doc_classes/BBTransform3D.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BBVariant.xml b/doc_classes/BBVariant.xml index 0451f84..8d3b970 100644 --- a/doc_classes/BBVariant.xml +++ b/doc_classes/BBVariant.xml @@ -1,5 +1,5 @@ - + Variant-type parameter to be used with BT tasks. See [BBParam]. @@ -7,13 +7,9 @@ - - - - diff --git a/doc_classes/BBVector2.xml b/doc_classes/BBVector2.xml index 36ec24d..17e0f51 100644 --- a/doc_classes/BBVector2.xml +++ b/doc_classes/BBVector2.xml @@ -1,5 +1,5 @@ - + Vector2-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBVector2Array.xml b/doc_classes/BBVector2Array.xml index 36d90f5..f762e8b 100644 --- a/doc_classes/BBVector2Array.xml +++ b/doc_classes/BBVector2Array.xml @@ -1,5 +1,5 @@ - + Vector2Array-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBVector2i.xml b/doc_classes/BBVector2i.xml new file mode 100644 index 0000000..1f1c283 --- /dev/null +++ b/doc_classes/BBVector2i.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BBVector3.xml b/doc_classes/BBVector3.xml index b60823a..f670b96 100644 --- a/doc_classes/BBVector3.xml +++ b/doc_classes/BBVector3.xml @@ -1,5 +1,5 @@ - + Vector3-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBVector3Array.xml b/doc_classes/BBVector3Array.xml index fb509d6..27f0509 100644 --- a/doc_classes/BBVector3Array.xml +++ b/doc_classes/BBVector3Array.xml @@ -1,5 +1,5 @@ - + Vector3Array-type parameter to be used with BT tasks. See [BBParam]. @@ -7,11 +7,7 @@ - - - + - - diff --git a/doc_classes/BBVector3i.xml b/doc_classes/BBVector3i.xml new file mode 100644 index 0000000..39c17c7 --- /dev/null +++ b/doc_classes/BBVector3i.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BBVector4.xml b/doc_classes/BBVector4.xml new file mode 100644 index 0000000..9950be3 --- /dev/null +++ b/doc_classes/BBVector4.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BBVector4i.xml b/doc_classes/BBVector4i.xml new file mode 100644 index 0000000..bf854d2 --- /dev/null +++ b/doc_classes/BBVector4i.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/doc_classes/BTAction.xml b/doc_classes/BTAction.xml index b297ec1..3914f6e 100644 --- a/doc_classes/BTAction.xml +++ b/doc_classes/BTAction.xml @@ -1,16 +1,13 @@ - + Base class for BT actions. Base class for all behavior tree actions. Extend [code]BTAction[/code] to create your own actions. - An action 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]. Actions cannot have child tasks. + 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]. - - - - diff --git a/doc_classes/BTAlwaysFail.xml b/doc_classes/BTAlwaysFail.xml index d43ad23..119839a 100644 --- a/doc_classes/BTAlwaysFail.xml +++ b/doc_classes/BTAlwaysFail.xml @@ -1,5 +1,5 @@ - + BT decorator that turns SUCCESS into FAILURE. @@ -7,8 +7,4 @@ - - - - diff --git a/doc_classes/BTAlwaysSucceed.xml b/doc_classes/BTAlwaysSucceed.xml index 86343b5..1707283 100644 --- a/doc_classes/BTAlwaysSucceed.xml +++ b/doc_classes/BTAlwaysSucceed.xml @@ -1,5 +1,5 @@ - + BT decorator that turns FAILURE into SUCCESS. @@ -7,8 +7,4 @@ - - - - diff --git a/doc_classes/BTComposite.xml b/doc_classes/BTComposite.xml index 5cb8482..0e3fa34 100644 --- a/doc_classes/BTComposite.xml +++ b/doc_classes/BTComposite.xml @@ -1,16 +1,12 @@ - + Base class for BT composite tasks. Base class for all behavior tree composite tasks. Extend [code]BTComposite[/code] to create your own. - Composite tasks can have one or more child tasks. A composite task will execute its child tasks in a certain order. Depending on the status returned by a child task, execution either continues to the next task in order or stops and a status is returned to the parent task. + 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]. - - - - diff --git a/doc_classes/BTCondition.xml b/doc_classes/BTCondition.xml index 0ccd0e4..b08a3c3 100644 --- a/doc_classes/BTCondition.xml +++ b/doc_classes/BTCondition.xml @@ -1,16 +1,13 @@ - + Base class for BT conditions. - Base class for all behavior tree conditions. Extend [code]BTCondition[/code] to create your own conditions. - Conditions don't take multiple ticks to finish and return [constant BTTask.SUCCESS] or [constant BTTask.FAILURE] immeditely. + 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 [constant BTTask.SUCCESS] or [constant BTTask.FAILURE] immeditely. - - - - diff --git a/doc_classes/BTConsolePrint.xml b/doc_classes/BTConsolePrint.xml index 5dafbe3..4d3c1df 100644 --- a/doc_classes/BTConsolePrint.xml +++ b/doc_classes/BTConsolePrint.xml @@ -1,5 +1,5 @@ - + BT action task that prints text to console. @@ -8,16 +8,11 @@ - - - - An array with blackboard variables, values of which will serve as format arguments. + 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. - - diff --git a/doc_classes/BTCooldown.xml b/doc_classes/BTCooldown.xml index 4867f3c..1ba2322 100644 --- a/doc_classes/BTCooldown.xml +++ b/doc_classes/BTCooldown.xml @@ -1,5 +1,5 @@ - + BT decorator that executes child only if [member cooldown] time passed since previous execution. @@ -11,8 +11,6 @@ - - Boolean variable to save cooldown state in the [Blackboard]. If empty, the variable will be automatically created and assigned. @@ -32,6 +30,4 @@ Trigger cooldown, if the child returns [code]FAILURE[/code]. - - diff --git a/doc_classes/BTDecorator.xml b/doc_classes/BTDecorator.xml index d173043..f48a78f 100644 --- a/doc_classes/BTDecorator.xml +++ b/doc_classes/BTDecorator.xml @@ -1,16 +1,13 @@ - + Base class for BT decorators. Base class for all behavior tree decorators. Extend [code]BTDecorator[/code] to create your own decorators. - Decorator alters the behavior of its child task in some way. Decorators can only have one child. + 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. - - - - diff --git a/doc_classes/BTDelay.xml b/doc_classes/BTDelay.xml index 533e07c..b2c25f8 100644 --- a/doc_classes/BTDelay.xml +++ b/doc_classes/BTDelay.xml @@ -1,5 +1,5 @@ - + BT decorator that delays execution of its child. @@ -8,13 +8,9 @@ - - Delay duration in seconds. - - diff --git a/doc_classes/BTDynamicSelector.xml b/doc_classes/BTDynamicSelector.xml index b9e7178..71f799f 100644 --- a/doc_classes/BTDynamicSelector.xml +++ b/doc_classes/BTDynamicSelector.xml @@ -1,5 +1,5 @@ - + BT composite that executes tasks from the beginning each tick until first [code]SUCCESS[/code]. @@ -11,8 +11,4 @@ - - - - diff --git a/doc_classes/BTDynamicSequence.xml b/doc_classes/BTDynamicSequence.xml index e911d9e..0b321f7 100644 --- a/doc_classes/BTDynamicSequence.xml +++ b/doc_classes/BTDynamicSequence.xml @@ -1,5 +1,5 @@ - + BT composite that executes tasks from the beginning each tick for as long as they return [code]SUCCESS[/code]. @@ -11,8 +11,4 @@ - - - - diff --git a/doc_classes/BTFail.xml b/doc_classes/BTFail.xml index 9f32575..dabde12 100644 --- a/doc_classes/BTFail.xml +++ b/doc_classes/BTFail.xml @@ -1,5 +1,5 @@ - + BT action that returns FAILURE. @@ -7,8 +7,4 @@ - - - - diff --git a/doc_classes/BTForEach.xml b/doc_classes/BTForEach.xml index 64c3a30..f32ee29 100644 --- a/doc_classes/BTForEach.xml +++ b/doc_classes/BTForEach.xml @@ -1,5 +1,5 @@ - + BT decorator that executes child for each element of an [Array]. @@ -8,8 +8,6 @@ - - An [Array] stored in the [Blackboard] to iterate over. @@ -18,6 +16,4 @@ [Blackboard] variable to store an element of array, referenced by [member array_var]. - - diff --git a/doc_classes/BTInvert.xml b/doc_classes/BTInvert.xml index 5b5dde6..3d931b4 100644 --- a/doc_classes/BTInvert.xml +++ b/doc_classes/BTInvert.xml @@ -1,5 +1,5 @@ - + BT decorator that inverts FAILURE to SUCCESS and SUCCESS to FAILURE. @@ -7,8 +7,4 @@ - - - - diff --git a/doc_classes/BTNewScope.xml b/doc_classes/BTNewScope.xml index f3b5349..998edac 100644 --- a/doc_classes/BTNewScope.xml +++ b/doc_classes/BTNewScope.xml @@ -1,5 +1,5 @@ - + BT decorator that creates a new [Blackboard] scope. @@ -9,13 +9,9 @@ - - Data that is used to populate a new scope of the [Blackboard]. - - diff --git a/doc_classes/BTParallel.xml b/doc_classes/BTParallel.xml index abfe22a..be938b4 100644 --- a/doc_classes/BTParallel.xml +++ b/doc_classes/BTParallel.xml @@ -1,5 +1,5 @@ - + BT composite that executes tasks simultaneously. @@ -12,8 +12,6 @@ - - @@ -22,6 +20,4 @@ - - diff --git a/doc_classes/BTPlayer.xml b/doc_classes/BTPlayer.xml index 1149f0b..0558eb3 100644 --- a/doc_classes/BTPlayer.xml +++ b/doc_classes/BTPlayer.xml @@ -1,5 +1,5 @@ - + Player of [BehaviorTree] resources. @@ -9,6 +9,12 @@ + + + + Returns last execution status. See [enum BTTask.TaskStatus]. + + @@ -17,26 +23,23 @@ - + Assign a [Blackboard] instance. - + 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]. - + If [code]true[/code], tree is active and will be processed. - - If [code]true[/code] player will restart when it finishes executing the tree and receives a [code]SUCCESS[/code] or [code]FAILURE[/code]. - [BehaviorTree] resource to instantiate and process at run time. @@ -46,13 +49,13 @@ 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. - + Defines when BehaviorTree is executed. See [enum UpdateMode]. - + 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. diff --git a/doc_classes/BTProbability.xml b/doc_classes/BTProbability.xml index 74a9d64..a59bd75 100644 --- a/doc_classes/BTProbability.xml +++ b/doc_classes/BTProbability.xml @@ -1,5 +1,5 @@ - + BT decorator that executes child with probability. @@ -8,12 +8,8 @@ - - - - diff --git a/doc_classes/BTRandomSelector.xml b/doc_classes/BTRandomSelector.xml index ad5e8c0..31926e7 100644 --- a/doc_classes/BTRandomSelector.xml +++ b/doc_classes/BTRandomSelector.xml @@ -1,5 +1,5 @@ - + BT composite that executes tasks in random order until first [code]SUCCESS[/code]. @@ -11,8 +11,4 @@ - - - - diff --git a/doc_classes/BTRandomSequence.xml b/doc_classes/BTRandomSequence.xml index 992a0c2..f50c4fe 100644 --- a/doc_classes/BTRandomSequence.xml +++ b/doc_classes/BTRandomSequence.xml @@ -1,5 +1,5 @@ - + BT composite that executes tasks in random order for as long as they return [code]SUCCESS[/code]. @@ -11,8 +11,4 @@ - - - - diff --git a/doc_classes/BTRandomWait.xml b/doc_classes/BTRandomWait.xml index 490b5eb..83229e6 100644 --- a/doc_classes/BTRandomWait.xml +++ b/doc_classes/BTRandomWait.xml @@ -1,19 +1,19 @@ - + BT action that waits for a randomized duration to pass and returns [code]SUCCESS[/code]. - BT action that waits for a randomized duration to pass and returns [code]SUCCESS[/code]. The minimum wait time is defined by [code]duration_min_max.x[/code], and the maximum is defined by [code]duration_min_max.y[/code]. + 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]. - - - + + Maximum duration to wait. + + + Minimum duration to wait. - - diff --git a/doc_classes/BTRepeat.xml b/doc_classes/BTRepeat.xml index 1870895..cd09091 100644 --- a/doc_classes/BTRepeat.xml +++ b/doc_classes/BTRepeat.xml @@ -1,5 +1,5 @@ - + BT decorator that repeats its child specified number of [member times]. @@ -11,8 +11,6 @@ - - If [code]false[/code], [code]FAILURE[/code] status returned by the child is also considered a successfully finished execution. @@ -21,6 +19,4 @@ A number of times to repeat an execution of the child task. - - diff --git a/doc_classes/BTRepeatUntilFailure.xml b/doc_classes/BTRepeatUntilFailure.xml index e00b9dd..dddec38 100644 --- a/doc_classes/BTRepeatUntilFailure.xml +++ b/doc_classes/BTRepeatUntilFailure.xml @@ -1,5 +1,5 @@ - + BT decorator that repeats child until [code]FAILURE[/code]. @@ -10,8 +10,4 @@ - - - - diff --git a/doc_classes/BTRepeatUntilSuccess.xml b/doc_classes/BTRepeatUntilSuccess.xml index 7c08582..1fea8be 100644 --- a/doc_classes/BTRepeatUntilSuccess.xml +++ b/doc_classes/BTRepeatUntilSuccess.xml @@ -1,5 +1,5 @@ - + BT decorator that repeats child until [code]SUCCESS[/code]. @@ -10,8 +10,4 @@ - - - - diff --git a/doc_classes/BTRunLimit.xml b/doc_classes/BTRunLimit.xml index 8f69dd5..14553df 100644 --- a/doc_classes/BTRunLimit.xml +++ b/doc_classes/BTRunLimit.xml @@ -1,5 +1,5 @@ - + BT decorator that allows child's execution a limited number of times. @@ -9,13 +9,9 @@ - - A limit on number of times the child is allowed to be executed. - - diff --git a/doc_classes/BTSelector.xml b/doc_classes/BTSelector.xml index 145e52c..be57ecc 100644 --- a/doc_classes/BTSelector.xml +++ b/doc_classes/BTSelector.xml @@ -1,5 +1,5 @@ - + BT composite that executes tasks in turn until first [code]SUCCESS[/code]. @@ -11,8 +11,4 @@ - - - - diff --git a/doc_classes/BTSequence.xml b/doc_classes/BTSequence.xml index ab0996b..d92e33b 100644 --- a/doc_classes/BTSequence.xml +++ b/doc_classes/BTSequence.xml @@ -1,5 +1,5 @@ - + BT composite that executes tasks in turn for as long as they return [code]SUCCESS[/code]. @@ -11,8 +11,4 @@ - - - - diff --git a/doc_classes/BTState.xml b/doc_classes/BTState.xml index 766666a..7d3f14e 100644 --- a/doc_classes/BTState.xml +++ b/doc_classes/BTState.xml @@ -1,17 +1,14 @@ - + A state node for [LimboHSM] that hosts a [BehaviorTree]. - This state node instantiates an instance of [BehaviorTree] and dispatches events, when the tree returns [code]SUCCESS[/code] or [code]FAILURE[/code]. - When the tree returns [code]SUCCESS[/code], this state dispatches [member success_event]. - When the tree returns [code]FAILURE[/code], this state dispatches [member failure_event]. + 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]. - - A [BehaviorTree] resource that contains state behavior. @@ -23,6 +20,4 @@ HSM event that will be dispatched when the behavior tree returns [code]SUCCESS[/code]. - - diff --git a/doc_classes/BTSubtree.xml b/doc_classes/BTSubtree.xml index 23e0a6a..95260b0 100644 --- a/doc_classes/BTSubtree.xml +++ b/doc_classes/BTSubtree.xml @@ -1,5 +1,5 @@ - + BT decorator that instantiates a subtree. @@ -9,14 +9,9 @@ - - - A [BehaviorTree] resource that will be instantiated as a subtree. - - diff --git a/doc_classes/BTTask.xml b/doc_classes/BTTask.xml index a9ffa31..59b4e9c 100644 --- a/doc_classes/BTTask.xml +++ b/doc_classes/BTTask.xml @@ -1,13 +1,13 @@ - + - Base class for BT tasks. + Base class for [BehaviorTree] tasks. - Base class for all behavior tree tasks. Tasks are arranged in a tree-like structure called behavior tree (BT). + 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 TaskStatus]. - There are several types of tasks: actions, conditions, decorators, and composites. Each type of task has its own corresponding subclass: [BTAction], [BTCondition], [BTDecorator], [BTComposite]. - [b]Note:[/b] Do not inherint [BTTask] directly for your own tasks, instead inherit one of the subtypes above. + 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. @@ -25,13 +25,13 @@ Called when task is "exited", i.e. after [method _tick] returns [constant SUCCESS] or [constant FAILURE] status. - + 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]. - + 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. @@ -45,7 +45,7 @@ - + Called when task is "ticked", i.e. executed by [BTPlayer] or [BTState] during update. Returns [member TaskStatus]. @@ -54,15 +54,15 @@ - + Adds a child task. The [code]p_child[/code] is placed at the end of the children list. - - + + Adds a child task. The [code]p_child[/code] is placed at [code]p_idx[/code] position in the children list. @@ -75,14 +75,14 @@ - + 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 SUCCESS] or [constant FAILURE] status is returned by [method _tick], [method _exit] will be called next. - + Returns a child task by its index. @@ -95,11 +95,17 @@ - + Returns the child task's index. If [code]p_child[/code] is not a child of the task, [code]-1[/code] is returned instead. + + + + Returns task's parent. + + @@ -115,15 +121,15 @@ - + Returns [code]true[/code] if [code]p_child[/code] is a child of this task. - - + + Initilizes the task. Assigns [member agent] and [member blackboard], and calls [method _setup] for the task and its children. The method is called recursively for each child task. @@ -131,7 +137,7 @@ - + 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. @@ -151,29 +157,29 @@ - + Prints the subtree that starts with this task to console. - + Removes [code]p_child[/code] task from children. - + Removes a child task by index. - - The agent is a contextual object for the task's behavior tree instance. Usually, the agent is an owner of the node with the behavior tree instance. + + 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. Provides access to the blackboard for this task and behavior tree. Blackboard is used to share data among tasks of the associated behavior tree. @@ -182,9 +188,6 @@ 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]. - - The task's parent. - Last execution [enum TaskStatus] returned by [method _tick]. diff --git a/doc_classes/BTTimeLimit.xml b/doc_classes/BTTimeLimit.xml index d4680a7..8ef0d91 100644 --- a/doc_classes/BTTimeLimit.xml +++ b/doc_classes/BTTimeLimit.xml @@ -1,5 +1,5 @@ - + BT decorator that allots a limited time for child's execution. @@ -8,13 +8,9 @@ - - Time allotted for a child task's execution. - - diff --git a/doc_classes/BTWait.xml b/doc_classes/BTWait.xml index 68f5730..0d33a3c 100644 --- a/doc_classes/BTWait.xml +++ b/doc_classes/BTWait.xml @@ -1,5 +1,5 @@ - + BT action that waits for a [member duration] to pass and returns [code]SUCCESS[/code]. @@ -7,12 +7,8 @@ - - - - diff --git a/doc_classes/BTWaitTicks.xml b/doc_classes/BTWaitTicks.xml index 01e90c4..6a5a83c 100644 --- a/doc_classes/BTWaitTicks.xml +++ b/doc_classes/BTWaitTicks.xml @@ -1,5 +1,5 @@ - + BT action that waits for a number of ticks to pass and returns SUCCESS. @@ -7,12 +7,8 @@ - - - - diff --git a/doc_classes/BehaviorTree.xml b/doc_classes/BehaviorTree.xml index 41d29d5..b1fb8c5 100644 --- a/doc_classes/BehaviorTree.xml +++ b/doc_classes/BehaviorTree.xml @@ -1,9 +1,11 @@ - + - Contains behavior tree data. + Contains Behavior Tree data. + [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. @@ -14,29 +16,31 @@ Makes a copy of behavior tree. - - + + - Initializes a loaded behavior tree, making sure tasks are properly linked. + Returns root task of the [BehaviorTree] resource. - + - - + + Instantiates behavior tree and returns the root [BTTask]. + + + + + Assign new root task to [BehaviorTree] resource. + + User-provided description of BehaviorTree. - - Stores root task. - - - diff --git a/doc_classes/Blackboard.xml b/doc_classes/Blackboard.xml index 5ed3017..14ee570 100644 --- a/doc_classes/Blackboard.xml +++ b/doc_classes/Blackboard.xml @@ -1,5 +1,5 @@ - + A key/value store to hold data shared by BT tasks. @@ -11,6 +11,13 @@ + + + + + Removes variable by name. + + @@ -25,49 +32,53 @@ - - + + Returns variable value. - + Returns [code]true[/code] if Blackboard contains [code]p_key[/code] variable. Parent scope included. - + Replaces NodePath variables in the [Blackboard] with references that are retrieved by calling [method Node.get_node] on a [code]p_node[/code] argument. - + Overrides Blackboard data, discarding anything that was stored at this scope. Use with caution. - + 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. - - + + Sets value of blackboard variable. + + + + Returns topmost [Blackboard] in the scope chain. + + - - diff --git a/doc_classes/LimboHSM.xml b/doc_classes/LimboHSM.xml index 2ffa062..6d952fa 100644 --- a/doc_classes/LimboHSM.xml +++ b/doc_classes/LimboHSM.xml @@ -1,5 +1,5 @@ - + Event-based Hierarchical State Machine (HSM). @@ -12,9 +12,9 @@ - - - + + + Adds a transition from one state to another when [code]p_event[/code] is dispatched. @@ -33,22 +33,22 @@ - - + + Initializes state and calls [code]_setup[/code] for itself and every substate. - + If [code]true[/code], changes state to [member initial_state] and enables state processing depending on [member update_mode]. - + Calls [member 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]. @@ -62,13 +62,13 @@ A state that becomes active when state machine is activated by [method set_active] method. - + Determines when state machine is updated. See [enum UpdateMode]. - + Emitted when state is changed. diff --git a/doc_classes/LimboState.xml b/doc_classes/LimboState.xml index a09525c..80f2406 100644 --- a/doc_classes/LimboState.xml +++ b/doc_classes/LimboState.xml @@ -1,5 +1,5 @@ - + A State node for Hierarchical State Machine (HSM). @@ -28,56 +28,53 @@ - + Called during update. - - + + Register [code]p_method[/code] that will be called when [code]p_event[/code] happens. Method must belong to the state. - - + A chained method that connects [signal entered] signal to a [code]p_method[/code] on a [p_object]. - - + A chained method that connects [signal exited] signal to a [code]p_method[/code] on a [p_object]. - - + A chained method that connects [signal updated] signal to a [code]p_method[/code] on a [p_object]. - + - Removes the guard function that was set by [method set_guard_func]. + Removes state's guard function that was set by [method set_guard]. - - + + 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. + 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]. @@ -94,18 +91,16 @@ - + A chained method that sets the name of this state. - + - - - + - 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], that transition will not be allowed. + 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. @@ -113,7 +108,7 @@ A commonly used event that signifies that the state has finished work. - + An agent that is associated with the state. Assinged by initialization. @@ -137,12 +132,10 @@ - + Emitted when the state is updated. - - diff --git a/doc_classes/LimboUtility.xml b/doc_classes/LimboUtility.xml index 252426a..fbb2f91 100644 --- a/doc_classes/LimboUtility.xml +++ b/doc_classes/LimboUtility.xml @@ -1,5 +1,5 @@ - + Helper functions for LimboAI. @@ -10,19 +10,17 @@ - + Returns a string with a [Blackboard] variable name ready to be displayed or printed to console. - + Returns name of a [BTTask] status code. - - diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 3e6328b..b874bf4 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -1020,6 +1020,8 @@ void LimboAIEditor::apply_changes() { } Ref LimboAIEditor::get_task_icon(String p_script_path_or_class) { + ERR_FAIL_COND_V_MSG(p_script_path_or_class.is_empty(), Variant(), "BTTask: script path or class cannot be empty."); + String base_type = p_script_path_or_class; if (p_script_path_or_class.begins_with("res:")) { Ref