Skip to content

UseAbilityTask ​

Inherits: BehaviorTask < Resource

UseAbilityTask uses a specific ability on the current target. This is a common behavior task for combat and utility abilities.

Properties ​

intability_id0
boolface_targettrue
boolmove_into_rangetrue
floatmin_distance0.5

Variables ​

AbilityInstanceability_instancenull
boolpositioned_for_abilityfalse
boolfacing_completefalse

Methods ​

voidexecute_task_start()
voidexecute_task_complete()
voidexecute_task_interrupt()
voidexecute_task_fail()
AbilityInstanceget_ability_instance()
floatget_target_distance()

Property descriptions ​

Ability

int ability_id = 0 ​

The ID of the ability to use

bool face_target = true ​

Whether to face the target before using ability

Range Check

bool move_into_range = true ​

Whether to move into range if target is too far

float min_distance = 0.5 ​

Minimum distance to maintain from target

Variable descriptions ​

AbilityInstance ability_instance = null ​

The ability the entity uses.

bool positioned_for_ability = false ​

True once the entity is in place to use the ability.

bool facing_complete = false ​

True once the entity faces the target.

Method descriptions ​

void execute_task_start() ​

Starts the task.

void execute_task_complete() ​

Called when the task finishes well.

void execute_task_interrupt() ​

Called when something interrupts the task.

void execute_task_fail() ​

Called when the task fails.

AbilityInstance get_ability_instance() ​

The ability the entity uses.

float get_target_distance() ​

The distance to the target (-1 when there is none).