movable

Vars | |
active_movement | A list containing arguments for Moved(). |
---|---|
affected_movable_lights | Lazylist to keep track on the sources of illumination. |
affecting_dynamic_lumi | Highest-intensity light affecting us, which determines our visibility. |
blocks_emissive | Either FALSE, EMISSIVE_BLOCK_GENERIC, or EMISSIVE_BLOCK_UNIQUE |
client_mobs_in_contents | contains every client mob corresponding to every client eye in this container. lazily updated by SSparallax and is sparse: only the last container of a client eye has this list assuming no movement since SSparallax's last fire |
currently_z_moving | is the mob currently ascending or descending through z levels? |
drag_delay | Delay added to mob's move_delay when pulling it. |
drag_windup | Wind-up before the mob can pull an object. |
em_block | Internal holder for emissive blocker object, do not use directly use blocks_emissive |
faction | The faction this AM is associated with, if any |
important_recursive_contents | an associative lazylist of relevant nested contents by "channel", the list is of the form: list(channel = list(important nested contents of that type)) each channel has a specific purpose and is meant to replace potentially expensive nested contents iteration. do NOT add channels to this for little reason as it can add considerable memory usage. |
move_force | How much the atom tries to push things out its way |
move_resist | How much the atom resists being thrown or moved. |
moving_diagonally | TRUE if we should not push or shuffle on bump/enter |
pass_flags | What things this atom can move past, if it has the corrosponding flag. Should not be directly modified |
pitch | The pitch adjustment that this movable uses when speaking. |
pulledby | AM that is pulling us |
pulling | AM we are pulling |
spatial_grid_key | String representing the spatial grid groups we want to be held in. acts as a key to the list of spatial grid contents types we exist in via SSspatial_grid.spatial_grid_categories. We do it like this to prevent people trying to mutate them and to save memory on holding the lists ourselves |
thrown_speed | Speed of the current throw. 0 When not throwing. |
tts_silicon_voice_effect | Set to anything other than "" to activate the silicon voice effect for TTS messages. |
voice | The voice that this movable makes when speaking |
voice_filter | The filter to apply to the voice when processing the TTS audio message. |
Procs | |
CanPassThrough | Returns true or false to allow src to move through the blocker, mover has final say |
CanReach | A backwards depth-limited breadth-first-search to see if the target is logically "in" anything adjacent to us. |
Crossed | default byond proc that is deprecated for us in lieu of signals. do not call |
Move | The move proc is responsible for (in order): |
Uncross | Uncross() is a default BYOND proc that is called when something is going
to exit this atom's turf. It is prefered over Uncrossed when you want to
deny that movement, such as in the case of border objects, objects that allow
you to walk through them in any direction except the one they block
(think side windows). |
Uncrossed | default byond proc that is normally called on everything inside the previous turf a movable was in after moving to its current turf this is wasteful since the vast majority of objects do not use Uncrossed use connect_loc to register to COMSIG_ATOM_EXITED instead |
_do_submerge | Adds submerge effects to the AM. Should never be called directly |
_reset_transformation_animation | Resets filters and removes transformation animations helper objects from vis contents. |
abstract_move | meant for movement with zero side effects. only use for objects that are supposed to move "invisibly" (like camera mobs or ghosts) if you want something to move onto a tile with a beartrap or recycler or tripmine or mouse without that object knowing about it at all, use this most of the time you want forceMove() |
add_nosubmerge_trait | Wrapper for setting the submerge trait. This trait should ALWAYS be set via this proc so we can listen for the trait removal in all cases |
add_pass_flags | Correctly sets pass_flags with their source |
ai_should_stay_buckled | Whether an NPC mob should stay buckled to this atom or not |
become_hearing_sensitive | allows this movable to hear and adds itself to the important_recursive_contents list of itself and every movable loc its in |
become_warped_invisible | Adds a warping effect to the provided atom, while making it invisible Note: alpha on the target decreases the strength of the effect Also overrides any render target on the target atom temporarily while active do we want to consider a managed render target thing for this? @param invis_atom The atom to apply the effect to @param strength The strength of the effect, 100 is highest, 0 means no effect |
can_z_move | Checks if the destination turf is elegible for z movement from the start turf to a given direction and returns it if so. Args: |
cancel_override_minimap_tracking | Stops minimap override tracking |
compose_name_href | Allows us to wrap the name for specific cases like AI tracking or observer tracking |
face_atom | Change the direction of the atom to face the targeted atom |
footstep_override | overrides the turf's normal footstep sound |
force_push | returns bool for if we want to get handle forcepushing, return is bool if we can move an anchored obj |
force_pushed | returns bool for if we want to get forcepushed |
get_export_value | Getter proc for the point value of this object |
get_gravity | Checks the gravity the atom is subjected to |
get_z_move_affected | Returns a list of movables that should also be affected when src moves through zlevels, and src. |
is_jumpable | Can this be jumped over |
keybind_face_direction | A wrapper for setDir that should only be able to fail by living mobs. |
lose_hearing_sensitivity | removes the hearing sensitivity channel from the important_recursive_contents list of this and all nested locs containing us if there are no more sources of the trait left since RECURSIVE_CONTENTS_HEARING_SENSITIVE is also a spatial grid content type, removes us from the spatial grid if the trait is removed |
move_crush | returns bool for if we want to get handle move crushing, return is bool if we can move an anchored obj |
move_crushed | returns bool for if we want to get crushed |
move_from_pull | Called when src is being moved to a target turf because another movable (puller) is moving around. |
on_changed_z_level | Called when a movable changes z-levels. |
on_warped_overlays | signal handler to remove any emissives while we're warped invis |
override_minimap_tracking | Used to handle minimap tracking inside other movables |
remove_pass_flags | Correctly removes sources and pass_flags as required |
set_currently_z_moving | Sets the currently_z_moving variable to a new value. Used to allow some zMovement sources to have precedence over others. |
set_flying | Toggles AM between flying states |
set_light_range_power_color | Helper to change several lighting overlay settings. |
set_submerge_level | Sets the submerged level of an AM based on its turf |
set_throwing | Toggles AM between throwing states |
stop_throw | Clean up all throw vars |
stop_warped_invisible | Stops the warped invisibility effect |
supply_export | Function that sells whatever object this is to the faction_selling; returns a /datum/export_report if successful |
throw_bounce | Bounces the AM off hit_atom |
throw_impact | called when src is thrown into hit_atom |
transformation_animation | Creates animation that turns current icon into result appearance from top down. |
turf_collision | This is called when the AM is thrown into a dense turf |
turf_cover_check | returns that src is covering its turf. Used to prevent turf interactions such as water |
update_dynamic_luminosity | Keeps track of the sources of dynamic luminosity and updates our visibility with the highest. |
Var Details
active_movement

A list containing arguments for Moved().
affected_movable_lights

Lazylist to keep track on the sources of illumination.
affecting_dynamic_lumi

Highest-intensity light affecting us, which determines our visibility.
blocks_emissive

Either FALSE, EMISSIVE_BLOCK_GENERIC, or EMISSIVE_BLOCK_UNIQUE
client_mobs_in_contents

contains every client mob corresponding to every client eye in this container. lazily updated by SSparallax and is sparse: only the last container of a client eye has this list assuming no movement since SSparallax's last fire
currently_z_moving

is the mob currently ascending or descending through z levels?
drag_delay

Delay added to mob's move_delay when pulling it.
drag_windup

Wind-up before the mob can pull an object.
em_block

Internal holder for emissive blocker object, do not use directly use blocks_emissive
faction

The faction this AM is associated with, if any
important_recursive_contents

an associative lazylist of relevant nested contents by "channel", the list is of the form: list(channel = list(important nested contents of that type)) each channel has a specific purpose and is meant to replace potentially expensive nested contents iteration. do NOT add channels to this for little reason as it can add considerable memory usage.
move_force

How much the atom tries to push things out its way
move_resist

How much the atom resists being thrown or moved.
moving_diagonally

TRUE if we should not push or shuffle on bump/enter
pass_flags

What things this atom can move past, if it has the corrosponding flag. Should not be directly modified
pitch

The pitch adjustment that this movable uses when speaking.
pulledby

AM that is pulling us
pulling

AM we are pulling
spatial_grid_key

String representing the spatial grid groups we want to be held in. acts as a key to the list of spatial grid contents types we exist in via SSspatial_grid.spatial_grid_categories. We do it like this to prevent people trying to mutate them and to save memory on holding the lists ourselves
thrown_speed

Speed of the current throw. 0 When not throwing.
tts_silicon_voice_effect

Set to anything other than "" to activate the silicon voice effect for TTS messages.
voice

The voice that this movable makes when speaking
voice_filter

The filter to apply to the voice when processing the TTS audio message.
Proc Details
CanPassThrough
Returns true or false to allow src to move through the blocker, mover has final say
CanReach
A backwards depth-limited breadth-first-search to see if the target is logically "in" anything adjacent to us.
Crossed
default byond proc that is deprecated for us in lieu of signals. do not call
Move
The move proc is responsible for (in order):
- Checking if you can move out of the current loc (The exit proc, which calls on_exit through the connect_loc)
- Checking if you can move into the new loc (The enter proc, which calls on_enter through the connect_loc and is also overwritten by some atoms) This is where most bumps take place
- If you can do both, then it changes the loc var calls Exited on the old loc, and Entered on the new loc
- After that, it does some area checks, calls Moved and handle pulling/buckled mobs.area
A diagonal move is slightly different as Moved, entered and exited is called only once In order of calling:
- Check if you can exit the current loc
- Check if it's a diagonal move
- If yes, check if you could exit the turf in that direction, and then if you can enter it (This calls on_exit and on_enter)
- Check if you can enter the final new loc
- Do the rest of the Move proc normally (Moved, entered, exited, check area change etc)
Warning : Doesn't support well multi-tile diagonal moves
Uncross
Uncross()
is a default BYOND proc that is called when something is going
to exit this atom's turf. It is prefered over Uncrossed
when you want to
deny that movement, such as in the case of border objects, objects that allow
you to walk through them in any direction except the one they block
(think side windows).
While being seemingly harmless, most everything doesn't actually want to use this, meaning that we are wasting proc calls for every single atom on a turf, every single time something exits it, when basically nothing cares.
This overhead caused real problems on Sybil round #159709, where lag attributed to Uncross was so bad that the entire master controller collapsed and people made Among Us lobbies in OOC.
If you want to replicate the old Uncross()
behavior, the most apt
replacement is [/datum/element/connect_loc
] while hooking onto
[COMSIG_ATOM_EXIT
].
Uncrossed
default byond proc that is normally called on everything inside the previous turf a movable was in after moving to its current turf this is wasteful since the vast majority of objects do not use Uncrossed use connect_loc to register to COMSIG_ATOM_EXITED instead
_do_submerge
Adds submerge effects to the AM. Should never be called directly
_reset_transformation_animation
Resets filters and removes transformation animations helper objects from vis contents.
abstract_move
meant for movement with zero side effects. only use for objects that are supposed to move "invisibly" (like camera mobs or ghosts) if you want something to move onto a tile with a beartrap or recycler or tripmine or mouse without that object knowing about it at all, use this most of the time you want forceMove()
add_nosubmerge_trait
Wrapper for setting the submerge trait. This trait should ALWAYS be set via this proc so we can listen for the trait removal in all cases
add_pass_flags
Correctly sets pass_flags with their source
ai_should_stay_buckled
Whether an NPC mob should stay buckled to this atom or not
become_hearing_sensitive
allows this movable to hear and adds itself to the important_recursive_contents list of itself and every movable loc its in
become_warped_invisible
Adds a warping effect to the provided atom, while making it invisible Note: alpha on the target decreases the strength of the effect Also overrides any render target on the target atom temporarily while active do we want to consider a managed render target thing for this? @param invis_atom The atom to apply the effect to @param strength The strength of the effect, 100 is highest, 0 means no effect
can_z_move
Checks if the destination turf is elegible for z movement from the start turf to a given direction and returns it if so. Args:
- direction: the direction to go, UP or DOWN, only relevant if target is null.
- start: Each destination has a starting point on the other end. This is it. Most of the times the location of the source.
- z_move_flags: bitflags used for various checks. See __DEFINES/movement.dm.
- rider: A living mob in control of the movable. Only non-null when a mob is riding a vehicle through z-levels.
cancel_override_minimap_tracking
Stops minimap override tracking
compose_name_href
Allows us to wrap the name for specific cases like AI tracking or observer tracking
Arguments
- name {string} the name of the mob to modify.
face_atom
Change the direction of the atom to face the targeted atom
footstep_override
overrides the turf's normal footstep sound
force_push
returns bool for if we want to get handle forcepushing, return is bool if we can move an anchored obj
force_pushed
returns bool for if we want to get forcepushed
get_export_value
Getter proc for the point value of this object
Returns:
- A list where the first value is the number of req points and the second number is the number of cas points.
get_gravity
Checks the gravity the atom is subjected to
get_z_move_affected
Returns a list of movables that should also be affected when src moves through zlevels, and src.
is_jumpable
Can this be jumped over
keybind_face_direction
A wrapper for setDir that should only be able to fail by living mobs.
Called from [/atom/movable/proc/keyLoop], this exists to be overwritten by living mobs with a check to see if we're actually alive enough to change directions
lose_hearing_sensitivity
removes the hearing sensitivity channel from the important_recursive_contents list of this and all nested locs containing us if there are no more sources of the trait left since RECURSIVE_CONTENTS_HEARING_SENSITIVE is also a spatial grid content type, removes us from the spatial grid if the trait is removed
- trait_source - trait source define or ALL, if ALL, force removes hearing sensitivity. if a trait source define, removes hearing sensitivity only if the trait is removed
move_crush
returns bool for if we want to get handle move crushing, return is bool if we can move an anchored obj
move_crushed
returns bool for if we want to get crushed
move_from_pull
Called when src is being moved to a target turf because another movable (puller) is moving around.
on_changed_z_level
Called when a movable changes z-levels.
Arguments:
- old_turf - The previous turf they were on before.
- new_turf - The turf they have now entered.
- same_z_layer - If their old and new z levels are on the same level of plane offsets or not
- notify_contents - Whether or not to notify the movable's contents that their z-level has changed. NOTE, IF YOU SET THIS, YOU NEED TO MANUALLY SET PLANE OF THE CONTENTS LATER
on_warped_overlays
signal handler to remove any emissives while we're warped invis
override_minimap_tracking
Used to handle minimap tracking inside other movables
remove_pass_flags
Correctly removes sources and pass_flags as required
set_currently_z_moving
Sets the currently_z_moving variable to a new value. Used to allow some zMovement sources to have precedence over others.
set_flying
Toggles AM between flying states
set_light_range_power_color
Helper to change several lighting overlay settings.
set_submerge_level
Sets the submerged level of an AM based on its turf
set_throwing
Toggles AM between throwing states
stop_throw
Clean up all throw vars
stop_warped_invisible
Stops the warped invisibility effect
supply_export
Function that sells whatever object this is to the faction_selling; returns a /datum/export_report if successful
throw_bounce
Bounces the AM off hit_atom
throw_impact
called when src is thrown into hit_atom
transformation_animation
Creates animation that turns current icon into result appearance from top down.
result_appearance - End result appearance/atom/image time - Animation duration transform_appearance - Appearance/atom/image of effect that moves along the animation - should be horizonatally centered
turf_collision
This is called when the AM is thrown into a dense turf
turf_cover_check
returns that src is covering its turf. Used to prevent turf interactions such as water
update_dynamic_luminosity
Keeps track of the sources of dynamic luminosity and updates our visibility with the highest.