byond - Modules - TypesVar Details - Proc Details

(global)

Vars

FailsafeFailsafe
MasterStonedMC
SSambienceThe subsystem used to play ambience to users every now and then, makes them real excited.
SSarea_contentsResponsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed
SSasset_loadingAllows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init
SSauraTracks aura emitters and tells them to pulse. Also used for creating new ones.
SSautomatedfire
SSdiscord
SSearly_assetsInitializes any assets that need to be loaded ASAP, before the atoms SS initializes.
SSminimaps
SSsecurity_level
SSspatial_grid
SStguitgui subsystem
SStimer
SStutorialsNamespace for housing code relating to giving contextual tutorials to users.

Procs

DirBlockedChecks if moving in a direction is blocked
GibberishTurn text into complete gibberish!
HandleUserlessProcCallHandles a userless proccall, used by circuits.
HandleUserlessSDQLHandles a userless sdql, used by circuits and tgs.
LeftAndRightOfDirReturns the left and right dir of the input dir, used for AI stutter step while attacking
LinkBlockedReturns true if the path from A to B is blocked. Checks both paths where the direction is diagonal
TurfBlockedNonWindowReturns true if any object on a turf is both dense and not a window
WEAKREFCreates a weakref to the given input. See /datum/weakref's documentation for more information.
WrapAdminProcCallWrapper for proccalls where the datum is flagged as vareditted
___TraitAddDO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
___TraitRemoveDO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
__check_serialization_semverChecks if the actual semver is equal or later than the wanted semver Must be passed as TEXT; you're probably looking for CHECK_SERIALIZATION_SEMVER, look right above
_addtimerCreate a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information.
add_keybindingAdds an instanced keybinding to the global tracker
add_verbhandles adding verbs and updating the stat panel browser
adminscrubRuns STRIP_HTML_SIMPLE and byond's sanitization proc.
alone_in_areaChecks if the mob provided (must_be_alone) is alone in an area
angle_to_cardinal_dirReturns one of the 4 cardinal directions based on an angle
angle_to_dirReturns one of the 8 directions based on an angle
armored_init_guntypesim a lazy bum who cant use initial on lists, so we just load everything into a list
assemble_alertDesign a faction alert. Returns a string.
assertion_messageUsed by ASSERT to add a more detailed context to CRASH messages
assign_random_nameGenerate a name devices
assoc_to_keysTurns an associative list into a flat list of keys
auxtools_expr_stubauxtools expression evaluation
behemoth_area_attackChecks for any atoms caught in the attack's range, and applies several effects based on the atom's type.
bfg_beamexecutes a BFG zap. just damages living mobs in an AOE from the source
bitfield_to_listConverts a bitfield to a list of numbers (or words if a wordlist is provided)
blend_cutoff_colorsUsed to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments
blend_screen_colorBlends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker
bullet_burstFires a list of projectile objects in a circle around an atom Arguments:
buy_categoryReturn true if you can buy this category, and also change the loadout seller buying bitfield
buy_item_in_vendorReturn true if the item was found in a linked vendor and successfully bought
buy_stackCheck if that stack is buyable in a points vendor (currently, only metal, sandbags and plasteel)
callback_selectRuns a list of callbacks asyncronously, returning only when all have finished
can_buy_categoryWill check if the selected category can be bought according to the category choices left
can_see_throughReturns if a turf can be seen from another turf.
can_sell_human_bodyReturn TRUE if the relation between the two factions are bad enough that a bounty is on the human_to_sell head
center_imageCenter's an image. Requires: The Image The x dimension of the icon file used in the image The y dimension of the icon file used in the image eg: center_image(image_to_center, 32,32) eg2: center_image(image_to_center, 96,96)
cheap_get_atomThis proc attempts to get an instance of an atom type within distance, with center as the center. Arguments
cheap_get_humans_nearReturns a list of humans via get_dist and same z level method, very cheap compared to range()
cheap_get_living_nearReturns a list of mobs/living via get_dist and same z level method, very cheap compared to range()
cheap_get_mechs_nearReturns a list of mechs via get_dist and same z level method, very cheap compared to range()
cheap_get_tanks_nearReturns a list of vehicles via get_dist and same z level method, very cheap compared to range()
cheap_get_xenos_nearReturns a list of xenos via get_dist and same z level method, very cheap compared to range()
check_admin_pingsChecks a given message to see if any of the words contain an active admin's ckey with an @ before it
check_pathDraws a line between two atoms, then checks if the path is blocked Returns the last turf in the list it can successfully path to
check_topdown_validityChecks if a passed in MA or atom is allowed to have its current plane/layer matchup
circle_rangeReturns all atoms present in a circle around the center
circle_range_turfsReturns a list of turfs around a center based on RANGE_TURFS()
circle_viewReturns all atoms present in a circle around the center but uses view() instead of range() (Currently not used)
circle_view_turfsReturns a list of turfs around a center based on view()
closest_cardinal_dirIf given a diagonal dir, return a corresponding cardinal dir. East/west preferred
cmp_crafting_req_prioritySorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
color_hex2color_matrixTakes a hex color provided as string and returns the proper color matrix using hex2num.
color_matrix2color_hexwill drop all values not on the diagonal returns a hex color
compare_listflat list comparison, checks if two lists have the same contents
considered_escapedChecks if the passed mind is considered "escaped".
create_empty_loadoutReturn a new empty loayout
create_glass_stylesConstructs a nested list of glass style singletons
create_ooc_announcement_divInserts a span styled message into an OOC alert style div
create_squadinitializes a new custom squad. all args mandatory
create_strippable_listCreates an assoc list of keys to /datum/strippable_item
cut_relative_directionTakes a screen_loc string and cut out any directions like NORTH or SOUTH
deadchat_broadcastDisplays a message in deadchat, sent by source. Source is not linkified, message is, to avoid stuff like character names to be linkified. Automatically gives the class deadsay to the whole message (message + source)
debug_variableGet displayed variable in VV variable list
default_ui_stateThe sane defaults for a UI such as a computer or a machine.
delete_all_SS_and_recreate_masterDelete all existing SS to basically start over
deltimerDelete a timer
diff_appearancesTakes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays
do_afterA delayed action with adjustable checks
do_eord_respawnGrabs a mob, if it's human, check uniform, if it has one just stops there, otherwise proceeds. if it's not human, creates a human mob and transfers the mind there. Proceeds to outfit either result with the loadout of various factions. 7% chance to be a separate rare strong or funny faction. Tiny additional 2% chance if that procs to be a deathsquad! SOM and TG loadouts are handled differently, taking subtypes from the HvH loadout sets.
do_warningWarns nearby players, in any way or form, of the incoming ability and the range it will affect.
dump_in_spaceDump a movable in a random eligible tile
dviewVersion of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant).
electrocute_mobDetermines how strong could be shock, deals damage to mob, uses power.
emissive_appearanceProduces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR.
emissive_blockerProduces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR.
empulseEMP's everything in a specified radius, similar to an explosion
explosionMakes a given atom explode.
extend_line_to_radiusgets a line from a x and y, to the offset x and y of length radius
filter_fancy_listTakes a given fancy list and filters out a given filter text. Args: fancy_list - The list provided we filter. filter - the text we use to filter fancy_list
flick_overlay_viewwrapper for flick_overlay(), flicks to everyone who can see the target atom
generate_and_hash_rsc_filegenerates a filename for a given asset. like generate_asset_name(), except returns the rsc reference and the rsc file hash as well as the asset name (sans extension) used so that certain asset files dont have to be hashed twice
generate_asset_nameGenerate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.)
generate_coneGenerates a cone shape. Any other checks should be handled with the resulting list. Can work with up to 359 degrees Variables: center - where the cone begins, or center of a circle drawn with this max_row_count - how many rows are checked starting_row - from how far should the turfs start getting included in the cone. -1 required to include center turf due to byond cone_width - big the angle of the cone is cone_direction - at what angle should the cone be made, relative to the game board's orientation blocked - whether the cone should take into consideration obstacles
generate_greyscale_weapons_datagenerates the static list data containig all printable mech equipment modules for greyscale
generate_lazy_template_mapIterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance.
generate_lighting_appearance_by_zUpdates the lowest offset value
get_adjacent_areasReturns a list of all areas that are adjacent to the center atom's area, clear the list of nulls at the end.
get_adjacent_open_areasReturns a list with all the adjacent areas by getting the adjacent open turfs
get_adjacent_open_turfsReturns a list with all the adjacent open turfs. Clears the list of nulls in the end.
get_allowed_instrument_idsGet all non admin_only instruments as a list of text ids.
get_areasTakes: Area type as text string or as typepath OR an instance of the area. Returns: A list of all areas of that type in the world.
get_areas_in_rangeReturns a list with the names of the areas around a center at a certain distance Returns the local area if no distance is indicated Returns an empty list if the center is null
get_atom_on_turfReturns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
get_base_caste_typereturns the basetype caste from this caste or typepath to get what the base caste is (e.g base rav not primo or strain rav)
get_bbox_of_atomsGet a bounding box of a list of atoms.
get_between_anglesreturns degrees between two angles
get_closest_atomReturns the closest atom of a specific type in a list from a source
get_current_missionReturns the current mission, if its the campaign gamemode
get_dist_euclidianReturns the distance between two atoms
get_dist_manhattanReturns the manhattan distance between two atoms. Returns INFINITY if either are not on a turf, for BYOND get_dist() parity.
get_fancy_list_of_atom_typesGenerates a static list of 'fancy' atom types, or returns that if its already been generated.
get_fancy_list_of_datum_typesGenerates a static list of 'fancy' datum types, excluding everything atom, or returns that if its already been generated.
get_forward_squareReturns a rectangle of turfs in front of the center.
get_greyscale_render_ordersprite stuff with layering requires we make a specific order for each dir
get_hearLike view but bypasses luminosity check
get_hearers_in_LOSReturns a list of movable atoms that are hearing sensitive in view_radius and line of sight to source the majority of the work is passed off to the spatial grid if view_radius > 0 because view() isnt a raycasting algorithm, this does not hold symmetry to it. something in view might not be hearable with this. if you want that use get_hearers_in_view() - however thats significantly more expensive
get_hearers_in_rangeThe exact same as get_hearers_in_view, but not limited by visibility. Does no filtering for traits, line of sight, or any other such criteria. Filtering is intended to be done by whatever calls this function.
get_hearers_in_viewreturns every hearaing movable in view to the turf of source not taking into account lighting useful when you need to maintain always being able to hear something if a sound is emitted from it and you can see it (and youre in range). otherwise this is just a more expensive version of get_hearers_in_LOS().
get_icon_dmi_pathgiven an icon object, dmi file path, or atom/image/mutable_appearance, attempts to find and return an associated dmi file path. a weird quirk about dm is that /icon objects represent both compile-time or dynamic icons in the rsc, but stringifying rsc references returns a dmi file path ONLY if that icon represents a completely unchanged dmi file from when the game was compiled. so if the given object is associated with an icon that was in the rsc when the game was compiled, this returns a path. otherwise it returns ""
get_item_stack_numberIf the item is not a stack, return 1. If it is a stack, return the stack size
get_item_stack_representation_amountIf the item representation is not a stack, return 1. Else, return the satck size
get_lineGet a list of turfs in a line from starting_atom to ending_atom.
get_mech_limbhelper that converts greyscale mech slots and types into typepaths
get_nearest_targetReturns the nearest target that has the right target flag
get_nested_locsReturns a list of all locations (except the area) the movable is within.
get_open_turf_in_dirReturns the open turf next to the center in a specific direction
get_parent_caste_typereturns the parent caste type for the given caste (e.g. bloodthirster would return base rav)
get_pathReturns the most optimal path to get from starting atom to goal atom
get_random_reagent_idReturns a random reagent ID minus blacklisted reagents
get_screen_sizegets the current screen size as defined in config
get_sfxUsed to convert a SFX define into a .ogg so we can add some variance to sounds. If soundin is already a .ogg, we simply return it
get_sorted_areasReturns a sorted version of GLOB.areas, by name
get_strain_optionsreturns a list of strains(xeno castedatum paths) that this caste can currently evolve to
get_traits_from_pass_flagsReturns a list of traits corrosponding to a supplied set of passflags
get_traversal_lineGet a list of turfs in a line from starting_atom to ending_atom. Unlike get_line, this only takes cardinal steps, useful for checking movement or LOS Uses the ultra-fast Bresenham Line-Drawing Algorithm.
get_turf_on_clickcatcherHelper proc that processes a clicked target, if the target is not black tiles, it will not change it. If they are it will return the turf of the black tiles. It will return null if the object is a screen object other than black tiles.
get_valid_screen_locationReturns a valid location to place a screen object without overflowing the viewport
get_view_centerReturn the center turf of the user's view
getpoisReturns a list of all items of interest with their name
give_admin_popupTries to give the target an admin popup. If it fails, will send the error to the passed admin.
give_free_headsetWill give a headset corresponding to the user job to the user
handle_initial_squadA generic proc for handling the initial squad role assignment in SSjob
icon2base64Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)
icon2htmlthe dmi file path we attempt to return if the given object argument is associated with a stringifiable icon if successful, this looks like "icons/path/to/dmi_file.dmi" but they pass both isicon() and isfile() checks. theyre the easiest case since stringifying them gives us the path we want generate an asset for the given icon or the icon of the given appearance for [thing], and send it to any clients in target. Arguments:
icon_existsChecks whether a given icon state exists in a given icon file. If file and state both exist, this will return TRUE - otherwise, it will return FALSE.
icon_exists_or_screamFunctions the same as /proc/icon_exists(), but with the addition of a stack trace if the specified file or state doesn't exist.
inLineOfSightCalculate if two atoms are in sight, returns TRUE or FALSE
in_view_rangeReturns TRUE if the atom is in the user view range.
init_alcohol_containers////////////////////////////////////////////Alchohol bottles! -Agouri ////////////////////////// Initializes GLOB.alcohol_containers, only containers that actually have reagents are added to the list.
init_campaign_asset_iconsPopulates campaign_asset_icons
init_campaign_loadout_item_iconsPopulates campaign_loadout_item_icons
init_campaign_mission_iconsPopulates campaign_mission_icons
init_campaign_perk_iconsPopulates campaign_perk_icons
init_crafting_recipesInits crafting recipe lists
init_crafting_recipes_atomsInits atoms used in crafting recipes
init_emote_keybindsCreate a keybind for each datum/emote
init_ethnicitiesEthnicity - Initialise all /datum/ethnicity into a list indexed by ethnicity name
init_keybindingsCreates and sorts all the keybinding datums
init_minimap_iconsPopulates minimap_icons
init_quick_loadoutsThe list is shared across all quick vendors, but they will only display the tabs specified by the vendor, and only show the loadouts with jobs that match the displayed tabs.
init_sprite_accessoriesInitial Building
init_surgerySurgery Steps - Initialize all /datum/surgery_step into a list
is_handful_buyableReturn TRUE if this handful should be buyable, aka if it's corresponding aka box is in a linked vendor
is_ic_filteredGiven a text, will return what word is on the IC filter, with the reason. Returns null if the message is OK.
is_ic_filtered_for_bombvestsGiven a text, will return what word is on the IC filter, or bomb vest filter, with the reason. Returns null if the message is OK.
is_ooc_filteredGiven a text, will return what word is on the OOC filter, with the reason. Returns null if the message is OK.
is_soft_ic_filteredGiven a text, will return what word is on the soft IC filter, with the reason. Returns null if the message is OK.
is_soft_ic_filtered_for_bombvestsGiven a text, will return what word is on the soft IC filter, ignoring words allowed on the PDA, with the reason. Returns null if the message is OK.
is_soft_ooc_filteredGiven a text, will return that word is on the soft OOC filter, with the reason. Returns null if the message is OK.
is_valid_dmi_filegiven a text string, returns whether it is a valid dmi icons folder path
is_valid_for_resin_structureChecks all conditions if a spot is valid for construction , will return TRUE
is_valid_srcCheck if a datum has not been deleted and is a valid source
item2representation_typeReturn wich type of item_representation should representate any item_type
jatum_deserializeAttempt to create a value from a JATUN JSON.
jatum_serializeAttempt to serialize a given value to the JATUM format.
json_deserialize_datumConvert a list of json to datum
json_serialize_datumConvert a datum into a json blob
level_announceSends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message.
line_of_sightChecks if ending atom is viewable by starting atom, uses bresenham line algorithm but checks some extra tiles on a diagonal next tile
list_clear_nullsRemoves any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise
load_mapHelper and recommened way to load a map file
load_poll_dataLoads all current and future server polls and their options to store both as datums.
log_accessLogging for logging in & out of the game, with error messages.
log_adminGeneral logging for admin actions
log_admin_privateGeneral logging for admin actions
log_adminsayLogging for AdminSay (ASAY) messages
log_assetLogging for loading and caching assets
log_attackGeneric attack logging
log_bomberLogging for bombs detonating
log_combatLog a combat message in the attack log
log_configLogging for config errors Rarely gets called; just here in case the config breaks.
log_directed_talkHelper for logging of messages with only one sender and receiver (i.e. mind links)
log_dsayLogging for DeadchatSay (DSAY) messages
log_emoteLogging for emotes
log_ffattackGeneric attack logging for friendly fire
log_filterLogs to the filter log with the given message, match, and scope
log_gameLogging for generic/unsorted game messages
log_hivemindLogging for hivemind messages
log_job_debugLogging for job slot changes
log_loocLogging for messages sent in LOOC
log_manifestLogging for player manifest (ckey, name, job, special role, roundstart/latejoin)
log_mappingLogging for mapping errors
log_mechaLogging for mech actions
log_mentorsayLogging for MentorSay (MSAY) messages
log_minimap_drawingLogging for drawing on minimap
log_moocLogging for messages sent in MOOC
log_oocLogging for messages sent in OOC
log_paperLogging for writing made on paper
log_prayerLogging for prayed messages
log_qdelLogging for hard deletes
log_sayLogging for generic spoken messages
log_speech_indicatorsLogging for speech indicators.
log_sqlLogging for DB errors
log_telecommsLogging for speech taking place over comms, as well as tcomms equipment
log_tguiAppends a tgui-related log entry. All arguments are optional.
log_toolLogging for tool usage
log_topicLogging for world/Topic
log_transportLogging for transport (tram/elevator) actions
log_voteLogging for OOC votes
log_whisperLogging for whispered messages
log_worldLog to both DD and the logfile.
log_xoocLogging for messages sent in XOOC
make_datum_reference_listsThese should be replaced with proper _INIT macros
make_maint_all_accessEnables all access for maintenance airlocks
make_types_fancyTurns a list of typepaths into 'fancy' titles for admins.
md5asfileSave file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
md5filepathReturns the md5 of a file at a given path.
message_to_htmlMessage-related procs
minor_announceMake a minor announcement to a target
movespeed_data_null_checkChecks if a move speed modifier is valid and not missing any data
mutable_appearance
offset_to_screen_locTakes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope
overlays2textConverts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get
params2screenpixelConverts a screen loc param to a x,y coordinate pixel on the screen
partially_block_emissivesTakes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate
peekReturns the top (last) element from the list, does not remove it from the list. Stack functionality.
pick_weight_recursiveLike pickweight, but allowing for nested lists.
pickweightPicks 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.
play_fov_effectPlays a visual effect representing a sound cue for people with vision obstructed by FOV or blindness
play_vox_wordplay vox words for mobs on our zlevel
playsound
playsound_zPlay sound for all online mobs on a given Z-level. Good for ambient sounds.
playsound_z_humansPlay a sound for all cliented humans and ghosts by zlevel
playsound_z_xenosPlay a sound for all cliented xenos and ghosts by hive on a zlevel
prepare_explosion_turfsReturns a list of turfs in X range from the epicenter Returns in a unique order, spiraling outwards This is done to ensure our progressive cache of blast resistance is always valid This is quite fast
pretty_string_from_reagent_listConvert reagent list to a printable string for logging etc
print_command_reportSpawns a paper at each communications printer
priority_announceMake a priority announcement to a target
propagate_networkremove the old powernet and replace it with a new one throughout the network.
qdelShould be treated as a replacement for the 'del' keyword.
random_tts_voicereturns a random tts voice based on gender. Assumes theres 30 voices, not actually how many there are but yolo. todo should return based on gender but we need voice tags for that
realize_appearance_queueTakes a list of appearnces, makes them mutable so they can be properly vv'd and inspected
recoil_cameraMakes a recoil-like animation on the mob camera.
recover_all_SS_and_recreate_masterRecreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars
reject_bad_textReturns the text if properly formatted, or null else.
remove_image_from_clientRemoves an image from a client's .images. Useful as a callback.
remove_images_from_clientsRemoves an image from a list of client's images
remove_verbhandles removing verb and sending it to browser to update, use this for removing verbs
request_z_pillarReturns a z pillar to insert turfs into
return_generator_argsreturns the arguments given to a generator and manually extracts them from the internal byond object returns:
return_typenamesSplits the type with parenthesis between each word so admins visually tell it is a typepath.
revoke_maint_all_accessDisables all access for maintenance airlocks
rustg_get_versionGets the version of rust_g
rustg_git_commit_dateReturns the date of the given revision using the provided format. Defaults to returning %F which is YYYY-MM-DD.
rustg_git_commit_date_headReturns the formatted datetime string of HEAD using the provided format. Defaults to returning %F which is YYYY-MM-DD. This is different to rustg_git_commit_date because it only needs the logs directory.
rustg_sound_lengthProvided a static RSC file path or a raw text file path, returns the duration of the file in deciseconds as a float.
rustg_unix_timestampReturns the timestamp as a string
sanitizeRuns byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.
sanitize_inlist_ttsa wrapper with snowflake handling for tts
sanitize_is_full_emote_listSanitize the custom emote list
sanitize_islistMakes sure value is a list Args: value - The list we're ensuring is actually a list default - The set default that will be given as fallback. required_amount - The required length of value for it to be valid, otherwise will continue to check for a fallback default. check_valid - If we should check if the values are all in the list of possible inputs possible_input_list - The list of possible valid inputs this list can hold, only gets checked if check_valid is TRUE
screen_loc_to_offsetTakes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc
semver_to_listConverts a semver string into a list of numbers
send2adminchatSends a message to TGS admin chat channels.
send2chatSends a message to TGS chat channels.
send_ooc_announcementSends a div formatted chat box announcement
set_sentry_ignore_ListCreates the list of atoms that will be ignored by sentry target pathing
set_z_lightingModifies the lighting for a z_level
siunitFormats a number to human readable form with the appropriate SI unit.
slurMakes you speak like you're drunk todo remove, deprecated
sort_listsort any value in a list
sort_namesuses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead
starsConvert random parts of a passed in message to stars
start_logship both attack logs and victim logs to the end of round attack.log just to ensure we don't lose information
string_listCaches lists with non-numeric stringify-able values (text or typepath).
strip_appearance_underlaysStrips all underlays on a different plane from an appearance. Returns the stripped appearance.
strip_htmlRuns STRIP_HTML_SIMPLE and sanitize.
stripped_inputUsed to get a properly sanitized input. Returns null if cancel is pressed.
stripped_multiline_inputUsed to get a properly sanitized input in a larger box. Works very similarly to stripped_input.
stutterAdds stuttering to the message passed in, todo remove, deprecated
tgalertDEPRECATED: USE tgui_alert(...) INSTEAD
tgui_TopicMiddleware for /client/Topic.
tgui_alertCreates a TGUI alert window and returns the user's response.
tgui_input_checkboxes
tgui_input_listCreates a TGUI input list window and returns the user's response.
tgui_input_numberCreates a TGUI window with a number input. Returns the user's response as num | null.
tgui_input_textCreates a TGUI window with a text input. Returns the user's response.
timeleftGet the remaining deciseconds on a timer
to_chatSends the message to the recipient (target).
to_chat_immediateCircumvents the message queue and sends the message to the recipient (target) as soon as possible.
turf_block_checkReturn TRUE if we have a block, return FALSE otherwise
ui_status_only_livingReturns a UI status such that the dead will be able to watch, but not interact.
ui_status_silicon_has_accessReturns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.
ui_status_user_has_free_handsReturns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.
ui_status_user_is_abledReturns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.
ui_status_user_is_adjacentReturns a UI status such that users adjacent to source will be able to interact, far away users will be able to see, and anyone farther won't see anything. Dead users will receive updates no matter what, though you likely want to add a [ui_status_only_living] check for finer observer interactions.
ui_status_user_is_advanced_tool_userReturns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.
ui_status_user_is_conscious_and_lying_downReturns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.
ui_status_user_strictly_adjacentReturn UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
unique_listReturn a list with no duplicate entries
unique_list_in_placesame as unique_list, but returns nothing and acts on list in place (also handles associated values properly)
url2htmlloaderReturn html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.
valid_build_directionChecks whether the target turf is in a valid state to accept a directional construction such as windows or railings.
view_to_pixelsTakes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)
weight_class_dataReturns an assoc list of WEIGHT CLASS TEXT = DESCRIPTION based on the arg you provide. Used by examine tags for giving each weight class a special description.
weight_class_to_textReturns a string based on the weight class define used as argument.
xeno_messageSend a message to all xenos. Force forces the message whether or not the hivemind is intact. Target is an atom that is pointed out to the hive. Filter list is a list of xenos we don't message.
zap_beamShocks xenos, returns shocked xenos.

Var Details

Failsafe

Failsafe

Pretty much pokes the MC to make sure it's still alive.

Master

StonedMC

Designed to properly split up a given tick among subsystems Note: if you read parts of this code and think "why is it doing it that way" Odds are, there is a reason

SSambience

The subsystem used to play ambience to users every now and then, makes them real excited.

SSarea_contents

Responsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed

SSasset_loading

Allows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init

SSaura

Tracks aura emitters and tells them to pulse. Also used for creating new ones.

SSautomatedfire

Autofire Subsystem

Maintains a timer-like system to handle autofiring. Much of this code is modeled after or adapted from the runechat subsytem.

Note that this has the same structure for storing and queueing shooter component as the timer subsystem does for handling timers: the bucket_list is a list of autofire component, each of which are the head of a linked list. Any given index in bucket_list could be null, representing an empty bucket.

Doesn't support any event scheduled for more than 100 ticks in the future, as it has no secondary queue by design

SSdiscord

Discord Subsystem

This subsystem handles some integrations with discord

NOTES:

HOW NOTIFYING WORKSROUNDSTART:
  1. The file is loaded and the discord IDs are extracted
  2. A ping is sent to the discord with the IDs of people who wished to be notified
  3. The file is emptied
MIDROUND:
  1. Someone usees the notify verb, it adds their discord ID to the list.
  2. On fire, it will write that to the disk, as long as conditions above are correct
END ROUND:
  1. The file is force-saved, incase it hasn't fired at end round

This is an absolute clusterfuck, but its my clusterfuck -aa07

SSearly_assets

Initializes any assets that need to be loaded ASAP, before the atoms SS initializes.

SSminimaps

Minimaps subsystem

Handles updating and handling of the by-zlevel minimaps

Minimaps are a low priority subsystem that fires relatively often the Initialize proc for this subsystem draws the maps as one of the last initializing subsystems

Fire() for this subsystem doens't actually updates anything, and purely just reapplies the overlays that it already tracks actual updating of marker locations is handled by [/datum/controller/subsystem/minimaps/proc/on_move] and zlevel changes are handled in /datum/controller/subsystem/minimaps/proc/on_z_change tracking of the actual atoms you want to be drawn on is done by means of datums holding info pertaining to them with /datum/hud_displays

Todo *: add fetching of images to allow stuff like adding/removing xeno crowns easily *: add a system for viscontents so things like minimap draw are more responsive

SSsecurity_level

Security Level Subsystem

Subsystem that controls the security level of the marine ship.

See /datum/security_level for usage (implementing new levels, modifying existing, etc).

SSspatial_grid

Spatial Grid

a gamewide grid of spatial_grid_cell datums, each "covering" SPATIAL_GRID_CELLSIZE ^ 2 turfs. each spatial_grid_cell datum stores information about what is inside its covered area, so that searches through that area dont have to literally search through all turfs themselves to know what is within it since view() calls are expensive, and so is iterating through stuff you dont want. this allows you to only go through lists of what you want very cheaply.

you can also register to objects entering and leaving a spatial cell, this allows you to do things like stay idle until a player enters, so you wont have to use expensive view() calls or iteratite over the global list of players and call get_dist() on every one. which is fineish for a few things, but is k * n operations for k objects iterating through n players.

currently this system is only designed for searching for relatively uncommon things, small subsets of /atom/movable. dont add stupid shit to the cells please, keep the information that the cells store to things that need to be searched for often

as of right now this system operates on a subset of the important_recursive_contents list for atom/movable, specifically RECURSIVE_CONTENTS_HEARING_SENSITIVE and RECURSIVE_CONTENTS_CLIENT_MOBS because both are those are both 1. important and 2. commonly searched for

SStgui

tgui subsystem

Contains all tgui state and subsystem code.

SStimer

Timer Subsystem

Handles creation, callbacks, and destruction of timed events.

It is important to understand the buckets used in the timer subsystem are just a series of doubly-linked lists. The object at a given index in bucket_list is a /datum/timedevent, the head of a list, which has prev and next references for the respective elements in that bucket's list.

SStutorials

Namespace for housing code relating to giving contextual tutorials to users.

Proc Details

DirBlocked

Checks if moving in a direction is blocked

Gibberish

Turn text into complete gibberish!

text is the inputted message, replace_characters will cause original letters to be replaced and chance are the odds that a character gets modified.

HandleUserlessProcCall

Handles a userless proccall, used by circuits.

Arguments:

HandleUserlessSDQL

Handles a userless sdql, used by circuits and tgs.

Arguments:

LeftAndRightOfDir

Returns the left and right dir of the input dir, used for AI stutter step while attacking

LinkBlocked

Returns true if the path from A to B is blocked. Checks both paths where the direction is diagonal

TurfBlockedNonWindow

Returns true if any object on a turf is both dense and not a window

WEAKREF

Creates a weakref to the given input. See /datum/weakref's documentation for more information.

WrapAdminProcCall

Wrapper for proccalls where the datum is flagged as vareditted

___TraitAdd

DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.

___TraitRemove

DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.

__check_serialization_semver

Checks if the actual semver is equal or later than the wanted semver Must be passed as TEXT; you're probably looking for CHECK_SERIALIZATION_SEMVER, look right above

_addtimer

Create a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information.

Arguments:

add_keybinding

Adds an instanced keybinding to the global tracker

add_verb

handles adding verbs and updating the stat panel browser

pass the verb type path to this instead of adding it directly to verbs so the statpanel can update Arguments:

adminscrub

Runs STRIP_HTML_SIMPLE and byond's sanitization proc.

alone_in_area

Checks if the mob provided (must_be_alone) is alone in an area

angle_to_cardinal_dir

Returns one of the 4 cardinal directions based on an angle

angle_to_dir

Returns one of the 8 directions based on an angle

armored_init_guntypes

im a lazy bum who cant use initial on lists, so we just load everything into a list

assemble_alert

Design a faction alert. Returns a string.

Arguments

assertion_message

Used by ASSERT to add a more detailed context to CRASH messages

assign_random_name

Generate a name devices

Creates a randomly generated tag or name for devices or anything really it keeps track of a special list that makes sure no name is used more than once

args:

assoc_to_keys

Turns an associative list into a flat list of keys

auxtools_expr_stub

auxtools expression evaluation

behemoth_area_attack

Checks for any atoms caught in the attack's range, and applies several effects based on the atom's type.

bfg_beam

executes a BFG zap. just damages living mobs in an AOE from the source

bitfield_to_list

Converts a bitfield to a list of numbers (or words if a wordlist is provided)

blend_cutoff_colors

Used to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments

blend_screen_color

Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker

bullet_burst

Fires a list of projectile objects in a circle around an atom Arguments:

buy_category

Return true if you can buy this category, and also change the loadout seller buying bitfield

buy_item_in_vendor

Return true if the item was found in a linked vendor and successfully bought

buy_stack

Check if that stack is buyable in a points vendor (currently, only metal, sandbags and plasteel)

callback_select

Runs a list of callbacks asyncronously, returning only when all have finished

Callbacks can be repeated, to call it multiple times

Arguments:

can_buy_category

Will check if the selected category can be bought according to the category choices left

can_see_through

Returns if a turf can be seen from another turf.

can_sell_human_body

Return TRUE if the relation between the two factions are bad enough that a bounty is on the human_to_sell head

center_image

Center's an image. Requires: The Image The x dimension of the icon file used in the image The y dimension of the icon file used in the image eg: center_image(image_to_center, 32,32) eg2: center_image(image_to_center, 96,96)

cheap_get_atom

This proc attempts to get an instance of an atom type within distance, with center as the center. Arguments

cheap_get_humans_near

Returns a list of humans via get_dist and same z level method, very cheap compared to range()

cheap_get_living_near

Returns a list of mobs/living via get_dist and same z level method, very cheap compared to range()

cheap_get_mechs_near

Returns a list of mechs via get_dist and same z level method, very cheap compared to range()

cheap_get_tanks_near

Returns a list of vehicles via get_dist and same z level method, very cheap compared to range()

cheap_get_xenos_near

Returns a list of xenos via get_dist and same z level method, very cheap compared to range()

check_admin_pings

Checks a given message to see if any of the words contain an active admin's ckey with an @ before it

Returns nothing if no pings are found, otherwise returns an associative list with ckey -> client Also modifies msg to underline the pings, then stores them in the key ADMINSAY_PING_UNDERLINE_NAME_INDEX for returning

Arguments:

check_path

Draws a line between two atoms, then checks if the path is blocked Returns the last turf in the list it can successfully path to

check_topdown_validity

Checks if a passed in MA or atom is allowed to have its current plane/layer matchup

circle_range

Returns all atoms present in a circle around the center

circle_range_turfs

Returns a list of turfs around a center based on RANGE_TURFS()

circle_view

Returns all atoms present in a circle around the center but uses view() instead of range() (Currently not used)

circle_view_turfs

Returns a list of turfs around a center based on view()

closest_cardinal_dir

If given a diagonal dir, return a corresponding cardinal dir. East/west preferred

cmp_crafting_req_priority

Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes

Prioritises /datum/reagent to ensure reagent requirements are always processed first when crafting. This prevents any reagent_containers from being consumed before the reagents they contain, which can lead to runtimes and item duplication when it happens.

color_hex2color_matrix

Takes a hex color provided as string and returns the proper color matrix using hex2num.

color_matrix2color_hex

will drop all values not on the diagonal returns a hex color

compare_list

flat list comparison, checks if two lists have the same contents

considered_escaped

Checks if the passed mind is considered "escaped".

Escaped mobs are used to check certain antag objectives / results.

Escaped includes minds with alive, non-exiled mobs generally.

create_empty_loadout

Return a new empty loayout

create_glass_styles

Constructs a nested list of glass style singletons

List format:

Where

Returns the list.

create_ooc_announcement_div

Inserts a span styled message into an OOC alert style div

Arguments

create_squad

initializes a new custom squad. all args mandatory

create_strippable_list

Creates an assoc list of keys to /datum/strippable_item

cut_relative_direction

Takes a screen_loc string and cut out any directions like NORTH or SOUTH

deadchat_broadcast

Displays a message in deadchat, sent by source. Source is not linkified, message is, to avoid stuff like character names to be linkified. Automatically gives the class deadsay to the whole message (message + source)

debug_variable

Get displayed variable in VV variable list

default_ui_state

The sane defaults for a UI such as a computer or a machine.

delete_all_SS_and_recreate_master

Delete all existing SS to basically start over

deltimer

Delete a timer

Arguments:

diff_appearances

Takes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays

do_after

A delayed action with adjustable checks

do_eord_respawn

Grabs a mob, if it's human, check uniform, if it has one just stops there, otherwise proceeds. if it's not human, creates a human mob and transfers the mind there. Proceeds to outfit either result with the loadout of various factions. 7% chance to be a separate rare strong or funny faction. Tiny additional 2% chance if that procs to be a deathsquad! SOM and TG loadouts are handled differently, taking subtypes from the HvH loadout sets.

do_warning

Warns nearby players, in any way or form, of the incoming ability and the range it will affect.

dump_in_space

Dump a movable in a random eligible tile

dview

Version of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant).

electrocute_mob

Determines how strong could be shock, deals damage to mob, uses power.

Arguments:

emissive_appearance

Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR.

emissive_blocker

Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR.

empulse

EMP's everything in a specified radius, similar to an explosion

explosion

Makes a given atom explode.

Arguments:

extend_line_to_radius

gets a line from a x and y, to the offset x and y of length radius

filter_fancy_list

Takes a given fancy list and filters out a given filter text. Args: fancy_list - The list provided we filter. filter - the text we use to filter fancy_list

flick_overlay_view

wrapper for flick_overlay(), flicks to everyone who can see the target atom

generate_and_hash_rsc_file

generates a filename for a given asset. like generate_asset_name(), except returns the rsc reference and the rsc file hash as well as the asset name (sans extension) used so that certain asset files dont have to be hashed twice

generate_asset_name

Generate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.)

generate_cone

Generates a cone shape. Any other checks should be handled with the resulting list. Can work with up to 359 degrees Variables: center - where the cone begins, or center of a circle drawn with this max_row_count - how many rows are checked starting_row - from how far should the turfs start getting included in the cone. -1 required to include center turf due to byond cone_width - big the angle of the cone is cone_direction - at what angle should the cone be made, relative to the game board's orientation blocked - whether the cone should take into consideration obstacles

generate_greyscale_weapons_data

generates the static list data containig all printable mech equipment modules for greyscale

generate_lazy_template_map

Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance.

Screams if more than one key exists, loudly.

generate_lighting_appearance_by_z

Updates the lowest offset value

get_adjacent_areas

Returns a list of all areas that are adjacent to the center atom's area, clear the list of nulls at the end.

get_adjacent_open_areas

Returns a list with all the adjacent areas by getting the adjacent open turfs

get_adjacent_open_turfs

Returns a list with all the adjacent open turfs. Clears the list of nulls in the end.

get_allowed_instrument_ids

Get all non admin_only instruments as a list of text ids.

get_areas

Takes: Area type as text string or as typepath OR an instance of the area. Returns: A list of all areas of that type in the world.

get_areas_in_range

Returns a list with the names of the areas around a center at a certain distance Returns the local area if no distance is indicated Returns an empty list if the center is null

get_atom_on_turf

Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.

Arguments

get_base_caste_type

returns the basetype caste from this caste or typepath to get what the base caste is (e.g base rav not primo or strain rav)

get_bbox_of_atoms

Get a bounding box of a list of atoms.

Arguments:

Returns: list(x1, y1, x2, y2)

get_between_angles

returns degrees between two angles

get_closest_atom

Returns the closest atom of a specific type in a list from a source

get_current_mission

Returns the current mission, if its the campaign gamemode

get_dist_euclidian

Returns the distance between two atoms

get_dist_manhattan

Returns the manhattan distance between two atoms. Returns INFINITY if either are not on a turf, for BYOND get_dist() parity.

get_fancy_list_of_atom_types

Generates a static list of 'fancy' atom types, or returns that if its already been generated.

get_fancy_list_of_datum_types

Generates a static list of 'fancy' datum types, excluding everything atom, or returns that if its already been generated.

get_forward_square

Returns a rectangle of turfs in front of the center.

To find what exact width and height to enter, width is based on west-east and height is north-south as if center is facing north.

Increments in width increases both sizes by said increment while height is only increased once by the increment.

get_greyscale_render_order

sprite stuff with layering requires we make a specific order for each dir

get_hear

Like view but bypasses luminosity check

get_hearers_in_LOS

Returns a list of movable atoms that are hearing sensitive in view_radius and line of sight to source the majority of the work is passed off to the spatial grid if view_radius > 0 because view() isnt a raycasting algorithm, this does not hold symmetry to it. something in view might not be hearable with this. if you want that use get_hearers_in_view() - however thats significantly more expensive

get_hearers_in_range

The exact same as get_hearers_in_view, but not limited by visibility. Does no filtering for traits, line of sight, or any other such criteria. Filtering is intended to be done by whatever calls this function.

This function exists to allow for mobs to hear speech without line of sight, if such a thing is needed.

get_hearers_in_view

returns every hearaing movable in view to the turf of source not taking into account lighting useful when you need to maintain always being able to hear something if a sound is emitted from it and you can see it (and youre in range). otherwise this is just a more expensive version of get_hearers_in_LOS().

get_icon_dmi_path

given an icon object, dmi file path, or atom/image/mutable_appearance, attempts to find and return an associated dmi file path. a weird quirk about dm is that /icon objects represent both compile-time or dynamic icons in the rsc, but stringifying rsc references returns a dmi file path ONLY if that icon represents a completely unchanged dmi file from when the game was compiled. so if the given object is associated with an icon that was in the rsc when the game was compiled, this returns a path. otherwise it returns ""

get_item_stack_number

If the item is not a stack, return 1. If it is a stack, return the stack size

get_item_stack_representation_amount

If the item representation is not a stack, return 1. Else, return the satck size

get_line

Get a list of turfs in a line from starting_atom to ending_atom.

Uses the ultra-fast Bresenham Line-Drawing Algorithm.

get_mech_limb

helper that converts greyscale mech slots and types into typepaths

get_nearest_target

Returns the nearest target that has the right target flag

get_nested_locs

Returns a list of all locations (except the area) the movable is within.

get_open_turf_in_dir

Returns the open turf next to the center in a specific direction

get_parent_caste_type

returns the parent caste type for the given caste (e.g. bloodthirster would return base rav)

get_path

Returns the most optimal path to get from starting atom to goal atom

get_random_reagent_id

Returns a random reagent ID minus blacklisted reagents

get_screen_size

gets the current screen size as defined in config

get_sfx

Used to convert a SFX define into a .ogg so we can add some variance to sounds. If soundin is already a .ogg, we simply return it

get_sorted_areas

Returns a sorted version of GLOB.areas, by name

get_strain_options

returns a list of strains(xeno castedatum paths) that this caste can currently evolve to

get_traits_from_pass_flags

Returns a list of traits corrosponding to a supplied set of passflags

get_traversal_line

Get a list of turfs in a line from starting_atom to ending_atom. Unlike get_line, this only takes cardinal steps, useful for checking movement or LOS Uses the ultra-fast Bresenham Line-Drawing Algorithm.

get_turf_on_clickcatcher

Helper proc that processes a clicked target, if the target is not black tiles, it will not change it. If they are it will return the turf of the black tiles. It will return null if the object is a screen object other than black tiles.

get_valid_screen_location

Returns a valid location to place a screen object without overflowing the viewport

Returns a screen loc representing the valid location

get_view_center

Return the center turf of the user's view

getpois

Returns a list of all items of interest with their name

give_admin_popup

Tries to give the target an admin popup. If it fails, will send the error to the passed admin.

give_free_headset

Will give a headset corresponding to the user job to the user

handle_initial_squad

A generic proc for handling the initial squad role assignment in SSjob

icon2base64

Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)

icon2html

the dmi file path we attempt to return if the given object argument is associated with a stringifiable icon if successful, this looks like "icons/path/to/dmi_file.dmi" but they pass both isicon() and isfile() checks. theyre the easiest case since stringifying them gives us the path we want generate an asset for the given icon or the icon of the given appearance for [thing], and send it to any clients in target. Arguments:

icon_exists

Checks whether a given icon state exists in a given icon file. If file and state both exist, this will return TRUE - otherwise, it will return FALSE.

If you want a stack trace to be output when the given state/file doesn't exist, use /proc/icon_exists_or_scream().

icon_exists_or_scream

Functions the same as /proc/icon_exists(), but with the addition of a stack trace if the specified file or state doesn't exist.

Stack traces will only be output once for each file.

inLineOfSight

Calculate if two atoms are in sight, returns TRUE or FALSE

in_view_range

Returns TRUE if the atom is in the user view range.

init_alcohol_containers

////////////////////////////////////////////Alchohol bottles! -Agouri ////////////////////////// Initializes GLOB.alcohol_containers, only containers that actually have reagents are added to the list.

init_campaign_asset_icons

Populates campaign_asset_icons

init_campaign_loadout_item_icons

Populates campaign_loadout_item_icons

init_campaign_mission_icons

Populates campaign_mission_icons

init_campaign_perk_icons

Populates campaign_perk_icons

init_crafting_recipes

Inits crafting recipe lists

init_crafting_recipes_atoms

Inits atoms used in crafting recipes

init_emote_keybinds

Create a keybind for each datum/emote

init_ethnicities

Ethnicity - Initialise all /datum/ethnicity into a list indexed by ethnicity name

init_keybindings

Creates and sorts all the keybinding datums

init_minimap_icons

Populates minimap_icons

init_quick_loadouts

The list is shared across all quick vendors, but they will only display the tabs specified by the vendor, and only show the loadouts with jobs that match the displayed tabs.

init_sprite_accessories

Initial Building

init_surgery

Surgery Steps - Initialize all /datum/surgery_step into a list

is_handful_buyable

Return TRUE if this handful should be buyable, aka if it's corresponding aka box is in a linked vendor

is_ic_filtered

Given a text, will return what word is on the IC filter, with the reason. Returns null if the message is OK.

is_ic_filtered_for_bombvests

Given a text, will return what word is on the IC filter, or bomb vest filter, with the reason. Returns null if the message is OK.

is_ooc_filtered

Given a text, will return what word is on the OOC filter, with the reason. Returns null if the message is OK.

is_soft_ic_filtered

Given a text, will return what word is on the soft IC filter, with the reason. Returns null if the message is OK.

is_soft_ic_filtered_for_bombvests

Given a text, will return what word is on the soft IC filter, ignoring words allowed on the PDA, with the reason. Returns null if the message is OK.

is_soft_ooc_filtered

Given a text, will return that word is on the soft OOC filter, with the reason. Returns null if the message is OK.

is_valid_dmi_file

given a text string, returns whether it is a valid dmi icons folder path

is_valid_for_resin_structure

Checks all conditions if a spot is valid for construction , will return TRUE

is_valid_src

Check if a datum has not been deleted and is a valid source

item2representation_type

Return wich type of item_representation should representate any item_type

jatum_deserialize

Attempt to create a value from a JATUN JSON.

jatum_serialize

Attempt to serialize a given value to the JATUM format.

json_deserialize_datum

Convert a list of json to datum

json_serialize_datum

Convert a datum into a json blob

level_announce

Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message.

line_of_sight

Checks if ending atom is viewable by starting atom, uses bresenham line algorithm but checks some extra tiles on a diagonal next tile

list_clear_nulls

Removes any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise

load_map

Helper and recommened way to load a map file

load_poll_data

Loads all current and future server polls and their options to store both as datums.

log_access

Logging for logging in & out of the game, with error messages.

log_admin

General logging for admin actions

log_admin_private

General logging for admin actions

log_adminsay

Logging for AdminSay (ASAY) messages

log_asset

Logging for loading and caching assets

log_attack

Generic attack logging

log_bomber

Logging for bombs detonating

log_combat

Log a combat message in the attack log

Arguments:

log_config

Logging for config errors Rarely gets called; just here in case the config breaks.

log_directed_talk

Helper for logging of messages with only one sender and receiver (i.e. mind links)

log_dsay

Logging for DeadchatSay (DSAY) messages

log_emote

Logging for emotes

log_ffattack

Generic attack logging for friendly fire

log_filter

Logs to the filter log with the given message, match, and scope

log_game

Logging for generic/unsorted game messages

log_hivemind

Logging for hivemind messages

log_job_debug

Logging for job slot changes

log_looc

Logging for messages sent in LOOC

log_manifest

Logging for player manifest (ckey, name, job, special role, roundstart/latejoin)

log_mapping

Logging for mapping errors

log_mecha

Logging for mech actions

log_mentorsay

Logging for MentorSay (MSAY) messages

log_minimap_drawing

Logging for drawing on minimap

log_mooc

Logging for messages sent in MOOC

log_ooc

Logging for messages sent in OOC

log_paper

Logging for writing made on paper

log_prayer

Logging for prayed messages

log_qdel

Logging for hard deletes

log_say

Logging for generic spoken messages

log_speech_indicators

Logging for speech indicators.

log_sql

Logging for DB errors

log_telecomms

Logging for speech taking place over comms, as well as tcomms equipment

log_tgui

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

log_tool

Logging for tool usage

log_topic

Logging for world/Topic

log_transport

Logging for transport (tram/elevator) actions

log_vote

Logging for OOC votes

log_whisper

Logging for whispered messages

log_world

Log to both DD and the logfile.

log_xooc

Logging for messages sent in XOOC

make_datum_reference_lists

These should be replaced with proper _INIT macros

make_maint_all_access

Enables all access for maintenance airlocks

make_types_fancy

Turns a list of typepaths into 'fancy' titles for admins.

md5asfile

Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.

md5filepath

Returns the md5 of a file at a given path.

message_to_html

Message-related procs

Message format (/list):

Copyright (c) 2020 Aleksej Komarov SPDX-License-Identifier: MIT

minor_announce

Make a minor announcement to a target

Arguments

movespeed_data_null_check

Checks if a move speed modifier is valid and not missing any data

mutable_appearance

offset_to_screen_loc

Takes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope

overlays2text

Converts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get

params2screenpixel

Converts a screen loc param to a x,y coordinate pixel on the screen

partially_block_emissives

Takes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate

peek

Returns the top (last) element from the list, does not remove it from the list. Stack functionality.

pick_weight_recursive

Like pickweight, but allowing for nested lists.

For example, given the following list: list(A = 1, list(B = 1, C = 1)) A would have a 50% chance of being picked, and list(B, C) would have a 50% chance of being picked. If list(B, C) was picked, B and C would then each have a 50% chance of being picked. So the final probabilities would be 50% for A, 25% for B, and 25% for C.

Weights should be integers. Entries without weights are assigned weight 1 (so unweighted lists can be used as well)

pickweight

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.

play_fov_effect

Plays a visual effect representing a sound cue for people with vision obstructed by FOV or blindness

play_vox_word

play vox words for mobs on our zlevel

playsound

playsound_z

Play sound for all online mobs on a given Z-level. Good for ambient sounds.

playsound_z_humans

Play a sound for all cliented humans and ghosts by zlevel

playsound_z_xenos

Play a sound for all cliented xenos and ghosts by hive on a zlevel

prepare_explosion_turfs

Returns a list of turfs in X range from the epicenter Returns in a unique order, spiraling outwards This is done to ensure our progressive cache of blast resistance is always valid This is quite fast

pretty_string_from_reagent_list

Convert reagent list to a printable string for logging etc

print_command_report

Spawns a paper at each communications printer

priority_announce

Make a priority announcement to a target

Arguments

propagate_network

remove the old powernet and replace it with a new one throughout the network.

qdel

Should be treated as a replacement for the 'del' keyword.

Datums passed to this will be given a chance to clean up references to allow the GC to collect them.

random_tts_voice

returns a random tts voice based on gender. Assumes theres 30 voices, not actually how many there are but yolo. todo should return based on gender but we need voice tags for that

realize_appearance_queue

Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected

recoil_camera

Makes a recoil-like animation on the mob camera.

recover_all_SS_and_recreate_master

Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars

reject_bad_text

Returns the text if properly formatted, or null else.

Things considered improper:

remove_image_from_client

Removes an image from a client's .images. Useful as a callback.

remove_images_from_clients

Removes an image from a list of client's images

remove_verb

handles removing verb and sending it to browser to update, use this for removing verbs

pass the verb type path to this instead of removing it from verbs so the statpanel can update Arguments:

request_z_pillar

Returns a z pillar to insert turfs into

return_generator_args

returns the arguments given to a generator and manually extracts them from the internal byond object returns:

return_typenames

Splits the type with parenthesis between each word so admins visually tell it is a typepath.

revoke_maint_all_access

Disables all access for maintenance airlocks

rustg_get_version

Gets the version of rust_g

rustg_git_commit_date

Returns the date of the given revision using the provided format. Defaults to returning %F which is YYYY-MM-DD.

rustg_git_commit_date_head

Returns the formatted datetime string of HEAD using the provided format. Defaults to returning %F which is YYYY-MM-DD. This is different to rustg_git_commit_date because it only needs the logs directory.

rustg_sound_length

Provided a static RSC file path or a raw text file path, returns the duration of the file in deciseconds as a float.

rustg_unix_timestamp

Returns the timestamp as a string

sanitize

Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.

sanitize_inlist_tts

a wrapper with snowflake handling for tts

sanitize_is_full_emote_list

Sanitize the custom emote list

sanitize_islist

Makes sure value is a list Args: value - The list we're ensuring is actually a list default - The set default that will be given as fallback. required_amount - The required length of value for it to be valid, otherwise will continue to check for a fallback default. check_valid - If we should check if the values are all in the list of possible inputs possible_input_list - The list of possible valid inputs this list can hold, only gets checked if check_valid is TRUE

screen_loc_to_offset

Takes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc

semver_to_list

Converts a semver string into a list of numbers

send2adminchat

Sends a message to TGS admin chat channels.

category - The category of the mssage. message - The message to send.

send2chat

Sends a message to TGS chat channels.

message - The message to send. channel_tag - Required. If "", the message with be sent to all connected (Game-type for TGS3) channels. Otherwise, it will be sent to TGS4 channels with that tag (Delimited by ','s).

send_ooc_announcement

Sends a div formatted chat box announcement

Formatted like:

" Server Announcement " (or sender_override)

" Title "

" Text "

Arguments

set_sentry_ignore_List

Creates the list of atoms that will be ignored by sentry target pathing

set_z_lighting

Modifies the lighting for a z_level

siunit

Formats a number to human readable form with the appropriate SI unit.

Supports SI exponents between 1e-15 to 1e15, but properly handles numbers outside that range as well. Examples:

slur

Makes you speak like you're drunk todo remove, deprecated

sort_list

sort any value in a list

sort_names

uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead

stars

Convert random parts of a passed in message to stars

This proc is dangerously laggy, avoid it or die

start_log

ship both attack logs and victim logs to the end of round attack.log just to ensure we don't lose information

string_list

Caches lists with non-numeric stringify-able values (text or typepath).

strip_appearance_underlays

Strips all underlays on a different plane from an appearance. Returns the stripped appearance.

strip_html

Runs STRIP_HTML_SIMPLE and sanitize.

stripped_input

Used to get a properly sanitized input. Returns null if cancel is pressed.

Arguments

stripped_multiline_input

Used to get a properly sanitized input in a larger box. Works very similarly to stripped_input.

Arguments

stutter

Adds stuttering to the message passed in, todo remove, deprecated

tgalert

DEPRECATED: USE tgui_alert(...) INSTEAD

Designed as a drop in replacement for alert(); functions the same. (outside of needing User specified) Arguments:

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_input_checkboxes

tgui_input_checkbox

Opens a window with a list of checkboxes and returns a list of selected choices.

user - The mob to display the window to message - The message inside the window title - The title of the window list/items - The list of items to display min_checked - The minimum number of checkboxes that must be checked (defaults to 1) max_checked - The maximum number of checkboxes that can be checked (optional) timeout - The timeout for the input (optional)

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_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_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:

timeleft

Get the remaining deciseconds on a timer

Arguments:

to_chat

Sends the message to the recipient (target).

Recommended way to write to_chat calls:

to_chat(client,
    type = MESSAGE_TYPE_INFO,
    html = "You have found <strong>[object]</strong>")

to_chat_immediate

Circumvents the message queue and sends the message to the recipient (target) as soon as possible.

turf_block_check

Return TRUE if we have a block, return FALSE otherwise

ui_status_only_living

Returns a UI status such that the dead will be able to watch, but not interact.

ui_status_silicon_has_access

Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.

ui_status_user_has_free_hands

Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.

ui_status_user_is_abled

Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.

ui_status_user_is_adjacent

Returns a UI status such that users adjacent to source will be able to interact, far away users will be able to see, and anyone farther won't see anything. Dead users will receive updates no matter what, though you likely want to add a [ui_status_only_living] check for finer observer interactions.

ui_status_user_is_advanced_tool_user

Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.

ui_status_user_is_conscious_and_lying_down

Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.

ui_status_user_strictly_adjacent

Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.

unique_list

Return a list with no duplicate entries

unique_list_in_place

same as unique_list, but returns nothing and acts on list in place (also handles associated values properly)

url2htmlloader

Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.

valid_build_direction

Checks whether the target turf is in a valid state to accept a directional construction such as windows or railings.

Returns FALSE if the target turf cannot accept a directional construction. Returns TRUE otherwise.

Arguments:

view_to_pixels

Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)

weight_class_data

Returns an assoc list of WEIGHT CLASS TEXT = DESCRIPTION based on the arg you provide. Used by examine tags for giving each weight class a special description.

weight_class_to_text

Returns a string based on the weight class define used as argument.

xeno_message

Send a message to all xenos. Force forces the message whether or not the hivemind is intact. Target is an atom that is pointed out to the hive. Filter list is a list of xenos we don't message.

zap_beam

Shocks xenos, returns shocked xenos.