(global)

Vars | |
Failsafe | Failsafe |
---|---|
Master | StonedMC |
SSambience | The subsystem used to play ambience to users every now and then, makes them real excited. |
SSarea_contents | Responsible for managing the sizes of area.contained_turfs and area.turfs_to_uncontain These lists do not check for duplicates, which is fine, but it also means they can balloon in size over time as a consequence of repeated changes in area in a space They additionally may not always resolve often enough to avoid memory leaks This is annoying, so lets keep an eye on them and cut them down to size if needed |
SSasset_loading | Allows us to lazyload asset datums Anything inserted here will fully load if directly gotten So this just serves to remove the requirement to load assets fully during init |
SSaura | Tracks aura emitters and tells them to pulse. Also used for creating new ones. |
SSautomatedfire | |
SSdiscord | |
SSearly_assets | Initializes any assets that need to be loaded ASAP, before the atoms SS initializes. |
SSminimaps | |
SSsecurity_level | |
SSspatial_grid | |
SStgui | tgui subsystem |
SStimer | |
SStutorials | Namespace for housing code relating to giving contextual tutorials to users. |
Procs | |
DirBlocked | Checks if moving in a direction is blocked |
Gibberish | Turn text into complete gibberish! |
HandleUserlessProcCall | Handles a userless proccall, used by circuits. |
HandleUserlessSDQL | Handles a userless sdql, used by circuits and tgs. |
LeftAndRightOfDir | Returns the left and right dir of the input dir, used for AI stutter step while attacking |
LinkBlocked | Returns true if the path from A to B is blocked. Checks both paths where the direction is diagonal |
TurfBlockedNonWindow | Returns true if any object on a turf is both dense and not a window |
WEAKREF | Creates a weakref to the given input. See /datum/weakref's documentation for more information. |
WrapAdminProcCall | Wrapper for proccalls where the datum is flagged as vareditted |
___TraitAdd | DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. |
___TraitRemove | DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback. |
__check_serialization_semver | Checks if the actual semver is equal or later than the wanted semver Must be passed as TEXT; you're probably looking for CHECK_SERIALIZATION_SEMVER, look right above |
_addtimer | Create a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information. |
add_keybinding | Adds an instanced keybinding to the global tracker |
add_verb | handles adding verbs and updating the stat panel browser |
adminscrub | Runs STRIP_HTML_SIMPLE and byond's sanitization proc. |
alone_in_area | Checks if the mob provided (must_be_alone) is alone in an area |
angle_to_cardinal_dir | Returns one of the 4 cardinal directions based on an angle |
angle_to_dir | Returns one of the 8 directions based on an angle |
armored_init_guntypes | im a lazy bum who cant use initial on lists, so we just load everything into a list |
assemble_alert | Design a faction alert. Returns a string. |
assertion_message | Used by ASSERT to add a more detailed context to CRASH messages |
assign_random_name | Generate a name devices |
assoc_to_keys | Turns an associative list into a flat list of keys |
auxtools_expr_stub | auxtools expression evaluation |
behemoth_area_attack | Checks for any atoms caught in the attack's range, and applies several effects based on the atom's type. |
bfg_beam | executes a BFG zap. just damages living mobs in an AOE from the source |
bitfield_to_list | Converts a bitfield to a list of numbers (or words if a wordlist is provided) |
blend_cutoff_colors | Used to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments |
blend_screen_color | Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker |
bullet_burst | Fires a list of projectile objects in a circle around an atom Arguments: |
buy_category | Return true if you can buy this category, and also change the loadout seller buying bitfield |
buy_item_in_vendor | Return true if the item was found in a linked vendor and successfully bought |
buy_stack | Check if that stack is buyable in a points vendor (currently, only metal, sandbags and plasteel) |
callback_select | Runs a list of callbacks asyncronously, returning only when all have finished |
can_buy_category | Will check if the selected category can be bought according to the category choices left |
can_see_through | Returns if a turf can be seen from another turf. |
can_sell_human_body | Return TRUE if the relation between the two factions are bad enough that a bounty is on the human_to_sell head |
center_image | Center's an image. Requires: The Image The x dimension of the icon file used in the image The y dimension of the icon file used in the image eg: center_image(image_to_center, 32,32) eg2: center_image(image_to_center, 96,96) |
cheap_get_atom | This proc attempts to get an instance of an atom type within distance, with center as the center. Arguments |
cheap_get_humans_near | Returns a list of humans via get_dist and same z level method, very cheap compared to range() |
cheap_get_living_near | Returns a list of mobs/living via get_dist and same z level method, very cheap compared to range() |
cheap_get_mechs_near | Returns a list of mechs via get_dist and same z level method, very cheap compared to range() |
cheap_get_tanks_near | Returns a list of vehicles via get_dist and same z level method, very cheap compared to range() |
cheap_get_xenos_near | Returns a list of xenos via get_dist and same z level method, very cheap compared to range() |
check_admin_pings | Checks a given message to see if any of the words contain an active admin's ckey with an @ before it |
check_path | Draws a line between two atoms, then checks if the path is blocked Returns the last turf in the list it can successfully path to |
check_topdown_validity | Checks if a passed in MA or atom is allowed to have its current plane/layer matchup |
circle_range | Returns all atoms present in a circle around the center |
circle_range_turfs | Returns a list of turfs around a center based on RANGE_TURFS() |
circle_view | Returns all atoms present in a circle around the center but uses view() instead of range() (Currently not used) |
circle_view_turfs | Returns a list of turfs around a center based on view() |
closest_cardinal_dir | If given a diagonal dir, return a corresponding cardinal dir. East/west preferred |
cmp_crafting_req_priority | Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes |
color_hex2color_matrix | Takes a hex color provided as string and returns the proper color matrix using hex2num. |
color_matrix2color_hex | will drop all values not on the diagonal returns a hex color |
compare_list | flat list comparison, checks if two lists have the same contents |
considered_escaped | Checks if the passed mind is considered "escaped". |
create_empty_loadout | Return a new empty loayout |
create_glass_styles | Constructs a nested list of glass style singletons |
create_ooc_announcement_div | Inserts a span styled message into an OOC alert style div |
create_squad | initializes a new custom squad. all args mandatory |
create_strippable_list | Creates an assoc list of keys to /datum/strippable_item |
cut_relative_direction | Takes a screen_loc string and cut out any directions like NORTH or SOUTH |
deadchat_broadcast | Displays a message in deadchat, sent by source. Source is not linkified, message is, to avoid stuff like character names to be linkified. Automatically gives the class deadsay to the whole message (message + source) |
debug_variable | Get displayed variable in VV variable list |
default_ui_state | The sane defaults for a UI such as a computer or a machine. |
delete_all_SS_and_recreate_master | Delete all existing SS to basically start over |
deltimer | Delete a timer |
diff_appearances | Takes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays |
do_after | A delayed action with adjustable checks |
do_eord_respawn | Grabs a mob, if it's human, check uniform, if it has one just stops there, otherwise proceeds. if it's not human, creates a human mob and transfers the mind there. Proceeds to outfit either result with the loadout of various factions. 7% chance to be a separate rare strong or funny faction. Tiny additional 2% chance if that procs to be a deathsquad! SOM and TG loadouts are handled differently, taking subtypes from the HvH loadout sets. |
do_warning | Warns nearby players, in any way or form, of the incoming ability and the range it will affect. |
dump_in_space | Dump a movable in a random eligible tile |
dview | Version of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant). |
electrocute_mob | Determines how strong could be shock, deals damage to mob, uses power. |
emissive_appearance | Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR. |
emissive_blocker | Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR. |
empulse | EMP's everything in a specified radius, similar to an explosion |
explosion | Makes a given atom explode. |
extend_line_to_radius | gets a line from a x and y, to the offset x and y of length radius |
filter_fancy_list | Takes a given fancy list and filters out a given filter text. Args: fancy_list - The list provided we filter. filter - the text we use to filter fancy_list |
flick_overlay_view | wrapper for flick_overlay(), flicks to everyone who can see the target atom |
generate_and_hash_rsc_file | generates a filename for a given asset. like generate_asset_name(), except returns the rsc reference and the rsc file hash as well as the asset name (sans extension) used so that certain asset files dont have to be hashed twice |
generate_asset_name | Generate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.) |
generate_cone | Generates a cone shape. Any other checks should be handled with the resulting list. Can work with up to 359 degrees Variables: center - where the cone begins, or center of a circle drawn with this max_row_count - how many rows are checked starting_row - from how far should the turfs start getting included in the cone. -1 required to include center turf due to byond cone_width - big the angle of the cone is cone_direction - at what angle should the cone be made, relative to the game board's orientation blocked - whether the cone should take into consideration obstacles |
generate_greyscale_weapons_data | generates the static list data containig all printable mech equipment modules for greyscale |
generate_lazy_template_map | Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance. |
generate_lighting_appearance_by_z | Updates the lowest offset value |
get_adjacent_areas | Returns a list of all areas that are adjacent to the center atom's area, clear the list of nulls at the end. |
get_adjacent_open_areas | Returns a list with all the adjacent areas by getting the adjacent open turfs |
get_adjacent_open_turfs | Returns a list with all the adjacent open turfs. Clears the list of nulls in the end. |
get_allowed_instrument_ids | Get all non admin_only instruments as a list of text ids. |
get_areas | Takes: Area type as text string or as typepath OR an instance of the area. Returns: A list of all areas of that type in the world. |
get_areas_in_range | Returns a list with the names of the areas around a center at a certain distance Returns the local area if no distance is indicated Returns an empty list if the center is null |
get_atom_on_turf | Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. |
get_base_caste_type | returns the basetype caste from this caste or typepath to get what the base caste is (e.g base rav not primo or strain rav) |
get_bbox_of_atoms | Get a bounding box of a list of atoms. |
get_between_angles | returns degrees between two angles |
get_closest_atom | Returns the closest atom of a specific type in a list from a source |
get_current_mission | Returns the current mission, if its the campaign gamemode |
get_dist_euclidian | Returns the distance between two atoms |
get_dist_manhattan | Returns the manhattan distance between two atoms. Returns INFINITY if either are not on a turf, for BYOND get_dist() parity. |
get_fancy_list_of_atom_types | Generates a static list of 'fancy' atom types, or returns that if its already been generated. |
get_fancy_list_of_datum_types | Generates a static list of 'fancy' datum types, excluding everything atom, or returns that if its already been generated. |
get_forward_square | Returns a rectangle of turfs in front of the center. |
get_greyscale_render_order | sprite stuff with layering requires we make a specific order for each dir |
get_hear | Like view but bypasses luminosity check |
get_hearers_in_LOS | Returns a list of movable atoms that are hearing sensitive in view_radius and line of sight to source the majority of the work is passed off to the spatial grid if view_radius > 0 because view() isnt a raycasting algorithm, this does not hold symmetry to it. something in view might not be hearable with this. if you want that use get_hearers_in_view() - however thats significantly more expensive |
get_hearers_in_range | The exact same as get_hearers_in_view, but not limited by visibility. Does no filtering for traits, line of sight, or any other such criteria. Filtering is intended to be done by whatever calls this function. |
get_hearers_in_view | returns every hearaing movable in view to the turf of source not taking into account lighting useful when you need to maintain always being able to hear something if a sound is emitted from it and you can see it (and youre in range). otherwise this is just a more expensive version of get_hearers_in_LOS(). |
get_icon_dmi_path | given an icon object, dmi file path, or atom/image/mutable_appearance, attempts to find and return an associated dmi file path. a weird quirk about dm is that /icon objects represent both compile-time or dynamic icons in the rsc, but stringifying rsc references returns a dmi file path ONLY if that icon represents a completely unchanged dmi file from when the game was compiled. so if the given object is associated with an icon that was in the rsc when the game was compiled, this returns a path. otherwise it returns "" |
get_item_stack_number | If the item is not a stack, return 1. If it is a stack, return the stack size |
get_item_stack_representation_amount | If the item representation is not a stack, return 1. Else, return the satck size |
get_line | Get a list of turfs in a line from starting_atom to ending_atom . |
get_mech_limb | helper that converts greyscale mech slots and types into typepaths |
get_nearest_target | Returns the nearest target that has the right target flag |
get_nested_locs | Returns a list of all locations (except the area) the movable is within. |
get_open_turf_in_dir | Returns the open turf next to the center in a specific direction |
get_parent_caste_type | returns the parent caste type for the given caste (e.g. bloodthirster would return base rav) |
get_path | Returns the most optimal path to get from starting atom to goal atom |
get_random_reagent_id | Returns a random reagent ID minus blacklisted reagents |
get_screen_size | gets the current screen size as defined in config |
get_sfx | Used to convert a SFX define into a .ogg so we can add some variance to sounds. If soundin is already a .ogg, we simply return it |
get_sorted_areas | Returns a sorted version of GLOB.areas, by name |
get_strain_options | returns a list of strains(xeno castedatum paths) that this caste can currently evolve to |
get_traits_from_pass_flags | Returns a list of traits corrosponding to a supplied set of passflags |
get_traversal_line | Get a list of turfs in a line from starting_atom to ending_atom .
Unlike get_line, this only takes cardinal steps, useful for checking movement or LOS
Uses the ultra-fast Bresenham Line-Drawing Algorithm. |
get_turf_on_clickcatcher | Helper proc that processes a clicked target, if the target is not black tiles, it will not change it. If they are it will return the turf of the black tiles. It will return null if the object is a screen object other than black tiles. |
get_valid_screen_location | Returns a valid location to place a screen object without overflowing the viewport |
get_view_center | Return the center turf of the user's view |
getpois | Returns a list of all items of interest with their name |
give_admin_popup | Tries to give the target an admin popup. If it fails, will send the error to the passed admin. |
give_free_headset | Will give a headset corresponding to the user job to the user |
handle_initial_squad | A generic proc for handling the initial squad role assignment in SSjob |
icon2base64 | Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64) |
icon2html | the dmi file path we attempt to return if the given object argument is associated with a stringifiable icon if successful, this looks like "icons/path/to/dmi_file.dmi" but they pass both isicon() and isfile() checks. theyre the easiest case since stringifying them gives us the path we want generate an asset for the given icon or the icon of the given appearance for [thing], and send it to any clients in target. Arguments: |
icon_exists | Checks whether a given icon state exists in a given icon file. If file and state both exist,
this will return TRUE - otherwise, it will return FALSE . |
icon_exists_or_scream | Functions the same as /proc/icon_exists() , but with the addition of a stack trace if the
specified file or state doesn't exist. |
inLineOfSight | Calculate if two atoms are in sight, returns TRUE or FALSE |
in_view_range | Returns TRUE if the atom is in the user view range. |
init_alcohol_containers | ////////////////////////////////////////////Alchohol bottles! -Agouri ////////////////////////// Initializes GLOB.alcohol_containers, only containers that actually have reagents are added to the list. |
init_campaign_asset_icons | Populates campaign_asset_icons |
init_campaign_loadout_item_icons | Populates campaign_loadout_item_icons |
init_campaign_mission_icons | Populates campaign_mission_icons |
init_campaign_perk_icons | Populates campaign_perk_icons |
init_crafting_recipes | Inits crafting recipe lists |
init_crafting_recipes_atoms | Inits atoms used in crafting recipes |
init_emote_keybinds | Create a keybind for each datum/emote |
init_ethnicities | Ethnicity - Initialise all /datum/ethnicity into a list indexed by ethnicity name |
init_keybindings | Creates and sorts all the keybinding datums |
init_minimap_icons | Populates minimap_icons |
init_quick_loadouts | The list is shared across all quick vendors, but they will only display the tabs specified by the vendor, and only show the loadouts with jobs that match the displayed tabs. |
init_sprite_accessories | Initial Building |
init_surgery | Surgery Steps - Initialize all /datum/surgery_step into a list |
is_handful_buyable | Return TRUE if this handful should be buyable, aka if it's corresponding aka box is in a linked vendor |
is_ic_filtered | Given a text, will return what word is on the IC filter, with the reason. Returns null if the message is OK. |
is_ic_filtered_for_bombvests | Given a text, will return what word is on the IC filter, or bomb vest filter, with the reason. Returns null if the message is OK. |
is_ooc_filtered | Given a text, will return what word is on the OOC filter, with the reason. Returns null if the message is OK. |
is_soft_ic_filtered | Given a text, will return what word is on the soft IC filter, with the reason. Returns null if the message is OK. |
is_soft_ic_filtered_for_bombvests | Given a text, will return what word is on the soft IC filter, ignoring words allowed on the PDA, with the reason. Returns null if the message is OK. |
is_soft_ooc_filtered | Given a text, will return that word is on the soft OOC filter, with the reason. Returns null if the message is OK. |
is_valid_dmi_file | given a text string, returns whether it is a valid dmi icons folder path |
is_valid_for_resin_structure | Checks all conditions if a spot is valid for construction , will return TRUE |
is_valid_src | Check if a datum has not been deleted and is a valid source |
item2representation_type | Return wich type of item_representation should representate any item_type |
jatum_deserialize | Attempt to create a value from a JATUN JSON. |
jatum_serialize | Attempt to serialize a given value to the JATUM format. |
json_deserialize_datum | Convert a list of json to datum |
json_serialize_datum | Convert a datum into a json blob |
level_announce | Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message. |
line_of_sight | Checks if ending atom is viewable by starting atom, uses bresenham line algorithm but checks some extra tiles on a diagonal next tile |
list_clear_nulls | Removes any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise |
load_map | Helper and recommened way to load a map file |
load_poll_data | Loads all current and future server polls and their options to store both as datums. |
log_access | Logging for logging in & out of the game, with error messages. |
log_admin | General logging for admin actions |
log_admin_private | General logging for admin actions |
log_adminsay | Logging for AdminSay (ASAY) messages |
log_asset | Logging for loading and caching assets |
log_attack | Generic attack logging |
log_bomber | Logging for bombs detonating |
log_combat | Log a combat message in the attack log |
log_config | Logging for config errors Rarely gets called; just here in case the config breaks. |
log_directed_talk | Helper for logging of messages with only one sender and receiver (i.e. mind links) |
log_dsay | Logging for DeadchatSay (DSAY) messages |
log_emote | Logging for emotes |
log_ffattack | Generic attack logging for friendly fire |
log_filter | Logs to the filter log with the given message, match, and scope |
log_game | Logging for generic/unsorted game messages |
log_hivemind | Logging for hivemind messages |
log_job_debug | Logging for job slot changes |
log_looc | Logging for messages sent in LOOC |
log_manifest | Logging for player manifest (ckey, name, job, special role, roundstart/latejoin) |
log_mapping | Logging for mapping errors |
log_mecha | Logging for mech actions |
log_mentorsay | Logging for MentorSay (MSAY) messages |
log_minimap_drawing | Logging for drawing on minimap |
log_mooc | Logging for messages sent in MOOC |
log_ooc | Logging for messages sent in OOC |
log_paper | Logging for writing made on paper |
log_prayer | Logging for prayed messages |
log_qdel | Logging for hard deletes |
log_say | Logging for generic spoken messages |
log_speech_indicators | Logging for speech indicators. |
log_sql | Logging for DB errors |
log_telecomms | Logging for speech taking place over comms, as well as tcomms equipment |
log_tgui | Appends a tgui-related log entry. All arguments are optional. |
log_tool | Logging for tool usage |
log_topic | Logging for world/Topic |
log_transport | Logging for transport (tram/elevator) actions |
log_vote | Logging for OOC votes |
log_whisper | Logging for whispered messages |
log_world | Log to both DD and the logfile. |
log_xooc | Logging for messages sent in XOOC |
make_datum_reference_lists | These should be replaced with proper _INIT macros |
make_maint_all_access | Enables all access for maintenance airlocks |
make_types_fancy | Turns a list of typepaths into 'fancy' titles for admins. |
md5asfile | Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results. |
md5filepath | Returns the md5 of a file at a given path. |
message_to_html | Message-related procs |
minor_announce | Make a minor announcement to a target |
movespeed_data_null_check | Checks if a move speed modifier is valid and not missing any data |
mutable_appearance | |
offset_to_screen_loc | Takes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope |
overlays2text | Converts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get |
params2screenpixel | Converts a screen loc param to a x,y coordinate pixel on the screen |
partially_block_emissives | Takes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate |
peek | Returns the top (last) element from the list, does not remove it from the list. Stack functionality. |
pick_weight_recursive | Like pickweight, but allowing for nested lists. |
pickweight | Picks a random element from a list based on a weighting system. For example, given the following list: A = 6, B = 3, C = 1, D = 0 A would have a 60% chance of being picked, B would have a 30% chance of being picked, C would have a 10% chance of being picked, and D would have a 0% chance of being picked. You should only pass integers in. |
play_fov_effect | Plays a visual effect representing a sound cue for people with vision obstructed by FOV or blindness |
play_vox_word | play vox words for mobs on our zlevel |
playsound | |
playsound_z | Play sound for all online mobs on a given Z-level. Good for ambient sounds. |
playsound_z_humans | Play a sound for all cliented humans and ghosts by zlevel |
playsound_z_xenos | Play a sound for all cliented xenos and ghosts by hive on a zlevel |
prepare_explosion_turfs | Returns a list of turfs in X range from the epicenter Returns in a unique order, spiraling outwards This is done to ensure our progressive cache of blast resistance is always valid This is quite fast |
pretty_string_from_reagent_list | Convert reagent list to a printable string for logging etc |
print_command_report | Spawns a paper at each communications printer |
priority_announce | Make a priority announcement to a target |
propagate_network | remove the old powernet and replace it with a new one throughout the network. |
qdel | Should be treated as a replacement for the 'del' keyword. |
random_tts_voice | returns a random tts voice based on gender. Assumes theres 30 voices, not actually how many there are but yolo. todo should return based on gender but we need voice tags for that |
realize_appearance_queue | Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected |
recoil_camera | Makes a recoil-like animation on the mob camera. |
recover_all_SS_and_recreate_master | Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars |
reject_bad_text | Returns the text if properly formatted, or null else. |
remove_image_from_client | Removes an image from a client's .images . Useful as a callback. |
remove_images_from_clients | Removes an image from a list of client's images |
remove_verb | handles removing verb and sending it to browser to update, use this for removing verbs |
request_z_pillar | Returns a z pillar to insert turfs into |
return_generator_args | returns the arguments given to a generator and manually extracts them from the internal byond object returns: |
return_typenames | Splits the type with parenthesis between each word so admins visually tell it is a typepath. |
revoke_maint_all_access | Disables all access for maintenance airlocks |
rustg_get_version | Gets the version of rust_g |
rustg_git_commit_date | Returns the date of the given revision using the provided format. Defaults to returning %F which is YYYY-MM-DD. |
rustg_git_commit_date_head | Returns the formatted datetime string of HEAD using the provided format. Defaults to returning %F which is YYYY-MM-DD. This is different to rustg_git_commit_date because it only needs the logs directory. |
rustg_sound_length | Provided a static RSC file path or a raw text file path, returns the duration of the file in deciseconds as a float. |
rustg_unix_timestamp | Returns the timestamp as a string |
sanitize | Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character. |
sanitize_inlist_tts | a wrapper with snowflake handling for tts |
sanitize_is_full_emote_list | Sanitize the custom emote list |
sanitize_islist | Makes sure value is a list Args: value - The list we're ensuring is actually a list default - The set default that will be given as fallback. required_amount - The required length of value for it to be valid, otherwise will continue to check for a fallback default. check_valid - If we should check if the values are all in the list of possible inputs possible_input_list - The list of possible valid inputs this list can hold, only gets checked if check_valid is TRUE |
screen_loc_to_offset | Takes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc |
semver_to_list | Converts a semver string into a list of numbers |
send2adminchat | Sends a message to TGS admin chat channels. |
send2chat | Sends a message to TGS chat channels. |
send_ooc_announcement | Sends a div formatted chat box announcement |
set_sentry_ignore_List | Creates the list of atoms that will be ignored by sentry target pathing |
set_z_lighting | Modifies the lighting for a z_level |
siunit | Formats a number to human readable form with the appropriate SI unit. |
slur | Makes you speak like you're drunk todo remove, deprecated |
sort_list | sort any value in a list |
sort_names | uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead |
stars | Convert random parts of a passed in message to stars |
start_log | ship both attack logs and victim logs to the end of round attack.log just to ensure we don't lose information |
string_list | Caches lists with non-numeric stringify-able values (text or typepath). |
strip_appearance_underlays | Strips all underlays on a different plane from an appearance. Returns the stripped appearance. |
strip_html | Runs STRIP_HTML_SIMPLE and sanitize. |
stripped_input | Used to get a properly sanitized input. Returns null if cancel is pressed. |
stripped_multiline_input | Used to get a properly sanitized input in a larger box. Works very similarly to stripped_input. |
stutter | Adds stuttering to the message passed in, todo remove, deprecated |
tgalert | DEPRECATED: USE tgui_alert(...) INSTEAD |
tgui_Topic | Middleware for /client/Topic. |
tgui_alert | Creates a TGUI alert window and returns the user's response. |
tgui_input_checkboxes | |
tgui_input_list | Creates a TGUI input list window and returns the user's response. |
tgui_input_number | Creates a TGUI window with a number input. Returns the user's response as num | null. |
tgui_input_text | Creates a TGUI window with a text input. Returns the user's response. |
timeleft | Get the remaining deciseconds on a timer |
to_chat | Sends the message to the recipient (target). |
to_chat_immediate | Circumvents the message queue and sends the message to the recipient (target) as soon as possible. |
turf_block_check | Return TRUE if we have a block, return FALSE otherwise |
ui_status_only_living | Returns a UI status such that the dead will be able to watch, but not interact. |
ui_status_silicon_has_access | Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled. |
ui_status_user_has_free_hands | Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch. |
ui_status_user_is_abled | Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive. |
ui_status_user_is_adjacent | Returns a UI status such that users adjacent to source will be able to interact,
far away users will be able to see, and anyone farther won't see anything.
Dead users will receive updates no matter what, though you likely want to add
a [ui_status_only_living ] check for finer observer interactions. |
ui_status_user_is_advanced_tool_user | Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch. |
ui_status_user_is_conscious_and_lying_down | Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise. |
ui_status_user_strictly_adjacent | Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise. |
unique_list | Return a list with no duplicate entries |
unique_list_in_place | same as unique_list, but returns nothing and acts on list in place (also handles associated values properly) |
url2htmlloader | Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn. |
valid_build_direction | Checks whether the target turf is in a valid state to accept a directional construction such as windows or railings. |
view_to_pixels | Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height) |
weight_class_data | Returns an assoc list of WEIGHT CLASS TEXT = DESCRIPTION based on the arg you provide. Used by examine tags for giving each weight class a special description. |
weight_class_to_text | Returns a string based on the weight class define used as argument. |
xeno_message | Send a message to all xenos. Force forces the message whether or not the hivemind is intact. Target is an atom that is pointed out to the hive. Filter list is a list of xenos we don't message. |
zap_beam | Shocks xenos, returns shocked xenos. |
Var Details
Failsafe

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

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

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

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

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

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

Maintains a timer-like system to handle autofiring. Much of this code is modeled after or adapted from the runechat subsytem.
Note that this has the same structure for storing and queueing shooter component as the timer subsystem does for handling timers: the bucket_list is a list of autofire component, each of which are the head of a linked list. Any given index in bucket_list could be null, representing an empty bucket.
Doesn't support any event scheduled for more than 100 ticks in the future, as it has no secondary queue by design
SSdiscord

This subsystem handles some integrations with discord
NOTES:
- There is a DB table to track ckeys and associated discord IDs. (discord_link)
- This system REQUIRES TGS for notifying users at end of the round
- The SS uses fire() instead of just pure shutdown, so people can be notified if it comes back after a crash, where the SS wasn't properly shutdown
- It only writes to the disk every 5 minutes, and it won't write to disk if the file is the same as it was the last time it was written. This is to save on disk writes
- The system is kept per-server (EG: Terry will not notify people who pressed notify on Sybil), but the accounts are between servers so you dont have to relink on each server.
- The file is loaded and the discord IDs are extracted
- A ping is sent to the discord with the IDs of people who wished to be notified
- The file is emptied
- Someone usees the notify verb, it adds their discord ID to the list.
- On fire, it will write that to the disk, as long as conditions above are correct
- The file is force-saved, incase it hasn't fired at end round
This is an absolute clusterfuck, but its my clusterfuck -aa07
SSearly_assets

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

Handles updating and handling of the by-zlevel minimaps
Minimaps are a low priority subsystem that fires relatively often the Initialize proc for this subsystem draws the maps as one of the last initializing subsystems
Fire() for this subsystem doens't actually updates anything, and purely just reapplies the overlays that it already tracks actual updating of marker locations is handled by [/datum/controller/subsystem/minimaps/proc/on_move] and zlevel changes are handled in /datum/controller/subsystem/minimaps/proc/on_z_change tracking of the actual atoms you want to be drawn on is done by means of datums holding info pertaining to them with /datum/hud_displays
Todo *: add fetching of images to allow stuff like adding/removing xeno crowns easily *: add a system for viscontents so things like minimap draw are more responsive
SSsecurity_level

Subsystem that controls the security level of the marine ship.
See /datum/security_level for usage (implementing new levels, modifying existing, etc).
SSspatial_grid

a gamewide grid of spatial_grid_cell datums, each "covering" SPATIAL_GRID_CELLSIZE ^ 2 turfs. each spatial_grid_cell datum stores information about what is inside its covered area, so that searches through that area dont have to literally search through all turfs themselves to know what is within it since view() calls are expensive, and so is iterating through stuff you dont want. this allows you to only go through lists of what you want very cheaply.
you can also register to objects entering and leaving a spatial cell, this allows you to do things like stay idle until a player enters, so you wont have to use expensive view() calls or iteratite over the global list of players and call get_dist() on every one. which is fineish for a few things, but is k * n operations for k objects iterating through n players.
currently this system is only designed for searching for relatively uncommon things, small subsets of /atom/movable. dont add stupid shit to the cells please, keep the information that the cells store to things that need to be searched for often
as of right now this system operates on a subset of the important_recursive_contents list for atom/movable, specifically RECURSIVE_CONTENTS_HEARING_SENSITIVE and RECURSIVE_CONTENTS_CLIENT_MOBS because both are those are both 1. important and 2. commonly searched for
SStgui

tgui subsystem
Contains all tgui state and subsystem code.
SStimer

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

Namespace for housing code relating to giving contextual tutorials to users.
Proc Details
DirBlocked
Checks if moving in a direction is blocked
Gibberish
Turn text into complete gibberish!
text is the inputted message, replace_characters will cause original letters to be replaced and chance are the odds that a character gets modified.
HandleUserlessProcCall
Handles a userless proccall, used by circuits.
Arguments:
- user - a string used to identify the user
- target - the target to proccall on
- proc - the proc to call
- arguments - any arguments
HandleUserlessSDQL
Handles a userless sdql, used by circuits and tgs.
Arguments:
- user - a string used to identify the user
- query_text - the query text
LeftAndRightOfDir
Returns the left and right dir of the input dir, used for AI stutter step while attacking
LinkBlocked
Returns true if the path from A to B is blocked. Checks both paths where the direction is diagonal
TurfBlockedNonWindow
Returns true if any object on a turf is both dense and not a window
WEAKREF
Creates a weakref to the given input. See /datum/weakref's documentation for more information.
WrapAdminProcCall
Wrapper for proccalls where the datum is flagged as vareditted
___TraitAdd
DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
___TraitRemove
DO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
__check_serialization_semver
Checks if the actual semver is equal or later than the wanted semver Must be passed as TEXT; you're probably looking for CHECK_SERIALIZATION_SEMVER, look right above
_addtimer
Create a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information.
Arguments:
- callback the callback to call on timer finish
- wait deciseconds to run the timer for
- flags flags for this timer, see: code__DEFINES\subsystems.dm
add_keybinding
Adds an instanced keybinding to the global tracker
add_verb
handles adding verbs and updating the stat panel browser
pass the verb type path to this instead of adding it directly to verbs so the statpanel can update Arguments:
- target - Who the verb is being added to, client or mob typepath
- verb - typepath to a verb, or a list of verbs, supports lists of lists
adminscrub
Runs STRIP_HTML_SIMPLE and byond's sanitization proc.
alone_in_area
Checks if the mob provided (must_be_alone) is alone in an area
angle_to_cardinal_dir
Returns one of the 4 cardinal directions based on an angle
angle_to_dir
Returns one of the 8 directions based on an angle
armored_init_guntypes
im a lazy bum who cant use initial on lists, so we just load everything into a list
assemble_alert
Design a faction alert. Returns a string.
Arguments
- title - required, the title to use for this alert
- subtitle - optional, the subtitle/subheader to use for this alert
- message - required, the message to use for this alert
- color_override - optional, the color to use for this alert instead of blue
- minor - is this a minor alert?
assertion_message
Used by ASSERT to add a more detailed context to CRASH messages
assign_random_name
Generate a name devices
Creates a randomly generated tag or name for devices or anything really it keeps track of a special list that makes sure no name is used more than once
args:
- len (int)(Optional) Default=5 The length of the name
- prefix (string)(Optional) static text in front of the random name
- postfix (string)(Optional) static text in back of the random name Returns (string) The generated name
assoc_to_keys
Turns an associative list into a flat list of keys
auxtools_expr_stub
auxtools expression evaluation
behemoth_area_attack
Checks for any atoms caught in the attack's range, and applies several effects based on the atom's type.
- turfs_to_attack: The turfs affected by this proc.
- enhanced: Whether this is enhanced or not.
- instant: Whether this is done instantly or not.
bfg_beam
executes a BFG zap. just damages living mobs in an AOE from the source
bitfield_to_list
Converts a bitfield to a list of numbers (or words if a wordlist is provided)
blend_cutoff_colors
Used to blend together two different color cutoffs Uses the screen blendmode under the hood, essentially just /proc/blend_screen_color But paired down and modified to work for our color range Accepts the color cutoffs as two 3 length list(0-100,...) arguments
blend_screen_color
Blends together two colors (passed as 3 or 4 length lists) using the screen blend mode Much like multiply, screen effects the brightness of the resulting color Screen blend will always lighten the resulting color, since before multiplication we invert the colors This makes our resulting output brighter instead of darker
bullet_burst
Fires a list of projectile objects in a circle around an atom Arguments:
- source: [mandatory] atom the bullets are emitting from
- bullets: [mandatory] list of bullets (in order, clockwise) to fire
- firer: atom that "shot" these bullets
- fire_sound: sound to play while the bullets are firing
- range: bullet range
- speed: bullet speed
- randomized: bool, if true we randomly pick where we're firing instead of evenly seperated
- rotations: how many times to "spin" the rotation. if 0 or less, instead bursts all the bullets at once
buy_category
Return true if you can buy this category, and also change the loadout seller buying bitfield
buy_item_in_vendor
Return true if the item was found in a linked vendor and successfully bought
buy_stack
Check if that stack is buyable in a points vendor (currently, only metal, sandbags and plasteel)
callback_select
Runs a list of callbacks asyncronously, returning only when all have finished
Callbacks can be repeated, to call it multiple times
Arguments:
- list/callbacks the list of callbacks to be called
- list/callback_args the list of lists of arguments to pass into each callback
- savereturns Optionally save and return the list of returned values from each of the callbacks
- resolution The number of byond ticks between each time you check if all callbacks are complete
can_buy_category
Will check if the selected category can be bought according to the category choices left
can_see_through
Returns if a turf can be seen from another turf.
can_sell_human_body
Return TRUE if the relation between the two factions are bad enough that a bounty is on the human_to_sell head
center_image
Center's an image. Requires: The Image The x dimension of the icon file used in the image The y dimension of the icon file used in the image eg: center_image(image_to_center, 32,32) eg2: center_image(image_to_center, 96,96)
cheap_get_atom
This proc attempts to get an instance of an atom type within distance, with center as the center. Arguments
- center - The center of the search
- type - The type of atom we're looking for
- distance - The distance we should search
- list_to_search - The list to look through for the type
cheap_get_humans_near
Returns a list of humans via get_dist and same z level method, very cheap compared to range()
cheap_get_living_near
Returns a list of mobs/living via get_dist and same z level method, very cheap compared to range()
cheap_get_mechs_near
Returns a list of mechs via get_dist and same z level method, very cheap compared to range()
cheap_get_tanks_near
Returns a list of vehicles via get_dist and same z level method, very cheap compared to range()
cheap_get_xenos_near
Returns a list of xenos via get_dist and same z level method, very cheap compared to range()
check_admin_pings
Checks a given message to see if any of the words contain an active admin's ckey with an @ before it
Returns nothing if no pings are found, otherwise returns an associative list with ckey -> client Also modifies msg to underline the pings, then stores them in the key ADMINSAY_PING_UNDERLINE_NAME_INDEX for returning
Arguments:
- msg - the message being scanned
- adminonly - if it should only look for ASAY admins and not just a holder
check_path
Draws a line between two atoms, then checks if the path is blocked Returns the last turf in the list it can successfully path to
check_topdown_validity
Checks if a passed in MA or atom is allowed to have its current plane/layer matchup
circle_range
Returns all atoms present in a circle around the center
circle_range_turfs
Returns a list of turfs around a center based on RANGE_TURFS()
circle_view
Returns all atoms present in a circle around the center but uses view() instead of range() (Currently not used)
circle_view_turfs
Returns a list of turfs around a center based on view()
closest_cardinal_dir
If given a diagonal dir, return a corresponding cardinal dir. East/west preferred
cmp_crafting_req_priority
Sorts crafting recipe requirements before the crafting recipe is inserted into GLOB.crafting_recipes
Prioritises /datum/reagent to ensure reagent requirements are always processed first when crafting. This prevents any reagent_containers from being consumed before the reagents they contain, which can lead to runtimes and item duplication when it happens.
color_hex2color_matrix
Takes a hex color provided as string and returns the proper color matrix using hex2num.
color_matrix2color_hex
will drop all values not on the diagonal returns a hex color
compare_list
flat list comparison, checks if two lists have the same contents
considered_escaped
Checks if the passed mind is considered "escaped".
Escaped mobs are used to check certain antag objectives / results.
Escaped includes minds with alive, non-exiled mobs generally.
create_empty_loadout
Return a new empty loayout
create_glass_styles
Constructs a nested list of glass style singletons
List format:
- list(glasses = list(beer = style datum, vodka = style datum), shot glasses = list(vodka = different style datum))
Where
- "glasses" and "shotglasses" are item typepaths
- "beer" and "vodka" are reagent typepaths
- "style datum" is a glass style singleton datum
Returns the list.
create_ooc_announcement_div
Inserts a span styled message into an OOC alert style div
Arguments
- message - required, the message contents
- style_override - required, set the div style
create_squad
initializes a new custom squad. all args mandatory
create_strippable_list
Creates an assoc list of keys to /datum/strippable_item
cut_relative_direction
Takes a screen_loc string and cut out any directions like NORTH or SOUTH
deadchat_broadcast
Displays a message in deadchat, sent by source. Source is not linkified, message is, to avoid stuff like character names to be linkified. Automatically gives the class deadsay to the whole message (message + source)
debug_variable
Get displayed variable in VV variable list
default_ui_state
The sane defaults for a UI such as a computer or a machine.
delete_all_SS_and_recreate_master
Delete all existing SS to basically start over
deltimer
Delete a timer
Arguments:
- id a timerid or a /datum/timedevent
diff_appearances
Takes two appearances as args, prints out, logs, and returns a text representation of their differences Including suboverlays
do_after
A delayed action with adjustable checks
do_eord_respawn
Grabs a mob, if it's human, check uniform, if it has one just stops there, otherwise proceeds. if it's not human, creates a human mob and transfers the mind there. Proceeds to outfit either result with the loadout of various factions. 7% chance to be a separate rare strong or funny faction. Tiny additional 2% chance if that procs to be a deathsquad! SOM and TG loadouts are handled differently, taking subtypes from the HvH loadout sets.
do_warning
Warns nearby players, in any way or form, of the incoming ability and the range it will affect.
dump_in_space
Dump a movable in a random eligible tile
dview
Version of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant).
electrocute_mob
Determines how strong could be shock, deals damage to mob, uses power.
Arguments:
- M is a mob who touched wire/whatever
- power_source is a source of electricity, can be powercell, area, apc, cable, powernet or null
- source is an object caused electrocuting (airlock, grille, etc)
- siemens_coeff - layman's terms, conductivity
- dist_check - set to only shock mobs within 1 of source (vendors, airlocks, etc.)
- No animations will be performed by this proc.
emissive_appearance
Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EMISSIVE_COLOR.
emissive_blocker
Produces a mutable appearance glued to the [EMISSIVE_PLANE] dyed to be the EM_BLOCK_COLOR.
empulse
EMP's everything in a specified radius, similar to an explosion
explosion
Makes a given atom explode.
Arguments:
- origin: The atom that's exploding.
- devastation_range: The range at which the effects of the explosion are at their strongest.
- heavy_impact_range: The range at which the effects of the explosion are relatively severe.
- light_impact_range: The range at which the effects of the explosion are relatively weak.
- light_impact_range: The range at which the effects of the explosion are very weak.
- flash_range: The range at which the explosion flashes people.
- flame_range: range to make flame objs in
- throw_range: range the explosion throws people away
- adminlog: Whether to log the explosion/report it to the administration.
- silent: Whether to generate/execute sound effects.
- smoke: Whether to generate a smoke cloud provided the explosion is powerful enough to warrant it.
- color: light color that happens with the explosion
- tiny: whether to try use the tiny explosion sprite for this
- protect_epicenter: Whether to leave the epicenter turf unaffected by the explosion
- explosion_cause: [Optional] The atom that caused the explosion, when different to the origin. Used for logging.
- explosion_direction: The angle in which the explosion is pointed (for directional explosions.)
- explosion_arc: The angle of the arc covered by a directional explosion (if 360 the explosion is non-directional.)
extend_line_to_radius
gets a line from a x and y, to the offset x and y of length radius
filter_fancy_list
Takes a given fancy list and filters out a given filter text. Args: fancy_list - The list provided we filter. filter - the text we use to filter fancy_list
flick_overlay_view
wrapper for flick_overlay(), flicks to everyone who can see the target atom
generate_and_hash_rsc_file
generates a filename for a given asset. like generate_asset_name(), except returns the rsc reference and the rsc file hash as well as the asset name (sans extension) used so that certain asset files dont have to be hashed twice
generate_asset_name
Generate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.)
generate_cone
Generates a cone shape. Any other checks should be handled with the resulting list. Can work with up to 359 degrees Variables: center - where the cone begins, or center of a circle drawn with this max_row_count - how many rows are checked starting_row - from how far should the turfs start getting included in the cone. -1 required to include center turf due to byond cone_width - big the angle of the cone is cone_direction - at what angle should the cone be made, relative to the game board's orientation blocked - whether the cone should take into consideration obstacles
generate_greyscale_weapons_data
generates the static list data containig all printable mech equipment modules for greyscale
generate_lazy_template_map
Iterates through all lazy template datums that exist and returns a list of them as an associative list of key -> instance.
Screams if more than one key exists, loudly.
generate_lighting_appearance_by_z
Updates the lowest offset value
get_adjacent_areas
Returns a list of all areas that are adjacent to the center atom's area, clear the list of nulls at the end.
get_adjacent_open_areas
Returns a list with all the adjacent areas by getting the adjacent open turfs
get_adjacent_open_turfs
Returns a list with all the adjacent open turfs. Clears the list of nulls in the end.
get_allowed_instrument_ids
Get all non admin_only instruments as a list of text ids.
get_areas
Takes: Area type as text string or as typepath OR an instance of the area. Returns: A list of all areas of that type in the world.
get_areas_in_range
Returns a list with the names of the areas around a center at a certain distance Returns the local area if no distance is indicated Returns an empty list if the center is null
get_atom_on_turf
Returns the top-most atom sitting on the turf. For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf.
Arguments
- something_in_turf - a movable within the turf, somewhere.
- stop_type - optional - stops looking if stop_type is found in the turf, returning that type (if found).
get_base_caste_type
returns the basetype caste from this caste or typepath to get what the base caste is (e.g base rav not primo or strain rav)
get_bbox_of_atoms
Get a bounding box of a list of atoms.
Arguments:
- atoms - List of atoms. Can accept output of view() and range() procs.
Returns: list(x1, y1, x2, y2)
get_between_angles
returns degrees between two angles
get_closest_atom
Returns the closest atom of a specific type in a list from a source
get_current_mission
Returns the current mission, if its the campaign gamemode
get_dist_euclidian
Returns the distance between two atoms
get_dist_manhattan
Returns the manhattan distance between two atoms. Returns INFINITY if either are not on a turf, for BYOND get_dist() parity.
get_fancy_list_of_atom_types
Generates a static list of 'fancy' atom types, or returns that if its already been generated.
get_fancy_list_of_datum_types
Generates a static list of 'fancy' datum types, excluding everything atom, or returns that if its already been generated.
get_forward_square
Returns a rectangle of turfs in front of the center.
To find what exact width and height to enter, width is based on west-east and height is north-south as if center is facing north.
Increments in width increases both sizes by said increment while height is only increased once by the increment.
get_greyscale_render_order
sprite stuff with layering requires we make a specific order for each dir
get_hear
Like view but bypasses luminosity check
get_hearers_in_LOS
Returns a list of movable atoms that are hearing sensitive in view_radius and line of sight to source the majority of the work is passed off to the spatial grid if view_radius > 0 because view() isnt a raycasting algorithm, this does not hold symmetry to it. something in view might not be hearable with this. if you want that use get_hearers_in_view() - however thats significantly more expensive
- view_radius - what radius search circle we are using, worse performance as this increases but not as much as it used to
- source - object at the center of our search area. everything in get_turf(source) is guaranteed to be part of the search area
get_hearers_in_range
The exact same as get_hearers_in_view, but not limited by visibility. Does no filtering for traits, line of sight, or any other such criteria. Filtering is intended to be done by whatever calls this function.
This function exists to allow for mobs to hear speech without line of sight, if such a thing is needed.
- radius - what radius search circle we are using, worse performance as this increases
- source - object at the center of our search area. everything in get_turf(source) is guaranteed to be part of the search area
- contents_type - the type of contents we want to be looking for. defaults to hearing sensitive
get_hearers_in_view
returns every hearaing movable in view to the turf of source not taking into account lighting useful when you need to maintain always being able to hear something if a sound is emitted from it and you can see it (and youre in range). otherwise this is just a more expensive version of get_hearers_in_LOS().
- view_radius - what radius search circle we are using, worse performance as this increases
- source - object at the center of our search area. everything in get_turf(source) is guaranteed to be part of the search area
- contents_type - the type of contents we want to be looking for. defaults to hearing sensitive
get_icon_dmi_path
given an icon object, dmi file path, or atom/image/mutable_appearance, attempts to find and return an associated dmi file path. a weird quirk about dm is that /icon objects represent both compile-time or dynamic icons in the rsc, but stringifying rsc references returns a dmi file path ONLY if that icon represents a completely unchanged dmi file from when the game was compiled. so if the given object is associated with an icon that was in the rsc when the game was compiled, this returns a path. otherwise it returns ""
get_item_stack_number
If the item is not a stack, return 1. If it is a stack, return the stack size
get_item_stack_representation_amount
If the item representation is not a stack, return 1. Else, return the satck size
get_line
Get a list of turfs in a line from starting_atom
to ending_atom
.
Uses the ultra-fast Bresenham Line-Drawing Algorithm.
get_mech_limb
helper that converts greyscale mech slots and types into typepaths
get_nearest_target
Returns the nearest target that has the right target flag
get_nested_locs
Returns a list of all locations (except the area) the movable is within.
get_open_turf_in_dir
Returns the open turf next to the center in a specific direction
get_parent_caste_type
returns the parent caste type for the given caste (e.g. bloodthirster would return base rav)
get_path
Returns the most optimal path to get from starting atom to goal atom
get_random_reagent_id
Returns a random reagent ID minus blacklisted reagents
get_screen_size
gets the current screen size as defined in config
get_sfx
Used to convert a SFX define into a .ogg so we can add some variance to sounds. If soundin is already a .ogg, we simply return it
get_sorted_areas
Returns a sorted version of GLOB.areas, by name
get_strain_options
returns a list of strains(xeno castedatum paths) that this caste can currently evolve to
get_traits_from_pass_flags
Returns a list of traits corrosponding to a supplied set of passflags
get_traversal_line
Get a list of turfs in a line from starting_atom
to ending_atom
.
Unlike get_line, this only takes cardinal steps, useful for checking movement or LOS
Uses the ultra-fast Bresenham Line-Drawing Algorithm.
get_turf_on_clickcatcher
Helper proc that processes a clicked target, if the target is not black tiles, it will not change it. If they are it will return the turf of the black tiles. It will return null if the object is a screen object other than black tiles.
get_valid_screen_location
Returns a valid location to place a screen object without overflowing the viewport
- target: The target location as a purely number based screen_loc string "+-left-offset:+-pixel,+-bottom-offset:+-pixel"
- target_offset: The amount we want to offset the target location by. We explictly don't care about direction here, we will try all 4
- view: The view variable of the client we're doing this for. We use this to get the size of the screen
Returns a screen loc representing the valid location
get_view_center
Return the center turf of the user's view
getpois
Returns a list of all items of interest with their name
give_admin_popup
Tries to give the target an admin popup. If it fails, will send the error to the passed admin.
give_free_headset
Will give a headset corresponding to the user job to the user
handle_initial_squad
A generic proc for handling the initial squad role assignment in SSjob
icon2base64
Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)
icon2html
the dmi file path we attempt to return if the given object argument is associated with a stringifiable icon if successful, this looks like "icons/path/to/dmi_file.dmi" but they pass both isicon() and isfile() checks. theyre the easiest case since stringifying them gives us the path we want generate an asset for the given icon or the icon of the given appearance for [thing], and send it to any clients in target. Arguments:
- thing - either a /icon object, or an object that has an appearance (atom, image, mutable_appearance).
- target - either a reference to or a list of references to /client's or mobs with clients
- icon_state - string to force a particular icon_state for the icon to be used
- dir - dir number to force a particular direction for the icon to be used
- frame - what frame of the icon_state's animation for the icon being used
- moving - whether or not to use a moving state for the given icon
- sourceonly - if TRUE, only generate the asset and send back the asset url, instead of tags that display the icon to players
- extra_clases - string of extra css classes to use when returning the icon string
icon_exists
Checks whether a given icon state exists in a given icon file. If file
and state
both exist,
this will return TRUE
- otherwise, it will return FALSE
.
If you want a stack trace to be output when the given state/file doesn't exist, use
/proc/icon_exists_or_scream()
.
icon_exists_or_scream
Functions the same as /proc/icon_exists()
, but with the addition of a stack trace if the
specified file or state doesn't exist.
Stack traces will only be output once for each file.
inLineOfSight
Calculate if two atoms are in sight, returns TRUE or FALSE
in_view_range
Returns TRUE if the atom is in the user view range.
init_alcohol_containers
////////////////////////////////////////////Alchohol bottles! -Agouri ////////////////////////// Initializes GLOB.alcohol_containers, only containers that actually have reagents are added to the list.
init_campaign_asset_icons
Populates campaign_asset_icons
init_campaign_loadout_item_icons
Populates campaign_loadout_item_icons
init_campaign_mission_icons
Populates campaign_mission_icons
init_campaign_perk_icons
Populates campaign_perk_icons
init_crafting_recipes
Inits crafting recipe lists
init_crafting_recipes_atoms
Inits atoms used in crafting recipes
init_emote_keybinds
Create a keybind for each datum/emote
init_ethnicities
Ethnicity - Initialise all /datum/ethnicity into a list indexed by ethnicity name
init_keybindings
Creates and sorts all the keybinding datums
init_minimap_icons
Populates minimap_icons
init_quick_loadouts
The list is shared across all quick vendors, but they will only display the tabs specified by the vendor, and only show the loadouts with jobs that match the displayed tabs.
init_sprite_accessories
Initial Building
init_surgery
Surgery Steps - Initialize all /datum/surgery_step into a list
is_handful_buyable
Return TRUE if this handful should be buyable, aka if it's corresponding aka box is in a linked vendor
is_ic_filtered
Given a text, will return what word is on the IC filter, with the reason. Returns null if the message is OK.
is_ic_filtered_for_bombvests
Given a text, will return what word is on the IC filter, or bomb vest filter, with the reason. Returns null if the message is OK.
is_ooc_filtered
Given a text, will return what word is on the OOC filter, with the reason. Returns null if the message is OK.
is_soft_ic_filtered
Given a text, will return what word is on the soft IC filter, with the reason. Returns null if the message is OK.
is_soft_ic_filtered_for_bombvests
Given a text, will return what word is on the soft IC filter, ignoring words allowed on the PDA, with the reason. Returns null if the message is OK.
is_soft_ooc_filtered
Given a text, will return that word is on the soft OOC filter, with the reason. Returns null if the message is OK.
is_valid_dmi_file
given a text string, returns whether it is a valid dmi icons folder path
is_valid_for_resin_structure
Checks all conditions if a spot is valid for construction , will return TRUE
is_valid_src
Check if a datum has not been deleted and is a valid source
item2representation_type
Return wich type of item_representation should representate any item_type
jatum_deserialize
Attempt to create a value from a JATUN JSON.
- json - The JSON to deserialize.
jatum_serialize
Attempt to serialize a given value to the JATUM format.
- value - The var to serialize.
json_deserialize_datum
Convert a list of json to datum
json_serialize_datum
Convert a datum into a json blob
level_announce
Sends an announcement about the level changing to players. Uses the passed in datum and the subsystem's previous security level to generate the message.
line_of_sight
Checks if ending atom is viewable by starting atom, uses bresenham line algorithm but checks some extra tiles on a diagonal next tile
list_clear_nulls
Removes any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise
load_map
Helper and recommened way to load a map file
- dmm_file: The path to the map file
- x_offset: The x offset to load the map at
- y_offset: The y offset to load the map at
- z_offset: The z offset to load the map at
- crop_map: If true, the map will be cropped to the world bounds
- measure_only: If true, the map will not be loaded, but the bounds will be calculated
- no_changeturf: If true, the map will not call /turf/AfterChange
- x_lower: The minimum x coordinate to load
- x_upper: The maximum x coordinate to load
- y_lower: The minimum y coordinate to load
- y_upper: The maximum y coordinate to load
- z_lower: The minimum z coordinate to load
- z_upper: The maximum z coordinate to load
- place_on_top: Whether to use /turf/proc/PlaceOnTop rather than /turf/proc/ChangeTurf
- new_z: If true, a new z level will be created for the map
load_poll_data
Loads all current and future server polls and their options to store both as datums.
log_access
Logging for logging in & out of the game, with error messages.
log_admin
General logging for admin actions
log_admin_private
General logging for admin actions
log_adminsay
Logging for AdminSay (ASAY) messages
log_asset
Logging for loading and caching assets
log_attack
Generic attack logging
log_bomber
Logging for bombs detonating
log_combat
Log a combat message in the attack log
Arguments:
- atom/user - argument is the actor performing the action
- atom/target - argument is the target of the action
- what_done - is a verb describing the action (e.g. punched, throwed, kicked, etc.)
- atom/object - is a tool with which the action was made (usually an item)
- addition - is any additional text, which will be appended to the rest of the log line
log_config
Logging for config errors Rarely gets called; just here in case the config breaks.
log_directed_talk
Helper for logging of messages with only one sender and receiver (i.e. mind links)
log_dsay
Logging for DeadchatSay (DSAY) messages
log_emote
Logging for emotes
log_ffattack
Generic attack logging for friendly fire
log_filter
Logs to the filter log with the given message, match, and scope
log_game
Logging for generic/unsorted game messages
log_hivemind
Logging for hivemind messages
log_job_debug
Logging for job slot changes
log_looc
Logging for messages sent in LOOC
log_manifest
Logging for player manifest (ckey, name, job, special role, roundstart/latejoin)
log_mapping
Logging for mapping errors
log_mecha
Logging for mech actions
log_mentorsay
Logging for MentorSay (MSAY) messages
log_minimap_drawing
Logging for drawing on minimap
log_mooc
Logging for messages sent in MOOC
log_ooc
Logging for messages sent in OOC
log_paper
Logging for writing made on paper
log_prayer
Logging for prayed messages
log_qdel
Logging for hard deletes
log_say
Logging for generic spoken messages
log_speech_indicators
Logging for speech indicators.
log_sql
Logging for DB errors
log_telecomms
Logging for speech taking place over comms, as well as tcomms equipment
log_tgui
Appends a tgui-related log entry. All arguments are optional.
log_tool
Logging for tool usage
log_topic
Logging for world/Topic
log_transport
Logging for transport (tram/elevator) actions
log_vote
Logging for OOC votes
log_whisper
Logging for whispered messages
log_world
Log to both DD and the logfile.
log_xooc
Logging for messages sent in XOOC
make_datum_reference_lists
These should be replaced with proper _INIT macros
make_maint_all_access
Enables all access for maintenance airlocks
make_types_fancy
Turns a list of typepaths into 'fancy' titles for admins.
md5asfile
Save file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
md5filepath
Returns the md5 of a file at a given path.
message_to_html
Message-related procs
Message format (/list):
- type - Message type, must be one of defines in
code/__DEFINES/chat.dm
- text - Plain message text
- html - HTML message text
- Optional metadata, can be any key/value pair.
Copyright (c) 2020 Aleksej Komarov SPDX-License-Identifier: MIT
minor_announce
Make a minor announcement to a target
Arguments
- message - required, this is the announcement message
- title - optional, the title of the announcement
- alert - optional, alert or notice?
- receivers - a list of all players to send the message to
movespeed_data_null_check
Checks if a move speed modifier is valid and not missing any data
mutable_appearance
-
Helper similar to image()
-
icon - Our appearance's icon
-
icon_state - Our appearance's icon state
-
layer - Our appearance's layer
-
atom/offset_spokesman - An atom to use as reference for the z position of this appearance.
-
Only required if a plane is passed in. If this is not passed in we accept offset_const as a substitute
-
plane - The plane to use for the appearance. If this is not FLOAT_PLANE we require context for the offset to use
-
alpha - Our appearance's alpha
-
appearance_flags - Our appearance's appearance_flags
-
offset_const - A constant to offset our plane by, so it renders on the right "z layer"
offset_to_screen_loc
Takes a list in the form (x_offset, y_offset) And converts it to a screen loc string Accepts an optional view string/size to force the screen_loc around, so it can't go out of scope
overlays2text
Converts an overlay list into text for debug printing Of note: overlays aren't actually mutable appearances, they're just appearances Don't have access to that type tho, so this is the best you're gonna get
params2screenpixel
Converts a screen loc param to a x,y coordinate pixel on the screen
partially_block_emissives
Takes a non area atom and a threshold Makes it block emissive with any pixels with more alpha then that threshold, with the rest allowing the light to pass Returns a list of objects, automatically added to your vis_contents, that apply this effect QDEL them when appropriate
peek
Returns the top (last) element from the list, does not remove it from the list. Stack functionality.
pick_weight_recursive
Like pickweight, but allowing for nested lists.
For example, given the following list: list(A = 1, list(B = 1, C = 1)) A would have a 50% chance of being picked, and list(B, C) would have a 50% chance of being picked. If list(B, C) was picked, B and C would then each have a 50% chance of being picked. So the final probabilities would be 50% for A, 25% for B, and 25% for C.
Weights should be integers. Entries without weights are assigned weight 1 (so unweighted lists can be used as well)
pickweight
Picks a random element from a list based on a weighting system. For example, given the following list: A = 6, B = 3, C = 1, D = 0 A would have a 60% chance of being picked, B would have a 30% chance of being picked, C would have a 10% chance of being picked, and D would have a 0% chance of being picked. You should only pass integers in.
play_fov_effect
Plays a visual effect representing a sound cue for people with vision obstructed by FOV or blindness
play_vox_word
play vox words for mobs on our zlevel
playsound
-
Proc used to play a sound.
-
Arguments:
-
- source: what played the sound.
-
- soundin: the .ogg to use.
-
- vol: the initial volume of the sound, 0 is no sound at all, 75 is loud queen screech.
-
- vary: to make the frequency var of the sound vary (mostly unused).
-
- sound_range: the maximum theoretical range (in tiles) of the sound, by default is equal to the volume.
-
- falloff: how the sound's volume decreases with distance, low is fast decrease and high is slow decrease.
A good representation is: 'byond applies a volume reduction to the sound every X tiles', where X is falloff.
- falloff: how the sound's volume decreases with distance, low is fast decrease and high is slow decrease.
playsound_z
Play sound for all online mobs on a given Z-level. Good for ambient sounds.
playsound_z_humans
Play a sound for all cliented humans and ghosts by zlevel
playsound_z_xenos
Play a sound for all cliented xenos and ghosts by hive on a zlevel
prepare_explosion_turfs
Returns a list of turfs in X range from the epicenter Returns in a unique order, spiraling outwards This is done to ensure our progressive cache of blast resistance is always valid This is quite fast
pretty_string_from_reagent_list
Convert reagent list to a printable string for logging etc
print_command_report
Spawns a paper at each communications printer
priority_announce
Make a priority announcement to a target
Arguments
- message - required, the content of the announcement
- title - optional, the title of the announcement
- subtitle - optional, the subtitle/subheader of the announcement
- type - optional, the type of the announcement (see defines in
__HELPERS/announce.dm
) - sound - optional, the sound played accompanying the announcement
- channel_override - optional, what channel is this sound going to be played on?
- color_override - recommended, string, use the passed color instead of the default blue (see defines in
__HELPERS/announce.dm
) - receivers - a list of all players to send the message to. defaults to all humans, AIs and ghosts
- playing_sound - optional, is this playing sound?
propagate_network
remove the old powernet and replace it with a new one throughout the network.
qdel
Should be treated as a replacement for the 'del' keyword.
Datums passed to this will be given a chance to clean up references to allow the GC to collect them.
random_tts_voice
returns a random tts voice based on gender. Assumes theres 30 voices, not actually how many there are but yolo. todo should return based on gender but we need voice tags for that
realize_appearance_queue
Takes a list of appearnces, makes them mutable so they can be properly vv'd and inspected
recoil_camera
Makes a recoil-like animation on the mob camera.
recover_all_SS_and_recreate_master
Recreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars
reject_bad_text
Returns the text if properly formatted, or null else.
Things considered improper:
- Larger than max_length.
- Presence of non-ASCII characters if asci_only is set to TRUE.
- Only whitespaces, tabs and/or line breaks in the text.
- Presence of the <, >, \ and / characters.
- Presence of ASCII special control characters (horizontal tab and new line not included).
remove_image_from_client
Removes an image from a client's .images
. Useful as a callback.
remove_images_from_clients
Removes an image from a list of client's images
remove_verb
handles removing verb and sending it to browser to update, use this for removing verbs
pass the verb type path to this instead of removing it from verbs so the statpanel can update Arguments:
- target - Who the verb is being removed from, client or mob typepath
- verb - typepath to a verb, or a list of verbs, supports lists of lists
request_z_pillar
Returns a z pillar to insert turfs into
return_generator_args
returns the arguments given to a generator and manually extracts them from the internal byond object returns:
- flat list of strings for args given to the generator.
- Note: this means things like "list(1,2,3)" will need to be processed
return_typenames
Splits the type with parenthesis between each word so admins visually tell it is a typepath.
revoke_maint_all_access
Disables all access for maintenance airlocks
rustg_get_version
Gets the version of rust_g
rustg_git_commit_date
Returns the date of the given revision using the provided format. Defaults to returning %F which is YYYY-MM-DD.
rustg_git_commit_date_head
Returns the formatted datetime string of HEAD using the provided format. Defaults to returning %F which is YYYY-MM-DD. This is different to rustg_git_commit_date because it only needs the logs directory.
rustg_sound_length
Provided a static RSC file path or a raw text file path, returns the duration of the file in deciseconds as a float.
rustg_unix_timestamp
Returns the timestamp as a string
sanitize
Runs byond's html encoding sanitization proc, after replacing new-lines and tabs for the # character.
sanitize_inlist_tts
a wrapper with snowflake handling for tts
sanitize_is_full_emote_list
Sanitize the custom emote list
sanitize_islist
Makes sure value is a list Args: value - The list we're ensuring is actually a list default - The set default that will be given as fallback. required_amount - The required length of value for it to be valid, otherwise will continue to check for a fallback default. check_valid - If we should check if the values are all in the list of possible inputs possible_input_list - The list of possible valid inputs this list can hold, only gets checked if check_valid is TRUE
screen_loc_to_offset
Takes a screen loc string in the format "+-left-offset:+-pixel,+-bottom-offset:+-pixel" Where the :pixel is optional, and returns A list in the format (x_offset, y_offset) We require context to get info out of screen locs that contain relative info, so NORTH, SOUTH, etc
semver_to_list
Converts a semver string into a list of numbers
send2adminchat
Sends a message to TGS admin chat channels.
category - The category of the mssage. message - The message to send.
send2chat
Sends a message to TGS chat channels.
message - The message to send. channel_tag - Required. If "", the message with be sent to all connected (Game-type for TGS3) channels. Otherwise, it will be sent to TGS4 channels with that tag (Delimited by ','s).
send_ooc_announcement
Sends a div formatted chat box announcement
Formatted like:
" Server Announcement " (or sender_override)
" Title "
" Text "
Arguments
- text - required, the text to announce
- title - optional, the title of the announcement.
- players - optional, a list of all players to send the message to. defaults to the entire world
- play_sound - if TRUE, play a sound with the announcement
- sound_override - optional, override the default announcement sound
- sender_override - optional, modifies the sender of the announcement
- style - optional, is this an
ooc
(blue, used for admin announcements) orgame
(red, used for round-related announcements) announcement - encode_title - if TRUE, the title will be HTML encoded (escaped)
- encode_text - if TRUE, the text will be HTML encoded (escaped)
set_sentry_ignore_List
Creates the list of atoms that will be ignored by sentry target pathing
set_z_lighting
Modifies the lighting for a z_level
siunit
Formats a number to human readable form with the appropriate SI unit.
Supports SI exponents between 1e-15 to 1e15, but properly handles numbers outside that range as well. Examples:
-
siunit(1234, "Pa", 1)
->"1.2 kPa"
-
siunit(0.5345, "A", 0)
->"535 mA"
-
siunit(1000, "Pa", 4)
->"1 kPa"
Arguments: -
value - The number to convert to text. Can be positive or negative.
-
unit - The base unit of the number, such as "Pa" or "W".
-
maxdecimals - Maximum amount of decimals to display for the final number. Defaults to 1.
-
For pressure conversion, use proc/siunit_pressure() below
slur
Makes you speak like you're drunk todo remove, deprecated
sort_list
sort any value in a list
sort_names
uses sort_list() but uses the var's name specifically. This should probably be using mergeAtom() instead
stars
Convert random parts of a passed in message to stars
- phrase - the string to convert
- probability - probability any character gets changed
This proc is dangerously laggy, avoid it or die
start_log
ship both attack logs and victim logs to the end of round attack.log just to ensure we don't lose information
string_list
Caches lists with non-numeric stringify-able values (text or typepath).
strip_appearance_underlays
Strips all underlays on a different plane from an appearance. Returns the stripped appearance.
strip_html
Runs STRIP_HTML_SIMPLE and sanitize.
stripped_input
Used to get a properly sanitized input. Returns null if cancel is pressed.
Arguments
- user - Target of the input prompt.
- message - The text inside of the prompt.
- title - The window title of the prompt.
- max_length - If you intend to impose a length limit - default is 1024.
- no_trim - Prevents the input from being trimmed if you intend to parse newlines or whitespace.
stripped_multiline_input
Used to get a properly sanitized input in a larger box. Works very similarly to stripped_input.
Arguments
- user - Target of the input prompt.
- message - The text inside of the prompt.
- title - The window title of the prompt.
- max_length - If you intend to impose a length limit - default is 1024.
- no_trim - Prevents the input from being trimmed if you intend to parse newlines or whitespace.
stutter
Adds stuttering to the message passed in, todo remove, deprecated
tgalert
DEPRECATED: USE tgui_alert(...) INSTEAD
Designed as a drop in replacement for alert(); functions the same. (outside of needing User specified) Arguments:
- User - The user to show the alert to.
- Message - The textual body of the alert.
- Title - The title of the alert's window.
- Button1 - The first button option.
- Button2 - The second button option.
- Button3 - The third button option.
- StealFocus - Boolean operator controlling if the alert will steal the user's window focus.
- Timeout - The timeout of the window, after which no responses will be valid.
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.
- buttons - 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.
tgui_input_checkboxes
Opens a window with a list of checkboxes and returns a list of selected choices.
user - The mob to display the window to message - The message inside the window title - The title of the window list/items - The list of items to display min_checked - The minimum number of checkboxes that must be checked (defaults to 1) max_checked - The maximum number of checkboxes that can be checked (optional) timeout - The timeout for the input (optional)
tgui_input_list
Creates a TGUI input list window and returns the user's response.
This proc should be used to create alerts that the caller will wait for a response from. Arguments:
- 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.
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 number input to.
- message - The content of the number input, shown in the body of the TGUI window.
- title - The title of the number input 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, any number can be entered. Pressing "max" defaults to 1000.
- min_value - Specifies a minimum value. Often 0.
- timeout - The timeout of the number input, after which the modal will close and qdel itself. Set to zero for no timeout.
- round_value - whether the inputted number is rounded down into an integer.
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 text input to.
- message - The content of the text input, shown in the body of the TGUI window.
- title - The title of the text input 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. By default is infinity.
- multiline - Bool that determines if the input box is much larger. Good for large messages, laws, etc.
- encode - Toggling this determines if input is filtered via html_encode. Setting this to FALSE gives raw input.
- timeout - The timeout of the textbox, after which the modal will close and qdel itself. Set to zero for no timeout.
timeleft
Get the remaining deciseconds on a timer
Arguments:
- id a timerid or a /datum/timedevent
to_chat
Sends the message to the recipient (target).
Recommended way to write to_chat calls:
to_chat(client,
type = MESSAGE_TYPE_INFO,
html = "You have found <strong>[object]</strong>")
to_chat_immediate
Circumvents the message queue and sends the message to the recipient (target) as soon as possible.
turf_block_check
Return TRUE if we have a block, return FALSE otherwise
ui_status_only_living
Returns a UI status such that the dead will be able to watch, but not interact.
ui_status_silicon_has_access
Returns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.
ui_status_user_has_free_hands
Returns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.
ui_status_user_is_abled
Returns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.
ui_status_user_is_adjacent
Returns a UI status such that users adjacent to source will be able to interact,
far away users will be able to see, and anyone farther won't see anything.
Dead users will receive updates no matter what, though you likely want to add
a [ui_status_only_living
] check for finer observer interactions.
ui_status_user_is_advanced_tool_user
Returns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.
ui_status_user_is_conscious_and_lying_down
Returns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.
ui_status_user_strictly_adjacent
Return UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
unique_list
Return a list with no duplicate entries
unique_list_in_place
same as unique_list, but returns nothing and acts on list in place (also handles associated values properly)
url2htmlloader
Return html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.
valid_build_direction
Checks whether the target turf is in a valid state to accept a directional construction such as windows or railings.
Returns FALSE if the target turf cannot accept a directional construction. Returns TRUE otherwise.
Arguments:
- dest_turf - The destination turf to check for existing directional constructions
- test_dir - The prospective dir of some atom you'd like to put on this turf.
- is_fulltile - Whether the thing you're attempting to move to this turf takes up the entire tile or whether it supports multiple movable atoms on its tile.
view_to_pixels
Takes a string or num view, and converts it to pixel width/height in a list(pixel_width, pixel_height)
weight_class_data
Returns an assoc list of WEIGHT CLASS TEXT = DESCRIPTION based on the arg you provide. Used by examine tags for giving each weight class a special description.
weight_class_to_text
Returns a string based on the weight class define used as argument.
xeno_message
Send a message to all xenos. Force forces the message whether or not the hivemind is intact. Target is an atom that is pointed out to the hive. Filter list is a list of xenos we don't message.
zap_beam
Shocks xenos, returns shocked xenos.