byond - Modules - TypesVar Details - Proc Details

(global)

Vars

FailsafeFailsafe
MasterStonedMC
SSautomatedfire
SSescape_menuSubsystem for controlling anything related to the escape menu
SSinfluxdriverSends collected statistics to an influxdb v2 backend periodically
SSinfluxstatsSends generic round running statistics to the InfluxDB backend
SSminimaps
SSpager_statusUpdates BYOND pager status periodically
SStguitgui subsystem
SStimer

Procs

CreateBansDEBUG
GUIDreturns a GUID like identifier (using a mostly made up record format) guids are not on their own suitable for access or security tokens, as most of their bits are predictable. (But may make a nice salt to one)
Get_AngleCalculate the angle between two atoms. Uses north-clockwise convention: NORTH = 0, EAST = 90, etc.
HandleUserlessProcCallHandles a userless proccall, used by circuits.
HandleUserlessSDQLHandles a userless sdql, used by TGS.
TurfBlockedNonWindowthe actual dir between the start and target turf The direction that mover's path is being blocked by
WrapAdminProcCallWrapper for proccalls where the datum is flagged as vareditted
___TraitAddDO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
___TraitRemoveDO NOT USE ___TraitAdd OR ___TraitRemove as a replacement for ADD_TRAIT / REMOVE_TRAIT defines. To be used explicitly for callback.
______qdel_list_wrapperthe underscores are to encourage people not to use this directly.
_addtimerCreate a new timer and insert it in the queue. You should not call this directly, and should instead use the addtimer macro, which includes source information.
_animate_filterAuxtools REALLY doesn't know how to handle filters as values; when passed as arguments to auxtools-called procs, they aren't simply treated as nulls - they don't even count towards the length of args. For example, calling some_proc([a filter], foo, bar) from auxtools is equivalent to calling some_proc(foo, bar). Thus, we can't use _animate directly on filters. Use this to perform animation steps on a filter. Consecutive steps on the same filter can be achieved by calling _animate with no target.
_pick_listAllow me to explain for some reason, if pick() is passed arglist(args) directly and args contains only one list it considers it to be a list of lists this means something like _pick(list) would fail need to do this instead
add_keybindingAdds an instanced keybinding to the global tracker
add_verbhandles adding verbs and updating the stat panel browser
admin_ticket_logUse this proc when an admin takes action that may be related to an open ticket on what what can be a client, ckey, or mob player_message: If the message should be shown in the player ticket panel, fill this out log_in_blackbox: Whether or not this message with the blackbox system. If disabled, this message should be logged with a different proc call
anyprobchances are 1:value. anyprob(1) will always return true
at_leastTakes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold
baseturfs_string_listA wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues
big_number_to_textFormats a larger number to correct textual representation without losing data
bit_countcounts the number of bits in Byond's 16-bit width field, in constant time and memory!
bitfield_to_listConverts a bitfield to a list of numbers (or words if a wordlist is provided)
capitalize_first_lettersFinds the first letter of each word in the provided string and capitalize them
center_imageCenter's an image. Requires: The Image The x dimension of the icon file used in the image The y dimension of the icon file used in the image eg: center_image(image_to_center, 32,32) eg2: center_image(image_to_center, 96,96)
check_asay_linksChecks a given message to see if any of the words are something we want to treat specially, as detailed below.
cmp_mob_deathtime_ascCompares mobs based on their timeofdeath value in ascending order
cmp_obs_larvaqueuetime_ascCompares observers based on their larva_queue_time value in ascending order Assumes the client on the observer is not null
color_matrix_from_stringConverts a hex color string to a color matrix.
color_matrix_recolor_redCreates a matrix to re-paint a sprite, replacing shades of red with corresponding shades of a new color. In the base sprite, Hue must always be pure red. Saturation and Lightness can be anything. Arg is a hex string for a color. Proc is by Lummox JR, www.byond.com/forum/post/2209545 color_matrix_recolor_rgb is more complex, but gives more precise control over the palette, at least if using 3 or fewer colours.
color_matrix_recolor_rgbCreates a matrix to re-paint a sprite, replacing pure red, green, and blue with 3 different shades. Doesn't work with mixed tones of RGB or whites or greys -- must be pure. R/G/B 255 becomes the new color, darker shades become correspondingly darker. The arg is a list of hex colours, for ex "list("#d4c218", "#b929f7", "#339933"". if you want variations of the same color, color_matrix_recolor_red() is simpler.
create_strippable_listCreates an assoc list of keys to /datum/strippable_item
debug_variableGet displayed variable in VV variable list
default_ui_stateThe sane defaults for a UI such as a computer or a machine.
delete_all_SS_and_recreate_masterDelete all existing SS to basically start over
delta_to_angleCalculate the angle produced by a pair of x and y deltas. Uses north-clockwise convention: NORTH = 0, EAST = 90, etc.
deltimerDelete a timer
display_powerFormat a power value in W, kW, MW, or GW.
doviewVersion of oview() which ignores darkness
dviewVersion of view() which ignores darkness, because BYOND doesn't have it (I actually suggested it but it was tagged redundant, BUT HEARERS IS A T- /rant).
emissive_appearanceProduces a mutable appearance glued to the EMISSIVE_PLANE dyed to be the EMISSIVE_COLOR.
emissive_blockerProduces a mutable appearance glued to the EMISSIVE_PLANE dyed to be the EM_BLOCK_COLOR.
end_cooldownCallback called by a timer to end an associative-list-indexed cooldown.
extend_line_to_radiusgets a line from a x and y, to the offset x and y of length radius
flick_overlay_to_clientsAdd an image to a list of clients and calls a proc to remove it after a duration
generate_and_hash_rsc_filegenerates a filename for a given asset. like generate_asset_name(), except returns the rsc reference and the rsc file hash as well as the asset name (sans extension) used so that certain asset files dont have to be hashed twice
generate_asset_nameGenerate a filename for this asset The same asset will always lead to the same asset name (Generated names do not include file extention.)
generate_autowiki_outputWhen the AUTOWIKI define is enabled, will generate an output file for tools/autowiki/autowiki.js to consume. Autowiki code intentionally still exists even without the define, to ensure developers notice when they break it immediately, rather than until CI or worse, call time. Returns a string of the autowiki output file
generate_bitfieldsTurns /datum/bitfield subtypes into a list for use in debugging
generate_lazy_template_mapIterates through all lazy template datums that exist and returns a list of them as an associative list of type -> instance.
getFlatIconCreate a single /icon from a given /atom or /image.
get_active_player_countGet active players who are playing in the round
get_alien_candidatesGet a list of observers that can be alien candidates.
get_all_notesReturns all notes associated with a CKEY, structured as a list of strings.
get_bbox_of_atomsGet a bounding box of a list of atoms.
get_cardinal_dirReturns the nearest cardinal dir between two atoms. Favors NORTH/SOUTH on perfect diagonals. Consistent and reversible.
get_ceiling_protection_levelConvert a turf protection level to a ceiling protection level
get_icon_dmi_pathgiven an icon object, dmi file path, or atom/image/mutable_appearance, attempts to find and return an associated dmi file path. a weird quirk about dm is that /icon objects represent both compile-time or dynamic icons in the rsc, but stringifying rsc references returns a dmi file path ONLY if that icon represents a completely unchanged dmi file from when the game was compiled. so if the given object is associated with an icon that was in the rsc when the game was compiled, this returns a path. otherwise it returns ""
get_lineGet a list of turfs in a line from start_atom to end_atom.
get_minimap_flag_for_factionGets the MINIMAP_FLAG for the provided faction or hivenumber if one exists
get_pixel_position_xGives X position on pixel grid of an object, accounting for offsets
get_pixel_position_yGives Y position on pixel grid of an object, accounting for offsets
get_radios_in_viewonly gets FUNCTIONING radios
get_related_directionsGiven a direction, return the direction and the +-45 degree directions next to it
get_specialist_setGet a specialist set datum typepath given a mob, returns null if they aren't a spec or haven't chosen a kit.
get_tacmap_data_pngFetches the datum containing an announced flattend map png reference.
get_tacmap_data_svgFetches the last set of svg coordinates for the tacmap drawing.
get_total_living_playtimeReturns the total time in minutes a specific player ID has played for
get_turf_on_clickcatcherHelper proc that processes a clicked target, if the target is not black tiles, it will not change it. If they are it will return the turf of the black tiles. It will return null if the object is a screen object other than black tiles.
get_unannounced_tacmap_data_pngFetches the datum containing the latest unannounced flattend map png reference.
get_whitelisted_rolesreturns a list of strings containing the whitelists held by a specific ckey
getpoisReturns a list of all items of interest with their name
give_actionGives an action to a mob and returns it
give_escape_menu_detailsProvides a singleton for the escape menu details screen.
give_escape_menu_titleProvides a singleton for the escape menu details screen.
icon2htmlthe dmi file path we attempt to return if the given object argument is associated with a stringifiable icon if successful, this looks like "icons/path/to/dmi_file.dmi" but they pass both isicon() and isfile() checks. theyre the easiest case since stringifying them gives us the path we want generate an asset for the given icon or the icon of the given appearance for [thing], and send it to any clients in target. Arguments:
icon_existsChecks if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE.
init_keybindingsCreates and sorts all the keybinding datums
initiate_surgery_momentDoes the surgery initiation. Returns TRUE if the triggering attack should be halted.
is_valid_dmi_filegiven a text string, returns whether it is a valid dmi icons folder path
is_valid_srcCheck if a datum has not been deleted and is a valid source
lisp_replaceReplaces S and similar sounds with 'th' and such. Stolen from tg.
list_clear_nullsRemoves any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise
load_mapHelper and recommened way to load a map file
log_mappingLogging for mapping errors
log_perfLogging for game performance
log_tguiAppends a tgui-related log entry. All arguments are optional.
make_tupleReturns the name of the mathematical tuple of same length as the number arg (rounded down).
map_pill_iconsPills.
md5asfileSave file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
mergeListsSumSums values in two associative lists, from mergee into result, in place
message_alien_candidatesMessages observers that are currently candidates an update on the queue.
message_to_htmlMessage-related procs
mutable_appearanceHelper similar to image()
pick_n_takePick a random element from the list and remove it from the list.
pick_weightPicks 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.
playsound_areaPlays sound to all mobs that are map-level contents of an area
playsound_zPlay sound for all on-map clients on a given Z-level. Good for ambient sounds.
qdelShould be treated as a replacement for the 'del' keyword.
recover_all_SS_and_recreate_masterRecreate all SSs which will still cause data survive due to Recover(), the new Master will then find and take them from global.vars
recursive_holder_checkWill attempt to find what's holding this item if it's being contained by something, ie if it's in a satchel held by a human, this'll return the human
remove_image_from_clientRemoves an image from a client's .images. Useful as a callback.
remove_images_from_clientsLike remove_image_from_client, but will remove the image from a list of clients
remove_verbhandles removing verb and sending it to browser to update, use this for removing verbs
replace_non_alphanumeric_plusHelper for only alphanumeric characters plus common punctuation, spaces, underscore and hyphen _ -.
resend_current_map_pngRe-sends relevant flattened tacmaps to a single client.
reset_cooldownProc used by stoppable timers to end a cooldown before the time has ran out.
return_generator_argsreturns the arguments given to a generator and manually extracts them from the internal byond object returns:
reverse_rangereplaces reverseList ~Carnie
send2adminchatSends a message to TGS admin chat channels.
send2chatAsynchronously sends a message to TGS chat channels.
setup_hazard_joe_emotesSetup for Hazard joe emotes and category list, returns data for hj_emotes
setup_offsetSets the offset 2 lines above.
setup_working_joe_emotesSetup for Working joe emotes and category list, returns data for wj_emotes
shakeshipShakes the ship around
should_block_game_interactionReturns TRUE if the target is somewhere that the game should not interact with if possible In this case, admin Zs and tutorial areas
show_blurb*Shows a ticker reading out the given text on a client's screen. targets = mob or list of mobs to show it to.
show_blurb_uscmShows operation start blurb to living marines. Slightly different for squad marines, pilots, and deploying ship crew/passengers. exempt_ztraits = trait or list of traits of zlevels where any marines don't see the message, ex. marine faction survivors colonyside shouldn't see the ship marines' drop message. Ex. ZTRAIT_GROUND by default. unit = the unit the marines are from. FF, Dust Raiders etc. Military crew see this. base = the base the marines are staging from. The ship, Whiskey Outpost etc. Noncombat crew see this.
show_location_blurbReads out a description of game time, game date, main ship and current area. Originally for displaying roundstart messages on a conventional SS13 server.
shuffle_inplacesame as shuffle, but returns nothing and acts on list in place
sort_listsort any value in a list
sort_list_distReturns a list of atoms sorted by each entry's distance to target.
stars_decode_htmlSummary: proc that parses an html input string and scrambles the non-html string contents.
string_listCaches lists with non-numeric stringify-able values (text or typepath).
string_starts_withCheck if the string haystack begins with the string needle.
tgui_TopicMiddleware for /client/Topic.
tgui_alertCreates a TGUI alert window and returns the user's response.
tgui_alert_asyncCreates an asynchronous TGUI alert window with an associated callback.
tgui_input_checkboxes
tgui_input_checkboxes_async
tgui_input_listCreates a TGUI input list window and returns the user's response.
tgui_input_list_asyncCreates an asynchronous TGUI input list window with an associated callback.
tgui_input_numberCreates a TGUI window with a number input. Returns the user's response as num | null.
tgui_input_number_asyncCreates an asynchronous TGUI number input window with an associated callback.
tgui_input_real_numberA clone of tgui_input_number that defaults to accepting negative inputs too.
tgui_input_textCreates a TGUI window with a text input. Returns the user's response.
timeleftGet the remaining deciseconds on a timer
to_chatSends the message to the recipient (target).
to_chat_immediateCircumvents the message queue and sends the message to the recipient (target) as soon as possible.
ui_status_only_livingReturns a UI status such that the dead will be able to watch, but not interact.
ui_status_user_is_abledReturns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.
ui_status_user_is_adjacentReturns a UI status such that users adjacent to source will be able to interact, far away users will be able to see, and anyone farther won't see anything. Dead users will receive updates no matter what, though you likely want to add a [ui_status_only_living] check for finer observer interactions.
ui_status_user_is_advanced_tool_userReturns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.
ui_status_user_strictly_adjacentReturn UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
unique_listReturn a list with no duplicate entries
unique_list_in_placesame as unique_list, but returns nothing and acts on list in place (also handles associated values properly)
updatetimedelayUpdate the delay on an existing LOOPING timer Will come into effect on the next process
url2htmlloaderReturn html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.
worldtime2textReturns the world time in english. Do not use to get date information - starts at 0 + a random time offset from 10 minutes to 24 hours.

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

SSautomatedfire

Autofire Subsystem

Maintains a timer-like system to handle autofiring. Much of this code is modeled after or adapted from TGMC's 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

SSescape_menu

Subsystem for controlling anything related to the escape menu

SSinfluxdriver

Sends collected statistics to an influxdb v2 backend periodically

SSinfluxstats

Sends generic round running statistics to the InfluxDB backend

SSminimaps

Minimaps subsystem

Handles updating and handling of the by-zlevel minimaps

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

Fire() for this subsystem doesn't actually update 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

SSpager_status

Updates BYOND pager status periodically

SStgui

tgui subsystem

Contains all tgui state and subsystem code.

SStimer

Timer Subsystem

Handles creation, callbacks, and destruction of timed events.

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

Proc Details

CreateBans

DEBUG

GUID

returns a GUID like identifier (using a mostly made up record format) guids are not on their own suitable for access or security tokens, as most of their bits are predictable. (But may make a nice salt to one)

Get_Angle

Calculate the angle between two atoms. Uses north-clockwise convention: NORTH = 0, EAST = 90, etc.

HandleUserlessProcCall

Handles a userless proccall, used by circuits.

Arguments:

HandleUserlessSDQL

Handles a userless sdql, used by TGS.

Arguments:

TurfBlockedNonWindow

the actual dir between the start and target turf The direction that mover's path is being blocked by

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.

______qdel_list_wrapper

the underscores are to encourage people not to use this directly.

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

_animate_filter

Auxtools REALLY doesn't know how to handle filters as values; when passed as arguments to auxtools-called procs, they aren't simply treated as nulls - they don't even count towards the length of args. For example, calling some_proc([a filter], foo, bar) from auxtools is equivalent to calling some_proc(foo, bar). Thus, we can't use _animate directly on filters. Use this to perform animation steps on a filter. Consecutive steps on the same filter can be achieved by calling _animate with no target.

_pick_list

Allow me to explain for some reason, if pick() is passed arglist(args) directly and args contains only one list it considers it to be a list of lists this means something like _pick(list) would fail need to do this instead

I hate this timeline

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:

admin_ticket_log

Use this proc when an admin takes action that may be related to an open ticket on what what can be a client, ckey, or mob player_message: If the message should be shown in the player ticket panel, fill this out log_in_blackbox: Whether or not this message with the blackbox system. If disabled, this message should be logged with a different proc call

anyprob

chances are 1:value. anyprob(1) will always return true

at_least

Takes a value, and a threshold it has to at least match returns the correctly signed value max'd to the threshold

baseturfs_string_list

A wrapper for baseturf string lists, to offer support of non list values, and a stack_trace if we have major issues

big_number_to_text

Formats a larger number to correct textual representation without losing data

bit_count

counts the number of bits in Byond's 16-bit width field, in constant time and memory!

bitfield_to_list

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

capitalize_first_letters

Finds the first letter of each word in the provided string and capitalize them

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)

Checks a given message to see if any of the words are something we want to treat specially, as detailed below.

There are 3 cases where a word is something we want to act on

  1. Admin pings, like @adminckey. Pings the admin in question, text is not clickable
  2. Datum refs, like @0x2001169 or @mob_23. Clicking on the link opens up the VV for that datum
  3. Ticket refs, like #3. Displays the status and ahelper in the link, clicking on it brings up the ticket panel for it. Returns a list being used as a tuple. Index ASAY_LINK_NEW_MESSAGE_INDEX contains the new message text (with clickable links and such) while index ASAY_LINK_PINGED_ADMINS_INDEX contains a list of pinged admin clients, if there are any.

Arguments:

cmp_mob_deathtime_asc

Compares mobs based on their timeofdeath value in ascending order

cmp_obs_larvaqueuetime_asc

Compares observers based on their larva_queue_time value in ascending order Assumes the client on the observer is not null

color_matrix_from_string

Converts a hex color string to a color matrix.

color_matrix_recolor_red

Creates a matrix to re-paint a sprite, replacing shades of red with corresponding shades of a new color. In the base sprite, Hue must always be pure red. Saturation and Lightness can be anything. Arg is a hex string for a color. Proc is by Lummox JR, www.byond.com/forum/post/2209545 color_matrix_recolor_rgb is more complex, but gives more precise control over the palette, at least if using 3 or fewer colours.

color_matrix_recolor_rgb

Creates a matrix to re-paint a sprite, replacing pure red, green, and blue with 3 different shades. Doesn't work with mixed tones of RGB or whites or greys -- must be pure. R/G/B 255 becomes the new color, darker shades become correspondingly darker. The arg is a list of hex colours, for ex "list("#d4c218", "#b929f7", "#339933"". if you want variations of the same color, color_matrix_recolor_red() is simpler.

create_strippable_list

Creates an assoc list of keys to /datum/strippable_item

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

delta_to_angle

Calculate the angle produced by a pair of x and y deltas. Uses north-clockwise convention: NORTH = 0, EAST = 90, etc.

deltimer

Delete a timer

Arguments:

display_power

Format a power value in W, kW, MW, or GW.

doview

Version of oview() which ignores darkness

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).

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.

end_cooldown

Callback called by a timer to end an associative-list-indexed cooldown.

Arguments:

This sends a signal reporting the cooldown end.

extend_line_to_radius

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

flick_overlay_to_clients

Add an image to a list of clients and calls a proc to remove it after a duration

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_autowiki_output

When the AUTOWIKI define is enabled, will generate an output file for tools/autowiki/autowiki.js to consume. Autowiki code intentionally still exists even without the define, to ensure developers notice when they break it immediately, rather than until CI or worse, call time. Returns a string of the autowiki output file

generate_bitfields

Turns /datum/bitfield subtypes into a list for use in debugging

generate_lazy_template_map

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

getFlatIcon

Create a single /icon from a given /atom or /image.

Very low-performance. Should usually only be used for HTML, where BYOND's appearance system (overlays/underlays, etc.) is not available.

Only the first argument is required. appearance_flags indicates whether appearance_flags should be respected (at the cost of about 10-20% perf)

get_active_player_count

Get active players who are playing in the round

get_alien_candidates

Get a list of observers that can be alien candidates.

Arguments:

get_all_notes

Returns all notes associated with a CKEY, structured as a list of strings.

get_bbox_of_atoms

Get a bounding box of a list of atoms.

Arguments:

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

get_cardinal_dir

Returns the nearest cardinal dir between two atoms. Favors NORTH/SOUTH on perfect diagonals. Consistent and reversible.

get_ceiling_protection_level

Convert a turf protection level to a ceiling protection level

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_line

Get a list of turfs in a line from start_atom to end_atom.

Based on a linear interpolation method from Red Blob Games.

Arguments:

Returns: list - turfs from start_atom (in/exclusive) to end_atom (inclusive)

get_minimap_flag_for_faction

Gets the MINIMAP_FLAG for the provided faction or hivenumber if one exists

get_pixel_position_x

Gives X position on pixel grid of an object, accounting for offsets

get_pixel_position_y

Gives Y position on pixel grid of an object, accounting for offsets

get_radios_in_view

only gets FUNCTIONING radios

Given a direction, return the direction and the +-45 degree directions next to it

get_specialist_set

Get a specialist set datum typepath given a mob, returns null if they aren't a spec or haven't chosen a kit.

get_tacmap_data_png

Fetches the datum containing an announced flattend map png reference.

Arguments:

get_tacmap_data_svg

Fetches the last set of svg coordinates for the tacmap drawing.

Arguments:

get_total_living_playtime

Returns the total time in minutes a specific player ID has played for

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_unannounced_tacmap_data_png

Fetches the datum containing the latest unannounced flattend map png reference.

Arguments:

get_whitelisted_roles

returns a list of strings containing the whitelists held by a specific ckey

getpois

Returns a list of all items of interest with their name

give_action

Gives an action to a mob and returns it

If mob already has the action, unhide it if it's hidden

Can pass additional initialization args

give_escape_menu_details

Provides a singleton for the escape menu details screen.

give_escape_menu_title

Provides a singleton for the escape menu details screen.

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 if the given iconstate exists in the given file, caching the result. Setting scream to TRUE will print a stack trace ONCE.

init_keybindings

Creates and sorts all the keybinding datums

initiate_surgery_moment

Does the surgery initiation. Returns TRUE if the triggering attack should be halted.

is_valid_dmi_file

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

is_valid_src

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

lisp_replace

Replaces S and similar sounds with 'th' and such. Stolen from tg.

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

log_mapping

Logging for mapping errors

log_perf

Logging for game performance

log_tgui

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

make_tuple

Returns the name of the mathematical tuple of same length as the number arg (rounded down).

map_pill_icons

Pills.

Returns a list mapping pill icon classes to icon states

md5asfile

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

mergeListsSum

Sums values in two associative lists, from mergee into result, in place

message_alien_candidates

Messages observers that are currently candidates an update on the queue.

Arguments:

message_to_html

Message-related procs

Message format (/list):

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

mutable_appearance

Helper similar to image()

pick_n_take

Pick a random element from the list and remove it from the list.

pick_weight

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.

playsound_area

Plays sound to all mobs that are map-level contents of an area

playsound_z

Play sound for all on-map clients on a given Z-level. Good for ambient sounds.

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.

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

recursive_holder_check

Will attempt to find what's holding this item if it's being contained by something, ie if it's in a satchel held by a human, this'll return the human

remove_image_from_client

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

remove_images_from_clients

Like remove_image_from_client, but will remove the image from a list of clients

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:

replace_non_alphanumeric_plus

Helper for only alphanumeric characters plus common punctuation, spaces, underscore and hyphen _ -.

resend_current_map_png

Re-sends relevant flattened tacmaps to a single client.

Arguments:

reset_cooldown

Proc used by stoppable timers to end a cooldown before the time has ran out.

Arguments:

This sends a signal reporting the cooldown end, passing the time left as an argument.

return_generator_args

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

reverse_range

replaces reverseList ~Carnie

send2adminchat

Sends a message to TGS admin chat channels.

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

send2chat

Asynchronously sends a message to TGS chat channels.

message - The /datum/tgs_message_content 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). admin_only - Determines if this communication can only be sent to admin only channels.

setup_hazard_joe_emotes

Setup for Hazard joe emotes and category list, returns data for hj_emotes

setup_offset

Sets the offset 2 lines above.

setup_working_joe_emotes

Setup for Working joe emotes and category list, returns data for wj_emotes

shakeship

Shakes the ship around

Shakes the ship around and has the ship make sounds because of it, including warning klaxons it it's a big hit despite being in /almayer, this thing should work in any shipmap. Arguments:

should_block_game_interaction

Returns TRUE if the target is somewhere that the game should not interact with if possible In this case, admin Zs and tutorial areas

show_blurb

*Shows a ticker reading out the given text on a client's screen. targets = mob or list of mobs to show it to.

duration = how long it lingers after it finishes ticking.

message = the message to display. Due to using maptext it isn't very flexible format-wise. 11px font, up to 480 pixels per line. Use \n for line breaks. Single-character HTML tags (, , etc.) are handled correctly but others display strangely. Note that maptext can display text macros in strange ways, ex. \improper showing as "ÿ". Lines containing only spaces, including ones only containing "\improper ", don't display.

scroll_down = by default each line pushes the previous line upwards - this tells it to start high and scroll down. Ticks on \n - does not autodetect line breaks in long strings.

screen_position = screen loc for the bottom-left corner of the blurb.

text_alignment = "right", "left", or "center"

text_color = color of the text.

blurb_key = a key used for specific blurb types so they are not shown repeatedly. Ex. someone who joins as CLF repeatedly only seeing the mission blurb the first time.

ignore_key = used to skip key checks. Ex. a USCM ERT member shouldn't see the normal USCM drop message, but should see their own spawn message even if the player already dropped as USCM.*

show_blurb_uscm

Shows operation start blurb to living marines. Slightly different for squad marines, pilots, and deploying ship crew/passengers. exempt_ztraits = trait or list of traits of zlevels where any marines don't see the message, ex. marine faction survivors colonyside shouldn't see the ship marines' drop message. Ex. ZTRAIT_GROUND by default. unit = the unit the marines are from. FF, Dust Raiders etc. Military crew see this. base = the base the marines are staging from. The ship, Whiskey Outpost etc. Noncombat crew see this.

show_location_blurb

Reads out a description of game time, game date, main ship and current area. Originally for displaying roundstart messages on a conventional SS13 server.

shuffle_inplace

same as shuffle, but returns nothing and acts on list in place

sort_list

sort any value in a list

sort_list_dist

Returns a list of atoms sorted by each entry's distance to target.

stars_decode_html

Summary: proc that parses an html input string and scrambles the non-html string contents.

Arguments:

  • message - an html string value to be parsed and modified.

Return: returns the parsed and modified html output with the text content being partially scrambled with asteriks

string_list

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

string_starts_with

Check if the string haystack begins with the string needle.

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.
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

tgui_alert_async

Creates an asynchronous TGUI alert window with an associated callback.

This proc should be used to create alerts that invoke a callback with the user's chosen option. 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.
  • callback - The callback to be invoked when a choice is made.
  • 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.
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

tgui_input_checkboxes

tgui_input_checkbox

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

  • Arguments:
  • 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)
  • theme - The ui theme to use for the TGUI window (optional).
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

tgui_input_checkboxes_async

tgui_input_checkbox

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

  • Arguments:
  • 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)
  • callback - The callback to be invoked when a choice is made.
  • timeout - The timeout for the input (optional)
  • theme - The ui theme to use for the TGUI window (optional).
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

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 list input, 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 list input will close and qdel itself. Set to zero for no timeout.
  • theme - The ui theme to use for the TGUI window.
  • default - If an option is already preselected on the UI. Current values, etc.
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

tgui_input_list_async

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

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

  • user - The user to show the input box to.
  • message - The content of the input box, shown in the body of the TGUI window.
  • title - The title of the list input, 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.
  • callback - The callback to be invoked when a choice is made.
  • timeout - The timeout of the alert, after which the list_input will close and qdel itself. Set to zero for no timeout.
  • theme - The ui theme to use for the TGUI window.
  • default - If an option is already preselected on the UI. Current values, etc.
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

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.
  • integer_only - whether the inputted number is rounded down into an integer.
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

tgui_input_number_async

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

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

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.
  • callback - The callback to be invoked when a choice is made.
  • timeout - The timeout of the number input, after which the modal will close and qdel itself. Set to zero for no timeout.
  • integer_only - whether the inputted number is rounded down into an integer.
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

tgui_input_real_number

A clone of tgui_input_number that defaults to accepting negative inputs too.

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. MAX_MESSAGE_LEN is default (1024)
  • 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.
  • trim - Whether or not to trim leading and trailing whitespace from your input. Defaults to TRUE
  • ui_state - The TGUI UI state that will be returned in ui_state(). Default: always_state

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.

ui_status_only_living

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

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

updatetimedelay

Update the delay on an existing LOOPING timer Will come into effect on the next process

Arguments:

  • id a timerid or a /datum/timedevent
  • new_wait the new wait to give this looping timer

url2htmlloader

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

worldtime2text

Returns the world time in english. Do not use to get date information - starts at 0 + a random time offset from 10 minutes to 24 hours.