Module behavior_tree

Source

Modules§

interaction πŸ”’

Structs§

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 event

Enums§

ActionStateBehaviorTreeTimers πŸ”’
Enumeration of the timers used by the behavior tree.

Functions§

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 πŸ”’

Type Aliases§

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