byond - Modules - TypesVar Details - Proc Details

(global)

Vars

FailsafeFailsafe
MAX_EXPLOSION_RANGEThis was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage
MasterStonedMC
SSminimaps
SSpager_statusUpdates BYOND pager status periodically
SSstats_collectorCollects simple round statistics periodically
SStguitgui subsystem
SStimer
deployed_fultonsA list of fultons currently airborne.
fallen_list_crossThis is for dogtags placed on crosses- they will show up at the end-round memorial.
note_categoriesNote categories in text form, in order of their numerical #defines.
obfs_xA number between -500 and 500.
obfs_yA number between -500 and 500.
secret_force_modeIf this is anything but "secret", the secret rotation will forceably choose this mode.

Procs

CreateBansDEBUG
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
______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
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.
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.
debug_variableGet displayed variable in VV variable list
default_ui_stateThe sane defaults for a UI such as a computer or a machine.
delete_all_SS_and_recreate_masterDelete all existing SS to basically start over
deltimerDelete a timer
display_powerFormat a power value in W, kW, MW, or GW.
end_cooldownCallback called by a timer to end an associative-list-indexed cooldown.
flick_overlay_to_clientsAdd an image to a list of clients and calls a proc to remove it after a duration
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_bitfieldsTurns /datum/bitfield subtypes into a list for use in debugging
getFlatIconCreate a single /icon from a given /atom or /image.
get_active_player_countGet active players who are playing in the round
get_angleCalculate the angle between two movables and the west|east coordinate
get_angle_rawAngle between two arbitrary points and horizontal line same as /proc/get_angle
get_bbox_of_atomsGet a bounding box of a list of atoms.
get_lineGet a list of turfs in a line from starting_atom to ending_atom.
get_pixel_anglefor getting the angle when animating something's pixel_x and pixel_y
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
getpoisReturns a list of all items of interest with their name
give_actionGives an action to a mob and returns it
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_srcCheck if a datum has not been deleted and is a valid source
list_clear_nullsRemoves any null entries from the list Returns TRUE if the list had nulls, FALSE otherwise
load_mapShortcut function to parse a map and apply it to the world.
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_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
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.
send2chatSends a message to TGS chat channels.
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
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_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_is_conscious_and_lying_downReturns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.
ui_status_user_strictly_adjacentReturn UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
unique_listReturn a list with no duplicate entries
unique_list_in_placesame as unique_list, but returns nothing and acts on list in place (also handles associated values properly)
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 + 12 hours.

Var Details

Failsafe

Failsafe

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

MAX_EXPLOSION_RANGE

This was a define, but I changed it to a variable so it can be changed in-game.(kept the all-caps definition because... code...) -Errorage

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

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

SSstats_collector

Collects simple round statistics 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.

deployed_fultons

A list of fultons currently airborne.

fallen_list_cross

This is for dogtags placed on crosses- they will show up at the end-round memorial.

note_categories

Note categories in text form, in order of their numerical #defines.

obfs_x

A number between -500 and 500.

obfs_y

A number between -500 and 500.

secret_force_mode

If this is anything but "secret", the secret rotation will forceably choose this mode.

Proc Details

CreateBans

DEBUG

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

______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

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:

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.

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:

display_power

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

end_cooldown

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

Arguments:

This sends a signal reporting the cooldown end.

flick_overlay_to_clients

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

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_bitfields

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

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.

get_active_player_count

Get active players who are playing in the round

get_angle

Calculate the angle between two movables and the west|east coordinate

get_angle_raw

Angle between two arbitrary points and horizontal line same as /proc/get_angle

get_bbox_of_atoms

Get a bounding box of a list of atoms.

Arguments:

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

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_pixel_angle

for getting the angle when animating something's pixel_x and pixel_y

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

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

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_src

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

list_clear_nulls

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

load_map

Shortcut function to parse a map and apply it to the world.

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

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

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

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

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.

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.

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 alert to.
  • message - The content of the alert, 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.

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 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.
  • theme - The ui theme to use for the TGUI window.

tgui_input_number

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

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

Arguments:

  • user - The user to show the 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.

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.

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.

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

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 + 12 hours.