/tg/ Station 13 - Modules - TypesVar Details - Proc Details

ai_behavior

Abstract class for an action an AI can take, can range from movement to grabbing a nearby weapon.

Vars

action_cooldownCooldown between actions performances, defaults to the value of CLICK_CD_MELEE because that seemed like a nice standard for the speed of AI behavior Do not read directly or mutate, instead use get_cooldown()
behavior_flagsFlags for extra behavior
required_distanceWhat distance you need to be from the target to perform the action

Procs

clear_movement_targetClear the controller's movement target only if it was us who last set it
finish_actionCalled when the action is finished. This needs the same args as perform besides the default ones
get_cooldownReturns the delay to use for this behavior in the moment Override to return a conditional delay
performCalled by the AI controller when this action is performed Returns a set of flags defined in code/__DEFINES/ai/ai.dm
set_movement_targetHelper proc to ensure consistency in setting the source of the movement target
setupCalled by the ai controller when first being added. Additional arguments depend on the behavior type. Return FALSE to cancel

Var Details

action_cooldown

Cooldown between actions performances, defaults to the value of CLICK_CD_MELEE because that seemed like a nice standard for the speed of AI behavior Do not read directly or mutate, instead use get_cooldown()

behavior_flags

Flags for extra behavior

required_distance

What distance you need to be from the target to perform the action

Proc Details

clear_movement_target

Clear the controller's movement target only if it was us who last set it

finish_action

Called when the action is finished. This needs the same args as perform besides the default ones

get_cooldown

Returns the delay to use for this behavior in the moment Override to return a conditional delay

perform

Called by the AI controller when this action is performed Returns a set of flags defined in code/__DEFINES/ai/ai.dm

set_movement_target

Helper proc to ensure consistency in setting the source of the movement target

setup

Called by the ai controller when first being added. Additional arguments depend on the behavior type. Return FALSE to cancel