Files
2026-10-15 16:30:44 +08:00

158 lines
11 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<1074> <1/> <b>save_var</b> = <2/> <l3>🔗</l>
<1075> <1/> <b>set_save_var</b>(value: <2/>)
<1076> <1/> <b>get_save_var</b>()
<1077> A <l1>Blackboard</l> variable used to store an element of the array referenced by <l2>array_var</l>.
<1078> BTInstance
<1079> Represents a runtime instance of a <l1>BehaviorTree</l> resource.
<1080> Can be created using the <l1>BehaviorTree.instantiate</l> method.
<1081> <l1>monitor_performance</l>
<1082> <l1>get_agent</l>() <2/>
<1083> <l1>get_blackboard</l>() <2/>
<1084> <l1>get_last_status</l>() <2/>
<1085> <l1>get_owner_node</l>() <2/>
<1086> <l1>get_root_task</l>() <2/>
<1087> <l1>get_source_bt_path</l>() <2/>
<1088> <l1>is_instance_valid</l>() <2/>
<1089> <l1>register_with_debugger</l>()
<1090> <l1>unregister_with_debugger</l>()
<1091> <l1>update</l>(delta: <2/>)
<1092> <b>freed</b>() <l1>🔗</l>
<1093> Emitted when the behavior tree instance is freed. Used by debugger to unregister.
<1094> <b>updated</b>(status: <1/>) <l2>🔗</l>
<1095> Emitted when the behavior tree instance has finished updating.
<1096> <1/> <b>monitor_performance</b> = <2/> <l3>🔗</l>
<1097> If <1/>, adds a performance monitor for this instance to “Debugger->Monitors” in the editor.
<1098> <1/> <b>get_agent</b>() <2/> <l3>🔗</l>
<1099> Returns the agent of the behavior tree instance.
<1100> <l1>Blackboard</l> <b>get_blackboard</b>() <2/> <l3>🔗</l>
<1101> Returns the blackboard of the behavior tree instance.
<1102> <l1>Status</l> <b>get_last_status</b>() <2/> <l3>🔗</l>
<1103> Returns the execution status of the last update.
<1104> <1/> <b>get_owner_node</b>() <2/> <l3>🔗</l>
<1105> Returns the scene <1/> that owns this behavior tree instance.
<1106> <l1>BTTask</l> <b>get_root_task</b>() <2/> <l3>🔗</l>
<1107> Returns the root task of the behavior tree instance.
<1108> <1/> <b>get_source_bt_path</b>() <2/> <l3>🔗</l>
<1109> Returns the file path to the behavior tree resource that was used to create this instance.
<1110> <1/> <b>is_instance_valid</b>() <2/> <l3>🔗</l>
<1111> Returns <1/> if the behavior tree instance is properly initialized and can be used.
<1112> <1/> <b>register_with_debugger</b>() <l2>🔗</l>
<1113> Registers the behavior tree instance with the debugger.
<1114> <1/> <b>unregister_with_debugger</b>() <l2>🔗</l>
<1115> Unregisters the behavior tree instance from the debugger. This is typically not necessary, as the debugger will automatically unregister the instance when it is freed.
<1116> <l1>Status</l> <b>update</b>(delta: <2/>) <l3>🔗</l>
<1117> Ticks the behavior tree instance and returns its status.
<1118> BTInvert
<1119> BT decorator that transforms <1/> into <2/> and <3/> into <4/>.
<1120> BTInvert transforms <1/> into <2/> and <3/> into <4/>.
<1121> BTNewScope
<1122> <b>Inherited By:</b> <l1>BTSubtree</l>
<1123> BT decorator that creates a new <l1>Blackboard</l> scope.
<1124> BTNewScope creates a new <l1>Blackboard</l> scope during initialization and populates it with data. See <l2>Blackboard</l>.
<1125> Returns the status of the child task execution.
<1126> <l1>blackboard_plan</l>
<1127> <l1>BlackboardPlan</l> <b>blackboard_plan</b> <l2>🔗</l>
<1128> BTParallel
<1129> BT composite that executes all of its child tasks simultaneously.
<1130> BTParallel executes all of its child tasks simultaneously. Note that BTParallel doesn’t involve multithreading. It processes each task sequentially, from first to last, in the same tick before returning a result. If one of the abort criterea is met, any tasks currently <1/> will be terminated, and the result will be either <2/> or <3/>. The <l4>num_failures_required</l> determines when BTParallel fails and <l5>num_successes_required</l> when it succeeds. When both are fullfilled, it gives priority to <l6>num_failures_required</l>.
<1131> If set to <l1>repeat</l>, all child tasks will be re-executed each tick, regardless of whether they previously resulted in <2/> or <3/>.
<1132> Returns <1/> when the required number of child tasks result in <2/>. When <l3>repeat</l> is set to <4/>, if none of the criteria were met and all child tasks resulted in either <5/> or <6/>, BTParallel will return <7/>.
<1133> Returns <1/> when the required number of child tasks result in <2/>.
<1134> Returns <1/> if none of the criterea were fulfilled, and either <l2>repeat</l> is set to <3/> or a child task resulted in <4/>.
<1135> <l1>num_failures_required</l>
<1136> <l1>num_successes_required</l>
<1137> <l1>repeat</l>
<1138> <1/> <b>num_failures_required</b> = <2/> <l3>🔗</l>
<1139> <1/> <b>set_num_failures_required</b>(value: <2/>)
<1140> <1/> <b>get_num_failures_required</b>()
<1141> If the specified number of child tasks return <1/>, BTParallel will also return <2/>.
<1142> <1/> <b>num_successes_required</b> = <2/> <l3>🔗</l>
<1143> <1/> <b>set_num_successes_required</b>(value: <2/>)
<1144> <1/> <b>get_num_successes_required</b>()
<1145> If the specified number of child tasks return <1/>, BTParallel will also return <2/>.
<1146> <1/> <b>repeat</b> = <2/> <l3>🔗</l>
<1147> <1/> <b>set_repeat</b>(value: <2/>)
<1148> <1/> <b>get_repeat</b>()
<1149> When <1/>, the child tasks will be executed again, regardless of whether they previously resulted in a <2/> or <3/>.
<1150> When <1/>, if none of the criteria were met, and all child tasks resulted in a <2/> or <3/>, BTParallel will return <4/>.
<1151> BTPauseAnimation
<1152> BT action that pauses the playback of an animation on the specified <1/> node.
<1153> BTPauseAnimation action pauses the playback of an animation on the specified <1/> node and returns <2/>.
<1154> Returns <1/> if the action fails to get the <2/> node.
<1155> <l1>animation_player</l>
<1156> <l1>BBNode</l> <b>animation_player</b> <l2>🔗</l>
<1157> BTPlayAnimation
<1158> BT action that plays an animation on the specified <1/> node.
<1159> BTPlayAnimation action plays an animation on the specified <1/> node. If the <l2>await_completion</l> is greater than <3/>, the action will wait for the animation to complete, with the maximum waiting time equal to <l4>await_completion</l>.
<1160> Returns <1/> if the animation finishes playing or if the elapsed time exceeds <l2>await_completion</l>. When <l3>await_completion</l> is set to <4/>, BTPlayAnimation doesn’t wait for the animation to finish and immediately returns <5/>.
<1161> Returns <1/> if the animation is still playing and the elapsed time is less than <l2>await_completion</l>.
<1162> Returns <1/> if the action fails to play the requested animation.
<1163> <l1>animation_name</l>
<1164> <l1>animation_player</l>
<1165> <l1>await_completion</l>
<1166> <l1>blend</l>
<1167> <l1>from_end</l>
<1168> <l1>speed</l>
<1169> <1/> <b>animation_name</b> = <2/> <l3>🔗</l>
<1170> Animation’s key within the <1/> node. If empty, BTPlayAnimation will resume the last played animation if the <2/> was previously paused.
<1171> <l1>BBNode</l> <b>animation_player</b> <l2>🔗</l>
<1172> <1/> <b>await_completion</b> = <2/> <l3>🔗</l>
<1173> <1/> <b>set_await_completion</b>(value: <2/>)
<1174> <1/> <b>get_await_completion</b>()
<1175> The maximum duration to wait for the animation to complete (in seconds). If the animation doesn’t finish within this time, BTPlayAnimation will stop waiting and return <1/>.
<1176> <1/> <b>blend</b> = <2/> <l3>🔗</l>
<1177> <1/> <b>set_blend</b>(value: <2/>)
<1178> <1/> <b>get_blend</b>()
<1179> Custom blend time (in seconds). See AnimationPlayer.play.
<1180> <1/> <b>from_end</b> = <2/> <l3>🔗</l>
<1181> <1/> <b>set_from_end</b>(value: <2/>)
<1182> <1/> <b>get_from_end</b>()
<1183> Play animation from the end. Used in combination with negative <l1>speed</l> to play animation in reverse. See AnimationPlayer.play.
<1184> <1/> <b>speed</b> = <2/> <l3>🔗</l>
<1185> <1/> <b>set_speed</b>(value: <2/>)
<1186> <1/> <b>get_speed</b>()
<1187> Custom playback speed scaling ratio. See AnimationPlayer.play.
<1188> BTProbability
<1189> BT decorator that executes its child task with a given probability.
<1190> BTProbability executes its child task with a given probability defined by <l1>run_chance</l>.
<1191> Returns the result of the child task if it was executed; otherwise, it returns <1/>.
<1192> <l1>run_chance</l>
<1193> <1/> <b>run_chance</b> = <2/> <l3>🔗</l>
<1194> <1/> <b>set_run_chance</b>(value: <2/>)
<1195> <1/> <b>get_run_chance</b>()
<1196> Probability that defines how likely the child task will be executed.
<1197> BTProbabilitySelector
<1198> BT composite that chooses a child task to execute based on attached probabilities.
<1199> BTProbabilitySelector chooses a child task to execute based on attached probabilities. It is typically used for decision-making purposes. Probability distribution is calculated based on weights assigned to each child task.
<1200> Returns <1/> when a child task results in <2/>.
<1201> Returns <1/> when a child task results in <2/>.
<1202> The behavior of BTProbabilitySelector when a child task results in <1/> depends on the <l2>abort_on_failure</l> value:
<1203> If <l1>abort_on_failure</l> is <2/>, when a child task results in <3/>, BTProbabilitySelector will normalize the probability distribution over the remaining children and choose a new child task to be executed. If all child tasks fail, the composite will return <4/>.
<1204> If <l1>abort_on_failure</l> is <2/>, when a child task results in <3/>, BTProbabilitySelector will not choose another child task to be executed and will immediately return <4/>.
<1205> <l1>abort_on_failure</l>
<1206> <l1>get_probability</l>(child_idx: <2/>) <3/>
<1207> <l1>get_total_weight</l>() <2/>
<1208> <l1>get_weight</l>(child_idx: <2/>) <3/>
<1209> <l1>has_probability</l>(child_idx: <2/>) <3/>
<1210> <l1>set_probability</l>(child_idx: <2/>, probability: <3/>)
<1211> <l1>set_weight</l>(child_idx: <2/>, weight: <3/>)
<1212> <1/> <b>abort_on_failure</b> = <2/> <l3>🔗</l>
<1213> <1/> <b>set_abort_on_failure</b>(value: <2/>)
<1214> <1/> <b>get_abort_on_failure</b>()
<1215> If <1/>, BTProbabilitySelector will not choose another child to execute and will return <2/> when a child task results in <3/>.
<1216> <1/> <b>get_probability</b>(child_idx: <2/>) <3/> <l4>🔗</l>
<1217> Returns the child task’s selection probability.
<1218> <1/> <b>get_total_weight</b>() <2/> <l3>🔗</l>
<1219> Returns the total weight of all child tasks.
<1220> <1/> <b>get_weight</b>(child_idx: <2/>) <3/> <l4>🔗</l>
<1221> Returns the child task’s weight within the weighted probability selection algorithm.
<1222> <1/> <b>has_probability</b>(child_idx: <2/>) <3/> <l4>🔗</l>
<1223> Returns whether the child task at index <1/> participates within the weighted probability selection algorithm and has a probability assigned to it. Returns <2/> for <l3>BTComment</l> tasks.
<1224> <1/> <b>set_probability</b>(child_idx: <2/>, probability: <3/>) <l4>🔗</l>
<1225> Sets the child task’s weight calculated based on the desired probability.
<1226> <1/> <b>set_weight</b>(child_idx: <2/>, weight: <3/>) <l4>🔗</l>
<1227> Sets the child task’s weight for the weighted probability selection algorithm.
<1228> BTRandomSelector
<1229> BT composite that executes tasks in random order until first <1/>.
<1230> BTRandomSelector executes its child tasks in a random order until any child returns <1/>. If a child task results in <2/>, BTRandomSelector will immediately execute another child task until one of them returns <3/> or all of them result in <4/>.
<1231> Returns <1/> if a child task results in <2/>. BTRandomSelector will remember the execution order and the last child task that returned <3/>, ensuring it resumes from that point in the next tick.