Space Station 13 - Modules - Types — Var Details - Proc Details

/(global)

Vars

DebuggerStonedMC
FailsafeFailsafe
SStguitgui subsystem
SStimer
SSverb_managerSSverb_manager, a subsystem that runs every tick and runs through its entire queue without yielding like SSinput. this exists because of how the byond tick works and where user inputted verbs are put within it.
SSweather
access_cent_generalCentral Command
access_change_medbayAccess Change
access_mercenaryAntag access
access_nt_discipleNeoTheology
access_securityStation access
access_synthMisc
comet_hardcore........::::::%%%SPACE_COMET
default_abstract_uplink_iconAbstract Uplink Entries
photo_countphoto

Procs

Broadcast_MessageHere is the big, bad function that broadcasts a message given the appropriate parameters.
CreateBansDEBUG
REF\ref behaviour got changed in 512 so this is necesary to replicate old behaviour. If it ever becomes necesary to get a more performant REF(), this lies here in wait #define REF(thing) (thing && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]")
WEAKREFCreates a weakref to the given input. See /datum/weakref's documentation for more information.
______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.
_queue_verbqueue a callback for the given verb/verblike proc and any given arguments to the specified verb subsystem, so that they process in the next tick. intended to only work with verbs or verblike procs called directly from client input, use as part of TRY_QUEUE_VERB() and co.
add_verbhandles adding verbs and updating the stat panel browser
bitfield_to_listConverts a bitfield to a list of numbers (or words if a wordlist is provided)
callHook@file hooks.dm Implements hooks, a simple way to run code on pre-defined events.
callback_selectRuns a list of callbacks asyncronously, returning only when all have finished
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
find_nearby_burrowBurrow Finding and Sorting
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.)
getFlatIconCreate a single [/icon] from a given /atom or /image.
getFlatTypeIconalways_use_defdir IS DEPRICATED
getOPressureDifferentialGets the highest and lowest pressures from the tiles in cardinal directions around us, then checks the difference.
get_default_outfit_backpackHelpers
get_random_uplink_itemsSupport procs
get_wound_typeWOUND DEFINITIONS
icon2base64Converts an icon to base64. Operates by putting the icon in the iconCache savefile, exporting it as text, and then parsing the base64 from that. (This relies on byond automatically storing icons in savefiles as base64)
is_special_characterADMIN HELPER PROCS
log_mappingLogging for mapping errors
log_tguiAppends a tgui-related log entry. All arguments are optional.
makeDatumRefListsInitial Building
md5asfileSave file as an external file then md5 it. Used because md5ing files stored in the rsc sometimes gives incorrect md5 results.
md5filepathReturns the md5 of a file at a given path.
message_adminTicket
message_mentorTicket
number_of_issuesUSED BY UNIT TEST: uniqueness.dm
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
remove_verbhandles removing verb and sending it to browser to update, use this for removing verbs
rustg_get_versionGets the version of rust_g
storyteller_buttondatum/storyteller/proc/trigger_event()
strip_improperStrip out the special beyond characters for \proper and \improper from text that will be sent to the browser.
tgui_TopicMiddleware for /client/Topic.
timeleftGet the remaining deciseconds on a timer
ui_status_only_livingReturns a UI status such that the dead will be able to watch, but not interact.
ui_status_silicon_has_accessReturns a UI status such that silicons will be able to interact with whatever they would have access to if this was a machine. For example, AIs can interact if there's cameras with wireless control is enabled.
ui_status_user_has_free_handsReturns a UI status such that those without blocked hands will be able to interact, but everyone else can only watch.
ui_status_user_is_abledReturns a UI status such that users with debilitating conditions, such as being dead or not having power for silicons, will not be able to interact. Being dead will disable UI, being incapacitated will continue updating it, and anything else will make it interactive.
ui_status_user_is_adjacentReturns a UI status such that users adjacent to source will be able to interact, far away users will be able to see, and anyone farther won't see anything. Dead users will receive updates no matter what, though you likely want to add a [ui_status_only_living] check for finer observer interactions.
ui_status_user_is_advanced_tool_userReturns a UI status such that advanced tool users will be able to interact, but everyone else can only watch.
ui_status_user_is_conscious_and_lying_downReturns UI_INTERACTIVE if the user is conscious and lying down. Returns UI_UPDATE otherwise.
ui_status_user_strictly_adjacentReturn UI_INTERACTIVE if the user is strictly adjacent to the target atom, whether they can see it or not. Return UI_CLOSE otherwise.
url2htmlloaderReturn html to load a url. for use inside of browse() calls to html assets that might be loaded on a cdn.

Var Details

Debugger

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

Failsafe

Failsafe

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

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.

SSverb_manager

SSverb_manager, a subsystem that runs every tick and runs through its entire queue without yielding like SSinput. this exists because of how the byond tick works and where user inputted verbs are put within it.

see TICK_ORDER.md for more info on how the byond tick is structured.

The way the MC allots its time is via TICK_LIMIT_RUNNING, it simply subtracts the cost of SendMaps (MAPTICK_LAST_INTERNAL_TICK_USAGE) plus TICK_BYOND_RESERVE from the tick and uses up to that amount of time (minus the percentage of the tick used by the time it executes subsystems) on subsystems running cool things like atmospherics or Life or SSInput or whatever.

Without this subsystem, verbs are likely to cause overtime if the MC uses all of the time it has alloted for itself in the tick, and SendMaps uses as much as its expected to, and an expensive verb ends up executing that tick. This is because the MC is completely blind to the cost of verbs, it can't account for it at all. The only chance for verbs to not cause overtime in a tick where the MC used as much of the tick as it alloted itself and where SendMaps costed as much as it was expected to is if the verb(s) take less than TICK_BYOND_RESERVE percent of the tick, which isnt much. Not to mention if SendMaps takes more than 30% of the tick and the MC forces itself to take at least 70% of the normal tick duration which causes ticks to naturally overrun even in the absence of verbs.

With this subsystem, the MC can account for the cost of verbs and thus stop major overruns of ticks. This means that the most important subsystems like SSinput can start at the same time they were supposed to, leading to a smoother experience for the player since ticks arent riddled with minor hangs over and over again.

SSweather

                                      |WEATHER SUBSYSTEM|

///////// |SUBSYSTEM WEATHER| //////////////////// -------------------

access_cent_general

Central Command

access_change_medbay

Access Change

access_mercenary

Antag access

access_nt_disciple

NeoTheology

access_security

Station access

access_synth

Misc

comet_hardcore

........::::::%%%SPACE_COMET

Abstract Uplink Entries

photo_count

photo

Proc Details

Broadcast_Message

Here is the big, bad function that broadcasts a message given the appropriate parameters.

@param connection: The datum generated in radio.dm, stored in signal.data["connection"].

@param M: Reference to the mob/speaker, stored in signal.data["mob"]

@param vmask: Boolean value if the mob is "hiding" its identity via voice mask, stored in signal.data["vmask"]

@param vmessage: If specified, will display this as the message; such as "chimpering" for monkies if the mob is not understood. Stored in signal.data["vmessage"].

@param radio: Reference to the radio broadcasting the message, stored in signal.data["radio"]

@param message: The actual string message to display to mobs who understood mob M. Stored in signal.data["message"]

@param name: The name to display when a mob receives the message. signal.data["name"]

@param job: The name job to display for the AI when it receives the message. signal.data["job"]

@param realname: The "real" name associated with the mob. signal.data["realname"]

@param vname: If specified, will use this name when mob M is not understood. signal.data["vname"]

@param data: If specified: 1 -- Will only broadcast to intercoms 2 -- Will only broadcast to intercoms and station-bounced radios 3 -- Broadcast to syndicate frequency 4 -- AI can't track down this person. Useful for imitation broadcasts where you can't find the actual mob

@param compression: If 0, the signal is audible If nonzero, the signal may be partially inaudible or just complete gibberish.

@param level: The list of Z levels that the sending radio is broadcasting to. Having 0 in the list broadcasts on all levels

@param freq The frequency of the signal

CreateBans

DEBUG

REF

\ref behaviour got changed in 512 so this is necesary to replicate old behaviour. If it ever becomes necesary to get a more performant REF(), this lies here in wait #define REF(thing) (thing && isdatum(thing) && (thing:datum_flags & DF_USE_TAG) && thing:tag ? "[thing:tag]" : "\ref[thing]")

WEAKREF

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

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

_queue_verb

queue a callback for the given verb/verblike proc and any given arguments to the specified verb subsystem, so that they process in the next tick. intended to only work with verbs or verblike procs called directly from client input, use as part of TRY_QUEUE_VERB() and co.

returns TRUE if the queuing was successful, FALSE otherwise.

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:

bitfield_to_list

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

callHook

@file hooks.dm Implements hooks, a simple way to run code on pre-defined events.

Calls a hook, executing every piece of code that's attached to it. @param hook Identifier of the hook to call. @returns 1 if all hooked code runs successfully, 0 otherwise.

callback_select

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

Callbacks can be repeated, to call it multiple times

Arguments:

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:

find_nearby_burrow

Burrow Finding and Sorting

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

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.

getFlatTypeIcon

always_use_defdir IS DEPRICATED

getOPressureDifferential

Gets the highest and lowest pressures from the tiles in cardinal directions around us, then checks the difference.

get_default_outfit_backpack

Helpers

Support procs

get_wound_type

WOUND DEFINITIONS

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)

is_special_character

ADMIN HELPER PROCS

log_mapping

Logging for mapping errors

log_tgui

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

makeDatumRefLists

Initial Building

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_adminTicket

message_mentorTicket

number_of_issues

USED BY UNIT TEST: uniqueness.dm

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

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:

rustg_get_version

Gets the version of rust_g

storyteller_button

datum/storyteller/proc/trigger_event()

strip_improper

Strip out the special beyond characters for \proper and \improper from text that will be sent to the browser.

tgui_Topic

Middleware for /client/Topic.

return bool If TRUE, prevents propagation of the topic call.

timeleft

Get the remaining deciseconds on a timer

Arguments:

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.

url2htmlloader

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