movable
Vars | |
affected_dynamic_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 |
buckle_lying | Bed-like behaviour, forces mob.lying = buckle_lying if not set to NO_BUCKLE_LYING. |
can_be_unanchored | Used for the calculate_adjacencies proc for icon smoothing. |
demo_last_loc | Last location of the atom for demo recording purposes |
em_block | Internal holder for emissive blocker object, do not use directly use blocks_emissive |
face_mouse | Whether a user will face atoms on entering them with a mouse. Despite being a mob variable, it is here for performance |
generic_canpass | If false makes CanPass call CanPassThrough on this type instead of using default behaviour |
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. |
movement_type | In case you have multiple types, you automatically use the most useful one. IE: Skating on ice, flippers on water, flying over chasm/space, etc. Should only be changed through setMovetype() |
pass_flags | Things we can pass through while moving. If any of this matches the thing we're trying to pass's [pass_flags_self], then we can pass through. |
set_dir_on_move | Whether this atom should have its dir automatically changed when it moves. Setting this to FALSE allows for things such as directional windows to retain dir on moving without snowflake code all of the place. |
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 |
Process_Spacemove | Called whenever an object moves and by mobs when they attempt to move themselves through space And when an object or action applies a force on src, see newtonian_move |
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 |
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_blocked_language | Adds a language to the blocked language list. Use this over remove_language in cases where you will give languages back later. |
attacked_by | Called from /obj/item/proc/attack_obj and /obj/item/proc/attack if the attack succeeds |
become_area_sensitive | See traits.dm. Use this in place of ADD_TRAIT. |
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 |
can_speak_language | Checks if atom can speak the language. |
copy_languages | Copies all languages into the supplied atom/language holder. Source should be overridden when you do not want the language overwritten by later atom updates or want to avoid blocked languages. |
could_speak_language | Returns the result of tongue specific limitations on spoken languages. |
get_language_holder | Gets or creates the relevant language holder. For mindless atoms, gets the local one. For atom with mind, gets the mind one. |
get_random_spoken_language | Gets a random spoken language, useful for forced speech and such. |
get_random_understood_language | Gets a random understood language, useful for hallucinations and such. |
get_selected_language | Returns selected language, if it can be spoken, or finds, sets and returns a new selected language if possible. |
grant_all_languages | Grants every language. |
grant_language | Grants the supplied language and sets omnitongue true. |
has_language | Checks if atom has the language. If spoken is true, only checks if atom can speak the language. |
is_buckle_possible | Simple helper proc that runs a suite of checks to test whether it is possible or not to buckle the target mob to src. |
is_user_buckle_possible | Simple helper proc that runs a suite of checks to test whether it is possible or not for user to buckle target mob to src. |
newtonian_move | Only moves the object if it's under no gravity |
on_changed_z_level | Called when a movable changes z-levels. |
on_enter_storage | called when this atom is added into a storage item, which is passed on as S. The loc variable is already set to the storage item. |
on_exit_storage | called when this atom is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called. |
on_virtual_z_change | Called when an atom moves to a different virtual z. Warning, it will pass z-level 0 in new_virtual_z on creation and 0 in previous_virtual_z whenever moved to nullspace |
on_z_change | zMove already handles whether a pull from another movable should be broken. |
point_at | Point at an atom |
relay_container_resist_act | called when a mob resists while inside a container that is itself inside something. |
remove_all_languages | Removes every language and sets omnitongue false. |
remove_blocked_language | Removes a language from the blocked language list. |
remove_language | Removes a single language. |
setGrabState | Updates the grab state of the movable |
setMovetype | Proc to modify the movement_type and hook behavior associated with it changing. |
set_anchored | Sets the anchored var and returns if it was sucessfully changed or not. |
set_light_range_power_color | Helper to change several lighting overlay settings. |
set_pulledby | Reports the event of the change in value of the pulledby variable. |
throw_at | If this returns FALSE then callback will not be called. |
update_atom_languages | Empties out the atom specific languages and updates them according to the current atoms language holder. As a side effect, it also creates missing language holders in the process. |
update_dynamic_luminosity | Keeps track of the sources of dynamic luminosity and updates our visibility with the highest. |
Var Details
affected_dynamic_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
buckle_lying
Bed-like behaviour, forces mob.lying = buckle_lying if not set to NO_BUCKLE_LYING.
can_be_unanchored
Used for the calculate_adjacencies proc for icon smoothing.
demo_last_loc
Last location of the atom for demo recording purposes
em_block
Internal holder for emissive blocker object, do not use directly use blocks_emissive
face_mouse
Whether a user will face atoms on entering them with a mouse. Despite being a mob variable, it is here for performance
generic_canpass
If false makes CanPass call CanPassThrough on this type instead of using default behaviour
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.
movement_type
In case you have multiple types, you automatically use the most useful one. IE: Skating on ice, flippers on water, flying over chasm/space, etc. Should only be changed through setMovetype()
pass_flags
Things we can pass through while moving. If any of this matches the thing we're trying to pass's [pass_flags_self], then we can pass through.
set_dir_on_move
Whether this atom should have its dir automatically changed when it moves. Setting this to FALSE allows for things such as directional windows to retain dir on moving without snowflake code all of the place.
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
Process_Spacemove
Called whenever an object moves and by mobs when they attempt to move themselves through space And when an object or action applies a force on src, see newtonian_move
Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting
Mobs should return 1 if they should be able to move of their own volition, see /client/Move
Arguments:
- movement_dir - 0 when stopping or any dir when trying to move
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
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_blocked_language
Adds a language to the blocked language list. Use this over remove_language in cases where you will give languages back later.
attacked_by
Called from /obj/item/proc/attack_obj and /obj/item/proc/attack if the attack succeeds
become_area_sensitive
See traits.dm. Use this in place of ADD_TRAIT.
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
can_speak_language
Checks if atom can speak the language.
copy_languages
Copies all languages into the supplied atom/language holder. Source should be overridden when you do not want the language overwritten by later atom updates or want to avoid blocked languages.
could_speak_language
Returns the result of tongue specific limitations on spoken languages.
get_language_holder
Gets or creates the relevant language holder. For mindless atoms, gets the local one. For atom with mind, gets the mind one.
get_random_spoken_language
Gets a random spoken language, useful for forced speech and such.
get_random_understood_language
Gets a random understood language, useful for hallucinations and such.
get_selected_language
Returns selected language, if it can be spoken, or finds, sets and returns a new selected language if possible.
grant_all_languages
Grants every language.
grant_language
Grants the supplied language and sets omnitongue true.
has_language
Checks if atom has the language. If spoken is true, only checks if atom can speak the language.
is_buckle_possible
Simple helper proc that runs a suite of checks to test whether it is possible or not to buckle the target mob to src.
Returns FALSE if any conditions that should prevent buckling are satisfied. Returns TRUE otherwise. Arguments:
- target - Target mob to check against buckling to src.
- force - Whether or not the buckle should be forced. If TRUE, ignores src's can_buckle var.
- check_loc - Whether to do a proximity check or not. The proximity check looks for target.loc == src.loc.
is_user_buckle_possible
Simple helper proc that runs a suite of checks to test whether it is possible or not for user to buckle target mob to src.
Returns FALSE if any conditions that should prevent buckling are satisfied. Returns TRUE otherwise. Arguments:
- target - Target mob to check against buckling to src.
- user - The mob who is attempting to buckle the target to src.
- check_loc - Whether to do a proximity check or not when calling is_buckle_possible().
newtonian_move
Only moves the object if it's under no gravity
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_enter_storage
called when this atom is added into a storage item, which is passed on as S. The loc variable is already set to the storage item.
on_exit_storage
called when this atom is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.
on_virtual_z_change
Called when an atom moves to a different virtual z. Warning, it will pass z-level 0 in new_virtual_z on creation and 0 in previous_virtual_z whenever moved to nullspace
on_z_change
zMove already handles whether a pull from another movable should be broken.
point_at
Point at an atom
Intended to enable and standardise the pointing animation for all atoms
Not intended as a replacement for the mob verb
relay_container_resist_act
called when a mob resists while inside a container that is itself inside something.
remove_all_languages
Removes every language and sets omnitongue false.
remove_blocked_language
Removes a language from the blocked language list.
remove_language
Removes a single language.
setGrabState
Updates the grab state of the movable
This exists to act as a hook for behaviour
setMovetype
Proc to modify the movement_type and hook behavior associated with it changing.
set_anchored
Sets the anchored var and returns if it was sucessfully changed or not.
set_light_range_power_color
Helper to change several lighting overlay settings.
set_pulledby
Reports the event of the change in value of the pulledby variable.
throw_at
If this returns FALSE then callback will not be called.
update_atom_languages
Empties out the atom specific languages and updates them according to the current atoms language holder. As a side effect, it also creates missing language holders in the process.
update_dynamic_luminosity
Keeps track of the sources of dynamic luminosity and updates our visibility with the highest.