Goonstation 13 - Modules - TypesVar Details - Proc Details

(global)

Vars

NTHoS/NTSO-whitelisted players
RARITY_COLORGlobal static list of rarity color associations
Z4_ACTIVECentcom / Earth Stuff Contents: Areas: Main Area Outside Offices Lobby Lounge Garden Power Supply
action_namesUsed to translate internal action names to human-readable names.
action_verbsUsed for literal input of actions
adminsAdmins ( ["ckey"] = "rank" ) Populated by proc call in world.New()
all_valid_random_right_armsNumber of tiles where it should try to make a splatter
alldirsEvery direction known to 2D tile-grid-locked spessmen
antagonistsAn associative list of all antagonist IDs, associated with a list of all antagonist datums of that ID.
area_list_is_up_to_dateThe station_areas list is up to date. If something changes an area, make sure to set this to 0
area_parallax_render_source_groupsAn associative list of parallax render source group types and the corresponding instance of that type.
biomesAll possible biomes in assoc list as type || instance
by_catcontains lists of objects indexed by a category string based on START_TRACKING_CAT / STOP_TRACKING_CAT
by_typecontains lists of objects indexed by their type based on [START_TRACKING] / [STOP_TRACKING]
cached_colorspaint cans
cardinalNever Soggy Eat Waffles
chessboard
compid_fileThe file holding computer ID information
cycling_airlocksa global associative list of all airlocks linked together by cycling mechanisms. Indexed by ID
dirnamesAssoc. list of dirs like "north"=NORTH
dirvaluesAssoc. list of dirs like "[NORTH]" = "NORTH", useful for screen_loc
do_compid_analysisShould we be analysing the comp IDs of new clients?
dont_init_spaceWhen toggled on creating new /turf/space will be faster but they will be slightly broken used when creating new z-levels
ehjaxEHJAX - Like ajax but for byond A framework for browser popups to interact with the byond server, async (client-side)
emergency_shuttleControls the emergency shuttle
fishing_spotsinitialised on world/New(), associative list with the format (fishing_atom_type = /datum/fishing_spot)
flock_signal_unleashedHas a flock relay been unleashed yet this round
flocksassociative list of flock names to their flock
flockstats_globalGlobal list to handle multiple flocks existing
input_window_presetsPresets for standard windows
ircbotProcs for handling ircbot connectivity and data transfer
is_blank_string_regexReturns true if given string is just space characters The explicitly defined entries are various blank unicode characters that don't get included as white space by \s
key_namesUsed to translate bitflags of hotkeys into human-readable names
keybind_stylesThis file is intended to hold all data pertaining to keybind_style datums and related functionality
light_update_queueList of items that want to be deleted
logsLoooooooooogs
mapNamesid corresponds to the name of the /obj/landmark/map playerPickable defines whether the map can be chosen by players when voting on a new map.
material_category_namesMaterial category names as displayed in fabricators see match_material_pattern() for exact definitions
mentorsMentors
named_color_cacheglobal cache of all named colors once fetched with a color rgba
named_colorsglobal list of all named colors
no_more_radiosstupid global var, if true then all radios will start "bricked"
ordinalDiagonal directions
oven_recipesCOOKING RECODE
parallax_enabledWhether parallax has been enabled or disabled globally.
part_customizationsLazy init singleton list
phrase_logThis system keeps a logged list of player-created phrases of various categories. The lists are cross-round. Useful for stuff like hallucinations etc. If the number of phrases in a category exceeds src.max_length random phrases get thrown out to reduce the size when saving. Currently logged categories: say - people talking whisper - people whispering pda - pda messages deadsay - ghosts talking ailaw - custom AI laws record - custom radio station record names emote - custom emotes prayer - prayers name-X - player chosen name for X where X is from the set {blob, ai, cyborg, clown, mime, wizard, ...} vehicle - vehicle names (via a bottle of Champagne) sing - people singing pill - custom pill name bottle - custom obttle name voice-mimic - voices used by the changeling mimic voice ability voice-radiostation - voices used by the radio station voice synthesizer telepathy - messages sent through the telepathy genetics ability bot-X - custom bot name, X is from the set {camera, fire, guard, med, sec} (I bet you didn't even know you could rename bots with a pen, huh) name-bee - custom bee / bee larva name name-critter - custom critter name (you can rename those with a pen too, whoa) seed - custom botany seed name paper - stuff people write on papers crayon-queue - crayon queue mode inputs
planetZLevelThe following is based on GenerateMining.dm
planet_parallax_render_source_groupsAn list of parallax render source group instances that are used within procedurally generated planets.
portable_machineryRemote parent
protected_frequenciesradio frequencies unable to be picked up by (empowered) radio_brain
reagent_shorthandsList of 2 letter shorthands for the reagent, currently only used by the cybernetic hypospray
roles_to_prefsAssociative list of role defines and their respective client preferences.
roundManagementCollection of methods to handle recording round data to the API
sb_tricksTypes of sounds: AMBIENCE_LOOPING, AMBIENCE_FX_1, and AMBIENCE_FX_2 Holds the associated sound channel we want Determines if we are repeating or not Should the sound set the wait var? pool of precached sounds
sortInstanceThis is a global instance to allow much of this code to be reused. The interfaces are kept separately
special_admin_observing_verbsproc/possess, client/proc/generate_poster, client/proc/addpathogens, client/proc/debug_check_possible_reactions, client/proc/dbg_itemspecial, client/proc/dbg_objectprop,
station_areasAll the accessible areas on the station in one convenient place
statusGroupLimitsSimple global list of groupname : amount, that tells the system how many effects of a group we can have active at most. See exclusiveGroup. Buffs above the max will not be applied.
switched_objsContains objects in ID-based switched object groups, such as blinds and their switches
tgui_admin_statetgui state: admin_state
tgui_always_statetgui state: always_state
tgui_broken_statetgui state: broken
tgui_conscious_statetgui state: conscious_state
tgui_contained_statetgui state: contained_state
tgui_deep_inventory_statetgui state: deep_inventory_state
tgui_default_statetgui state: default_state
tgui_hands_statetgui state: hands_state
tgui_human_adjacent_statetgui state: human_adjacent_state
tgui_inventory_statetgui state: inventory_state
tgui_not_incapacitated_statetgui state: not_incapacitated_state
tgui_not_incapacitated_turf_statetgui state: not_incapacitated_turf_state
tgui_notcontained_statetgui state: notcontained_state
tgui_observer_statetgui state: observer_state
tgui_physical_obscured_statetgui state: physical_obscured_state
tgui_physical_statetgui state: physical_state
tgui_processtgui process
tgui_self_statetgui state: self_state
tgui_z_statetgui state: z_state
the_automatoncogwerks spooky automaton thing that kinda just sits there being weird and ominous
transception_arrayStation's transception anrray, used for cargo I/O operations on maps that include one
triggerVarsThis contains the names of the trigger lists on materials. Required for copying materials. Remember to keep this updated if you add new triggers.
valid_icon_statesIcon states that exist for a given icon ref. Format is valid_icon_states[icon] = list(). Populated by is_valid_icon_state(), used for caching.
waterflow_enabledFluid Object
whitelistCkeysPlayers whomst'd've get allowed if whitelist-only is enabled
worldgenCandidatesLargely used for handling auto turfs that update their appearance to "connect" to nearby walls Turfs add themselves to this in their New()
z_level_parallax_render_source_groupsAn associative list of each z-level define and its corresponding parallax layer render source group. See code\map\map_settings.dm for the default parallax render sources for each z-level.
zlevelsList containing all z-level datums indexed by their z coordinate

Procs

ClearBadsmokeRefsSMOKE SYSTEMS
FindBankAccountsByJobsGiven a list of jobs, return the associated bank account records. Does not de-duplicate bank account records.
FindPromotionCandidatesCOMMAND PROMOTIONS
GetRandomPerimeterTurfReturns a turf at the edge of a squared circle of specified radius around a thing
HYPchem_scalingThis proc causes all chem production of botany to have a diminishing return with potency (or other stats for e.g. maneaters) For potency reaching infinite, this times linear_factor will be the result Refer to the graph in the explation on how this is calculated
HYPfull_potency_calculationthis proc is a shortcut to calculate the amount of chems to produce from a linear factor and the plantgenes
HYPpassplantgenesThis proc generates the name of a produce item
HeapPathWeightCompareTODO: Macro this to reduce proc overhead
IsGuestKeyReturns true if the given key is a guest key
addPlayerNoteAdding a player note
addTimeAdd time to a given BYOND time format
add_coloradds a named color to the global list given name and RGB color
affine_color_mapping_matrixThe same thing as [proc/color_mapping_matrix] but with 4 mapped colors. The first color is used as the origin in the affine transform.
angle2textReturns the given degree converted to a text string in the form of a direction
angle_inbetweenChecks if an angle is between two other angles
angle_to_dirTransforms a given angle to a cardinal/ordinal direction
angle_to_vectorTransforms a given angle to vec2 in a list
applyCableMaterialsYes hello apparently we need a proc for this because theres a million types of different wires and cables.
ass_explosion_limb_successFirst try to sever their butt If that didn't work, try severing a limb or tail Dont want your tail removed? Keep all your limbs intact! Returns 0 if it cant be severed like this, 1 if it always gets severed, or 2 if it sometimes gets severed
ass_explosion_messageReturns if the limb is not ass-severable, and a message to the owner about why not returns some flufftext as to why their limb didnt come off. Or came off anyway.
attack_particleobj/attackby(var/obj/item/I, mob/user)
attenuate_for_locationreturns 0 to 1 based on air pressure in turf
bash_explodeBASH explode: Splits a string into string pieces the same way BASH handles this.
binobj_to_generatorParticle sets contain a "_binobj" variable, which exposes some of its properties, as the /particles/ "datum" is otherwise just a wrapper wih nothing relevant in it. This proc extracts data from a given _binobj value and creates a generator with the same properties.
blank_or_es'they smash' vs 'he smashes'
blank_or_s'they run' vs 'he runs'
blend_skintoneBlends given rgb values with old human mob skin color (#ffca95) to return a new rgb value
borkborkbork_parse!!! !!!
build_manufacturer_iconsPre-build the icons for things manufacturers make
build_syndi_buylist_cacheBuilds the entire syndicate buylist cache, retrieved by uplinks. Ideally only executed once during the pre-round
calculateHeatTransferCoefficientReturns the thermal conductivity between two materials, based on thermal and electrical conductivity mat property. Thermal conductivity ranges from 0 (perfect insulator) to infinity. Excellent conductors like copper are about 100
can_actReturns true if not incapicitated and unhandcuffed (by default)
change_ghost_invisibilityChanges ghost invisibility for the round.
checkTurfPassableReturns false if there is a dense atom on the turf, unless a custom hueristic is passed.
check_whitelistRemoves non-whitelisted reagents from the reagents of TA
ckey_to_mobA universal ckey -> mob reference lookup proc, adapted from whois() (Convair880).
ckey_to_mob_maybe_disconnectedGiven a ckey finds a mob with that ckey even if they are not in the game.
cloud_saves_put_data_bulkMass save a collection of cloud data for various players Input format: list( list( "player_id" = 1, "key" = "foo", "value" = "bar" ), list( "player_id" = 2, "key" = "foo2", "value" = "bar2" ) )
cloud_saves_transferTransfer all cloud save files from one player to another WARNING: This overwrites all the saves for the target
color_mapping_matrixTakes two lists, inp=list(i1, i2, i3), out=(o1, o2, o3). Creates a color matrix which maps color i1 to o2, i2 to o2, i3 to o3. (Ignores alpha values.) Keep the i1, i2, i3 vectors linearly independent. The colors can be either be color hex strings or lists as returned from hex_to_rgb_list. You need to supply all arguments. If you don't care about the third just set i3 = o3 to something linearly independent of i1 and i2.
concrete_typesof[/proc/typesof()] but only for concrete (not abstract) types, it caches the result so you don't need to worry about doing that manually so subsequent calls on the same type will be very fast.
connect_camera_neighboursThe direction we're trying to fill The reciprocal of this direction
connectdirs_to_byonddirsconverts get_connected_directions_bitflag() diagonal bits to byond direction flags
copy_overlaysCopies the overlay data from one atom to another
create_named_colorscalled at world startup populates the color list
csoundSoundcache NEVER use these sounds for modifying. This should only be used for sounds that are played unaltered to the user. @param text name the name of the sound that will be returned @return sound
dead_player_listReturns a list of eligible dead players to be respawned as an antagonist or whatever (Convair880). Text messages: 1: alert | 2: alert (chatbox) | 3: alert acknowledged (chatbox) | 4: no longer eligible (chatbox) | 5: waited too long (chatbox) for_antag indicates that we are polling for an antag role and so should exclude antag-banned players
deletePlayerNoteDeleting a player note
derive_analogous_colors
derive_color_from_hue_offset
derive_complementary_color
derive_square_colors
derive_triadic_colors
dir_to_angleTransforms a cardinal/ordinal direction to an angle
dir_to_dirnameReturns the lowercase english word for a direction (num)
dirname_to_dirReturns the direction (num) of a given lowercase english direction
display_slipup_imageSpawns an image above a patient when you slip up. Only the surgeon sees it.
doAssetParseCDN PROCS FOR LIVE SERVERS
do_hud_offset_thingadjusts a screen_loc to account for non-32px-width sprites, so they get centered in a HUD slot
do_slipupYou messed up. Cause damage and spawn some indicators.
eligible_dead_player_listReturns a list of eligible dead players that COULD choose to respawn or whatever
english_listReturns a list in plain english as a string
faction_checkReturns TRUE if ourguy is enemies with otherguy FALSE otherwise
filename_from_pathGets the filaname from a filesystem path. Optionally strips extension too
filter_is_character_setup_ringtonetype filter for ringtones that're suposed to be selectable at roundstart
filtered_concrete_typesofThe same thing but now you can filter the types using a proc. Also cached. The filter proc takes a type and should return 1 if we want to include it and 0 otherwise. That proc should also be pure (always return the same thing for the same arguments) because of the caching. If you want to use non-pure proc do the filtering manually yourself and don't use this. Note that the first call to filtered_concrete_typesof with a given type and filter will be (possibly a lot) slower than doing it manually. The benefit of this proc only shows itself for future calls which are very fast due to caching.
find_all_by_typeFinds all instance of a type in the world. Returns a list of the instances if no procedure is given. Otherwise, calls the procedure for each instance and returns an assoc list of the form list(instance = procedure(instance, arguments...), ...) procedure_src is the src for the proc call. If it is null, a global proc is called. If it is the string "instance" the output list will be instead list(instance = instance.procedure(arguments...), ...)
find_clientFind a client based on ckey
find_first_by_typeFinds some instance of a type in the world. Returns null if none found.
find_ghost_by_keyfind a ghost mob (or a ghost respawned as critter in vr/afterlife bar)
find_job_in_controller_by_stringSoft supresses crash on failing to find a job
find_playerreturns a reference to a player datum based on the ckey you put into it
fireflashgeneric proc for creating flashes of hotspot fire falloff is in units of degrees per tile
fireflash_meltinggeneric proc for hotspot fire flashes that also melt turf
fixed_randompseudorandom number based on x, y in range 0 to 1
flatten_listFlattens a keyed list into a list of it's contents
flock_speakhow to speak in the flock for speaker, pass: -null to give a general system message -mob to make a mob speak -flock_structure for a structure message involuntary overrides the sentient styling for messages generated by the possessed flock critter
formatTimeTextReturns time input as mm:ss
formattedShiftTimeReturns shift time as a string in hh:mm format. Call with TRUE to get time in hh:mm:ss format.
fromIso8601Convert ISO 8601 to BYOND time format (or epoch time if given argument for that)
gas_text_colorEnables debug overlay which counts process_cell() calls per turf (viewable through info-overlays) Enables debug overlay which counts all atmos operations per turf (viewable through info-overlays) Puts a list of turfs which get processed a lot into global.hotly_processed_turf for debugging Returns the color of a given gas ID.
generate_access_name_lookupBuild the access_name_lookup table, to associate descriptions of accesses with their numerical value.
getClientFromCkeyFinds a client by ckey, throws exception if not found
getFlatIconCreates a single icon from a given /atom or /image. Only the first argument is required.
getFusedMaterialMerges two materials and returns result as new material.
getFusedTriggersFuses two material trigger lists.
getIconSizeHandles the two states icon_size can be in: basic number, or string in WxH format
getInterpolatedNameMerges two material names into one.
getItemIconGenerates item icons for manufacturers and other things, used in UI dialogs. Sends to client if needed.
getLineMatrixReturns the line matrix from a start atom to an end atom, used in creating line objects
getMatFailStringReturns a string for when a material fail or breaks depending on its material flags.
getMatFlagStringTranslates a material flag into a string.
getMaterialReturns one of the base materials by id.
getOreQualityName*** MISC ***
getQualityNameSimply returns a string for a given quality. Used as prefix for objects.
getRoleReturns a string based on the current job and antag role of the mob e.g. "Staff Assistant [Traitor]"
getTimeInSecondsSinceTimeReturns the time in seconds since a given timestamp
get_accessible_station_areasReturns a list of all areas on a station
get_adjacent_floorReturns the turf facing the fab for cardinal directions (which should also be the user's turf), but for diagonals it returns a neighbouring turf depending on where you click Just in case you're attacking a corner diagonally. (made initially for lamp manufacturers, probably behaves funky above range 1)
get_alive_antags_percentagereturns a decimal representing the percentage of alive crew that are also antags
get_all_accesses/ Heads of staff / Security / Medical / Science Engineering / Civilian Other or gimmick
get_all_antagonistsGets a list of all antagonist datums of ID role_id, or of all IDs if no ID is specified. Returns a list of all antagonist datums. If no antagonist datums could be found, returns an empty list.
get_all_character_setup_ringtonessets up the list of ringtones players can select through character setup
get_all_gangsReturns a list of all gang datums.
get_all_mobs_inReturns list of all mobs within an atom. Not cheap! (unlike ur mum)
get_angleReturns the angle between two given atoms
get_assetsReturns either the already-created asset or creates a new one and returns it
get_available_custom_style_typesGets all the customization_styles which are available to a given client. Can be filtered by providing a gender flag or a type
get_average_colorTakes an icon and optionally two non-zero Pixel Intervals and returns the average color of the icon.
get_dead_crew_percentagereturns a decimal representing the percentage of dead crew (non-observers) to all crew
get_default_flockGimmick flock with infinite compute that lone structures and units automatically connect to
get_general_recordReturns the datacore general record, or null if none found
get_hud_styleReturns hud style preferences of given client/mob
get_id_cardchecks an item for an id card
get_image_groupReturns the client image group for a given "key" argument. If one doesn't yet exist, creates it.
get_manifestReturns the crew manifest, but sorted according to the individual's rank. include_cryo includes a list of individuals in cryogenic storage Set synd_int_request_device to the object calling the proc to get Syndicate Intelligence.
get_map_prefabsGets all prefabs of a given type.
get_matches_stringADMIN HELPER PROCS
get_nearest_colorreturns the name of the color nearest to the given color RGB
get_nearest_color_datumreturns the named_color datum that is nearest to the given color RGB
get_one_matchget_one_match attempts to find a type match for a given object. The function allows customization of the base type, whether to use concrete types, whether to use only admin spawnable, the comparison procedure, and the sort limit. The function sorts the matches if a comparison procedure is provided and if the sort limit condition allows it, then it presents a list of matches for the user to choose from.
get_ouija_word_listget_ouija_word_list
get_parallax_render_source_groupReturns a reference to the parallax render source group datum belonging to either an area or z-level.
get_path_toThis is the proc you use whenever you want to have pathfinding more complex than "try stepping towards the thing".
get_preference_for_roleReturn the name of a preference variable for the given role define.
get_random_station_storage_listReturn a list of station-level storage objects that are safe to spawn things into
get_random_subtypeReturns a random subtype when an atom has TYPEINFO with a random_subtypes list
get_singletonGets the instance of a singleton type (or a non-singleton type if you decide to use it on one).
get_standard_skintoneGiven user, will proompt user to select skin color from list (or custom) and returns skin tone after blending
get_type_typeinfoRetrieves the typeinfo datum for a given type.
get_uplink_typeReturns a path of a (presumably) valid uplink dependent on the user's mind.
get_weakrefGets a weak reference to the given datum. This is a basically a reference that will not prevent garbage collection of the datum. Useful when you don't want to "own" the datum in question. For example a mob holding a reference to its trinket. In that case it doesn't make sense to prevent garbage collection of the trinket. If the trinket gets destroyed in-game we are fine if this weak reference to the trinket turns to null.
gradientTextReturns span with a color gradient between two given colors of given message
handleTriggerGenerationsIncreases generations on material triggers and handles removal if over the generation cap.
hasParentMaterialSearches the parent materials of the given material, up to a given generation, for an id.
has_or_have'they have' vs 'he has'
he_or_she_dont_or_doesnt"he doesn't" vs "they don't"
hes_or_shes"they're outside" vs "he's outside"
hex2color_nameGiven hex color, returns string name of nearest named color
his_or_her'their cookie' vs 'her cookie'
hsv_transform_color_matrixGenerates a color matrix which performs an approximation of the HSV-space transform. Hue is in degrees and is applied additively. Saturation is in a 0-1 range and is applied multiplicatively. Value is in a 0-1 range and is applied multiplicatively.
identify_objectFor runtime logs- returns the above plus ref
illiterateGarbleTextReturns given text replaced entirely by nonsense chars
in_cone_of_visionThis proc checks if one atom is in the cone of vision of another one.
in_interact_rangeFor interacting with stuff.
initialise_fishing_spotsrun on world/New(), clears global.fishing_spots (if it exists) and fills it with the format (fishing_atom_type = /datum/fishing_spot)
initialize_biomesInitialize all biomes, assoc as type || instance
isLeapYearreturns true if the year is divisible by 4, except for years that are divisible by 100. However, years that are divisible by 400 are also leap years.
isUpperReturns true if the char you feed it is uppercase.
isVowelReturns true if the given string has a vowel
is_hexReturns true if given value is a hex value
is_incapacitatedReturns true if the given mob is incapacitated
is_music_playingApproximate check of whether music is playing or not (radio / ad tapes / admin music all count as music here) If music is playing this should return TRUE. But if music stopped playing only recently-ish it can sometimes return TRUE still. In some rare cases it can happen that this has a false negative too so like don't rely on this for anything super important, ok?
is_or_are'they are' vs 'he is'
is_valid_abcu_objectChecks if a thing should be allowed to be saved / loaded by the ABCU. Currently does not do the whitelist / blacklist filtering.
isadminReturns true if given mob/client/mind is an admin
istypesistype but for checking a list of types
jobban_isbannedCan be provided with a mob, a raw cache list, or a ckey. Prefer providing a cache if you can't use a mob, as that reduces API load.
jpsTurfPassablethis is a slight modification of /proc/checkTurfPassable to avoid indirect proc call overhead Returns false if there is a dense atom on the turf, unless a custom hueristic is passed.
load_config_listGets a list of ckeys from a file, ignoring comments/blank lines This could probably be refactored to config files in general, but
log_objectFor logs- returns the thing's name and type. Handles nulls and non-datums fine, might do something weird for savefiles, clients, etc
log_respawn_eventLogs a player respawning as something from a respawn event, noting if they joined the round as an observer or not Note: should be called BEFORE they are transferred to the new body
log_tguiAppends a tgui-related log entry. All arguments are optional.
make_associativeMake a normal list an associative one
make_fake_explosionobj/item/tank/plasma = 2
make_playerreturns a reference to a player datum, but it tries to make a new one if it cant an already existing one (this is how it persists between connections)
man_or_woman'this man' vs 'this person'
matchesMaterialRecipeChecks if a material matches a recipe and returns the recipe if a match is found. returns null if nothing matches it.
maximal_subtypeReturns the maximal subtype (i.e. the most subby) in a list of given types
md5_to_more_pronouncableTakes a hash generated by md5() and turns it into a string of alternating consonants and vowels
move_elementMove a single element from position from_index within a list, to position to_index
move_rangeMove elements [from_index,from_index+len) to [to_index-len, to_index)
mult_color_matrixTakes two 20-length lists, turns them into 5x4 matrices, multiplies them together, and returns a 20-length list
newline_html_decodeReturns a string with all HTML special characters decoded and
replaced with newlines
newline_html_encodeReturns a string with all HTML special characters encoded and newlines replaced with
normalize_color_to_matrixTakes a possible value of the color var and returns a length 20 color matrix doing the same thing. Available inputs: null, "#rgb", "#rrggbb", "#rgba", "#rrggbbaa", all forms of color matrices
normalize_plain_data_listRecursively normalizes a list of plain_data and primitive values. Plain_data values are converted to lists, recursively.
o_clock_timeReturns the current timeofday in o'clock format
pick_map_prefabPicks a random prefab from given prefab type. Filters the prefabs picked based on the given tags. Choice is performed by a weighted random choice based on the prefab's probability. Prefabs marked as required are always picked first.
pick_refGives the target mob a reference picker ability and returns the atom picked. Synchronous.
placeAllPrefabs
placeAllRandomRoomsSimilar to the prefab runtime checker. The following text is mostly plagiarised from PrefabRuntimeChecker.dm
playsound_globalPlays a sound to some clients without caring about its source location and stuff. target can be either a list of clients or a list of mobs or world or an area or a z-level number.
predecessor_path_in_listFind predecessor of a type
prioritize_dead_playersReturns a randomized list of minds with players who joined as observer at the back
purge_fluid_blacklistDeletes any reagents that are banned in fluid puddles.
purge_smoke_blacklistDeletes any reagents that are banned in smoke clouds.
qdelqdel
radioGarbleTextReturns given text replaced by nonsense chars, excepting HTML tags, on a 40% or given % basis
random_emojiGenerates a random Unicode emoji that will look ok in the chat
random_hexReturns random hex value of length given
random_nonrestrictedz_turfReturns a random turf on a non-restricted z-level.
random_space_turfTries to return a random space turf. Tries a given number of times and if it fails it returns null instead.
random_splitReturns amount evenly distributed random integers that sum to sum
rc_buildentrySmall helper proc to simplify basic contract entry creation. Accepts the path to the entry datum, and the count (in whatever unit it uses) to require.
record_cloner_defectsWrite current cloner defects to an existing datacore medical record
recursive_flistLists all files recursively in a given dir, refer to builtin flist() for details
resourceGENERIC HELPERS FOR BOTH SYSTEMS
reverse_list_rangeReverses a given list within the given range
rustg_get_versionGets the version of rust_g
rustg_redis_disconnect_rqDisconnects from a previously connected redis server
rustg_unix_timestampReturns the timestamp as a string
s_esReturns the plural based on a number provided.
sanitize_frequencyReturns f, ensured that it's a valid frequency
save_flock_statsIn a sensible language, this would be a static class proc. Alas this is DM. This proc saves all the stats for all flocks in this round, and rotates the log so only the last FLOCK_ROUNDS_SAVED flock rounds are stored
seen_by_cameraReturn true if mob is on a turf with camera coverage
sendItemIconsSends all of the item icons to a client. Kinda gross, but whatever.
sendItemIconsToAllSends all item icons to all clients. Used at world startup to preload things.
send_assetsSends the list of asset files to client if they're needed
separate_radio_prefix_and_messageGiven a message, returns a list containing the radio prefix and the message, so that the message can be manipulated seperately in various functions.
setup_z_level_parallax_render_sourcesInitialises z_level_parallax_render_source_groups by populating it with z-level parallax render source groups.
should_diary_logCheck config for whether a message should be logged to the diary
showLineCreates and shows a line object. Line object has an "affected" var that contains the cross tiles.
singularity_containment_checkChecks if there is a containment field in each direction from the center turf. If not returns null. If yes returns the distance to the closest field.
smilify!!! !!!
sonic_attack_environmental_effectGiven center turf/atom, range, and list of things to smash, will damage said objects within range of center. Used for sonic grenades and similar. Avoiding C&P Code.
sortListsortList - To sort lists via TimSort (in place)
sortListCopyJust like /proc/sortList, but return a sorted copy of the given list
soviet_parse!!! !!! !!! !!!
string_type_of_anythingthing.type but it also returns "num" for numbers etc.
strip_prefixRemoves a given prefix from a string.
subtractTimeSubtract time from a given BYOND time format
swap_rangeMove elements from [from_index, from_index+len) to [to_index, to_index+len)
text2num_safeParses a number except for NaNs and infinities
tgui_TopicMiddleware for /client/Topic.
tgui_alertCreates a TGUI alert window and returns the user's response.
tgui_color_picker@file @copyright 2023 @author itsmeow (https://github.com/itsmeow) @license MIT
tgui_color_picker_asyncCreates an asynchronous TGUI color picker window with an associated callback.
tgui_input_bitfieldCopyright (c) 2024 @Azrun SPDX-License-Identifier: MIT
tgui_input_listCreates a TGUI input list window and returns the user's response.
tgui_input_list_asyncCreates an asynchronous TGUI input list window with an associated callback.
tgui_input_numberCreates a TGUI window with a number input. Returns the user's response as num | null.
tgui_input_number_asyncCreates an asynchronous TGUI number input window with an associated callback.
tgui_input_textCreates a TGUI window with a text input. Returns the user's response.
tgui_input_text_asyncCreates an asynchronous TGUI text input window with an associated callback.
tgui_message@file @copyright 2024 @author ZeWaka (https://github.com/zewaka) @license MIT
tidy_net_dataCleans up data passed in from network packets for display so it doesn't mess with formatting
time_to_textReturns the passed decisecond-format time in the form of a text string
toIso8601Convert BYOND time format to ISO 8601
total_crossChecks if Cross succeeds for the turf and all atoms in it
total_densityReturns the sum of densities of all atoms in the given turf including the turf itself
type2parentReturns the parent type of a given type. Assumes that parent_type was not overriden.
typecache_filter_listRurns a new list with only atoms that are in the typecache list
typecache_filter_list_reverseReturn a new list with atoms that are not in the typecache list
typecache_filter_multi_list_exclusionSimilar to typecache_filter_list and typecache_filter_list_reverse but it supports an inclusion list and and exclusion list
typecacheofLike typesof() or subtypesof(), but returns a typecache instead of a list.
ucfirstUppercases first letter
ucfirstsUppercases first letter of every word
ui_describe_reagentsReturns a serialized representation of the reagents of an atom for use with the ReagentInfo TGUI components Note that this is not a built in TGUI proc
uwutalkuwutalk
validateIso8601Validate ISO 8601 format
ve_or_s"they've had" vs "he's had"
vector_magnitudeReturns the vector magnitude of an x value and a y value
vector_to_dirTransforms a supplied vector x & y to a direction
weighted_pickPicks a random element from a list based on a weighting system.
whodeadFinds whoever's dead.
whoisLooks up a player based on a string. Searches a shit load of things whoa. Returns a list of mob refs.

Var Details

NT

HoS/NTSO-whitelisted players

RARITY_COLOR

Global static list of rarity color associations

Z4_ACTIVE

Centcom / Earth Stuff Contents: Areas: Main Area Outside Offices Lobby Lounge Garden Power Supply

Turfs: Outside Concrete & Grass

action_names

Used to translate internal action names to human-readable names.

action_verbs

Used for literal input of actions

admins

Admins ( ["ckey"] = "rank" ) Populated by proc call in world.New()

all_valid_random_right_arms

Number of tiles where it should try to make a splatter

alldirs

Every direction known to 2D tile-grid-locked spessmen

antagonists

An associative list of all antagonist IDs, associated with a list of all antagonist datums of that ID.

area_list_is_up_to_date

The station_areas list is up to date. If something changes an area, make sure to set this to 0

area_parallax_render_source_groups

An associative list of parallax render source group types and the corresponding instance of that type.

biomes

All possible biomes in assoc list as type || instance

by_cat

contains lists of objects indexed by a category string based on START_TRACKING_CAT / STOP_TRACKING_CAT

by_type

contains lists of objects indexed by their type based on [START_TRACKING] / [STOP_TRACKING]

cached_colors

paint cans

cardinal

Never Soggy Eat Waffles

chessboard


|\ |\ |\ |\ ___ \ |\ __\ |\ |\ _ \ _ |\ __ |\ |_ \ ___ \ |\ __ \ |\ ____\ |\ \ / __ |_ \
\ \ _
|\ \ \\ \ \ /|\ \ _|
\ \ _
|\ \ \_
\ \ \ \ |\ \ \ _
||
\ _\ \ /|\ \ |\ \ \ \ _|
\ \ _
|
|/|\ ||\ /
\ \ \ \ \ __ \ \ _|/\ _
_ \ _____ \ \ \|__| \ \ \ __ \ _____ \ \ \ \ \ \ _|/\ \ _ \ \ ___ \ _____ |/ \ \ \ |\ \
\ \ _\ \ \ \ \ \ _|\ ||\ \||\ \ \ \ \ \ \ \ \ \ ||\ \ \ \ \ \ \ _|\ \ \ \ | __||\ \||\ \ \ \ \ _\ \
\ _
__\ _\ _\ _____\ \ ___\ \ _\ \ _\ _\ ___\ \ \ _\ \ _\ _\ |___\ \ _\ \ \ _|_\
|
____||||||_______|_\_|| ||||||_\ || |_||||||_\\ ||||
|
|| || ||___|


|\ _|\ __ |\ __ |\ \ / /|\ __ |\ |\ |\ |\ |_ _\ / ___ |\ __ |\ __ |\ ____\ |\ \ |\ |\ __ |\ __ |\ ____\
\ \ _
|\ \ |\ \ \ |\ \ \ / / | \ |\ \ \ \ \ _
|\ \ \\ |
\ _| /__/|_/ /\ \ |\ \ \ |\ \ \ _| \ \ \ \ \ \ \ |\ \ \ |\ \ \ _|
\ \ \ \ \ \\ \ \ \ \ / / \ \ _ \ \ \ \ \ \ \ __ \ \ \ \ ||// / /\ \ \\ \ \ \\ \ \ _ \ \ \ \ \ \ \ __ \ \ _ \ \ \
\ \ _
\ \ \\ \ \ _
|/ / / \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ ___ / /_/__\ \ \\ \ \ \\ \ \ ___ \ \ \ |__\ \ \ \ \ \ \ \ \ \ _
\ _\ _\ _\ __/ / / \ _\ \ _\ ______\ _\ _\ \ _\\\ _\ _\ _\\ _________\ _\ _\ _\ \ ______
|||||||_/ / |||||__||_______||||| |||||||||||||__________||||||||||____| ||/

compid_file

The file holding computer ID information

cycling_airlocks

a global associative list of all airlocks linked together by cycling mechanisms. Indexed by ID

dirnames

Assoc. list of dirs like "north"=NORTH

dirvalues

Assoc. list of dirs like "[NORTH]" = "NORTH", useful for screen_loc

do_compid_analysis

Should we be analysing the comp IDs of new clients?

dont_init_space

When toggled on creating new /turf/space will be faster but they will be slightly broken used when creating new z-levels

ehjax

EHJAX - Like ajax but for byond A framework for browser popups to interact with the byond server, async (client-side)

emergency_shuttle

Controls the emergency shuttle

fishing_spots

initialised on world/New(), associative list with the format (fishing_atom_type = /datum/fishing_spot)

flock_signal_unleashed

Has a flock relay been unleashed yet this round

flocks

associative list of flock names to their flock

flockstats_global

Global list to handle multiple flocks existing

input_window_presets

Presets for standard windows

ircbot

Procs for handling ircbot connectivity and data transfer

is_blank_string_regex

Returns true if given string is just space characters The explicitly defined entries are various blank unicode characters that don't get included as white space by \s

key_names

Used to translate bitflags of hotkeys into human-readable names

keybind_styles

This file is intended to hold all data pertaining to keybind_style datums and related functionality

To add a new keybind: Add it in the right keybind_style below. Then, you need to update action_names to allow the menu to translate into human-readable format. Depending on what you're adding, you might need to update action_verbs as well. Global list holding all of the keybind style datums

light_update_queue

List of items that want to be deleted

logs

Loooooooooogs

mapNames

id corresponds to the name of the /obj/landmark/map playerPickable defines whether the map can be chosen by players when voting on a new map.

material_category_names

Material category names as displayed in fabricators see match_material_pattern() for exact definitions

mentors

Mentors

named_color_cache

global cache of all named colors once fetched with a color rgba

named_colors

global list of all named colors

no_more_radios

stupid global var, if true then all radios will start "bricked"

ordinal

Diagonal directions

oven_recipes

COOKING RECODE

parallax_enabled

Whether parallax has been enabled or disabled globally.

part_customizations

Lazy init singleton list

phrase_log

This system keeps a logged list of player-created phrases of various categories. The lists are cross-round. Useful for stuff like hallucinations etc. If the number of phrases in a category exceeds src.max_length random phrases get thrown out to reduce the size when saving. Currently logged categories: say - people talking whisper - people whispering pda - pda messages deadsay - ghosts talking ailaw - custom AI laws record - custom radio station record names emote - custom emotes prayer - prayers name-X - player chosen name for X where X is from the set {blob, ai, cyborg, clown, mime, wizard, ...} vehicle - vehicle names (via a bottle of Champagne) sing - people singing pill - custom pill name bottle - custom obttle name voice-mimic - voices used by the changeling mimic voice ability voice-radiostation - voices used by the radio station voice synthesizer telepathy - messages sent through the telepathy genetics ability bot-X - custom bot name, X is from the set {camera, fire, guard, med, sec} (I bet you didn't even know you could rename bots with a pen, huh) name-bee - custom bee / bee larva name name-critter - custom critter name (you can rename those with a pen too, whoa) seed - custom botany seed name paper - stuff people write on papers crayon-queue - crayon queue mode inputs

planetZLevel

The following is based on GenerateMining.dm

planet_parallax_render_source_groups

An list of parallax render source group instances that are used within procedurally generated planets.

portable_machinery

Remote parent

protected_frequencies

radio frequencies unable to be picked up by (empowered) radio_brain

reagent_shorthands

List of 2 letter shorthands for the reagent, currently only used by the cybernetic hypospray

roles_to_prefs

Associative list of role defines and their respective client preferences.

roundManagement

Collection of methods to handle recording round data to the API

sb_tricks

Types of sounds: AMBIENCE_LOOPING, AMBIENCE_FX_1, and AMBIENCE_FX_2 Holds the associated sound channel we want Determines if we are repeating or not Should the sound set the wait var? pool of precached sounds

sortInstance

This is a global instance to allow much of this code to be reused. The interfaces are kept separately

special_admin_observing_verbs

proc/possess, client/proc/generate_poster, client/proc/addpathogens, client/proc/debug_check_possible_reactions, client/proc/dbg_itemspecial, client/proc/dbg_objectprop,

station_areas

All the accessible areas on the station in one convenient place

statusGroupLimits

Simple global list of groupname : amount, that tells the system how many effects of a group we can have active at most. See exclusiveGroup. Buffs above the max will not be applied.

switched_objs

Contains objects in ID-based switched object groups, such as blinds and their switches

tgui_admin_state

tgui state: admin_state

Checks that the user is an admin, end-of-story.

tgui_always_state

tgui state: always_state

Always grants the user UI_INTERACTIVE. Period.

tgui_broken_state

tgui state: broken

Only checks if an object is not broken, can depend on obj type

tgui_conscious_state

tgui state: conscious_state

Only checks if the user is conscious.

tgui_contained_state

tgui state: contained_state

Checks that the user is inside the src_object.

tgui_deep_inventory_state

tgui state: deep_inventory_state

Checks that the src_object is in the user's deep (backpack, box, toolbox, etc) inventory.

tgui_default_state

tgui state: default_state

Checks a number of things -- mostly physical distance for humans and view for robots.

tgui_hands_state

tgui state: hands_state

Checks that the src_object is in the user's hands.

tgui_human_adjacent_state

tgui state: human_adjacent_state

In addition to default checks, only allows interaction for a human adjacent user.

tgui_inventory_state

tgui state: inventory_state

Checks that the src_object is in the user's top-level (hand, ear, pocket, belt, etc) inventory.

tgui_not_incapacitated_state

tgui state: not_incapacitated_state

Checks that the user isn't incapacitated

tgui_not_incapacitated_turf_state

tgui state: not_incapacitated_turf_state

Checks that the user isn't incapacitated and that their loc is a turf

tgui_notcontained_state

tgui state: notcontained_state

Checks that the user is not inside src_object, and then makes the default checks.

tgui_observer_state

tgui state: observer_state

Checks that the user is an observer/ghost.

tgui_physical_obscured_state

tgui state: physical_obscured_state

Short-circuits the default state to only check physical distance, being in view doesn't matter

tgui_physical_state

tgui state: physical_state

Short-circuits the default state to only check physical distance.

tgui_process

tgui process

Contains a bit of the tgui process code. Copyright (c) 2020 Aleksej Komarov & ZeWaka (minor porting changes) SPDX-License-Identifier: MIT

tgui_self_state

tgui state: self_state

Only checks that the user and src_object are the same.

tgui_z_state

tgui state: z_state

Only checks that the Z-level of the user and src_object are the same.

the_automaton

cogwerks spooky automaton thing that kinda just sits there being weird and ominous

transception_array

Station's transception anrray, used for cargo I/O operations on maps that include one

triggerVars

This contains the names of the trigger lists on materials. Required for copying materials. Remember to keep this updated if you add new triggers.

valid_icon_states

Icon states that exist for a given icon ref. Format is valid_icon_states[icon] = list(). Populated by is_valid_icon_state(), used for caching.

waterflow_enabled

Fluid Object

whitelistCkeys

Players whomst'd've get allowed if whitelist-only is enabled

worldgenCandidates

Largely used for handling auto turfs that update their appearance to "connect" to nearby walls Turfs add themselves to this in their New()

z_level_parallax_render_source_groups

An associative list of each z-level define and its corresponding parallax layer render source group. See code\map\map_settings.dm for the default parallax render sources for each z-level.

zlevels

List containing all z-level datums indexed by their z coordinate

Proc Details

ClearBadsmokeRefs

SMOKE SYSTEMS

FindBankAccountsByJobs

Given a list of jobs, return the associated bank account records. Does not de-duplicate bank account records.

FindPromotionCandidates

COMMAND PROMOTIONS

GetRandomPerimeterTurf

Returns a turf at the edge of a squared circle of specified radius around a thing

HYPchem_scaling

This proc causes all chem production of botany to have a diminishing return with potency (or other stats for e.g. maneaters) For potency reaching infinite, this times linear_factor will be the result Refer to the graph in the explation on how this is calculated

HYPfull_potency_calculation

this proc is a shortcut to calculate the amount of chems to produce from a linear factor and the plantgenes

HYPpassplantgenes

This proc generates the name of a produce item

HeapPathWeightCompare

TODO: Macro this to reduce proc overhead

IsGuestKey

Returns true if the given key is a guest key

addPlayerNote

Adding a player note

addTime

Add time to a given BYOND time format

add_color

adds a named color to the global list given name and RGB color

affine_color_mapping_matrix

The same thing as [proc/color_mapping_matrix] but with 4 mapped colors. The first color is used as the origin in the affine transform.

angle2text

Returns the given degree converted to a text string in the form of a direction

angle_inbetween

Checks if an angle is between two other angles

angle_to_dir

Transforms a given angle to a cardinal/ordinal direction

angle_to_vector

Transforms a given angle to vec2 in a list

applyCableMaterials

Yes hello apparently we need a proc for this because theres a million types of different wires and cables.

ass_explosion_limb_success

First try to sever their butt If that didn't work, try severing a limb or tail Dont want your tail removed? Keep all your limbs intact! Returns 0 if it cant be severed like this, 1 if it always gets severed, or 2 if it sometimes gets severed

ass_explosion_message

Returns if the limb is not ass-severable, and a message to the owner about why not returns some flufftext as to why their limb didnt come off. Or came off anyway.

attack_particle

obj/attackby(var/obj/item/I, mob/user)

attenuate_for_location

returns 0 to 1 based on air pressure in turf

bash_explode

BASH explode: Splits a string into string pieces the same way BASH handles this.

binobj_to_generator

Particle sets contain a "_binobj" variable, which exposes some of its properties, as the /particles/ "datum" is otherwise just a wrapper wih nothing relevant in it. This proc extracts data from a given _binobj value and creates a generator with the same properties.

blank_or_es

'they smash' vs 'he smashes'

blank_or_s

'they run' vs 'he runs'

blend_skintone

Blends given rgb values with old human mob skin color (#ffca95) to return a new rgb value

borkborkbork_parse

!!! !!!

build_manufacturer_icons

Pre-build the icons for things manufacturers make

build_syndi_buylist_cache

Builds the entire syndicate buylist cache, retrieved by uplinks. Ideally only executed once during the pre-round

calculateHeatTransferCoefficient

Returns the thermal conductivity between two materials, based on thermal and electrical conductivity mat property. Thermal conductivity ranges from 0 (perfect insulator) to infinity. Excellent conductors like copper are about 100

can_act

Returns true if not incapicitated and unhandcuffed (by default)

change_ghost_invisibility

Changes ghost invisibility for the round.

checkTurfPassable

Returns false if there is a dense atom on the turf, unless a custom hueristic is passed.

check_whitelist

Removes non-whitelisted reagents from the reagents of TA

ckey_to_mob

A universal ckey -> mob reference lookup proc, adapted from whois() (Convair880).

ckey_to_mob_maybe_disconnected

Given a ckey finds a mob with that ckey even if they are not in the game.

cloud_saves_put_data_bulk

Mass save a collection of cloud data for various players Input format: list( list( "player_id" = 1, "key" = "foo", "value" = "bar" ), list( "player_id" = 2, "key" = "foo2", "value" = "bar2" ) )

cloud_saves_transfer

Transfer all cloud save files from one player to another WARNING: This overwrites all the saves for the target

color_mapping_matrix

Takes two lists, inp=list(i1, i2, i3), out=(o1, o2, o3). Creates a color matrix which maps color i1 to o2, i2 to o2, i3 to o3. (Ignores alpha values.) Keep the i1, i2, i3 vectors linearly independent. The colors can be either be color hex strings or lists as returned from hex_to_rgb_list. You need to supply all arguments. If you don't care about the third just set i3 = o3 to something linearly independent of i1 and i2.

concrete_typesof

[/proc/typesof()] but only for concrete (not abstract) types, it caches the result so you don't need to worry about doing that manually so subsequent calls on the same type will be very fast.

just don't modify the result of the call directly

OKAY: var/list/hats = concrete_typesof(/obj/item/clothing/head) - /obj/item/clothing/head/hosberet

ALSO OKAY:

var/list/hats = concrete_typesof(/obj/item/clothing/head).Copy()
hats -= /obj/item/clothing/head/hosberet

NOT OKAY:

var/list/hats = concrete_typesof(/obj/item/clothing/head)
hats -= /obj/item/clothing/head/hosberet

connect_camera_neighbours

The direction we're trying to fill The reciprocal of this direction

connectdirs_to_byonddirs

converts get_connected_directions_bitflag() diagonal bits to byond direction flags

copy_overlays

Copies the overlay data from one atom to another

create_named_colors

called at world startup populates the color list

csound

Soundcache NEVER use these sounds for modifying. This should only be used for sounds that are played unaltered to the user. @param text name the name of the sound that will be returned @return sound

dead_player_list

Returns a list of eligible dead players to be respawned as an antagonist or whatever (Convair880). Text messages: 1: alert | 2: alert (chatbox) | 3: alert acknowledged (chatbox) | 4: no longer eligible (chatbox) | 5: waited too long (chatbox) for_antag indicates that we are polling for an antag role and so should exclude antag-banned players

deletePlayerNote

Deleting a player note

derive_analogous_colors

derive_color_from_hue_offset

derive_complementary_color

derive_square_colors

derive_triadic_colors

dir_to_angle

Transforms a cardinal/ordinal direction to an angle

dir_to_dirname

Returns the lowercase english word for a direction (num)

dirname_to_dir

Returns the direction (num) of a given lowercase english direction

display_slipup_image

Spawns an image above a patient when you slip up. Only the surgeon sees it.

doAssetParse

CDN PROCS FOR LIVE SERVERS

PROCS FOR LOCAL SERVER FALLBACK

do_hud_offset_thing

adjusts a screen_loc to account for non-32px-width sprites, so they get centered in a HUD slot

do_slipup

You messed up. Cause damage and spawn some indicators.

eligible_dead_player_list

Returns a list of eligible dead players that COULD choose to respawn or whatever

english_list

Returns a list in plain english as a string

faction_check

Returns TRUE if ourguy is enemies with otherguy FALSE otherwise

filename_from_path

Gets the filaname from a filesystem path. Optionally strips extension too

filter_is_character_setup_ringtone

type filter for ringtones that're suposed to be selectable at roundstart

filtered_concrete_typesof

The same thing but now you can filter the types using a proc. Also cached. The filter proc takes a type and should return 1 if we want to include it and 0 otherwise. That proc should also be pure (always return the same thing for the same arguments) because of the caching. If you want to use non-pure proc do the filtering manually yourself and don't use this. Note that the first call to filtered_concrete_typesof with a given type and filter will be (possibly a lot) slower than doing it manually. The benefit of this proc only shows itself for future calls which are very fast due to caching.

Example:

proc/filter_is_syndicate(type)
	var/obj/fake_instance = type
	return initial(fake_instance.is_syndicate)

var/syndie_thing_type = pick(filtered_concrete_typesof(/obj/item, /proc/filter_is_syndicate))

find_all_by_type

Finds all instance of a type in the world. Returns a list of the instances if no procedure is given. Otherwise, calls the procedure for each instance and returns an assoc list of the form list(instance = procedure(instance, arguments...), ...) procedure_src is the src for the proc call. If it is null, a global proc is called. If it is the string "instance" the output list will be instead list(instance = instance.procedure(arguments...), ...)

find_client

Find a client based on ckey

find_first_by_type

Finds some instance of a type in the world. Returns null if none found.

find_ghost_by_key

find a ghost mob (or a ghost respawned as critter in vr/afterlife bar)

find_job_in_controller_by_string

Soft supresses crash on failing to find a job

find_player

returns a reference to a player datum based on the ckey you put into it

fireflash

generic proc for creating flashes of hotspot fire falloff is in units of degrees per tile

fireflash_melting

generic proc for hotspot fire flashes that also melt turf

fixed_random

pseudorandom number based on x, y in range 0 to 1

flatten_list

Flattens a keyed list into a list of it's contents

flock_speak

how to speak in the flock for speaker, pass: -null to give a general system message -mob to make a mob speak -flock_structure for a structure message involuntary overrides the sentient styling for messages generated by the possessed flock critter

formatTimeText

Returns time input as mm:ss

formattedShiftTime

Returns shift time as a string in hh:mm format. Call with TRUE to get time in hh:mm:ss format.

fromIso8601

Convert ISO 8601 to BYOND time format (or epoch time if given argument for that)

gas_text_color

Enables debug overlay which counts process_cell() calls per turf (viewable through info-overlays) Enables debug overlay which counts all atmos operations per turf (viewable through info-overlays) Puts a list of turfs which get processed a lot into global.hotly_processed_turf for debugging Returns the color of a given gas ID.

This is used only in the gas mixer computer as of now.

generate_access_name_lookup

Build the access_name_lookup table, to associate descriptions of accesses with their numerical value.

getClientFromCkey

Finds a client by ckey, throws exception if not found

getFlatIcon

Creates a single icon from a given /atom or /image. Only the first argument is required.

getFusedMaterial

Merges two materials and returns result as new material.

getFusedTriggers

Fuses two material trigger lists.

getIconSize

Handles the two states icon_size can be in: basic number, or string in WxH format

getInterpolatedName

Merges two material names into one.

getItemIcon

Generates item icons for manufacturers and other things, used in UI dialogs. Sends to client if needed.

getLineMatrix

Returns the line matrix from a start atom to an end atom, used in creating line objects

getMatFailString

Returns a string for when a material fail or breaks depending on its material flags.

getMatFlagString

Translates a material flag into a string.

getMaterial

Returns one of the base materials by id.

getOreQualityName

*** MISC ***

getQualityName

Simply returns a string for a given quality. Used as prefix for objects.

getRole

Returns a string based on the current job and antag role of the mob e.g. "Staff Assistant [Traitor]"

getTimeInSecondsSinceTime

Returns the time in seconds since a given timestamp

get_accessible_station_areas

Returns a list of all areas on a station

get_adjacent_floor

Returns the turf facing the fab for cardinal directions (which should also be the user's turf), but for diagonals it returns a neighbouring turf depending on where you click Just in case you're attacking a corner diagonally. (made initially for lamp manufacturers, probably behaves funky above range 1)

get_alive_antags_percentage

returns a decimal representing the percentage of alive crew that are also antags

get_all_accesses

/ Heads of staff / Security / Medical / Science Engineering / Civilian Other or gimmick

get_all_antagonists

Gets a list of all antagonist datums of ID role_id, or of all IDs if no ID is specified. Returns a list of all antagonist datums. If no antagonist datums could be found, returns an empty list.

get_all_character_setup_ringtones

sets up the list of ringtones players can select through character setup

get_all_gangs

Returns a list of all gang datums.

get_all_mobs_in

Returns list of all mobs within an atom. Not cheap! (unlike ur mum)

get_angle

Returns the angle between two given atoms

get_assets

Returns either the already-created asset or creates a new one and returns it

get_available_custom_style_types

Gets all the customization_styles which are available to a given client. Can be filtered by providing a gender flag or a type

get_average_color

Takes an icon and optionally two non-zero Pixel Intervals and returns the average color of the icon.

The pixel intervals represent the distance between each pixel scanned on the X/Y axes respectively, and default to 4 for performance. For example, an X interval of 1 and a Y interval of 3 will mean every X coordinate of every 3rd Y coordinate will be scanned.

get_dead_crew_percentage

returns a decimal representing the percentage of dead crew (non-observers) to all crew

get_default_flock

Gimmick flock with infinite compute that lone structures and units automatically connect to

get_general_record

Returns the datacore general record, or null if none found

get_hud_style

Returns hud style preferences of given client/mob

get_id_card

checks an item for an id card

get_image_group

Returns the client image group for a given "key" argument. If one doesn't yet exist, creates it.

get_manifest

Returns the crew manifest, but sorted according to the individual's rank. include_cryo includes a list of individuals in cryogenic storage Set synd_int_request_device to the object calling the proc to get Syndicate Intelligence.

get_map_prefabs

Gets all prefabs of a given type.

get_matches_string

ADMIN HELPER PROCS

get_nearest_color

returns the name of the color nearest to the given color RGB

get_nearest_color_datum

returns the named_color datum that is nearest to the given color RGB

get_one_match

get_one_match attempts to find a type match for a given object. The function allows customization of the base type, whether to use concrete types, whether to use only admin spawnable, the comparison procedure, and the sort limit. The function sorts the matches if a comparison procedure is provided and if the sort limit condition allows it, then it presents a list of matches for the user to choose from.

@param object This is the object for which the function is attempting to find a match.

@param base This is the base type used for matching. All results will be of this type tree.

@param use_concrete_types determines whether the function should respect concrete types for matching.

@param only_admin_spawnable This boolean value determines whether the function should only consider objects that are spawnable by an admin.

@param cmp_proc This is the comparison proc used for sorting matches. This should be a proc that takes two arguments and returns a boolean. The default value is null, indicating no comparison procedure is used. If cmp_proc is provided and the number of matches is within the sort_limit, the matches will be sorted using cmp_proc.

@param sort_limit This parameter defines the upper limit for the number of items to consider during the matching process. If the number of matches exceeds sort_limit, they will not be sorted even if cmp_proc is provided. If sort_limit is 0 or null, there will be no limit and matches will be sorted if cmp_proc is provided.

@return Returns the path of the selected match if one is chosen. If no matches are found, null is returned. If the operation is cancelled, FALSE is returned.

get_ouija_word_list

get_ouija_word_list

get_parallax_render_source_group

Returns a reference to the parallax render source group datum belonging to either an area or z-level.

get_path_to

This is the proc you use whenever you want to have pathfinding more complex than "try stepping towards the thing".

Arguments:

Returns: List of turfs from the caller to the end or a list of lists of the former if multiple ends are specified. If no paths were found, returns an empty list, which is important for bots like medibots who expect an empty list rather than nothing.

get_preference_for_role

Return the name of a preference variable for the given role define.

Arguments:

get_random_station_storage_list

Return a list of station-level storage objects that are safe to spawn things into

get_random_subtype

Returns a random subtype when an atom has TYPEINFO with a random_subtypes list

get_singleton

Gets the instance of a singleton type (or a non-singleton type if you decide to use it on one).

get_standard_skintone

Given user, will proompt user to select skin color from list (or custom) and returns skin tone after blending

get_type_typeinfo

Retrieves the typeinfo datum for a given type.

Example:

for(var/type in types)
	var/typeinfo/atom/typeinfo = get_type_typeinfo(type)
	if(!typeinfo.admin_spawnable)
		continue
	valid_types += type

Returns a path of a (presumably) valid uplink dependent on the user's mind.

Arguments:

get_weakref

Gets a weak reference to the given datum. This is a basically a reference that will not prevent garbage collection of the datum. Useful when you don't want to "own" the datum in question. For example a mob holding a reference to its trinket. In that case it doesn't make sense to prevent garbage collection of the trinket. If the trinket gets destroyed in-game we are fine if this weak reference to the trinket turns to null.

You need to use [/datum/weakref/proc/deref] to get the datum from the weak reference.

gradientText

Returns span with a color gradient between two given colors of given message

handleTriggerGenerations

Increases generations on material triggers and handles removal if over the generation cap.

hasParentMaterial

Searches the parent materials of the given material, up to a given generation, for an id.

Useful if you want to figure out if a given material was used in the making of another material.

Keep in mind that this can be expensive so use it only when you have to.

has_or_have

'they have' vs 'he has'

he_or_she_dont_or_doesnt

"he doesn't" vs "they don't"

should arguably just be 'does_or_doesnt' but i figure this is by far the dominant use of that so I'm rolling them together

hes_or_shes

"they're outside" vs "he's outside"

hex2color_name

Given hex color, returns string name of nearest named color

his_or_her

'their cookie' vs 'her cookie'

hsv_transform_color_matrix

Generates a color matrix which performs an approximation of the HSV-space transform. Hue is in degrees and is applied additively. Saturation is in a 0-1 range and is applied multiplicatively. Value is in a 0-1 range and is applied multiplicatively.

identify_object

For runtime logs- returns the above plus ref

illiterateGarbleText

Returns given text replaced entirely by nonsense chars

in_cone_of_vision

This proc checks if one atom is in the cone of vision of another one.

It uses the following map grid for the check, where each point is an integer coordinate and the seer is at point X: ```

POV ->	X * * *


```

A '*' represents a point that is within X's FOV

in_interact_range

For interacting with stuff.

initialise_fishing_spots

run on world/New(), clears global.fishing_spots (if it exists) and fills it with the format (fishing_atom_type = /datum/fishing_spot)

initialize_biomes

Initialize all biomes, assoc as type || instance

isLeapYear

returns true if the year is divisible by 4, except for years that are divisible by 100. However, years that are divisible by 400 are also leap years.

isUpper

Returns true if the char you feed it is uppercase.

isVowel

Returns true if the given string has a vowel

is_hex

Returns true if given value is a hex value

is_incapacitated

Returns true if the given mob is incapacitated

is_music_playing

Approximate check of whether music is playing or not (radio / ad tapes / admin music all count as music here) If music is playing this should return TRUE. But if music stopped playing only recently-ish it can sometimes return TRUE still. In some rare cases it can happen that this has a false negative too so like don't rely on this for anything super important, ok?

is_or_are

'they are' vs 'he is'

is_valid_abcu_object

Checks if a thing should be allowed to be saved / loaded by the ABCU. Currently does not do the whitelist / blacklist filtering.

isadmin

Returns true if given mob/client/mind is an admin

istypes

istype but for checking a list of types

jobban_isbanned

Can be provided with a mob, a raw cache list, or a ckey. Prefer providing a cache if you can't use a mob, as that reduces API load.

jpsTurfPassable

this is a slight modification of /proc/checkTurfPassable to avoid indirect proc call overhead Returns false if there is a dense atom on the turf, unless a custom hueristic is passed.

load_config_list

Gets a list of ckeys from a file, ignoring comments/blank lines This could probably be refactored to config files in general, but

log_object

For logs- returns the thing's name and type. Handles nulls and non-datums fine, might do something weird for savefiles, clients, etc

log_respawn_event

Logs a player respawning as something from a respawn event, noting if they joined the round as an observer or not Note: should be called BEFORE they are transferred to the new body

log_tgui

Appends a tgui-related log entry. All arguments are optional.

make_associative

Make a normal list an associative one

make_fake_explosion

obj/item/tank/plasma = 2

make_player

returns a reference to a player datum, but it tries to make a new one if it cant an already existing one (this is how it persists between connections)

man_or_woman

'this man' vs 'this person'

matchesMaterialRecipe

Checks if a material matches a recipe and returns the recipe if a match is found. returns null if nothing matches it.

maximal_subtype

Returns the maximal subtype (i.e. the most subby) in a list of given types

md5_to_more_pronouncable

Takes a hash generated by md5() and turns it into a string of alternating consonants and vowels

move_element

Move a single element from position from_index within a list, to position to_index

All elements in the range [1,to_index) before the move will be before the pivot afterwards

All elements in the range [to_index, L.len+1) before the move will be after the pivot afterwards

In other words, it's as if the range [from_index,to_index) have been rotated using a <<< operation common to other languages.

from_index and to_index must be in the range [1,L.len+1] Preserves associations

move_range

Move elements [from_index,from_index+len) to [to_index-len, to_index)

Same as /proc/move_element but for ranges of elements

Preserves associations

mult_color_matrix

Takes two 20-length lists, turns them into 5x4 matrices, multiplies them together, and returns a 20-length list

newline_html_decode

Returns a string with all HTML special characters decoded and
replaced with newlines

newline_html_encode

Returns a string with all HTML special characters encoded and newlines replaced with

normalize_color_to_matrix

Takes a possible value of the color var and returns a length 20 color matrix doing the same thing. Available inputs: null, "#rgb", "#rrggbb", "#rgba", "#rrggbbaa", all forms of color matrices

normalize_plain_data_list

Recursively normalizes a list of plain_data and primitive values. Plain_data values are converted to lists, recursively.

o_clock_time

Returns the current timeofday in o'clock format

pick_map_prefab

Picks a random prefab from given prefab type. Filters the prefabs picked based on the given tags. Choice is performed by a weighted random choice based on the prefab's probability. Prefabs marked as required are always picked first.

Prefab max count is respected. However, note that the count of a prefab is only updated in prefab's applyTo() function.

pick_ref

Gives the target mob a reference picker ability and returns the atom picked. Synchronous.

placeAllPrefabs

placeAllRandomRooms

Similar to the prefab runtime checker. The following text is mostly plagiarised from PrefabRuntimeChecker.dm

The proc places all random rooms on the map, at (3, 3, 1). It overwrites existing objects, mobs, and turfs when doing so. This proc will only work correctly if RUNTIME_CHECKING is defined, as some turfs cannot be replaced using turf/proc/ReplaceWith() and RUNTIME_CHECKING fixes this.

Do not use this proc on a live server.

If you run it locally do not move your mob into the location turfs are being placed (your client will be qdel'd).

This proc was designed to be used with totally blank maps, where every tile is either space or trench.

Prefabs are found by looking for concrete types of /datum/mapPrefab/random_room. To add a new prefab to be checked, simply create a type for it.

playsound_global

Plays a sound to some clients without caring about its source location and stuff. target can be either a list of clients or a list of mobs or world or an area or a z-level number.

predecessor_path_in_list

Find predecessor of a type

prioritize_dead_players

Returns a randomized list of minds with players who joined as observer at the back

purge_fluid_blacklist

Deletes any reagents that are banned in fluid puddles.

purge_smoke_blacklist

Deletes any reagents that are banned in smoke clouds.

qdel

qdel

queues a var for deletion by the delete queue processor. if used on /world, /list, /client, or /savefile, it just skips the queue.

radioGarbleText

Returns given text replaced by nonsense chars, excepting HTML tags, on a 40% or given % basis

random_emoji

Generates a random Unicode emoji that will look ok in the chat

random_hex

Returns random hex value of length given

random_nonrestrictedz_turf

Returns a random turf on a non-restricted z-level.

random_space_turf

Tries to return a random space turf. Tries a given number of times and if it fails it returns null instead.

random_split

Returns amount evenly distributed random integers that sum to sum

rc_buildentry

Small helper proc to simplify basic contract entry creation. Accepts the path to the entry datum, and the count (in whatever unit it uses) to require.

record_cloner_defects

Write current cloner defects to an existing datacore medical record

recursive_flist

Lists all files recursively in a given dir, refer to builtin flist() for details

resource

GENERIC HELPERS FOR BOTH SYSTEMS

reverse_list_range

Reverses a given list within the given range

rustg_get_version

Gets the version of rust_g

rustg_redis_disconnect_rq

Disconnects from a previously connected redis server

rustg_unix_timestamp

Returns the timestamp as a string

s_es

Returns the plural based on a number provided.

@param number the number to base the judgement off of @param es set this to true if your item's plural ends in "es" @return the plural suffix based on numbers

sanitize_frequency

Returns f, ensured that it's a valid frequency

save_flock_stats

In a sensible language, this would be a static class proc. Alas this is DM. This proc saves all the stats for all flocks in this round, and rotates the log so only the last FLOCK_ROUNDS_SAVED flock rounds are stored

seen_by_camera

Return true if mob is on a turf with camera coverage

sendItemIcons

Sends all of the item icons to a client. Kinda gross, but whatever.

sendItemIconsToAll

Sends all item icons to all clients. Used at world startup to preload things.

send_assets

Sends the list of asset files to client if they're needed

separate_radio_prefix_and_message

Given a message, returns a list containing the radio prefix and the message, so that the message can be manipulated seperately in various functions.

setup_z_level_parallax_render_sources

Initialises z_level_parallax_render_source_groups by populating it with z-level parallax render source groups.

should_diary_log

Check config for whether a message should be logged to the diary

showLine

Creates and shows a line object. Line object has an "affected" var that contains the cross tiles.

singularity_containment_check

Checks if there is a containment field in each direction from the center turf. If not returns null. If yes returns the distance to the closest field.

smilify

!!! !!!

sonic_attack_environmental_effect

Given center turf/atom, range, and list of things to smash, will damage said objects within range of center. Used for sonic grenades and similar. Avoiding C&P Code.

sortList

sortList - To sort lists via TimSort (in place)

If you want to not affect the original list, see /proc/sortListCopy

Arguments:

sortListCopy

Just like /proc/sortList, but return a sorted copy of the given list

soviet_parse

!!! !!! !!! !!!

string_type_of_anything

thing.type but it also returns "num" for numbers etc.

strip_prefix

Removes a given prefix from a string.

@return The string without the prefix if the prefix was present at the start. If not, the original string is returned.

Note: Non-text inputs will be converted into a string. The procedure is case sensitive.

subtractTime

Subtract time from a given BYOND time format

swap_range

Move elements from [from_index, from_index+len) to [to_index, to_index+len)

Move any elements being overwritten by the move to the now-empty elements, preserving order

Note: if the two ranges overlap, only the destination order will be preserved fully, since some elements will be within both ranges

text2num_safe

Parses a number except for NaNs and infinities

tgui_Topic

Middleware for /client/Topic.

return bool If TRUE, prevents propagation of the topic call.

tgui_alert

Creates a TGUI alert window and returns the user's response.

This proc should be used to create alerts that the caller will wait for a response from. Arguments:

tgui_color_picker

@file @copyright 2023 @author itsmeow (https://github.com/itsmeow) @license MIT

Creates a TGUI color picker window and returns the user's response.

This proc should be used to create a color picker that the caller will wait for a response from. Arguments:

tgui_color_picker_async

Creates an asynchronous TGUI color picker window with an associated callback.

This proc should be used to create a color picker that invokes a callback with the user's chosen option. Arguments:

tgui_input_bitfield

Copyright (c) 2024 @Azrun SPDX-License-Identifier: MIT

tgui_input_list

Creates a TGUI input list window and returns the user's response.

This proc should be used to create alerts that the caller will wait for a response from. Arguments:

tgui_input_list_async

Creates an asynchronous TGUI input list window with an associated callback.

This proc should be used to create inputs that invoke a callback with the user's chosen option. Arguments:

tgui_input_number

Creates a TGUI window with a number input. Returns the user's response as num | null.

This proc should be used to create windows for number entry that the caller will wait for a response from. If tgui fancy chat is turned off: Will return a normal input. If a max or min value is specified, will validate the input inside the UI and ui_act.

Arguments:

tgui_input_number_async

Creates an asynchronous TGUI number input window with an associated callback.

This proc should be used to create numboxes that invoke a callback with the user's entry.

Arguments:

tgui_input_text

Creates a TGUI window with a text input. Returns the user's response.

This proc should be used to create windows for text entry that the caller will wait for a response from. If tgui fancy chat is turned off: Will return a normal input. If max_length is specified, will return stripped_multiline_input.

Arguments:

tgui_input_text_async

Creates an asynchronous TGUI text input window with an associated callback.

This proc should be used to create textboxes that invoke a callback with the user's entry. Arguments:

tgui_message

@file @copyright 2024 @author ZeWaka (https://github.com/zewaka) @license MIT

Creates a TGUI window with that just displays a plain message to the user.

This should be used to display simple messages to the user, in cases where you want to provide more text than you would include in an alert box.

Arguments:

tidy_net_data

Cleans up data passed in from network packets for display so it doesn't mess with formatting

time_to_text

Returns the passed decisecond-format time in the form of a text string

toIso8601

Convert BYOND time format to ISO 8601

total_cross

Checks if Cross succeeds for the turf and all atoms in it

total_density

Returns the sum of densities of all atoms in the given turf including the turf itself

type2parent

Returns the parent type of a given type. Assumes that parent_type was not overriden.

typecache_filter_list

Rurns a new list with only atoms that are in the typecache list

typecache_filter_list_reverse

Return a new list with atoms that are not in the typecache list

typecache_filter_multi_list_exclusion

Similar to typecache_filter_list and typecache_filter_list_reverse but it supports an inclusion list and and exclusion list

typecacheof

Like typesof() or subtypesof(), but returns a typecache instead of a list.

Arguments:

ucfirst

Uppercases first letter

ucfirsts

Uppercases first letter of every word

ui_describe_reagents

Returns a serialized representation of the reagents of an atom for use with the ReagentInfo TGUI components Note that this is not a built in TGUI proc

uwutalk

uwutalk

owo-talk version 2. Nyo it's sewious!

validateIso8601

Validate ISO 8601 format

ve_or_s

"they've had" vs "he's had"

vector_magnitude

Returns the vector magnitude of an x value and a y value

vector_to_dir

Transforms a supplied vector x & y to a direction

weighted_pick

Picks a random element from a list based on a weighting system.

For example, given the following list: A = 6, B = 3, C = 1, D = 0, A would have a 60% chance of being picked, B would have a 30% chance of being picked, C would have a 10% chance of being picked, and D would have a 0% chance of being picked.

You should only pass integers in.

whodead

Finds whoever's dead.

whois

Looks up a player based on a string. Searches a shit load of things whoa. Returns a list of mob refs.