From 6148a82f5eab1eeb62208be12f7a07861ecebe66 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 4 Nov 2022 13:27:09 +0100 Subject: [PATCH] Add documentation to many classes --- doc_classes/BBAabb.xml | 1 + doc_classes/BBArray.xml | 1 + doc_classes/BBBasis.xml | 1 + doc_classes/BBBool.xml | 1 + doc_classes/BBByteArray.xml | 1 + doc_classes/BBColor.xml | 1 + doc_classes/BBColorArray.xml | 1 + doc_classes/BBDictionary.xml | 1 + doc_classes/BBFloat.xml | 1 + doc_classes/BBInt.xml | 1 + doc_classes/BBIntArray.xml | 1 + doc_classes/BBNode.xml | 1 + doc_classes/BBParam.xml | 11 +++++++++++ doc_classes/BBPlane.xml | 1 + doc_classes/BBQuat.xml | 1 + doc_classes/BBRealArray.xml | 1 + doc_classes/BBRect2.xml | 1 + doc_classes/BBString.xml | 1 + doc_classes/BBStringArray.xml | 1 + doc_classes/BBTransform.xml | 1 + doc_classes/BBTransform2D.xml | 1 + doc_classes/BBVariant.xml | 1 + doc_classes/BBVector2.xml | 1 + doc_classes/BBVector2Array.xml | 1 + doc_classes/BBVector3.xml | 1 + doc_classes/BBVector3Array.xml | 1 + doc_classes/BTAction.xml | 3 +++ doc_classes/BTAlwaysFail.xml | 1 + doc_classes/BTAlwaysSucceed.xml | 1 + doc_classes/BTComposite.xml | 3 +++ doc_classes/BTCondition.xml | 3 +++ doc_classes/BTConsolePrint.xml | 4 ++++ doc_classes/BTCooldown.xml | 12 ++++++++++++ doc_classes/BTDecorator.xml | 3 +++ doc_classes/BTDelay.xml | 3 +++ doc_classes/BTDynamicSelector.xml | 5 +++++ doc_classes/BTDynamicSequence.xml | 5 +++++ doc_classes/BTFail.xml | 1 + doc_classes/BTForEach.xml | 4 ++++ doc_classes/BTInvert.xml | 1 + doc_classes/BTNewScope.xml | 4 ++++ doc_classes/BTParallel.xml | 6 ++++++ doc_classes/BTPlayer.xml | 18 ++++++++++++++++-- doc_classes/BTProbability.xml | 2 ++ doc_classes/BTRandomSelector.xml | 5 +++++ doc_classes/BTRandomSequence.xml | 5 +++++ doc_classes/BTRandomWait.xml | 2 ++ doc_classes/BTRepeat.xml | 7 +++++++ doc_classes/BTRepeatUntilFailure.xml | 4 ++++ doc_classes/BTRepeatUntilSuccess.xml | 4 ++++ doc_classes/BTRunLimit.xml | 4 ++++ doc_classes/BTSelector.xml | 5 +++++ doc_classes/BTSequence.xml | 5 +++++ doc_classes/BTState.xml | 12 +++++++++++- doc_classes/BTSubtree.xml | 4 ++++ doc_classes/BTTimeLimit.xml | 3 +++ doc_classes/BTWait.xml | 1 + doc_classes/BTWaitTicks.xml | 1 + doc_classes/BehaviorTree.xml | 6 ++++++ doc_classes/Blackboard.xml | 12 ++++++++++++ doc_classes/LimboHSM.xml | 18 +++++++++++++++++- doc_classes/LimboState.xml | 25 +++++++++++++++++++++++-- doc_classes/LimboUtility.xml | 3 +++ 63 files changed, 235 insertions(+), 6 deletions(-) diff --git a/doc_classes/BBAabb.xml b/doc_classes/BBAabb.xml index a4ad3d6..d7a0616 100644 --- a/doc_classes/BBAabb.xml +++ b/doc_classes/BBAabb.xml @@ -1,6 +1,7 @@ + AABB-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBArray.xml b/doc_classes/BBArray.xml index b9ef743..cca3a38 100644 --- a/doc_classes/BBArray.xml +++ b/doc_classes/BBArray.xml @@ -1,6 +1,7 @@ + Array-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBBasis.xml b/doc_classes/BBBasis.xml index 136d275..93df8d9 100644 --- a/doc_classes/BBBasis.xml +++ b/doc_classes/BBBasis.xml @@ -1,6 +1,7 @@ + Basis-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBBool.xml b/doc_classes/BBBool.xml index be0b3bf..2529d38 100644 --- a/doc_classes/BBBool.xml +++ b/doc_classes/BBBool.xml @@ -1,6 +1,7 @@ + Bool-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBByteArray.xml b/doc_classes/BBByteArray.xml index 21940ff..5a00ad9 100644 --- a/doc_classes/BBByteArray.xml +++ b/doc_classes/BBByteArray.xml @@ -1,6 +1,7 @@ + ByteArray-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBColor.xml b/doc_classes/BBColor.xml index a7be77e..cfe4814 100644 --- a/doc_classes/BBColor.xml +++ b/doc_classes/BBColor.xml @@ -1,6 +1,7 @@ + Color-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBColorArray.xml b/doc_classes/BBColorArray.xml index 417ed70..ece32a6 100644 --- a/doc_classes/BBColorArray.xml +++ b/doc_classes/BBColorArray.xml @@ -1,6 +1,7 @@ + ColorArray-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBDictionary.xml b/doc_classes/BBDictionary.xml index 8c49304..9513bfc 100644 --- a/doc_classes/BBDictionary.xml +++ b/doc_classes/BBDictionary.xml @@ -1,6 +1,7 @@ + Dictionary-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBFloat.xml b/doc_classes/BBFloat.xml index f7cc8f7..376a510 100644 --- a/doc_classes/BBFloat.xml +++ b/doc_classes/BBFloat.xml @@ -1,6 +1,7 @@ + Float-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBInt.xml b/doc_classes/BBInt.xml index 11f4fad..52057f6 100644 --- a/doc_classes/BBInt.xml +++ b/doc_classes/BBInt.xml @@ -1,6 +1,7 @@ + Integer-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBIntArray.xml b/doc_classes/BBIntArray.xml index cebf642..7dd3f42 100644 --- a/doc_classes/BBIntArray.xml +++ b/doc_classes/BBIntArray.xml @@ -1,6 +1,7 @@ + IntArray-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBNode.xml b/doc_classes/BBNode.xml index 9f1396f..23d9e34 100644 --- a/doc_classes/BBNode.xml +++ b/doc_classes/BBNode.xml @@ -1,6 +1,7 @@ + Node-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBParam.xml b/doc_classes/BBParam.xml index d5b71dc..fb88bee 100644 --- a/doc_classes/BBParam.xml +++ b/doc_classes/BBParam.xml @@ -1,8 +1,12 @@ + A base class for typed parameters to be used with BT tasks. + 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. @@ -10,6 +14,7 @@ + Returns expected type of the parameter. @@ -18,21 +23,27 @@ + 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]. + A source for the value of BBParam. See [enum ValueSource]. + A name of [Blackboard] variable. It is used to retrieve the parameter's value, if [member value_source] is [constant BLACKBOARD_VAR]. + Value is stored directly with BBParam resource. + Value is referenced by a variable name and retrieved from the [Blackboard]. A variable name is stored with BBParam resource. diff --git a/doc_classes/BBPlane.xml b/doc_classes/BBPlane.xml index a616b01..ec5700c 100644 --- a/doc_classes/BBPlane.xml +++ b/doc_classes/BBPlane.xml @@ -1,6 +1,7 @@ + Plane-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBQuat.xml b/doc_classes/BBQuat.xml index 1757de1..d73ef9a 100644 --- a/doc_classes/BBQuat.xml +++ b/doc_classes/BBQuat.xml @@ -1,6 +1,7 @@ + Quat-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBRealArray.xml b/doc_classes/BBRealArray.xml index 998b15c..e59daad 100644 --- a/doc_classes/BBRealArray.xml +++ b/doc_classes/BBRealArray.xml @@ -1,6 +1,7 @@ + RealArray-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBRect2.xml b/doc_classes/BBRect2.xml index 2637730..1d6ea5b 100644 --- a/doc_classes/BBRect2.xml +++ b/doc_classes/BBRect2.xml @@ -1,6 +1,7 @@ + Rect2-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBString.xml b/doc_classes/BBString.xml index abeee02..ba75e9b 100644 --- a/doc_classes/BBString.xml +++ b/doc_classes/BBString.xml @@ -1,6 +1,7 @@ + String-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBStringArray.xml b/doc_classes/BBStringArray.xml index a9d9203..103fc9d 100644 --- a/doc_classes/BBStringArray.xml +++ b/doc_classes/BBStringArray.xml @@ -1,6 +1,7 @@ + StringArray-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBTransform.xml b/doc_classes/BBTransform.xml index 1ab8b04..84c136d 100644 --- a/doc_classes/BBTransform.xml +++ b/doc_classes/BBTransform.xml @@ -1,6 +1,7 @@ + Transform-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBTransform2D.xml b/doc_classes/BBTransform2D.xml index 87e8778..9f0d2c5 100644 --- a/doc_classes/BBTransform2D.xml +++ b/doc_classes/BBTransform2D.xml @@ -1,6 +1,7 @@ + Transform2D-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBVariant.xml b/doc_classes/BBVariant.xml index 1f205f0..0451f84 100644 --- a/doc_classes/BBVariant.xml +++ b/doc_classes/BBVariant.xml @@ -1,6 +1,7 @@ + Variant-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBVector2.xml b/doc_classes/BBVector2.xml index 60221ea..36ec24d 100644 --- a/doc_classes/BBVector2.xml +++ b/doc_classes/BBVector2.xml @@ -1,6 +1,7 @@ + Vector2-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBVector2Array.xml b/doc_classes/BBVector2Array.xml index 6535af5..36d90f5 100644 --- a/doc_classes/BBVector2Array.xml +++ b/doc_classes/BBVector2Array.xml @@ -1,6 +1,7 @@ + Vector2Array-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBVector3.xml b/doc_classes/BBVector3.xml index 3d804c6..b60823a 100644 --- a/doc_classes/BBVector3.xml +++ b/doc_classes/BBVector3.xml @@ -1,6 +1,7 @@ + Vector3-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BBVector3Array.xml b/doc_classes/BBVector3Array.xml index 05bcb66..fb509d6 100644 --- a/doc_classes/BBVector3Array.xml +++ b/doc_classes/BBVector3Array.xml @@ -1,6 +1,7 @@ + Vector3Array-type parameter to be used with BT tasks. See [BBParam]. diff --git a/doc_classes/BTAction.xml b/doc_classes/BTAction.xml index 0c8ef55..b297ec1 100644 --- a/doc_classes/BTAction.xml +++ b/doc_classes/BTAction.xml @@ -1,8 +1,11 @@ + 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. diff --git a/doc_classes/BTAlwaysFail.xml b/doc_classes/BTAlwaysFail.xml index 43f924a..d43ad23 100644 --- a/doc_classes/BTAlwaysFail.xml +++ b/doc_classes/BTAlwaysFail.xml @@ -1,6 +1,7 @@ + BT decorator that turns SUCCESS into FAILURE. diff --git a/doc_classes/BTAlwaysSucceed.xml b/doc_classes/BTAlwaysSucceed.xml index 29d0f6c..86343b5 100644 --- a/doc_classes/BTAlwaysSucceed.xml +++ b/doc_classes/BTAlwaysSucceed.xml @@ -1,6 +1,7 @@ + BT decorator that turns FAILURE into SUCCESS. diff --git a/doc_classes/BTComposite.xml b/doc_classes/BTComposite.xml index 64beab4..5cb8482 100644 --- a/doc_classes/BTComposite.xml +++ b/doc_classes/BTComposite.xml @@ -1,8 +1,11 @@ + 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. diff --git a/doc_classes/BTCondition.xml b/doc_classes/BTCondition.xml index bc3bbbd..0ccd0e4 100644 --- a/doc_classes/BTCondition.xml +++ b/doc_classes/BTCondition.xml @@ -1,8 +1,11 @@ + 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. diff --git a/doc_classes/BTConsolePrint.xml b/doc_classes/BTConsolePrint.xml index 3589cf9..5dafbe3 100644 --- a/doc_classes/BTConsolePrint.xml +++ b/doc_classes/BTConsolePrint.xml @@ -1,8 +1,10 @@ + BT action task that prints text to console. + BT action task that prints text to console. Can contain placeholders for format arguments as in GDScript's % operator. @@ -10,8 +12,10 @@ + 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 889bc04..4867f3c 100644 --- a/doc_classes/BTCooldown.xml +++ b/doc_classes/BTCooldown.xml @@ -1,8 +1,13 @@ + BT decorator that executes child only if [member cooldown] time passed since previous execution. + BT decorator that executes child only if [member cooldown] 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 cooldown] time didn't pass since previous execution. @@ -10,14 +15,21 @@ + 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. + Time to wait before child's another execution is allowed. + Process cooldown time when [SceneTree] is paused. + Start on a cooldown, as if the child was executed before the first BT tick. + Trigger cooldown, if the child returns [code]FAILURE[/code]. diff --git a/doc_classes/BTDecorator.xml b/doc_classes/BTDecorator.xml index 4fbaf5d..d173043 100644 --- a/doc_classes/BTDecorator.xml +++ b/doc_classes/BTDecorator.xml @@ -1,8 +1,11 @@ + 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. diff --git a/doc_classes/BTDelay.xml b/doc_classes/BTDelay.xml index 78c8481..533e07c 100644 --- a/doc_classes/BTDelay.xml +++ b/doc_classes/BTDelay.xml @@ -1,8 +1,10 @@ + BT decorator that delays execution of its child. + BT decorator that delays execution of its child by [member seconds]. Returns [code]RUNNING[/code] during a period of delay. @@ -10,6 +12,7 @@ + Delay duration in seconds. diff --git a/doc_classes/BTDynamicSelector.xml b/doc_classes/BTDynamicSelector.xml index bcbbb40..b9e7178 100644 --- a/doc_classes/BTDynamicSelector.xml +++ b/doc_classes/BTDynamicSelector.xml @@ -1,8 +1,13 @@ + BT composite that executes tasks from the beginning each tick until first [code]SUCCESS[/code]. + BT composite that executes child tasks from first to last until any child returns [code]SUCCESS[/code]. BTDynamicSelector will execute tasks from the beginning each tick, reevaluating their statuses. + Returns [code]RUNNING[/code] if a task returns [code]RUNNING[/code], and remembers last [code]RUNNING[/code] child. In contrast to normal selector, on the next execution tick it will reexecute preceeding tasks and reevaluate their return statuses. If any of the preceeding tasks does not return [code]FAILURE[/code], it will cancel execution of the remembered [code]RUNNING[/code] task. + Returns [code]FAILURE[/code] if all tasks return [code]FAILURE[/code]. + Returns [code]SUCCESS[/code] if any task returns [code]SUCCESS[/code]. diff --git a/doc_classes/BTDynamicSequence.xml b/doc_classes/BTDynamicSequence.xml index 1c93444..e911d9e 100644 --- a/doc_classes/BTDynamicSequence.xml +++ b/doc_classes/BTDynamicSequence.xml @@ -1,8 +1,13 @@ + BT composite that executes tasks from the beginning each tick for as long as they return [code]SUCCESS[/code]. + BT composite that executes child tasks from first to last for as long as they return [code]SUCCESS[/code]. BTDynamicSequence will execute tasks from the beginning each tick, reevaluating their statuses. + Returns [code]RUNNING[/code] if a task returns [code]RUNNING[/code], and remembers last [code]RUNNING[/code] child. In contrast to [BTSequence], on the next execution tick it will reexecute preceeding tasks and reevaluate their return statuses. If any of the preceeding tasks does not return [code]SUCCESS[/code], it will cancel execution of the remembered [code]RUNNING[/code] task. + Returns [code]FAILURE[/code] if any task returns [code]FAILURE[/code]. + Returns [code]SUCCESS[/code] if all tasks return [code]SUCCESS[/code]. diff --git a/doc_classes/BTFail.xml b/doc_classes/BTFail.xml index 0749ff0..9f32575 100644 --- a/doc_classes/BTFail.xml +++ b/doc_classes/BTFail.xml @@ -1,6 +1,7 @@ + BT action that returns FAILURE. diff --git a/doc_classes/BTForEach.xml b/doc_classes/BTForEach.xml index 2722d16..64c3a30 100644 --- a/doc_classes/BTForEach.xml +++ b/doc_classes/BTForEach.xml @@ -1,8 +1,10 @@ + BT decorator that executes child for each element of an [Array]. + BT decorator that executes child for each element of an [Array]. On each iteration an element is saved to a [Blackboard] variable. @@ -10,8 +12,10 @@ + An [Array] stored in the [Blackboard] to iterate over. + [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 4ec4008..5b5dde6 100644 --- a/doc_classes/BTInvert.xml +++ b/doc_classes/BTInvert.xml @@ -1,6 +1,7 @@ + BT decorator that inverts FAILURE to SUCCESS and SUCCESS to FAILURE. diff --git a/doc_classes/BTNewScope.xml b/doc_classes/BTNewScope.xml index 6408e7c..f3b5349 100644 --- a/doc_classes/BTNewScope.xml +++ b/doc_classes/BTNewScope.xml @@ -1,8 +1,11 @@ + BT decorator that creates a new [Blackboard] scope. + BT decorator that creates a new [Blackboard] scope during initialization and fills it with data. See [Blackboard]. + Returns status of the child execution. @@ -10,6 +13,7 @@ + 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 72168db..abfe22a 100644 --- a/doc_classes/BTParallel.xml +++ b/doc_classes/BTParallel.xml @@ -1,8 +1,14 @@ + BT composite that executes tasks simultaneously. + BT composite that executes tasks simultaneously until one of the criterea is met. BTParallel will execute each task from first to last at least once before returning a result. + If set to [member repeat], the tasks will be executed again, even if they returned [code]SUCCESS[/code] or [code]FAILURE[/code] on the previous tick. + Returns [code]FAILURE[/code] when a required number of tasks return [code]FAILURE[/code]. When not set to [member repeat], if no criteria was met, but all tasks returned [code]SUCCESS[/code] or [code]FAILURE[/code], a [code]FAILURE[/code] will be returned. + Returns [code]SUCCESS[/code] when a required number of tasks return [code]SUCCESS[/code]. + Returns [code]RUNNING[/code] after executing all tasks from first to last, and for as long as the above criterea are not met. diff --git a/doc_classes/BTPlayer.xml b/doc_classes/BTPlayer.xml index 37b06fd..1149f0b 100644 --- a/doc_classes/BTPlayer.xml +++ b/doc_classes/BTPlayer.xml @@ -1,8 +1,10 @@ + Player of [BehaviorTree] resources. + BTPlayer is used for instantiation and playback of [BehaviorTree] resources at run time. @@ -10,50 +12,62 @@ + Cancel execution of the tree and start anew. This method does not reset [Blackboard]. + 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. + [Blackboard] instance that contains data shared by the tasks in [BehaviorTree]. + 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. + Process tree during the idle process. + Process tree during the physics process. + Tree is processed manually by calling [method update]. diff --git a/doc_classes/BTProbability.xml b/doc_classes/BTProbability.xml index 9dd1c0d..74a9d64 100644 --- a/doc_classes/BTProbability.xml +++ b/doc_classes/BTProbability.xml @@ -1,8 +1,10 @@ + BT decorator that executes child with probability. + BT decorator that executes its child task with a probability of the [member run_chance]. Returns FAILURE if the execution didn't happen. diff --git a/doc_classes/BTRandomSelector.xml b/doc_classes/BTRandomSelector.xml index 4961424..ad5e8c0 100644 --- a/doc_classes/BTRandomSelector.xml +++ b/doc_classes/BTRandomSelector.xml @@ -1,8 +1,13 @@ + BT composite that executes tasks in random order until first [code]SUCCESS[/code]. + BT composite that executes child tasks in random order until any child returns [code]SUCCESS[/code]. + Returns [code]RUNNING[/code] if a task returns [code]RUNNING[/code], and remembers last [code]RUNNING[/code] child and the order of execution. BTRandomSelector will continue where it left off on the next execution tick. + Returns [code]FAILURE[/code] if all tasks return [code]FAILURE[/code]. + Returns [code]SUCCESS[/code] if any task returns [code]SUCCESS[/code]. diff --git a/doc_classes/BTRandomSequence.xml b/doc_classes/BTRandomSequence.xml index 847c8cc..992a0c2 100644 --- a/doc_classes/BTRandomSequence.xml +++ b/doc_classes/BTRandomSequence.xml @@ -1,8 +1,13 @@ + BT composite that executes tasks in random order for as long as they return [code]SUCCESS[/code]. + BTRandomSequence executes child tasks in random order for as long as they return [code]SUCCESS[/code]. + Returns [code]RUNNING[/code] if a task returns [code]RUNNING[/code], and remembers last [code]RUNNING[/code] child and the order of execution. BTRandomSequence will continue where it left off on the next execution tick. + Returns [code]FAILURE[/code] if any task returns [code]FAILURE[/code]. + Returns [code]SUCCESS[/code] if all tasks return [code]SUCCESS[/code]. diff --git a/doc_classes/BTRandomWait.xml b/doc_classes/BTRandomWait.xml index 2385312..490b5eb 100644 --- a/doc_classes/BTRandomWait.xml +++ b/doc_classes/BTRandomWait.xml @@ -1,8 +1,10 @@ + 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]. diff --git a/doc_classes/BTRepeat.xml b/doc_classes/BTRepeat.xml index 4e3409e..1870895 100644 --- a/doc_classes/BTRepeat.xml +++ b/doc_classes/BTRepeat.xml @@ -1,8 +1,13 @@ + BT decorator that repeats its child specified number of [member times]. + 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]. + 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]. @@ -10,8 +15,10 @@ + If [code]false[/code], [code]FAILURE[/code] status returned by the child is also considered a successfully finished execution. + 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 0b26ab1..e00b9dd 100644 --- a/doc_classes/BTRepeatUntilFailure.xml +++ b/doc_classes/BTRepeatUntilFailure.xml @@ -1,8 +1,12 @@ + BT decorator that repeats child until [code]FAILURE[/code]. + 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]. diff --git a/doc_classes/BTRepeatUntilSuccess.xml b/doc_classes/BTRepeatUntilSuccess.xml index 59d6609..7c08582 100644 --- a/doc_classes/BTRepeatUntilSuccess.xml +++ b/doc_classes/BTRepeatUntilSuccess.xml @@ -1,8 +1,12 @@ + BT decorator that repeats child until [code]SUCCESS[/code]. + 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]. diff --git a/doc_classes/BTRunLimit.xml b/doc_classes/BTRunLimit.xml index 9fdaca8..8f69dd5 100644 --- a/doc_classes/BTRunLimit.xml +++ b/doc_classes/BTRunLimit.xml @@ -1,8 +1,11 @@ + BT decorator that allows child's execution a limited number of times. + 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. @@ -10,6 +13,7 @@ + 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 df54327..145e52c 100644 --- a/doc_classes/BTSelector.xml +++ b/doc_classes/BTSelector.xml @@ -1,8 +1,13 @@ + BT composite that executes tasks in turn until first [code]SUCCESS[/code]. + BT composite that executes child tasks from first to last until any child returns [code]SUCCESS[/code]. + Returns [code]RUNNING[/code] if a task returns [code]RUNNING[/code], and remembers last [code]RUNNING[/code] child. BTSelector will continue where it left off on the next execution tick. + Returns [code]FAILURE[/code] if all tasks return [code]FAILURE[/code]. + Returns [code]SUCCESS[/code] if any task returns [code]SUCCESS[/code]. diff --git a/doc_classes/BTSequence.xml b/doc_classes/BTSequence.xml index 512a769..ab0996b 100644 --- a/doc_classes/BTSequence.xml +++ b/doc_classes/BTSequence.xml @@ -1,8 +1,13 @@ + BT composite that executes tasks in turn for as long as they return [code]SUCCESS[/code]. + BT composite that executes child tasks from first to last for as long as they return [code]SUCCESS[/code]. + Returns [code]RUNNING[/code] if a task returns [code]RUNNING[/code], and remembers last [code]RUNNING[/code] child. BTSequence will continue where it left off on the next execution tick. + Returns [code]FAILURE[/code] if any task returns [code]FAILURE[/code]. + Returns [code]SUCCESS[/code] if all tasks return [code]SUCCESS[/code]. diff --git a/doc_classes/BTState.xml b/doc_classes/BTState.xml index c266a7d..766666a 100644 --- a/doc_classes/BTState.xml +++ b/doc_classes/BTState.xml @@ -1,16 +1,26 @@ + 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]. - + A [BehaviorTree] resource that contains state behavior. + + + HSM event that will be dispatched when the behavior tree returns [code]FAILURE[/code]. + + + 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 222e09a..23e0a6a 100644 --- a/doc_classes/BTSubtree.xml +++ b/doc_classes/BTSubtree.xml @@ -1,8 +1,11 @@ + BT decorator that instantiates a subtree. + Instantiates a behavior tree as a child of this task during initialization and creates a new [Blackboard] scope. + Returns status of the child execution. @@ -11,6 +14,7 @@ + A [BehaviorTree] resource that will be instantiated as a subtree. diff --git a/doc_classes/BTTimeLimit.xml b/doc_classes/BTTimeLimit.xml index 75ed6a9..d4680a7 100644 --- a/doc_classes/BTTimeLimit.xml +++ b/doc_classes/BTTimeLimit.xml @@ -1,8 +1,10 @@ + BT decorator that allots a limited time for child's execution. + BT decorator that allots a limited time for child's execution. Cancels execution and returns [code]FAILURE[/code] if [member time_limit] is exceeded. @@ -10,6 +12,7 @@ + Time allotted for a child task's execution. diff --git a/doc_classes/BTWait.xml b/doc_classes/BTWait.xml index ca9c791..68f5730 100644 --- a/doc_classes/BTWait.xml +++ b/doc_classes/BTWait.xml @@ -1,6 +1,7 @@ + BT action that waits for a [member duration] to pass and returns [code]SUCCESS[/code]. diff --git a/doc_classes/BTWaitTicks.xml b/doc_classes/BTWaitTicks.xml index 45b9da7..01e90c4 100644 --- a/doc_classes/BTWaitTicks.xml +++ b/doc_classes/BTWaitTicks.xml @@ -1,6 +1,7 @@ + BT action that waits for a number of ticks to pass and returns SUCCESS. diff --git a/doc_classes/BehaviorTree.xml b/doc_classes/BehaviorTree.xml index 8d08379..41d29d5 100644 --- a/doc_classes/BehaviorTree.xml +++ b/doc_classes/BehaviorTree.xml @@ -1,6 +1,7 @@ + Contains behavior tree data. @@ -10,11 +11,13 @@ + Makes a copy of behavior tree. + Initializes a loaded behavior tree, making sure tasks are properly linked. @@ -22,13 +25,16 @@ + Instantiates behavior tree and returns the root [BTTask]. + User-provided description of BehaviorTree. + Stores root task. diff --git a/doc_classes/Blackboard.xml b/doc_classes/Blackboard.xml index 1ec406a..5ed3017 100644 --- a/doc_classes/Blackboard.xml +++ b/doc_classes/Blackboard.xml @@ -1,8 +1,12 @@ + A key/value store to hold data shared by BT tasks. + 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]. @@ -10,11 +14,13 @@ + Returns [Blackboard] data as a [Dictionary]. + Returns a [Blackboard] that serves as a parent scope for this instance. @@ -22,30 +28,35 @@ + 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. @@ -53,6 +64,7 @@ + Sets value of blackboard variable. diff --git a/doc_classes/LimboHSM.xml b/doc_classes/LimboHSM.xml index f60c951..2ffa062 100644 --- a/doc_classes/LimboHSM.xml +++ b/doc_classes/LimboHSM.xml @@ -1,8 +1,11 @@ + Event-based Hierarchical State Machine (HSM). + 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. @@ -13,16 +16,19 @@ + Adds a transition from one state to another when [code]p_event[/code] is dispatched. + Returns active state. + Returns the leaf state that is currently active in HSM. @@ -30,43 +36,53 @@ + 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]. + Useful to define a transition from any state. - + 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. + Update state machine during idle process. + Update state machine during physics process. + Update state machine manually by calling [method update] from a script. diff --git a/doc_classes/LimboState.xml b/doc_classes/LimboState.xml index 0198166..a09525c 100644 --- a/doc_classes/LimboState.xml +++ b/doc_classes/LimboState.xml @@ -1,6 +1,7 @@ + A State node for Hierarchical State Machine (HSM). @@ -10,22 +11,26 @@ + Called when state is entered. + Called when state is exited. + Called once during intialization. + Called during update. @@ -33,6 +38,7 @@ + Register [code]p_method[/code] that will be called when [code]p_event[/code] happens. Method must belong to the state. @@ -40,6 +46,7 @@ + A chained method that connects [signal entered] signal to a [code]p_method[/code] on a [p_object]. @@ -47,6 +54,7 @@ + A chained method that connects [signal exited] signal to a [code]p_method[/code] on a [p_object]. @@ -54,11 +62,13 @@ + 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]. @@ -66,22 +76,27 @@ + 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. + Returns the root [LimboState]. + Returns [code]true[/code] if it is currently active, i.e. it is the active substate of the parent [LimboHSM]. + A chained method that sets the name of this state. @@ -90,35 +105,41 @@ + 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. - - + A commonly used event that signifies that the state has finished work. + An agent that is associated with the state. Assinged by initialization. + A key/value data store shared by states of the state machine this state belongs to. + Emitted when the state is entered. + Emitted when the state is exited. + Emitted when the state is initialized. + Emitted when the state is updated. diff --git a/doc_classes/LimboUtility.xml b/doc_classes/LimboUtility.xml index d817b37..252426a 100644 --- a/doc_classes/LimboUtility.xml +++ b/doc_classes/LimboUtility.xml @@ -1,6 +1,7 @@ + Helper functions for LimboAI. @@ -11,12 +12,14 @@ + Returns a string with a [Blackboard] variable name ready to be displayed or printed to console. + Returns name of a [BTTask] status code.