Add documentation to many classes
This commit is contained in:
parent
8d3249d8a8
commit
6148a82f5e
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBAabb" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBArray" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBBasis" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBBool" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBByteArray" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBColor" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBColorArray" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBDictionary" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBFloat" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBInt" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBIntArray" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBNode" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBParam" inherits="Resource" version="3.5" 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.
|
||||
</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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,6 +14,7 @@
|
|||
<method name="get_type" qualifiers="const">
|
||||
<return type="int" enum="Variant.Type" />
|
||||
<description>
|
||||
Returns expected type of the parameter.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_value">
|
||||
|
@ -18,21 +23,27 @@
|
|||
<argument index="1" name="p_blackboard" type="Blackboard" />
|
||||
<argument index="2" name="p_default" type="Variant" default="null" />
|
||||
<description>
|
||||
Returns value of the parameter.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="saved_value" type="Variant" setter="set_saved_value" getter="get_saved_value" default="PoolColorArray( )">
|
||||
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].
|
||||
</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].
|
||||
</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].
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
<constant name="SAVED_VALUE" value="0" enum="ValueSource">
|
||||
Value is stored directly with 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.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBPlane" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBQuat" inherits="BBParam" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Quat-type parameter to be used with BT tasks. See [BBParam].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBRealArray" inherits="BBParam" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
RealArray-type parameter to be used with BT tasks. See [BBParam].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBRect2" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBString" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBStringArray" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBTransform" inherits="BBParam" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Transform-type parameter to be used with BT tasks. See [BBParam].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBTransform2D" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBVariant" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBVector2" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBVector2Array" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBVector3" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BBVector3Array" inherits="BBParam" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTAction" inherits="BTTask" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Base class for BT actions.
|
||||
</brief_description>
|
||||
<description>
|
||||
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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTAlwaysFail" inherits="BTDecorator" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT decorator that turns SUCCESS into FAILURE.
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTAlwaysSucceed" inherits="BTDecorator" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT decorator that turns FAILURE into SUCCESS.
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTComposite" inherits="BTTask" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
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 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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTCondition" inherits="BTTask" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Base class for BT conditions.
|
||||
</brief_description>
|
||||
<description>
|
||||
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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTConsolePrint" inherits="BTAction" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT action task that prints text to console.
|
||||
</brief_description>
|
||||
<description>
|
||||
BT action task that prints text to console. Can contain placeholders for format arguments as in GDScript's % operator.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,8 +12,10 @@
|
|||
</methods>
|
||||
<members>
|
||||
<member name="format_var_args" type="PoolStringArray" setter="set_format_var_args" getter="get_format_var_args" default="PoolStringArray( )">
|
||||
An array with blackboard variables, values of which will serve as format arguments.
|
||||
</member>
|
||||
<member name="text" type="String" setter="set_text" getter="get_text" default="""">
|
||||
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.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTCooldown" inherits="BTDecorator" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT decorator that executes child only if [member cooldown] time passed since previous execution.
|
||||
</brief_description>
|
||||
<description>
|
||||
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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,14 +15,21 @@
|
|||
</methods>
|
||||
<members>
|
||||
<member name="cooldown_state_var" type="String" setter="set_cooldown_state_var" getter="get_cooldown_state_var" default="""">
|
||||
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.
|
||||
</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.
|
||||
</member>
|
||||
<member name="process_pause" type="bool" setter="set_process_pause" getter="get_process_pause" default="false">
|
||||
Process cooldown time when [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.
|
||||
</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 returns [code]FAILURE[/code].
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTDecorator" inherits="BTTask" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
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 alters the behavior of its child task in some way. Decorators can only have one child.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTDelay" inherits="BTDecorator" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT decorator that delays execution of its child.
|
||||
</brief_description>
|
||||
<description>
|
||||
BT decorator that delays execution of its child by [member seconds]. Returns [code]RUNNING[/code] during a period of delay.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,6 +12,7 @@
|
|||
</methods>
|
||||
<members>
|
||||
<member name="seconds" type="float" setter="set_seconds" getter="get_seconds" default="1.0">
|
||||
Delay duration in seconds.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTDynamicSelector" inherits="BTComposite" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT composite that executes tasks from the beginning each tick until first [code]SUCCESS[/code].
|
||||
</brief_description>
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTDynamicSequence" inherits="BTComposite" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT composite that executes tasks from the beginning each tick for as long as they return [code]SUCCESS[/code].
|
||||
</brief_description>
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTFail" inherits="BTAction" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT action that returns FAILURE.
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTForEach" inherits="BTDecorator" version="3.5" 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].
|
||||
</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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,8 +12,10 @@
|
|||
</methods>
|
||||
<members>
|
||||
<member name="array_var" type="String" setter="set_array_var" getter="get_array_var" default="""">
|
||||
An [Array] stored in the [Blackboard] to iterate over.
|
||||
</member>
|
||||
<member name="save_var" type="String" setter="set_save_var" getter="get_save_var" default="""">
|
||||
[Blackboard] variable to store an element of array, referenced by [member array_var].
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTInvert" inherits="BTDecorator" version="3.5" 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.
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTNewScope" inherits="BTDecorator" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,6 +13,7 @@
|
|||
</methods>
|
||||
<members>
|
||||
<member name="_blackboard_data" type="Dictionary" setter="_set_blackboard_data" getter="_get_blackboard_data" default="{}">
|
||||
Data that is used to populate a new scope of the [Blackboard].
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,14 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTParallel" inherits="BTComposite" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT composite that executes tasks simultaneously.
|
||||
</brief_description>
|
||||
<description>
|
||||
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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTPlayer" inherits="Node" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Player of [BehaviorTree] resources.
|
||||
</brief_description>
|
||||
<description>
|
||||
BTPlayer is used for instantiation and playback of [BehaviorTree] resources at run time.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,50 +12,62 @@
|
|||
<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" />
|
||||
<argument index="0" name="p_blackboard" type="Blackboard" />
|
||||
<description>
|
||||
Assign a [Blackboard] instance.
|
||||
</description>
|
||||
</method>
|
||||
<method name="update">
|
||||
<return type="void" />
|
||||
<argument 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].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="_blackboard_data" type="Dictionary" setter="_set_blackboard_data" getter="_get_blackboard_data" default="{}">
|
||||
</member>
|
||||
<member name="active" type="bool" setter="set_active" getter="get_active" default="false">
|
||||
If [code]true[/code], tree is active and will be processed.
|
||||
</member>
|
||||
<member name="auto_restart" type="bool" setter="set_auto_restart" getter="get_auto_restart" default="false">
|
||||
If [code]true[/code] player will restart when it finishes executing the tree and receives a [code]SUCCESS[/code] or [code]FAILURE[/code].
|
||||
</member>
|
||||
<member name="behavior_tree" type="BehaviorTree" setter="set_behavior_tree" getter="get_behavior_tree">
|
||||
[BehaviorTree] resource to instantiate and process at run time.
|
||||
</member>
|
||||
<member name="blackboard" type="Blackboard" setter="" getter="get_blackboard">
|
||||
[Blackboard] instance that contains data shared by the tasks in [BehaviorTree].
|
||||
</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.
|
||||
</member>
|
||||
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="BTPlayer.UpdateMode" default="0">
|
||||
Defines when BehaviorTree is executed. See [enum UpdateMode].
|
||||
</member>
|
||||
</members>
|
||||
<signals>
|
||||
<signal name="behavior_tree_finished">
|
||||
<argument 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.
|
||||
</description>
|
||||
</signal>
|
||||
</signals>
|
||||
<constants>
|
||||
<constant name="IDLE" value="0" enum="UpdateMode">
|
||||
Process tree during the idle process.
|
||||
</constant>
|
||||
<constant name="PHYSICS" value="1" enum="UpdateMode">
|
||||
Process tree during the physics process.
|
||||
</constant>
|
||||
<constant name="MANUAL" value="2" enum="UpdateMode">
|
||||
Tree is processed manually by calling [method update].
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTProbability" inherits="BTDecorator" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT decorator that executes child with probability.
|
||||
</brief_description>
|
||||
<description>
|
||||
BT decorator that executes its child task with a probability of the [member run_chance]. Returns FAILURE if the execution didn't happen.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTRandomSelector" inherits="BTComposite" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT composite that executes tasks in random order until first [code]SUCCESS[/code].
|
||||
</brief_description>
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTRandomSequence" inherits="BTComposite" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT composite that executes tasks in random order for as long as they return [code]SUCCESS[/code].
|
||||
</brief_description>
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTRandomWait" inherits="BTAction" version="3.5" 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].
|
||||
</brief_description>
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTRepeat" inherits="BTDecorator" version="3.5" 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].
|
||||
</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].
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,8 +15,10 @@
|
|||
</methods>
|
||||
<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.
|
||||
</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.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTRepeatUntilFailure" inherits="BTDecorator" version="3.5" 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].
|
||||
</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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTRepeatUntilSuccess" inherits="BTDecorator" version="3.5" 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].
|
||||
</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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTRunLimit" inherits="BTDecorator" version="3.5" 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.
|
||||
</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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,6 +13,7 @@
|
|||
</methods>
|
||||
<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.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTSelector" inherits="BTComposite" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT composite that executes tasks in turn until first [code]SUCCESS[/code].
|
||||
</brief_description>
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTSequence" inherits="BTComposite" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT composite that executes tasks in turn for as long as they return [code]SUCCESS[/code].
|
||||
</brief_description>
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -1,16 +1,26 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTState" inherits="LimboState" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
A state node for [LimboHSM] that hosts a [BehaviorTree].
|
||||
</brief_description>
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<methods>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="_blackboard_data" type="Dictionary" setter="_set_blackboard_data" getter="_get_blackboard_data" overrides="LimboState" default="{}" />
|
||||
<member name="behavior_tree" type="BehaviorTree" setter="set_behavior_tree" getter="get_behavior_tree">
|
||||
A [BehaviorTree] resource that contains state behavior.
|
||||
</member>
|
||||
<member name="failure_event" type="String" setter="set_failure_event" getter="get_failure_event" default=""failure"">
|
||||
HSM event that will be dispatched when the behavior tree returns [code]FAILURE[/code].
|
||||
</member>
|
||||
<member name="success_event" type="String" setter="set_success_event" getter="get_success_event" default=""success"">
|
||||
HSM event that will be dispatched when the behavior tree returns [code]SUCCESS[/code].
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTSubtree" inherits="BTNewScope" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT decorator that instantiates a subtree.
|
||||
</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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -11,6 +14,7 @@
|
|||
<members>
|
||||
<member name="_blackboard_data" type="Dictionary" setter="_set_blackboard_data" getter="_get_blackboard_data" overrides="BTNewScope" default="{}" />
|
||||
<member name="subtree" type="BehaviorTree" setter="set_subtree" getter="get_subtree">
|
||||
A [BehaviorTree] resource that will be instantiated as a subtree.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTTimeLimit" inherits="BTDecorator" version="3.5" 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.
|
||||
</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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,6 +12,7 @@
|
|||
</methods>
|
||||
<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.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTWait" inherits="BTAction" version="3.5" 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 returns [code]SUCCESS[/code].
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BTWaitTicks" inherits="BTAction" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
BT action that waits for a number of ticks to pass and returns SUCCESS.
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="BehaviorTree" inherits="Resource" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Contains behavior tree data.
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
@ -10,11 +11,13 @@
|
|||
<method name="clone" qualifiers="const">
|
||||
<return type="BehaviorTree" />
|
||||
<description>
|
||||
Makes a copy of behavior tree.
|
||||
</description>
|
||||
</method>
|
||||
<method name="init">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Initializes a loaded behavior tree, making sure tasks are properly linked.
|
||||
</description>
|
||||
</method>
|
||||
<method name="instance" qualifiers="const">
|
||||
|
@ -22,13 +25,16 @@
|
|||
<argument index="0" name="p_agent" type="Object" />
|
||||
<argument index="1" name="p_blackboard" type="Blackboard" />
|
||||
<description>
|
||||
Instantiates behavior tree and returns the root [BTTask].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="description" type="String" setter="set_description" getter="get_description" default="""">
|
||||
User-provided description of BehaviorTree.
|
||||
</member>
|
||||
<member name="root_task" type="BTTask" setter="set_root_task" getter="get_root_task">
|
||||
Stores root task.
|
||||
</member>
|
||||
</members>
|
||||
<constants>
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="Blackboard" inherits="Reference" version="3.5" 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.
|
||||
</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].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -10,11 +14,13 @@
|
|||
<method name="get_data" qualifiers="const">
|
||||
<return type="Dictionary" />
|
||||
<description>
|
||||
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.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_var" qualifiers="const">
|
||||
|
@ -22,30 +28,35 @@
|
|||
<argument index="0" name="p_key" type="Variant" />
|
||||
<argument index="1" name="p_default" type="Variant" default="null" />
|
||||
<description>
|
||||
Returns variable value.
|
||||
</description>
|
||||
</method>
|
||||
<method name="has_var" qualifiers="const">
|
||||
<return type="bool" />
|
||||
<argument index="0" name="p_key" type="Variant" />
|
||||
<description>
|
||||
Returns [code]true[/code] if Blackboard contains [code]p_key[/code] variable. Parent scope included.
|
||||
</description>
|
||||
</method>
|
||||
<method name="prefetch_nodepath_vars">
|
||||
<return type="void" />
|
||||
<argument 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.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_data">
|
||||
<return type="void" />
|
||||
<argument index="0" name="p_data" type="Dictionary" />
|
||||
<description>
|
||||
Overrides Blackboard data, discarding anything that was stored at this scope. Use with caution.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_parent_scope">
|
||||
<return type="void" />
|
||||
<argument 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.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_var">
|
||||
|
@ -53,6 +64,7 @@
|
|||
<argument index="0" name="p_key" type="Variant" />
|
||||
<argument index="1" name="p_value" type="Variant" />
|
||||
<description>
|
||||
Sets value of blackboard variable.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="LimboHSM" inherits="LimboState" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
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.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -13,16 +16,19 @@
|
|||
<argument index="1" name="p_to_state" type="Node" />
|
||||
<argument index="2" name="p_event" type="String" />
|
||||
<description>
|
||||
Adds a transition from one state to another when [code]p_event[/code] is dispatched.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_active_state" qualifiers="const">
|
||||
<return type="LimboState" />
|
||||
<description>
|
||||
Returns active state.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_leaf_state" qualifiers="const">
|
||||
<return type="LimboState" />
|
||||
<description>
|
||||
Returns the leaf state that is currently active in HSM.
|
||||
</description>
|
||||
</method>
|
||||
<method name="initialize">
|
||||
|
@ -30,43 +36,53 @@
|
|||
<argument index="0" name="p_agent" type="Object" />
|
||||
<argument index="1" name="p_parent_scope" type="Blackboard" default="null" />
|
||||
<description>
|
||||
Initializes state and calls [code]_setup[/code] for itself and every substate.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_active">
|
||||
<return type="void" />
|
||||
<argument 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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="update">
|
||||
<return type="void" />
|
||||
<argument index="0" name="p_delta" type="float" />
|
||||
<description>
|
||||
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].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="ANYSTATE" type="LimboState" setter="" getter="anystate">
|
||||
Useful to define a transition from any state.
|
||||
</member>
|
||||
<member name="_blackboard_data" type="Dictionary" setter="_set_blackboard_data" getter="_get_blackboard_data" overrides="LimboState" default="{}" />
|
||||
<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.
|
||||
</member>
|
||||
<member name="update_mode" type="int" setter="set_update_mode" getter="get_update_mode" enum="LimboHSM.UpdateMode" default="0">
|
||||
Determines when state machine is updated. See [enum UpdateMode].
|
||||
</member>
|
||||
</members>
|
||||
<signals>
|
||||
<signal name="state_changed">
|
||||
<argument index="0" name="p_state" type="LimboState" />
|
||||
<description>
|
||||
Emitted when state is changed.
|
||||
</description>
|
||||
</signal>
|
||||
</signals>
|
||||
<constants>
|
||||
<constant name="IDLE" value="0" enum="UpdateMode">
|
||||
Update state machine during idle process.
|
||||
</constant>
|
||||
<constant name="PHYSICS" value="1" enum="UpdateMode">
|
||||
Update state machine during physics process.
|
||||
</constant>
|
||||
<constant name="MANUAL" value="2" enum="UpdateMode">
|
||||
Update state machine manually by calling [method update] from a script.
|
||||
</constant>
|
||||
</constants>
|
||||
</class>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="LimboState" inherits="Node" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
A State node for Hierarchical State Machine (HSM).
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
@ -10,22 +11,26 @@
|
|||
<method name="_enter" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Called when state is entered.
|
||||
</description>
|
||||
</method>
|
||||
<method name="_exit" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Called when state is exited.
|
||||
</description>
|
||||
</method>
|
||||
<method name="_setup" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Called once during intialization.
|
||||
</description>
|
||||
</method>
|
||||
<method name="_update" qualifiers="virtual">
|
||||
<return type="void" />
|
||||
<argument index="0" name="p_delta" type="float" />
|
||||
<description>
|
||||
Called during update.
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_event_handler">
|
||||
|
@ -33,6 +38,7 @@
|
|||
<argument index="0" name="p_event" type="String" />
|
||||
<argument index="1" name="p_method" type="String" />
|
||||
<description>
|
||||
Register [code]p_method[/code] that will be called when [code]p_event[/code] happens. Method must belong to the state.
|
||||
</description>
|
||||
</method>
|
||||
<method name="call_on_enter">
|
||||
|
@ -40,6 +46,7 @@
|
|||
<argument index="0" name="p_object" type="Object" />
|
||||
<argument index="1" name="p_method" type="String" />
|
||||
<description>
|
||||
A chained method that connects [signal entered] signal to a [code]p_method[/code] on a [p_object].
|
||||
</description>
|
||||
</method>
|
||||
<method name="call_on_exit">
|
||||
|
@ -47,6 +54,7 @@
|
|||
<argument index="0" name="p_object" type="Object" />
|
||||
<argument index="1" name="p_method" type="String" />
|
||||
<description>
|
||||
A chained method that connects [signal exited] signal to a [code]p_method[/code] on a [p_object].
|
||||
</description>
|
||||
</method>
|
||||
<method name="call_on_update">
|
||||
|
@ -54,11 +62,13 @@
|
|||
<argument index="0" name="p_object" type="Object" />
|
||||
<argument index="1" name="p_method" type="String" />
|
||||
<description>
|
||||
A chained method that connects [signal updated] signal to a [code]p_method[/code] on a [p_object].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_guard_func">
|
||||
<return type="void" />
|
||||
<description>
|
||||
Removes the guard function that was set by [method set_guard_func].
|
||||
</description>
|
||||
</method>
|
||||
<method name="dispatch">
|
||||
|
@ -66,22 +76,27 @@
|
|||
<argument index="0" name="p_event" type="String" />
|
||||
<argument 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.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_root" qualifiers="const">
|
||||
<return type="LimboState" />
|
||||
<description>
|
||||
Returns the root [LimboState].
|
||||
</description>
|
||||
</method>
|
||||
<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].
|
||||
</description>
|
||||
</method>
|
||||
<method name="named">
|
||||
<return type="LimboState" />
|
||||
<argument index="0" name="p_name" type="String" />
|
||||
<description>
|
||||
A chained method that sets the name of this state.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_guard_func">
|
||||
|
@ -90,35 +105,41 @@
|
|||
<argument index="1" name="p_func" type="String" />
|
||||
<argument index="2" name="p_binds" type="Array" default="[ ]" />
|
||||
<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], that transition will not be allowed.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
<members>
|
||||
<member name="EVENT_FINISHED" type="String" setter="" getter="event_finished">
|
||||
</member>
|
||||
<member name="_blackboard_data" type="Dictionary" setter="_set_blackboard_data" getter="_get_blackboard_data" default="{}">
|
||||
A commonly used event that signifies that the state has finished work.
|
||||
</member>
|
||||
<member name="agent" type="Object" setter="set_agent" getter="get_agent">
|
||||
An agent that is associated with the state. Assinged by 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.
|
||||
</member>
|
||||
</members>
|
||||
<signals>
|
||||
<signal name="entered">
|
||||
<description>
|
||||
Emitted when the state is entered.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="exited">
|
||||
<description>
|
||||
Emitted when the state is exited.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="setup">
|
||||
<description>
|
||||
Emitted when the state is initialized.
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="updated">
|
||||
<argument index="0" name="p_delta" type="float" />
|
||||
<description>
|
||||
Emitted when the state is updated.
|
||||
</description>
|
||||
</signal>
|
||||
</signals>
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<class name="LimboUtility" inherits="Object" version="3.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
|
||||
<brief_description>
|
||||
Helper functions for LimboAI.
|
||||
</brief_description>
|
||||
<description>
|
||||
</description>
|
||||
|
@ -11,12 +12,14 @@
|
|||
<return type="String" />
|
||||
<argument index="0" name="p_variable" type="String" />
|
||||
<description>
|
||||
Returns a string with a [Blackboard] variable name ready to be displayed or printed to console.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_status_name" qualifiers="const">
|
||||
<return type="String" />
|
||||
<argument index="0" name="p_status" type="int" />
|
||||
<description>
|
||||
Returns name of a [BTTask] status code.
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
|
|
Loading…
Reference in New Issue