/(global)
Vars | |
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 |
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() |
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. |
base_slip_delay | base movedelay threshold for slipping |
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 | |
clothingbooth_catalogue | Global list of clothingbooth_grouping datums, generated at runtime. |
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 |
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 |
generic_exit_list | Global list representing the standard exit command packet. |
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 |
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. |
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" |
non_vital_organ_strings | This contains a list with organ strings that not instantly kill someone when lost. |
ordinal | Diagonal directions |
oven_recipes | COOKING RECODE |
parallax_enabled | Whether parallax has been enabled or disabled globally. |
part_customizations | Lazy init singleton list |
pcap_kick_messages | specifies if pcap kick messages show display to admins in chat |
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 |
requirement_cache | Manufacturing Requirements are datums which check if a material satisfies some given requirements, to determine if a manufacturer can produce a blueprint. Manufacturing datums define them by their string ID, which gets converted to the single instance of it in the cache on New(). Not shown in this file are the exact material ID requirement datums, which are generated for the cache on init using the material cache. |
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 | pool of precached sounds |
serialized_clothingbooth_catalogue | Serialized version of global.clothingbooth_catalogue for sending to the clothingbooth's interface. |
serialized_clothingbooth_tags | Serialized list of used clothingbooth_tag s for sending to the clothingbooth's interface. |
sortInstance | This is a global instance to allow much of this code to be reused. The interfaces are kept separately |
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 |
tgui_always_state | tgui state: always_state |
tgui_broken_state | tgui state: broken |
tgui_conscious_state | tgui state: conscious_state |
tgui_contained_state | tgui state: contained_state |
tgui_deep_inventory_state | tgui state: deep_inventory_state |
tgui_default_state | tgui state: default_state |
tgui_hands_state | tgui state: hands_state |
tgui_human_adjacent_state | tgui state: human_adjacent_state |
tgui_inventory_state | tgui state: inventory_state |
tgui_not_incapacitated_state | tgui state: not_incapacitated_state |
tgui_not_incapacitated_turf_state | tgui state: not_incapacitated_turf_state |
tgui_notcontained_state | tgui state: notcontained_state |
tgui_observer_state | tgui state: observer_state |
tgui_physical_obscured_state | tgui state: physical_obscured_state |
tgui_physical_state | tgui state: physical_state |
tgui_self_state | tgui state: self_state |
tgui_z_state | tgui state: z_state |
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. |
unconnected_zone | Areas built anew belong to a single unconnected zone, which gives its turfs over to other expandable areas when contacting them |
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 |
Procs | |
ClearBadsmokeRefs | SMOKE SYSTEMS |
FindBankAccountsByJobs | Given a list of jobs, return the associated bank account records. Does not de-duplicate bank account records. |
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) |
HYPfull_potency_calculation | this proc is a shortcut to calculate the amount of chems to produce from a linear factor and the plantgenes |
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 |
add_zero | Adds zeroes to the beginning of a string until it reaches the desired length |
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 |
animate_spaghettification | Animate being stretched and spun around a point. Looks best when combined with a distortion map. Note that the resulting dummy object is added to center.vis_contents and deleted when done. atom/A is the thing to spaghettify. Note this proc does not delete A, you must handle that separately atom/center is the central atom around which to spin, usually the singulo spaget_time is how long to run the animation. Default 15 seconds. right_spinning is whether to go clockwise or anti-clockwise. Default true. client/C is to show the spaghetti to only one client, or null to show it to everybody. Default null. |
applyCableMaterials | Yes hello apparently we need a proc for this because theres a million types of different wires and cables. |
approx_time_text | returns a string describing approximately how much time this represents, useful for when you want to be vague if this already exists somewhere else I apologise but I couldn't find it |
ass_explosion_limb_success | 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 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 |
build_clothingbooth_caches | Executed at runtime to generate the catalogue of clothingbooth_grouping s for the clothing booth. |
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 |
cmp_minimap_modifiers | Compare the priority of two minimap render modifiers. |
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. |
command2list | Command2list is a modified version of dd_text2list() designed to eat empty list entries generated by superfluous whitespace. It also can insert shell alias/variables if provided with a replacement value list. |
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. |
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 |
dectalk | dectalk SAYS its default volume is 5 but it seems to actually be more like 100 |
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 |
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 |
eligible_to_clone | Check if a mind has a current mob, a client, and is dead/a ghost/doing afterlife stuff. Scanning var controls whether we will return ghosts, because ghosts needs special handling in clone scans to ensure they're not using a body that they've been cloned from before |
english_list | Returns a list in plain english as a string |
faction_check | Returns TRUE if ourguy is enemies with otherguy FALSE otherwise |
fake_blood | Helper procs |
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. |
findLastMatch | returns the position of the last matching needle in haystack, case sensitive |
findLastMatchEx | returns the position of the last matching needle in haystack, case insensitive |
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 logging 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 | Returns the color of a given gas ID. |
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. |
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_access | Global lookup proc for access levels based on a job string (e.g. "Captain") |
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_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. |
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_fullness | return description of how full a container is |
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. |
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". |
get_preference_for_role | Return the name of a preference variable for the given role define. |
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_tgm_maxx | returns the maxx value of a TGM formatted map. Accepts either a map file or preread map text data |
get_tgm_maxy | returns the maxy value of a TGM formatted map. Accepts either a map file or preread map text data |
get_top_ancestor | Get the highest ancestor of this object in the tree that is an immediate child of a given ancestor. |
get_type_typeinfo | Retrieves the typeinfo datum for a given type. |
get_uplink_type | Returns a path of a (presumably) valid uplink dependent on the user's mind. |
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. |
gradientText | Repeat a gradient between two colors across text. Note: This is inaccurate because its a linear transformation, but human eyes do not perceive color this way. |
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. |
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_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. |
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_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' |
mass_print_wanted_poster | Print a wanted poster to all station-level printers |
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 |
move_range | Move elements [from_index,from_index+len) to [to_index-len, to_index) |
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 |
pad_leading | Adds char ahead of text until it reaches length characters total |
pad_trailing | Adds char after text until it reaches length characters total |
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. |
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 |
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 |
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. |
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 |
search_snippet | Returns an html input and a script which allows to toggle elements of a certain class visible or hidden depending what filter the user types in the input. |
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. |
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) |
sortListCopy | Just like /proc/sortList, but return a sorted copy of the given list |
string_type_of_anything | thing.type but it also returns "num" for numbers etc. |
stringify_file_name | Returns a file objects name as a string with or without the exstension stripped |
strip_prefix | Removes a given prefix from a string. |
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) |
text2num_safe | Parses a number except for NaNs and infinities |
tgui_Topic | Middleware for /client/Topic. |
tgui_alert | Creates a TGUI alert window and returns the user's response. |
tgui_color_picker | Creates a TGUI color picker window and returns the user's response. |
tgui_color_picker_async | Creates an asynchronous TGUI color picker window with an associated callback. |
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. |
tgui_input_list_async | Creates an asynchronous TGUI input list window with an associated callback. |
tgui_input_number | Creates a TGUI window with a number input. Returns the user's response as num | null. |
tgui_input_number_async | Creates an asynchronous TGUI number input window with an associated callback. |
tgui_input_pin | Creates a TGUI window with a PIN input. Returns the user's response as string | null. |
tgui_input_pin_async | Creates an asynchronous TGUI PIN input window with an associated callback. |
tgui_input_text | Creates a TGUI window with a text input. Returns the user's response. |
tgui_input_text_async | Creates 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_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. |
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 |
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. |
were_or_was | 'they were' vs 'he was' |
whodead | Finds whoever's dead. |
whois | Looks up a player based on a string. Searches a shit load of things |
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()
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.
base_slip_delay
base movedelay threshold for slipping
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
|\ |\ |\ |\ ___ \ |\ __\ |\ |\ _ \ _ |\ __ |\ |_ \ ___ \ |\ __ \ |\ ____\ |\ \ / __ |_ \
\ \ _|\ \ \\ \ \ /|\ \ _|\ \ _|\ \ \_\ \ \ \ |\ \ \ _|| \ _\ \ /|\ \ |\ \ \ \ _|\ \ _||/|\ ||\ /
\ \ \ \ \ __ \ \ _|/\ __ \ _____ \ \ \|__| \ \ \ __ \ _____ \ \ \ \ \ \ _|/\ \ _ \ \ ___ \ _____ |/ \ \ \ |\ \
\ \ _\ \ \ \ \ \ _|\ ||\ \||\ \ \ \ \ \ \ \ \ \ ||\ \ \ \ \ \ \ _|\ \ \ \ | __||\ \||\ \ \ \ \ _\ \
\ ___\ _\ _\ _____\ \ ___\ \ _\ \ _\ _\ ___\ \ \ _\ \ _\ _\ |___\ \ _\ \ \ _|_\
|____||||||_______|_\_|| ||||||_\ || |_||||||_\\ ||||
||| || ||___|
|\ _|\ __ |\ __ |\ \ / /|\ __ |\ |\ |\ |\ |_ _\ / ___ |\ __ |\ __ |\ ____\ |\ \ |\ |\ __ |\ __ |\ ____\
\ \ _|\ \ |\ \ \ |\ \ \ / / | \ |\ \ \ \ \ _|\ \ \\ | \ _| /__/|_/ /\ \ |\ \ \ |\ \ \ _| \ \ \ \ \ \ \ |\ \ \ |\ \ \ _|
\ \ \ \ \ \\ \ \ \ \ / / \ \ _ \ \ \ \ \ \ \ __ \ \ \ \ ||// / /\ \ \\ \ \ \\ \ \ _ \ \ \ \ \ \ \ __ \ \ _ \ \ \
\ \ _\ \ \\ \ \ _|/ / / \ \ \ \ \ \ \ |\ \ \ \ \ \ \ \ \ ___ / /_/__\ \ \\ \ \ \\ \ \ ___ \ \ \ |__\ \ \ \ \ \ \ \ \ \ _
\ _\ _\ _\ __/ / / \ _\ \ _\ ______\ _\ _\ \ _\\\ _\ _\ _\\ _________\ _\ _\ _\ \ ______
|||||||_/ / |||||__||_______||||| |||||||||||||__________||||||||||____|
||/
clothingbooth_catalogue
Global list of clothingbooth_grouping
datums, generated at runtime.
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
generic_exit_list
Global list representing the standard exit command packet.
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.
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"
non_vital_organ_strings
This contains a list with organ strings that not instantly kill someone when lost.
ordinal
Diagonal directions
oven_recipes
COOKING RECODE
parallax_enabled
Whether parallax has been enabled or disabled globally.
part_customizations
Lazy init singleton list
pcap_kick_messages
specifies if pcap kick messages show display to admins in chat
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
requirement_cache
Manufacturing Requirements are datums which check if a material satisfies some given requirements, to determine if a manufacturer can produce a blueprint. Manufacturing datums define them by their string ID, which gets converted to the single instance of it in the cache on New(). Not shown in this file are the exact material ID requirement datums, which are generated for the cache on init using the material cache.
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
pool of precached sounds
serialized_clothingbooth_catalogue
Serialized version of global.clothingbooth_catalogue
for sending to the clothingbooth's interface.
serialized_clothingbooth_tags
Serialized list of used clothingbooth_tag
s for sending to the clothingbooth's interface.
sortInstance
This is a global instance to allow much of this code to be reused. The interfaces are kept separately
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_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.
unconnected_zone
Areas built anew belong to a single unconnected zone, which gives its turfs over to other expandable areas when contacting them
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.
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)
HYPfull_potency_calculation
this proc is a shortcut to calculate the amount of chems to produce from a linear factor and the plantgenes
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
add_zero
Adds zeroes to the beginning of a string until it reaches the desired length
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
animate_spaghettification
Animate being stretched and spun around a point. Looks best when combined with a distortion map. Note that the resulting dummy object is added to center.vis_contents and deleted when done. atom/A is the thing to spaghettify. Note this proc does not delete A, you must handle that separately atom/center is the central atom around which to spin, usually the singulo spaget_time is how long to run the animation. Default 15 seconds. right_spinning is whether to go clockwise or anti-clockwise. Default true. client/C is to show the spaghetti to only one client, or null to show it to everybody. Default null.
applyCableMaterials
Yes hello apparently we need a proc for this because theres a million types of different wires and cables.
approx_time_text
returns a string describing approximately how much time this represents, useful for when you want to be vague if this already exists somewhere else I apologise but I couldn't find it
ass_explosion_limb_success
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 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.
- Process quoted strings LTR: Apostrophized strings are unparsed. Quoted strings are parsed.
- Insert parsed strings back into the string by using a placeholder for spaces.
- Split the string with the usual space separation method.
- Return list.
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
build_clothingbooth_caches
Executed at runtime to generate the catalogue of clothingbooth_grouping
s for the clothing booth.
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
-
user: the mob that adds a reagent to an atom that has a reagent whitelist
-
TA: Target Atom. The thing that the user is adding the reagent to
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
cmp_minimap_modifiers
Compare the priority of two minimap render modifiers.
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.
command2list
Command2list is a modified version of dd_text2list() designed to eat empty list entries generated by superfluous whitespace. It also can insert shell alias/variables if provided with a replacement value list.
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
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
dectalk
dectalk SAYS its default volume is 5 but it seems to actually be more like 100
deletePlayerNote
Deleting a player note
derive_analogous_colors
-
Derives analogous colors based on a given base color
-
Parameters:
- color: Hex color code of the base color.
-
Returns:
- A list of two hex colors that are analogous to the color
derive_color_from_hue_offset
-
Derives a color based on a given hue offset, accepting and returning hex color values.
-
Parameters:
- color: Hex color code of the base color.
- offset: Degree offset to apply to the hue of the base color.
-
Returns:
- A hex color code derived from the adjusted hue.
derive_complementary_color
-
Derives a complementary color based on a given base color
-
Parameters:
- color: Hex color code of the base color.
-
Returns:
- A hex color that is complementary to the given color.
derive_square_colors
-
Derives three colors that form a square color scheme with the given color in HSL color space
-
Parameters:
- color: Hex color code of the base color.
-
Returns:
- A list of three hex colors that, along with the base color, form a square on the color wheel in HSL color space.
derive_triadic_colors
-
Derives triadic colors based on a given base color
-
Parameters:
- color: Hex color code of the base color.
-
Returns:
- A list of three hex colors that are triadic to the color
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
eligible_to_clone
Check if a mind has a current mob, a client, and is dead/a ghost/doing afterlife stuff. Scanning var controls whether we will return ghosts, because ghosts needs special handling in clone scans to ensure they're not using a body that they've been cloned from before
english_list
Returns a list in plain english as a string
faction_check
Returns TRUE if ourguy is enemies with otherguy FALSE otherwise
fake_blood
Helper procs
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))
findLastMatch
returns the position of the last matching needle in haystack, case sensitive
findLastMatchEx
returns the position of the last matching needle in haystack, case insensitive
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 logging 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
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.
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_access
Global lookup proc for access levels based on a job string (e.g. "Captain")
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_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_fullness
return description of how full a container is
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:
- caller: The movable atom that's trying to find the path
- ends: What we're trying to path to. It doesn't matter if this is a turf or some other atom, we're gonna just path to the turf it's on anyway
- max_distance: The maximum number of steps we can take in a given path to search (default: 30, 0 = infinite)
- mintargetdistance: Minimum distance to the target before path returns, could be used to get near a target, but not right to it - for an AI mob with a gun, for example.
- id: An ID card representing what access we have and what doors we can open. Its location relative to the pathing atom is irrelevant
- simulated_only: Whether we consider turfs without atmos simulation (AKA do we want to ignore space)
- exclude: If we want to avoid a specific turf, like if we're a mulebot who already got blocked by some turf
- skip_first: Whether or not to delete the first item in the path. This would be done because the first item is the starting tile, which can break movement for some creatures.
- cardinal_only: Whether to find only paths consisting of cardinal steps.
- required_goals: How many goals to find to succeed. Null for all.
- do_doorcheck: Whether or not to check if doors are blocked (welded, out of power, locked, etc...)
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:
- role - role to return a client preference for.
get_random_station_storage_list
Return a list of station-level storage objects that are safe to spawn things into
- closed: if TRUE, only include storage objects that are closed
- breathable: if TRUE, only include storage on breathable turfs
- no_others: if TRUE, do not include multiple storage objects on the same turf
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_tgm_maxx
returns the maxx value of a TGM formatted map. Accepts either a map file or preread map text data
get_tgm_maxy
returns the maxy value of a TGM formatted map. Accepts either a map file or preread map text data
get_top_ancestor
Get the highest ancestor of this object in the tree that is an immediate child of a given ancestor.
Usage: var/datum/fart/sassy/F = new get_top_parent(F, /datum) //returns a path to /datum/fart
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
get_uplink_type
Returns a path of a (presumably) valid uplink dependent on the user's mind.
Arguments:
- target - the mob that will own the uplink.
- uplink - the path of the uplink type that you wish to spawn
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
Repeat a gradient between two colors across text. Note: This is inaccurate because its a linear transformation, but human eyes do not perceive color this way.
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_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'
mass_print_wanted_poster
Print a wanted poster to all station-level printers
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
pad_leading
Adds char
ahead of text
until it reaches length
characters total
pad_trailing
Adds char
after text
until it reaches length
characters total
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
- The
placeAllPrefabs()
proc, as the name suggests, places all the prefabs-
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. UNDERWATER_MAP is used in
-
/proc/filter_underwater_prefab()
to choose underwater or space -
prefabs appropriately, depending on the type of map.
-
Prefabs are found by looking for concrete types of
-
/datum/mapPrefab/mining
. To add a new prefab to be checked, simply -
create a type for it.
-
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
search_snippet
Returns an html input and a script which allows to toggle elements of a certain class visible or hidden depending what filter the user types in the input.
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.
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:
- L - Given list to sort in place (Pass a copy if you want a copy)
- cmp - procpath to compare elements in the list
- associative - whether we are sorting list keys (0: L[i]) or associated values (1: L[L[i]])
- from/toIndex - indexes of the list you want to sort from and to
sortListCopy
Just like /proc/sortList, but return a sorted copy of the given list
string_type_of_anything
thing.type but it also returns "num" for numbers etc.
stringify_file_name
Returns a file objects name as a string with or without the exstension stripped
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:
- user - The user to show the alert to.
- message - The content of the alert, shown in the body of the TGUI window.
- title - The of the alert modal, shown on the top of the TGUI window.
- items - The options that can be chosen by the user, each string is assigned a button on the UI.
- timeout - The timeout of the alert, after which the modal will close and qdel itself. Set to zero for no timeout.
- autofocus - The bool that controls if this alert should grab window focus. - BROKEN DON'T SET TO FALSE (nulls items, ask zewaka)
- content_window - The name of the part to be used for the alert's content, to be used in lieu of message
- do_wait - waits for user input then returns it. Set to false for asynchronism
- theme - The TGUI theme used for the window.
tgui_color_picker
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:
- user - The user to show the picker to.
- title - The of the picker modal, shown on the top of the TGUI window.
- timeout - The timeout of the picker, after which the modal will close and qdel itself. Set to zero for no timeout.
- autofocus - The bool that controls if this picker should grab window focus.
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:
- user - The user to show the picker to.
- title - The of the picker modal, shown on the top of the TGUI window.
- callback - The callback to be invoked when a choice is made.
- timeout - The timeout of the picker, after which the modal will close and qdel itself. Set to zero for no timeout.
- autofocus - The bool that controls if this picker should grab window focus.
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:
- user - The user to show the input box to.
- message - The content of the input box, shown in the body of the TGUI window.
- title - The title of the input box, shown on the top of the TGUI window.
- items - The options that can be chosen by the user, each string is assigned a button on the UI.
- default - If an option is already preselected on the UI. Current values, etc.
- timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout.
- autofocus - The bool that controls if this alert should grab window focus.
- allowIllegal - Whether to allow illegal characters in items.
- start_with_search - Whether to start with the search bar open ("auto" for automatic, TRUE for yes, FALSE for no).
- capitalize - Whether to capitalize the first letter of each item.
- theme - The TGUI theme used for the window.
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:
- user - The user to show the input box to.
- message - The content of the input box, shown in the body of the TGUI window.
- title - The title of the input box, shown on the top of the TGUI window.
- items - The options that can be chosen by the user, each string is assigned a button on the UI.
- default - If an option is already preselected on the UI. Current values, etc.
- callback - The callback to be invoked when a choice is made.
- timeout - The timeout of the input box, after which the menu will close and qdel itself. Set to zero for no timeout.
- autofocus - The bool that controls if this alert should grab window focus.
- allowIllegal - Whether to allow illegal characters in items.
- start_with_search - Whether to start with the search bar open ("auto" for automatic, TRUE for yes, FALSE for no).
- capitalize - Whether to capitalize the first letter of each item.
- theme - The TGUI theme used for the window.
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:
- user - The user to show the numbox to.
- message - The content of the numbox, shown in the body of the TGUI window.
- title - The title of the numbox modal, shown on the top of the TGUI window.
- default - The default (or current) value, shown as a placeholder. Users can press refresh with this.
- max_value - Specifies a maximum value. If none is set, it defaults to 1000.
- min_value - Specifies a minimum value. If none is set, it defaults to 0.
- timeout - The timeout of the numbox, after which the modal will close and qdel itself. Set to zero for no timeout.
- round_input - If the number in the numbox should be rounded to the nearest integer.
- theme - The TGUI theme used for the window.
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:
- user - The user to show the numbox to.
- message - The content of the numbox, shown in the body of the TGUI window.
- title - The title of the numbox modal, shown on the top of the TGUI window.
- default - The default (or current) value, shown as a placeholder. Users can press refresh with this.
- max_value - Specifies a maximum value. If none is set, it defaults to 1000.
- min_value - Specifies a minimum value. If none is set, it defaults to 0.
- callback - The callback to be invoked when a choice is made.
- timeout - The timeout of the numbox, after which the modal will close and qdel itself. Disabled by default, can be set to seconds otherwise.
- round_input - If the number in the numbox should be rounded to the nearest integer.
- theme - The TGUI theme used for the window.
tgui_input_pin
Creates a TGUI window with a PIN input. Returns the user's response as string | null.
This proc should be used to create windows for PIN 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:
- user - The user to show the numbox to.
- message - The content of the numbox, shown in the body of the TGUI window.
- title - The title of the numbox modal, shown on the top of the TGUI window.
- default - The default (or current) value, shown as a placeholder. Users can press refresh with this.
- max_value - Specifies a maximum value. If none is set, it defaults to 9999.
- min_value - Specifies a minimum value. If none is set, it defaults to 0000.
- timeout - The timeout of the numbox, after which the modal will close and qdel itself. Set to zero for no timeout.
- theme - The TGUI theme used for the window.
tgui_input_pin_async
Creates an asynchronous TGUI PIN input window with an associated callback.
This proc should be used to create windows for PIN entry that invoke a callback with the user's entry.
Arguments:
- user - The user to show the numbox to.
- message - The content of the numbox, shown in the body of the TGUI window.
- title - The title of the numbox modal, shown on the top of the TGUI window.
- default - The default (or current) value, shown as a placeholder. Users can press refresh with this.
- max_value - Specifies a maximum value. If none is set, it defaults to 9999.
- min_value - Specifies a minimum value. If none is set, it defaults to 0000.
- callback - The callback to be invoked when a choice is made.
- timeout - The timeout of the numbox, after which the modal will close and qdel itself. Disabled by default, can be set to seconds otherwise.
- theme - The TGUI theme used for the window.
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:
- user - The user to show the textbox to.
- message - The content of the textbox, shown in the body of the TGUI window.
- title - The title of the textbox modal, shown on the top of the TGUI window.
- default - The default (or current) value, shown as a placeholder.
- max_length - Specifies a max length for input.
- multiline - Bool that determines if the input box is much larger. Good for large messages, laws, etc.
- timeout - The timeout of the textbox, after which the modal will close and qdel itself. Set to zero for no timeout.
- theme - The TGUI theme used for the window.
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:
- user - The user to show the textbox to.
- message - The content of the textbox, shown in the body of the TGUI window.
- title - The title of the textbox modal, shown on the top of the TGUI window.
- default - The default (or current) value, shown as a placeholder.
- max_length - Specifies a max length for input.
- multiline - Bool that determines if the input box is much larger. Good for large messages, laws, etc.
- callback - The callback to be invoked when a choice is made.
- timeout - The timeout of the textbox, after which the modal will close and qdel itself. Disabled by default, can be set to seconds otherwise.
- theme - The TGUI theme used for the window.
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:
- user - The user to show the msgbox to.
- message - The content of the msgbox, shown in the body of the TGUI window.
- title - The title of the msgbox modal, shown on the top of the TGUI window.
- sanitize - Whether or not to sanitize the message. DO NOT TRUST USER INPUT. NO.
- timeout - The timeout of the msgbox, after which the modal will close and qdel itself. Set to zero for no timeout.
- theme - The TGUI theme used for the window.
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:
- path: A typepath or list of typepaths.
- only_root_path: Whether the typecache should be specifically of the passed types.
- ignore_root_path: Whether to ignore the root path when caching subtypes.
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.
were_or_was
'they were' vs 'he was'
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.