Module behavior_tree Copy item path Source interaction π BehaviorData Struct containing essential data for running a behavior tree BehaviorTree list ββtreeββ of behavior functions
This struct will allow you to run through multiple behavior function until
one finally handles an eventActionStateBehaviorTreeTimers π Enumeration of the timers used by the behavior tree. attack_if_owner_hurt π Attack targetβs attacker (if there is one)
Target is the owner in this case do_combat π do_hostile_tree_if_hostile_and_aware π If target is hostile and agent is aware of target, do the hostile tree and
stop the current BehaviorTree do_idle_tree π Run the Idle BehaviorTree do_pet_tree_if_owned π if owned, do the pet tree and stop the current BehaviorTree do_pickup_loot π If the target is an ItemDrop, go pick it up do_save_allies π If there are nearby downed allies, save them. do_target_tree_if_target_else_do_idle_tree π If the agent has a target, do the target tree, else do the idle tree follow_if_far_away π If too far away, then follow the target handle_rtsim_actions π Handle action requests from rtsim, such as talking to NPCs or attacking handle_timed_events π Handle timed events, like looking at the player we are talking to heal_self_if_hurt π Try to heal self if our damage went below a certain threshold hurt_utterance π Hurt utterances at random upon receiving damage maintain_if_gliding π If in gliding, properly maintain it
If on ground, unwield glider react_if_on_fire π If on fire and able, stop, drop, and roll react_on_dangerous_fall π If falling velocity is critical, throw everything
and save yourself! remembers_fight_with π search_last_known_pos_if_not_alert π set_owner_if_no_target π Set owner if no target target_if_attacked π Target an entity thatβs attacking us if the attack was recent and we have
a health component untarget_if_dead π If target is dead, forget them update_last_known_pos π update_target_awareness π BehaviorFn π Behavior function
Determines if the current situation can be handled and act accordingly
Returns true if an action has been taken, stopping the tree execution