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

turf

Any floor or wall. What makes up the station and the rest of the map.

Vars

always_litBool, whether this turf will always be illuminated no matter what area it is in
archived_cycleused to determine whether we should archive
assigned_oranges_earwhat /mob/oranges_ear instance is already assigned to us as there should only ever be one. used for guaranteeing there is only one oranges_ear per turf when assigned, speeds up view() iteration
atmos_adjacent_turfslist of turfs adjacent to us that air can flow onto
atmos_supeconductivitybitfield of dirs in which we are superconducitng
directional_opacityWhich directions does this turf block the vision of, taking into account both the turf's opacity and the movable opacity_sources.
dynamic_lumcountLumcount added by sources other than lighting datum objects, such as the overlay lighting component.
fixed_underlayIcon-smoothing variable to map a diagonal wall corner with a fixed underlay.
force_no_gravitywhether or not this turf forces movables on it to have no gravity (unless they themselves have forced gravity)
heat_capacityAmount of heat necessary to activate some atmos processes (there is a weird usage of this var because is compared directly to the temperature instead of heat energy)
holodeck_compatiblethe holodeck can load onto this turf if TRUE
in_contents_ofFor the area_contents list unit test Allows us to know our area without needing to preassign it Sorry for the mess
initial_gas_mixused for mapping and for breathing while in walls (because that's a thing that needs to be accounted for...) string parsed by /datum/gas/proc/copy_from_turf approximation of MOLES_O2STANDARD and MOLES_N2STANDARD pending byond allowing constant expressions to be embedded in constant strings If someone will place 0 of some gas there, SHIT WILL BREAK. Do not do that.
lighting_corner_NELighting Corner datums.
lighting_objectOur lighting object.
max_fire_temperature_sustainedThe max temperature of the fire which it was subjected to
opacity_sourcesLazylist of movable atoms providing opacity sources.
overfloor_placedIf there's a tile over a basic floor that can be ripped out
pathing_pass_methodHow pathing algorithm will check if this turf is passable by itself (not including content checks). By default it's just density check. WARNING: Currently to use a density shortcircuiting this does not support dense turfs with special allow through function
rcd_memoryIf this turf contained an RCD'able object (or IS one, for walls) but is now destroyed, this will preserve the value. See _DEFINES/construction.dm for RCD_MEMORY*.
temperature_archivedArchived version of the temperature on a turf
thermal_conductivitiesAll currently stored conductivities changes
thermal_conductivityused for temperature calculations in superconduction
to_be_destroyedUsed for fire, if a melting temperature was reached, it will be destroyed
turf_flagsTurf bitflags, see code/__DEFINES/flags.dm
underfloor_accessibilityHow accessible underfloor pieces such as wires, pipes, etc are on this turf. Can be HIDDEN, VISIBLE, or INTERACTABLE.

Procs

Initalize_AtmosWe do NOT use the shortcut here, because this is faster Initializes our adjacent turfs. If you want to avoid this, do not override it, instead set init_air to FALSE
InitializeTurf Initialize
LinkBlockedWithAccessFor seeing if we can actually move between 2 given turfs while accounting for our access and the caller's pass_flags
ScrapeAwayTake off the top layer turf and replace it with the next baseturf down
add_opacity_sourceProc to add movable sources of opacity on the turf and let it handle lighting code.
air_update_turfA helper proc for dealing with atmos changes
clear_signal_refsWARNING WARNING Turfs DO NOT lose their signals when they get replaced, REMEMBER THIS It's possible because turfs are fucked, and if you have one in a list and it's replaced with another one, the list ref points to the new turf We do it because moving signals over was needlessly expensive, and bloated a very commonly used bit of code
conductivity_directionsSUPERCONDUCTIVITY ALLLLLLLLLLLLLLLLLLLLRIGHT HERE WE GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
consider_superconductivityShould we attempt to superconduct?
create_gas_mixture//////////////GAS MIXTURE PROCS/////////////////// Copies all gas info from the turf into a new gas_mixture, along with our temperature Returns the created gas_mixture
expose_reagentsHandles exposing a turf to reagents.
fromShuttleMoveBase procs
get_atmos_adjacent_turfsreturns a list of adjacent turfs that can share air with this one. alldir includes adjacent diagonal tiles that can share air with both of the related adjacent cardinal tiles
init_immediate_calculate_adjacent_turfsThis proc is a more deeply optimized version of immediate_calculate_adjacent_turfs It contains dumbshit, and also stuff I just can't do at runtime If you're not editing behavior, just read that proc. It's less bad
is_blocked_turfCheck whether the specified turf is blocked by something dense inside it with respect to a specific atom.
is_blocked_turf_ignore_climbableChecks whether the specified turf is blocked by something dense inside it, but ignores anything with the climbable trait
neighbor_conduct_with_srcThese two procs are a bit of a web, I belive in you
reachableAdjacentTurfsReturns adjacent turfs to this turf that are reachable, in all cardinal directions
recalculate_directional_opacityCalculate on which directions this turfs block view.
remove_opacity_sourceProc to remove movable sources of opacity on the turf and let it handle lighting code.
transfer_area_lightingTransfer the lighting of one area to another
washCalled when this turf is being washed. Washing a turf will also wash any mopable floor decals
zFallPrecipitates a movable (plus whatever buckled to it) to lower z levels if possible and then calls zImpact()
zImpactCalled each time the target falls down a z level possibly making their trajectory come to a halt. see __DEFINES/movement.dm.

Var Details

always_lit

Bool, whether this turf will always be illuminated no matter what area it is in

archived_cycle

used to determine whether we should archive

assigned_oranges_ear

what /mob/oranges_ear instance is already assigned to us as there should only ever be one. used for guaranteeing there is only one oranges_ear per turf when assigned, speeds up view() iteration

atmos_adjacent_turfs

list of turfs adjacent to us that air can flow onto

atmos_supeconductivity

bitfield of dirs in which we are superconducitng

directional_opacity

Which directions does this turf block the vision of, taking into account both the turf's opacity and the movable opacity_sources.

dynamic_lumcount

Lumcount added by sources other than lighting datum objects, such as the overlay lighting component.

fixed_underlay

Icon-smoothing variable to map a diagonal wall corner with a fixed underlay.

force_no_gravity

whether or not this turf forces movables on it to have no gravity (unless they themselves have forced gravity)

heat_capacity

Amount of heat necessary to activate some atmos processes (there is a weird usage of this var because is compared directly to the temperature instead of heat energy)

holodeck_compatible

the holodeck can load onto this turf if TRUE

in_contents_of

For the area_contents list unit test Allows us to know our area without needing to preassign it Sorry for the mess

initial_gas_mix

used for mapping and for breathing while in walls (because that's a thing that needs to be accounted for...) string parsed by /datum/gas/proc/copy_from_turf approximation of MOLES_O2STANDARD and MOLES_N2STANDARD pending byond allowing constant expressions to be embedded in constant strings If someone will place 0 of some gas there, SHIT WILL BREAK. Do not do that.

lighting_corner_NE

Lighting Corner datums.

lighting_object

Our lighting object.

max_fire_temperature_sustained

The max temperature of the fire which it was subjected to

opacity_sources

Lazylist of movable atoms providing opacity sources.

overfloor_placed

If there's a tile over a basic floor that can be ripped out

pathing_pass_method

How pathing algorithm will check if this turf is passable by itself (not including content checks). By default it's just density check. WARNING: Currently to use a density shortcircuiting this does not support dense turfs with special allow through function

rcd_memory

If this turf contained an RCD'able object (or IS one, for walls) but is now destroyed, this will preserve the value. See _DEFINES/construction.dm for RCD_MEMORY*.

temperature_archived

Archived version of the temperature on a turf

thermal_conductivities

All currently stored conductivities changes

thermal_conductivity

used for temperature calculations in superconduction

to_be_destroyed

Used for fire, if a melting temperature was reached, it will be destroyed

turf_flags

Turf bitflags, see code/__DEFINES/flags.dm

underfloor_accessibility

How accessible underfloor pieces such as wires, pipes, etc are on this turf. Can be HIDDEN, VISIBLE, or INTERACTABLE.

Proc Details

Initalize_Atmos

We do NOT use the shortcut here, because this is faster Initializes our adjacent turfs. If you want to avoid this, do not override it, instead set init_air to FALSE

Initialize

Turf Initialize

Doesn't call parent, see /atom/proc/Initialize Please note, space tiles do not run this code. This is done because it's called so often that any extra code just slows things down too much If you add something relevant here add it there too /turf/open/space/Initialize

LinkBlockedWithAccess

For seeing if we can actually move between 2 given turfs while accounting for our access and the caller's pass_flags

Assumes destinantion turf is non-dense - check and shortcircuit in code invoking this proc to avoid overhead. Makes some other assumptions, such as assuming that unless declared, non dense objects will not block movement. It's fragile, but this is VERY much the most expensive part of JPS, so it'd better be fast

Arguments:

ScrapeAway

Take off the top layer turf and replace it with the next baseturf down

add_opacity_source

Proc to add movable sources of opacity on the turf and let it handle lighting code.

air_update_turf

A helper proc for dealing with atmos changes

Ok so this thing is pretty much used as a catch all for all the situations someone might wanna change something About a turfs atmos. It's real clunky, and someone needs to clean it up, but not today. Arguments:

clear_signal_refs

WARNING WARNING Turfs DO NOT lose their signals when they get replaced, REMEMBER THIS It's possible because turfs are fucked, and if you have one in a list and it's replaced with another one, the list ref points to the new turf We do it because moving signals over was needlessly expensive, and bloated a very commonly used bit of code

conductivity_directions

SUPERCONDUCTIVITY ALLLLLLLLLLLLLLLLLLLLRIGHT HERE WE GOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

Read the code for more details, but first, a brief concept discussion/area

Our goal here is to "model" heat moving through solid objects, so walls, windows, and sometimes doors. We do this by heating up the floor itself with the heat of the gasmix ontop of it, this is what the coeffs are for here, they slow that movement Then we go through the process below.

If an active turf is fitting, we add it to processing, conduct with any covered tiles, (read windows and sometimes walls) Then we space some of our heat, and think about if we should stop conducting.

consider_superconductivity

Should we attempt to superconduct?

create_gas_mixture

//////////////GAS MIXTURE PROCS/////////////////// Copies all gas info from the turf into a new gas_mixture, along with our temperature Returns the created gas_mixture

expose_reagents

Handles exposing a turf to reagents.

fromShuttleMove

Base procs

get_atmos_adjacent_turfs

returns a list of adjacent turfs that can share air with this one. alldir includes adjacent diagonal tiles that can share air with both of the related adjacent cardinal tiles

init_immediate_calculate_adjacent_turfs

This proc is a more deeply optimized version of immediate_calculate_adjacent_turfs It contains dumbshit, and also stuff I just can't do at runtime If you're not editing behavior, just read that proc. It's less bad

is_blocked_turf

Check whether the specified turf is blocked by something dense inside it with respect to a specific atom.

Returns truthy value TURF_BLOCKED_TURF_DENSE if the turf is blocked because the turf itself is dense. Returns truthy value TURF_BLOCKED_CONTENT_DENSE if one of the turf's contents is dense and would block a source atom's movement. Returns falsey value TURF_NOT_BLOCKED if the turf is not blocked.

Arguments:

is_blocked_turf_ignore_climbable

Checks whether the specified turf is blocked by something dense inside it, but ignores anything with the climbable trait

Works similar to is_blocked_turf(), but ignores climbables and has less options. Primarily added for jaunting checks

neighbor_conduct_with_src

These two procs are a bit of a web, I belive in you

reachableAdjacentTurfs

Returns adjacent turfs to this turf that are reachable, in all cardinal directions

Arguments:

recalculate_directional_opacity

Calculate on which directions this turfs block view.

remove_opacity_source

Proc to remove movable sources of opacity on the turf and let it handle lighting code.

transfer_area_lighting

Transfer the lighting of one area to another

wash

Called when this turf is being washed. Washing a turf will also wash any mopable floor decals

zFall

Precipitates a movable (plus whatever buckled to it) to lower z levels if possible and then calls zImpact()

zImpact

Called each time the target falls down a z level possibly making their trajectory come to a halt. see __DEFINES/movement.dm.