138 lines
11 KiB
Plaintext
138 lines
11 KiB
Plaintext
<322> <1/> <b>is_root</b>() <2/> <l3>🔗</l>
|
||
<323> Returns <1/> if this task is the root task of its behavior tree. A behavior tree can have only one root task.
|
||
<324> <l1>BTTask</l> <b>next_sibling</b>() <2/> <l3>🔗</l>
|
||
<325> Returns the next task after this task in the parent’s children list.
|
||
<326> Returns <1/> if this task has no parent or it is the last child in the parent’s children list.
|
||
<327> <1/> <b>print_tree</b>(initial_tabs: <2/> = 0) <l3>🔗</l>
|
||
<328> Prints the subtree that starts with this task to the console.
|
||
<329> <1/> <b>remove_child</b>(task: <l2>BTTask</l>) <l3>🔗</l>
|
||
<330> Removes <1/> from children.
|
||
<331> <1/> <b>remove_child_at_index</b>(idx: <2/>) <l3>🔗</l>
|
||
<332> Removes a child task at a specified index from children.
|
||
<333> BTPlayer
|
||
<334> <b>Inherits:</b>
|
||
<335> Player of <l1>BehaviorTree</l> resources.
|
||
<336> <b>BTPlayer</b> node is used to instantiate and play <l1>BehaviorTree</l> resources at runtime. During initialization, the behavior tree instance is given references to the agent, the <l2>blackboard</l>, and the current scene root. The agent can be specified by the <l3>agent_node</l> property (defaults to the BTPlayer’s parent node).
|
||
<337> For an introduction to behavior trees, see <l1>BehaviorTree</l>.
|
||
<338> <l1>active</l>
|
||
<339> <l1>agent_node</l>
|
||
<340> <l1>behavior_tree</l>
|
||
<341> <l1>blackboard</l>
|
||
<342> <l1>BlackboardPlan</l>
|
||
<343> <l1>blackboard_plan</l>
|
||
<344> <l1>monitor_performance</l>
|
||
<345> <l1>UpdateMode</l>
|
||
<346> <l1>update_mode</l>
|
||
<347> <l1>BTInstance</l>
|
||
<348> <l1>get_bt_instance</l>()
|
||
<349> <l1>restart</l>()
|
||
<350> <l1>set_bt_instance</l>(bt_instance: <l2>BTInstance</l>)
|
||
<351> <l1>set_scene_root_hint</l>(scene_root: <2/>)
|
||
<352> <l1>update</l>(delta: <2/>)
|
||
<353> Signals
|
||
<354> <b>behavior_tree_finished</b>(status: <1/>) <l2>🔗</l>
|
||
<355> <b>Deprecated:</b> Use <l1>updated</l> signal instead.
|
||
<356> Emitted when the behavior tree has finished executing and returned <1/> or <2/>.
|
||
<357> Argument <1/> holds the status returned by the behavior tree. See <l2>Status</l>.
|
||
<358> <b>updated</b>(status: <1/>) <l2>🔗</l>
|
||
<359> Emitted when BTPlayer has finished the behavior tree update.
|
||
<360> Enumerations
|
||
<361> enum <b>UpdateMode</b>: <l1>🔗</l>
|
||
<362> <l1>UpdateMode</l> <b>IDLE</b> = <2/>
|
||
<363> Execute behavior tree during the idle process.
|
||
<364> <l1>UpdateMode</l> <b>PHYSICS</b> = <2/>
|
||
<365> Execute behavior tree during the physics process.
|
||
<366> <l1>UpdateMode</l> <b>MANUAL</b> = <2/>
|
||
<367> Behavior tree is executed manually by calling <l1>update</l>.
|
||
<368> <1/> <b>active</b> = <2/> <l3>🔗</l>
|
||
<369> <1/> <b>set_active</b>(value: <2/>)
|
||
<370> <1/> <b>get_active</b>()
|
||
<371> If <1/>, the behavior tree will be executed during update.
|
||
<372> <1/> <b>agent_node</b> = <2/> <l3>🔗</l>
|
||
<373> <1/> <b>set_agent_node</b>(value: <2/>)
|
||
<374> <1/> <b>get_agent_node</b>()
|
||
<375> Path to the node that will be used as the agent. Setting it after instantiation will have no effect.
|
||
<376> <l1>BehaviorTree</l> <b>behavior_tree</b> <l2>🔗</l>
|
||
<377> <1/> <b>set_behavior_tree</b>(value: <l2>BehaviorTree</l>)
|
||
<378> <l1>BehaviorTree</l> <b>get_behavior_tree</b>()
|
||
<379> <l1>BehaviorTree</l> resource to instantiate and execute at runtime.
|
||
<380> <l1>Blackboard</l> <b>blackboard</b> <l2>🔗</l>
|
||
<381> <1/> <b>set_blackboard</b>(value: <l2>Blackboard</l>)
|
||
<382> Holds data shared by the behavior tree tasks. See <l1>Blackboard</l>.
|
||
<383> <l1>BlackboardPlan</l> <b>blackboard_plan</b> <l2>🔗</l>
|
||
<384> <1/> <b>set_blackboard_plan</b>(value: <l2>BlackboardPlan</l>)
|
||
<385> <l1>BlackboardPlan</l> <b>get_blackboard_plan</b>()
|
||
<386> Stores and manages variables that will be used in constructing new <l1>Blackboard</l> instances.
|
||
<387> <1/> <b>monitor_performance</b> = <2/> <l3>🔗</l>
|
||
<388> <1/> <b>set_monitor_performance</b>(value: <2/>)
|
||
<389> <1/> <b>get_monitor_performance</b>()
|
||
<390> If <1/>, adds a performance monitor to “Debugger->Monitors” for each instance of this <b>BTPlayer</b> node.
|
||
<391> <l1>UpdateMode</l> <b>update_mode</b> = <2/> <l3>🔗</l>
|
||
<392> <1/> <b>set_update_mode</b>(value: <l2>UpdateMode</l>)
|
||
<393> <l1>UpdateMode</l> <b>get_update_mode</b>()
|
||
<394> Determines when the behavior tree is executed. See <l1>UpdateMode</l>.
|
||
<395> <l1>BTInstance</l> <b>get_bt_instance</b>() <l2>🔗</l>
|
||
<396> Returns the behavior tree instance.
|
||
<397> <1/> <b>restart</b>() <l2>🔗</l>
|
||
<398> Resets the behavior tree’s execution. Each running task will be aborted and the next tree execution will start anew. This method does not reset <l1>Blackboard</l>.
|
||
<399> <1/> <b>set_bt_instance</b>(bt_instance: <l2>BTInstance</l>) <l3>🔗</l>
|
||
<400> Sets the <l1>BTInstance</l> to play. This method is useful when you want to switch to a different behavior tree instance at runtime. See also <l2>BehaviorTree.instantiate</l>.
|
||
<401> <1/> <b>set_scene_root_hint</b>(scene_root: <2/>) <l3>🔗</l>
|
||
<402> Sets the <1/> that will be used as the scene root for the newly instantiated behavior tree. Should be called before the <b>BTPlayer</b> is added to the scene tree (before <2/>). This is typically useful when creating <b>BTPlayer</b> nodes dynamically from code.
|
||
<403> <1/> <b>update</b>(delta: <2/>) <l3>🔗</l>
|
||
<404> Executes the root task of the behavior tree instance if <l1>active</l> is <2/>. Call this method when <l3>update_mode</l> is set to <l4>MANUAL</l>. When <l5>update_mode</l> is not <l6>MANUAL</l>, the <l7>update</l> will be called automatically. See <l8>UpdateMode</l>.
|
||
<405> Blackboard
|
||
<406> A key/value storage for sharing among <l1>LimboHSM</l> states and <l2>BehaviorTree</l> tasks.
|
||
<407> Blackboard is where data is stored and shared between states in the <l1>LimboHSM</l> system and tasks in a <l2>BehaviorTree</l>. Each state and task in the <l3>BehaviorTree</l> can access this Blackboard, allowing them to read and write data. This makes it easy to share information between different actions and behaviors.
|
||
<408> Blackboard can also act as a parent scope for another Blackboard. If a specific variable is not found in the active scope, it looks in the parent Blackboard to find it. A parent Blackboard can itself have its own parent scope, forming what we call a “blackboard scope chain.” Importantly, there is no limit to how many Blackboards can be in this chain, and the Blackboard doesn’t modify values in the parent scopes.
|
||
<409> New scopes can be created using the <l1>BTNewScope</l> and <l2>BTSubtree</l> decorators. Additionally, a new scope is automatically created for any <l3>LimboState</l> that has defined non-empty Blackboard data or for any root-level <l4>LimboHSM</l> node.
|
||
<410> <l1>bind_var_to_property</l>(var_name: <2/>, object: <3/>, property: <4/>, create: <5/> = false)
|
||
<411> <l1>clear</l>()
|
||
<412> <l1>erase_var</l>(var_name: <2/>)
|
||
<413> <l1>Blackboard</l>
|
||
<414> <l1>get_parent</l>() <2/>
|
||
<415> <l1>get_var</l>(var_name: <2/>, default: <3/> = null, complain: <4/> = true) <5/>
|
||
<416> <l1>get_vars_as_dict</l>() <2/>
|
||
<417> <l1>has_var</l>(var_name: <2/>) <3/>
|
||
<418> <l1>link_var</l>(var_name: <2/>, target_blackboard: <l3>Blackboard</l>, target_var: <4/>, create: <5/> = false)
|
||
<419> Array[<1/>]
|
||
<420> <l1>list_vars</l>() <2/>
|
||
<421> <l1>populate_from_dict</l>(dictionary: <2/>)
|
||
<422> <l1>print_state</l>() <2/>
|
||
<423> <l1>set_parent</l>(blackboard: <l2>Blackboard</l>)
|
||
<424> <l1>set_var</l>(var_name: <2/>, value: <3/>)
|
||
<425> <l1>top</l>() <2/>
|
||
<426> <l1>unbind_var</l>(var_name: <2/>)
|
||
<427> <1/> <b>bind_var_to_property</b>(var_name: <2/>, object: <3/>, property: <4/>, create: <5/> = false) <l6>🔗</l>
|
||
<428> Establish a binding between a variable and the object’s property specified by <1/> and <2/>. Changes to the variable update the property, and vice versa. If <3/> is <4/>, the variable will be created if it doesn’t exist.
|
||
<429> <1/> <b>clear</b>() <l2>🔗</l>
|
||
<430> Removes all variables from the Blackboard. Parent scopes are not affected.
|
||
<431> <1/> <b>erase_var</b>(var_name: <2/>) <l3>🔗</l>
|
||
<432> Removes a variable by its name.
|
||
<433> <l1>Blackboard</l> <b>get_parent</b>() <2/> <l3>🔗</l>
|
||
<434> Returns a Blackboard that serves as the parent scope for this instance.
|
||
<435> <1/> <b>get_var</b>(var_name: <2/>, default: <3/> = null, complain: <4/> = true) <5/> <l6>🔗</l>
|
||
<436> Returns variable value or <1/> if variable doesn’t exist. If <2/> is <3/>, an error will be printed if variable doesn’t exist. If the variable doesn’t exist in the current <b>Blackboard</b> scope, it will look in the parent scope <b>Blackboard</b> to find it.
|
||
<437> <1/> <b>get_vars_as_dict</b>() <2/> <l3>🔗</l>
|
||
<438> Returns all variables in the Blackboard as a dictionary. Keys are the variable names, values are the variable values. Parent scopes are not included.
|
||
<439> <1/> <b>has_var</b>(var_name: <2/>) <3/> <l4>🔗</l>
|
||
<440> Returns <1/> if the Blackboard contains the <2/> variable, including the parent scopes.
|
||
<441> <1/> <b>link_var</b>(var_name: <2/>, target_blackboard: <l3>Blackboard</l>, target_var: <4/>, create: <5/> = false) <l6>🔗</l>
|
||
<442> Links a variable to another Blackboard variable. If a variable is linked to another variable, their state will always be identical, and any change to one will be reflected in the other. If <1/> is <2/>, the variable will be created if it doesn’t exist.
|
||
<443> You can use this method to link a variable in the current scope to a variable in another scope, or in another Blackboard instance. A variable can only be linked to one other variable. Calling this method again will overwrite the previous link. However, it is possible to link to the same variable from multiple different variables.
|
||
<444> Array[<1/>] <b>list_vars</b>() <2/> <l3>🔗</l>
|
||
<445> Returns all variable names in the Blackboard. Parent scopes are not included.
|
||
<446> <1/> <b>populate_from_dict</b>(dictionary: <2/>) <l3>🔗</l>
|
||
<447> Fills the Blackboard with multiple variables from a dictionary. The dictionary keys must be variable names and the dictionary values must be variable values. Keys must be StringName or String.
|
||
<448> <1/> <b>print_state</b>() <2/> <l3>🔗</l>
|
||
<449> Prints the values of all variables in each scope.
|
||
<450> <1/> <b>set_parent</b>(blackboard: <l2>Blackboard</l>) <l3>🔗</l>
|
||
<451> Assigns the parent scope. If a value isn’t in the current Blackboard scope, it will look in the parent scope Blackboard to find it.
|
||
<452> <1/> <b>set_var</b>(var_name: <2/>, value: <3/>) <l4>🔗</l>
|
||
<453> Assigns a value to a variable in the current Blackboard scope. If the variable doesn’t exist, it will be created. If the variable already exists in the parent scope, the parent scope value will NOT be changed.
|
||
<454> <l1>Blackboard</l> <b>top</b>() <2/> <l3>🔗</l>
|
||
<455> Returns the topmost <b>Blackboard</b> in the scope chain.
|
||
<456> <1/> <b>unbind_var</b>(var_name: <2/>) <l3>🔗</l>
|
||
<457> Remove binding from a variable.
|
||
<458> BBParam
|
||
<459> <b>Inherited By:</b> <l1>BBAabb</l>, <l2>BBArray</l>, <l3>BBBasis</l>, <l4>BBBool</l>, <l5>BBByteArray</l>, <l6>BBColor</l>, <l7>BBColorArray</l>, <l8>BBDictionary</l>, <l9>BBFloat</l>, <l10>BBFloat32Array</l>, <l11>BBFloat64Array</l>, <l12>BBInt</l>, <l13>BBInt32Array</l>, <l14>BBInt64Array</l>, <l15>BBNode</l>, <l16>BBPlane</l>, <l17>BBProjection</l>, <l18>BBQuaternion</l>, <l19>BBRect2</l>, <l20>BBRect2i</l>, <l21>BBString</l>, <l22>BBStringArray</l>, <l23>BBStringName</l>, <l24>BBTransform2D</l>, <l25>BBTransform3D</l>, <l26>BBVariant</l>, <l27>BBVector2</l>, <l28>BBVector2Array</l>, <l29>BBVector2i</l>, <l30>BBVector3</l>, <l31>BBVector3Array</l>, <l32>BBVector3i</l>, <l33>BBVector4</l>, <l34>BBVector4i</l> |