Space Station 13 - Modules - TypesVar Details - Proc Details

ai_holder

Vars

autopilotIf true, the AI won't be deactivated if a client gets attached to the AI's mob.
busyIf true, the ticker will skip processing this mob until this is false. Good for if you need the mob to stay still (e.g. delayed attacking). If you need the mob to be inactive for an extended period of time, consider sleeping the AI instead.
call_distanceHow far away calls for help will go for.
cooperativeIf true, asks allies to help when fighting something.
faction_friendsList of all mobs inside the faction with ai_holders that have cooperate on, to call for help without using range(). Note that this is only used for sending calls out. Receiving calls doesn't care about this list, only if the mob is in the faction.
holderThe mob this datum is going to control.
holder_required_typeThe required mob type of the holder.
intelligence_levelAdjust to make the AI be intentionally dumber, or make it more robust (e.g. dodging grenades).
next_received_help_requesttime when the mob can receive a help request from another mob
next_sent_help_requesttime when this mob is allowed to call for help
process_flagsWhere we're processing, see flag defines.
snapshotA list used in mass-editing of AI datums, holding a snapshot of the 'before' state
stanceDetermines if the mob should be doing a specific thing, e.g. attacking, following, standing around, etc.

Procs

add_attackerWe were attacked by this thing recently
can_see_targetCheck if target is visible to us.
check_attackerChecks to see if an atom attacked us lately
find_targetStep 2, filter down possible targets to things we actually care about.
forget_everythingResets a lot of 'memory' vars.
get_pathA* now, try to a path to a target
give_targetStep 4, give us our selected target.
go_sleepMakes this ai holder not get processed. Called automatically when the host mob is killed. Potential future optimization would be to sleep AIs which mobs that are far away from in-round players.
go_wakeReverses the go_sleep() proc. Revived mobs will wake their AI if they have one.
handle_special_strategicalOverride this for special things without polluting the main handle_strategicals() loop.
handle_special_tacticOverride this for special things without polluting the main handle_tactics() loop.
handle_stance_strategicalThis is called every two seconds.
handle_stance_tacticalThis is called every half a second.
handle_strategicals'Strategical' processes that are more expensive on the CPU and so don't get run as often as the above proc, such as A* pathfinding or robust targeting.
handle_tactics'Tactical' processes such as moving a step, meleeing an enemy, firing a projectile, and other fairly cheap actions that need to happen quickly.
handle_wander_movementWanders randomly in cardinal directions.
help_requestedWhat allies receive when someone else is calling for help.
list_targetsStep 1, find out what we can see.
lose_target'Soft' loss of target. They may still exist, we still have some info about them maybe.
lose_target_positionResets the last known position to null.
move_onceTake one step along a path
on_attackedSets a few vars so mobs that threaten will react faster to an attacker or someone who attacked them before.
pick_targetStep 3, pick among the possible, attackable targets.
react_to_attackResponds to a hostile action against its mob.
receive_tauntCauses targeting to prefer targeting the taunter if possible. This generally occurs if more than one option is within striking distance, including the taunter. Otherwise the default filter will prefer the closest target.
remove_attackerForgive this attacker
remove_target'Hard' loss of target. Clean things up and return to idle.
request_helpRequests help in combat from other mobs possessing ai_holders.
set_busy_delaySet the AI as 'busy' for a specific length of time.
set_stanceFor setting the stance WITHOUT processing it
target_filter_closestReturns the closest target and anything tied with it for distance
target_filter_distanceTargets closer to us than the current one.
track_target_positionUpdates the last known position of the target.
walk_pathWalk towards whatever.

Var Details

autopilot

If true, the AI won't be deactivated if a client gets attached to the AI's mob.

busy

If true, the ticker will skip processing this mob until this is false. Good for if you need the mob to stay still (e.g. delayed attacking). If you need the mob to be inactive for an extended period of time, consider sleeping the AI instead.

call_distance

How far away calls for help will go for.

cooperative

If true, asks allies to help when fighting something.

faction_friends

List of all mobs inside the faction with ai_holders that have cooperate on, to call for help without using range(). Note that this is only used for sending calls out. Receiving calls doesn't care about this list, only if the mob is in the faction.

holder

The mob this datum is going to control.

holder_required_type

The required mob type of the holder.

intelligence_level

Adjust to make the AI be intentionally dumber, or make it more robust (e.g. dodging grenades).

next_received_help_request

time when the mob can receive a help request from another mob

next_sent_help_request

time when this mob is allowed to call for help

process_flags

Where we're processing, see flag defines.

snapshot

A list used in mass-editing of AI datums, holding a snapshot of the 'before' state

stance

Determines if the mob should be doing a specific thing, e.g. attacking, following, standing around, etc.

Proc Details

add_attacker

We were attacked by this thing recently

can_see_target

Check if target is visible to us.

check_attacker

Checks to see if an atom attacked us lately

find_target

Step 2, filter down possible targets to things we actually care about.

forget_everything

Resets a lot of 'memory' vars.

get_path

A* now, try to a path to a target

give_target

Step 4, give us our selected target.

go_sleep

Makes this ai holder not get processed. Called automatically when the host mob is killed. Potential future optimization would be to sleep AIs which mobs that are far away from in-round players.

go_wake

Reverses the go_sleep() proc. Revived mobs will wake their AI if they have one.

handle_special_strategical

Override this for special things without polluting the main handle_strategicals() loop.

handle_special_tactic

Override this for special things without polluting the main handle_tactics() loop.

handle_stance_strategical

This is called every two seconds.

handle_stance_tactical

This is called every half a second.

handle_strategicals

'Strategical' processes that are more expensive on the CPU and so don't get run as often as the above proc, such as A* pathfinding or robust targeting.

handle_tactics

'Tactical' processes such as moving a step, meleeing an enemy, firing a projectile, and other fairly cheap actions that need to happen quickly.

handle_wander_movement

Wanders randomly in cardinal directions.

help_requested

What allies receive when someone else is calling for help.

list_targets

Step 1, find out what we can see.

lose_target

'Soft' loss of target. They may still exist, we still have some info about them maybe.

lose_target_position

Resets the last known position to null.

move_once

Take one step along a path

on_attacked

Sets a few vars so mobs that threaten will react faster to an attacker or someone who attacked them before.

pick_target

Step 3, pick among the possible, attackable targets.

react_to_attack

Responds to a hostile action against its mob.

receive_taunt

Causes targeting to prefer targeting the taunter if possible. This generally occurs if more than one option is within striking distance, including the taunter. Otherwise the default filter will prefer the closest target.

remove_attacker

Forgive this attacker

remove_target

'Hard' loss of target. Clean things up and return to idle.

request_help

Requests help in combat from other mobs possessing ai_holders.

set_busy_delay

Set the AI as 'busy' for a specific length of time.

set_stance

For setting the stance WITHOUT processing it

target_filter_closest

Returns the closest target and anything tied with it for distance

target_filter_distance

Targets closer to us than the current one.

track_target_position

Updates the last known position of the target.

walk_path

Walk towards whatever.