Improve docs: BTAlways{Fail,Succeed}, BTCooldown, BTDelay

This commit is contained in:
Serhii Snitsaruk 2023-10-05 12:21:25 +02:00
parent 0c325e3660
commit f71e158418
4 changed files with 15 additions and 17 deletions

View File

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

View File

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

View File

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

View File

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