parent
4cf5a18721
commit
7fc3831384
|
@ -4,7 +4,7 @@
|
|||
Base class for all [BehaviorTree] actions.
|
||||
</brief_description>
|
||||
<description>
|
||||
Base class for all actions within a [BehaviorTree]. You can create your own actions by extending the [code]BTAction[/code] class.
|
||||
Base class for all actions within a [BehaviorTree]. You can create your own actions by extending the [BTAction] class.
|
||||
Represents a specific behavior or action in a [BehaviorTree] that an agent should execute. Actions are the lowest level of the [BehaviorTree] hierarchy and are responsible for performing the actual work required to achieve a goal. Actions do not have child tasks.
|
||||
A single action can perform a task within one or multiple ticks. If it takes more than one tick to complete the task, the action should return [code]RUNNING[/code] status. When the task is finished, the action returns either [code]SUCCESS[/code] or [code]FAILURE[/code] to indicate the outcome.
|
||||
</description>
|
||||
|
|
|
@ -4,16 +4,16 @@
|
|||
BT condition that checks a trigger (a boolean variable).
|
||||
</brief_description>
|
||||
<description>
|
||||
BTCheckTrigger verifies whether the [member variable] is set to [code]true[/code]. If it is, the task switches it to [code]false[/code] and returns [code]SUCCESS[/code]. Otherwise, it returns [code]FAILURE[/code].
|
||||
BTCheckTrigger can function as a "gate" within a [BTSequence]: when the trigger variable is set to [code]true[/code], it permits the execution of subsequent tasks and then changes the variable to [code]false[/code].
|
||||
[BTCheckTrigger] verifies whether the [member variable] is set to [code]true[/code]. If it is, the task switches it to [code]false[/code] and returns [code]SUCCESS[/code]. Otherwise, it returns [code]FAILURE[/code].
|
||||
[BTCheckTrigger] can function as a "gate" within a [BTSequence]: when the trigger variable is set to [code]true[/code], it permits the execution of subsequent tasks and then changes the variable to [code]false[/code].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
<members>
|
||||
<member name="variable" type="String" setter="set_variable" getter="get_variable" default="""">
|
||||
A boolean variable on the [member blackboard] used as a trigger.
|
||||
If variable's value is [code]true[/code], BTCheckTrigger will switch it to [code]false[/code] and return [code]SUCCESS[/code].
|
||||
If variable's value is [code]false[/code], BTCheckTrigger will return [code]FAILURE[/code].
|
||||
A boolean variable on the blackboard used as a trigger. See also [member BTTask.blackboard].
|
||||
If variable's value is [code]true[/code], [BTCheckTrigger] will switch it to [code]false[/code] and return [code]SUCCESS[/code].
|
||||
If variable's value is [code]false[/code], [BTCheckTrigger] will return [code]FAILURE[/code].
|
||||
</member>
|
||||
</members>
|
||||
</class>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
Base class for BT conditions.
|
||||
</brief_description>
|
||||
<description>
|
||||
Base class for all [BehaviorTree] conditions. You can create your own conditions by extending the [code]BTCondition[/code] class.
|
||||
Base class for all [BehaviorTree] conditions. You can create your own conditions by extending the [BTCondition] class.
|
||||
Condition is a task within a [BehaviorTree] that checks for a specific condition before executing subsequent tasks. It is often used inside composite tasks to control the execution flow. Conditions are used to verify the state of the environment, check for the presence of an enemy, or evaluate the health status of the agent. The use of condition tasks in a [BehaviorTree] can improve system efficiency and prevent unnecessary actions. However, they may not be suitable for complex decision-making processes, and too many condition tasks can make the [BehaviorTree] difficult to read.
|
||||
Conditions typically don't take multiple ticks to finish and return either [code]SUCCESS[/code] or [code]FAILURE[/code] immediately.
|
||||
</description>
|
||||
|
|
|
@ -55,14 +55,14 @@
|
|||
<param index="0" name="p_status" type="int" />
|
||||
<description>
|
||||
Emitted when the behavior tree has finished executing and returned [code]SUCCESS[/code] or [code]FAILURE[/code].
|
||||
Argument [code]p_status[/code] holds the status returned by the behavior tree. See [enum BT.Status].
|
||||
Argument [param p_status] holds the status returned by the behavior tree. See [enum BT.Status].
|
||||
</description>
|
||||
</signal>
|
||||
<signal name="updated">
|
||||
<param index="0" name="p_status" type="int" />
|
||||
<description>
|
||||
Emitted when BTPlayer has finished the behavior tree update.
|
||||
Argument [code]p_status[/code] holds the status returned by the behavior tree. See [enum BT.Status].
|
||||
Argument [param p_status] holds the status returned by the behavior tree. See [enum BT.Status].
|
||||
</description>
|
||||
</signal>
|
||||
</signals>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
BT action that waits for a randomized duration to elapse and then returns [code]SUCCESS[/code].
|
||||
</brief_description>
|
||||
<description>
|
||||
BTRandomWait action waits for a randomized duration to elapse and then returns [code]SUCCESS[/code]. The duration is randomized within the specified range, defined by [code]min_duration[/code] and [code]max_duration[/code].
|
||||
BTRandomWait action waits for a randomized duration to elapse and then returns [code]SUCCESS[/code]. The duration is randomized within the specified range, defined by [member min_duration] and [member max_duration].
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
Base class for all [BehaviorTree] tasks. A task is a basic building block in a [BehaviorTree] that represents a specific behavior or control flow. Tasks are used to create complex behaviors by combining and nesting them in a hierarchy.
|
||||
A task can be one of the following types: action, condition, composite, or decorator. Each type of task has its own corresponding subclass: [BTAction], [BTCondition], [BTDecorator], [BTComposite].
|
||||
Tasks perform their work and return their status using the [method _tick] method. Status values are defined in [enum BT.Status]. Tasks can be initialized using the [method _setup] method. See also [method _enter] & [method _exit].
|
||||
[b]Note:[/b] Do not extend [code]BTTask[/code] directly for your own tasks. Instead, extend one of the subtypes mentioned above.
|
||||
[b]Note:[/b] Do not extend [BTTask] directly for your own tasks. Instead, extend one of the subtypes mentioned above.
|
||||
</description>
|
||||
<tutorials>
|
||||
</tutorials>
|
||||
|
@ -62,7 +62,7 @@
|
|||
<return type="void" />
|
||||
<param index="0" name="p_child" type="BTTask" />
|
||||
<description>
|
||||
Adds a child task. The [code]p_child[/code] is placed at the end of the children list.
|
||||
Adds a child task. The [param p_child] is placed at the end of the children list.
|
||||
</description>
|
||||
</method>
|
||||
<method name="add_child_at_index">
|
||||
|
@ -70,7 +70,7 @@
|
|||
<param index="0" name="p_child" type="BTTask" />
|
||||
<param index="1" name="p_idx" type="int" />
|
||||
<description>
|
||||
Adds a child task. The [code]p_child[/code] is placed at [code]p_idx[/code] position in the children list.
|
||||
Adds a child task. The [param p_child] is placed at [param p_idx] position in the children list.
|
||||
</description>
|
||||
</method>
|
||||
<method name="clone" qualifiers="const">
|
||||
|
@ -137,7 +137,7 @@
|
|||
<return type="bool" />
|
||||
<param index="0" name="p_child" type="BTTask" />
|
||||
<description>
|
||||
Returns [code]true[/code] if [code]p_child[/code] is a child of this task.
|
||||
Returns [code]true[/code] if [param p_child] is a child of this task.
|
||||
</description>
|
||||
</method>
|
||||
<method name="initialize">
|
||||
|
@ -153,7 +153,7 @@
|
|||
<return type="bool" />
|
||||
<param index="0" name="p_task" type="BTTask" />
|
||||
<description>
|
||||
Returns [code]true[/code] if this task is a descendant of [code]p_task[/code]. In other words, this task must be a child of [code]p_task[/code] or one of its children or grandchildren.
|
||||
Returns [code]true[/code] if this task is a descendant of [param p_task]. In other words, this task must be a child of [param p_task] or one of its children or grandchildren.
|
||||
</description>
|
||||
</method>
|
||||
<method name="is_root" qualifiers="const">
|
||||
|
@ -180,7 +180,7 @@
|
|||
<return type="void" />
|
||||
<param index="0" name="p_child" type="BTTask" />
|
||||
<description>
|
||||
Removes [code]p_child[/code] task from children.
|
||||
Removes [param p_child] task from children.
|
||||
</description>
|
||||
</method>
|
||||
<method name="remove_child_at_index">
|
||||
|
@ -200,7 +200,7 @@
|
|||
See [Blackboard] for additional info.
|
||||
</member>
|
||||
<member name="custom_name" type="String" setter="set_custom_name" getter="get_custom_name" default="""">
|
||||
User-provided name for the task. If not empty, [code]custom_name[/code] is used by the editor to represent the task. See [method get_task_name].
|
||||
User-provided name for the task. If not empty, it is used by the editor to represent the task. See [method get_task_name].
|
||||
</member>
|
||||
<member name="elapsed_time" type="float" setter="" getter="get_elapsed_time">
|
||||
Elapsed time since the task was "entered". See [method _enter].
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
<return type="bool" />
|
||||
<param index="0" name="p_key" type="Variant" />
|
||||
<description>
|
||||
Returns [code]true[/code] if the Blackboard contains the [code]p_key[/code] variable, including the parent scopes.
|
||||
Returns [code]true[/code] if the Blackboard contains the [param p_key] variable, including the parent scopes.
|
||||
</description>
|
||||
</method>
|
||||
<method name="prefetch_nodepath_vars">
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<param index="1" name="p_to_state" type="Node" />
|
||||
<param index="2" name="p_event" type="String" />
|
||||
<description>
|
||||
Establishes a transition from one state to another when [code]p_event[/code] is dispatched. Both [code]p_from_state[/code] and [code]p_to_state[/code] must be immediate children of this state.
|
||||
Establishes a transition from one state to another when [param p_event] is dispatched. Both [param p_from_state] and [param p_to_state] must be immediate children of this state.
|
||||
</description>
|
||||
</method>
|
||||
<method name="get_active_state" qualifiers="const">
|
||||
|
@ -35,7 +35,7 @@
|
|||
<param index="0" name="p_agent" type="Node" />
|
||||
<param index="1" name="p_parent_scope" type="Blackboard" default="null" />
|
||||
<description>
|
||||
Initiates the state and calls [code]_setup[/code] for both itself and all substates.
|
||||
Initiates the state and calls [method LimboState._setup] for both itself and all substates.
|
||||
</description>
|
||||
</method>
|
||||
<method name="set_active">
|
||||
|
|
|
@ -41,28 +41,28 @@
|
|||
<param index="0" name="p_event" type="String" />
|
||||
<param index="1" name="p_handler" type="Callable" />
|
||||
<description>
|
||||
Registers a [code]p_method[/code] to be called when [code]p_event[/code] is dispatched. The method must belong to the state.
|
||||
Registers a [param p_handler] to be called when [param p_event] is dispatched. The method must belong to the state.
|
||||
</description>
|
||||
</method>
|
||||
<method name="call_on_enter">
|
||||
<return type="LimboState" />
|
||||
<param index="0" name="p_callable" type="Callable" />
|
||||
<description>
|
||||
A chained method that connects the [signal entered] signal to a [code]p_callable[/code].
|
||||
A chained method that connects the [signal entered] signal to a [param p_callable].
|
||||
</description>
|
||||
</method>
|
||||
<method name="call_on_exit">
|
||||
<return type="LimboState" />
|
||||
<param index="0" name="p_callable" type="Callable" />
|
||||
<description>
|
||||
A chained method that connects the [signal exited] signal to a [code]p_callable[/code].
|
||||
A chained method that connects the [signal exited] signal to a [param p_callable].
|
||||
</description>
|
||||
</method>
|
||||
<method name="call_on_update">
|
||||
<return type="LimboState" />
|
||||
<param index="0" name="p_callable" type="Callable" />
|
||||
<description>
|
||||
A chained method that connects the [signal updated] signal to a [code]p_callable[/code].
|
||||
A chained method that connects the [signal updated] signal to a [param p_callable].
|
||||
</description>
|
||||
</method>
|
||||
<method name="clear_guard">
|
||||
|
@ -76,7 +76,7 @@
|
|||
<param index="0" name="p_event" type="String" />
|
||||
<param index="1" name="p_cargo" type="Variant" default="null" />
|
||||
<description>
|
||||
Recursively dispatches a state machine event named [code]p_event[/code] with an optional argument [code]p_cargo[/code]. Returns [code]true[/code] if the event was consumed.
|
||||
Recursively dispatches a state machine event named [param p_event] with an optional argument [param p_cargo]. Returns [code]true[/code] if the event was consumed.
|
||||
Events propagate from the leaf state to the root state, and propagation stops as soon as any state consumes the event. States will consume the event if they have a related transition or event handler. For more information on event handlers, see [method add_event_handler].
|
||||
</description>
|
||||
</method>
|
||||
|
|
Loading…
Reference in New Issue