Space Station 13 - Baystation 12 - Modules - TypesVar Details - Proc Details

(global)

Vars

FailsafeFailsafe
MasterStonedMC
SSpresenceBuilds a list of z-level populations to allow for easier pauses on processing when nobody is around to care
SStimer
access_cent_generalCentral Command
access_hangarSEV Torch
access_petrovNRV Petrov
access_securityStation access
access_syndicateAntag access
access_synthMisc
photo_countphoto
state_machinesList and procs for caching state machine instances.
z_levels< What the map edge should be formed with. (null = world.turf)

Procs

Atan2The 2-argument arctangent of x and y
BoundedCircularRandomCoordinateA circular random coordinate with radius on center_x, center_y, reflected into low_x,low_y -> high_x,high_y, clamped in low,high, and rounded if round is set
Broadcast_MessageHere is the big, bad function that broadcasts a message given the appropriate parameters.
CircularRandomCoordinateA circular random coordinate pair from 0, unit by default, scaled by radius, then rounded if round.
CircularRandomTurfPick a random turf using BoundedCircularRandomCoordinate about x,y on level z
CircularRandomTurfAroundPick a random turf using BoundedCircularRandomCoordinate around the turf of target
CreateBansDEBUG
DrandReturns a random real from an arbitrary XdY dice roll
GetAnomalySusceptibilityreturns 0..1, with 1 being no protection and 0 being fully protected
InterpolateReturns a linear interpolation from a to b according to weight. weight 0 is a, weight 1 is b, weight 0.5 is half-way between the two.
MeanReturns the mean of either a list or variadic arguments: Mean(list(1, 2, 3)) = 2 , Mean(1, 2, 3) = 2
Uptime% appears to round down floats, hence below values all being integers Real time since the server started. Same concept as REALTIMEOFDAY.
VecMagReturns the euclidian magnitude of a vector of either a list or variadic arguments: VecMag(list(3, 4)) = 5 , VecMag(3, 4) = 5
VecSquareMagReturns the euclidian square magnitude of a vector of either a list or variadic arguments: VecSquareMag(list(1, 2, 3)) = 14 , VecSquareMag(1, 2, 3) = 14
_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.
all_hearersHear Helpers
all_viewersView Helpers
callHook@file hooks.dm Implements hooks, a simple way to run code on pre-defined events.
ckey2clientGet the client associated with ckey text if it is currently connected
clients_in_rangeRange Helpers
copy_healthCopies the state of health from one atom to another.
deltimerDelete a timer
empulseGenerates an EMP pulse on the turf of the provided origin point, for the given range as a radius value. Calls emp_act() on every atom within range.
findNullRodConstruct Spells
generate_paddingBuilds a string of padding repeated until its character count meets or exceeds size
getOPressureDifferentialGets the highest and lowest pressures from the tiles in cardinal directions around us, then checks the difference.
get_base_turf_by_areaFetches the area's base_turf, if defined, or the z level's base_turf as a default.
get_compass_direction_stringReturns direction-string, rounded to multiples of 22.5, from the first parameter to the second N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW
get_default_outfit_backpackHelpers
get_fax_machines_by_departmentRetrieves a list of all fax machines matching the given department tag.
get_mannequinInitial Building
get_random_uplink_itemsSupport procs
get_wound_typeWOUND DEFINITIONS
html_pagePage matter from #30904, to be replaced by that behavior later
is_abstractPassed a path or instance, returns whether it is abstract. Otherwise null.
is_special_characterADMIN HELPER PROCS
join_urlConnects either a list or variadic arguments with "/" and cleans up multiple joins. eg: join_url("a", "b", "c") => "a/b/c" join_url(list("a", "b", "c")) => "a/b/c" join_url("https://some.tld/", "/cats", "~", "//dogs") => "https://some.tld/cats/~/dogs"
key2clientGet the client associated with key text if it is currently connected
pad_leftPads the matter of padding onto the start of text until the result length is size
pad_rightPads the matter of padding onto the start of text until the result length is size
resolve_clientNull, or a client if thing is a client, a mob with a client, a connected ckey, or null
resolve_speciesHelpers related to /datum/species Null, or a species if thing is a species, a species path, or a species name
select_clientNull or a client from the list of connected clients, chosen by actor if actor is valid
send_fax_loopHandles the loop of sending a fax to all machines matching the department tag. Returns TRUE if at least one fax machine successfully received the fax. Does not include sending faxes to admins.
set_scent_by_reagentsReagents have the following vars, which coorelate to the vars on the standard scent extension: scent, scent_intensity, scent_descriptor, scent_range To add a scent extension to an atom using a reagent's info, where R. is the reagent, use set_scent_by_reagents().
time_to_readableConverts an integer of world.time to a user-readable string split into time measurements from seconds to years.
timeleftGet the remaining deciseconds on a timer
typecache_filter_listReturns a new list with only atoms that are in typecache L
typecacheofLike typesof() or subtypesof(), but returns a typecache instead of a list
valid_ckeyDuck check to see if text looks like a ckey
valid_keyDuck check to see if text looks like a key

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

SSpresence

Builds a list of z-level populations to allow for easier pauses on processing when nobody is around to care

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.

access_cent_general

Central Command

access_hangar

SEV Torch

access_petrov

NRV Petrov

access_security

Station access

access_syndicate

Antag access

access_synth

Misc

photo_count

photo

state_machines

List and procs for caching state machine instances.

z_levels

< What the map edge should be formed with. (null = world.turf)

Proc Details

Atan2

The 2-argument arctangent of x and y

BoundedCircularRandomCoordinate

A circular random coordinate with radius on center_x, center_y, reflected into low_x,low_y -> high_x,high_y, clamped in low,high, and rounded if round is set

Generally this proc is useful for placement around a point (eg a player) that must stay within map boundaries, or some similar circle in box constraint

A "donut" pattern can be achieved by varying the number supplied as radius outside the scope of the proc, eg as BoundedCircularRandomCoordinate(Frand(1, 3), ...)

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

@param channel_tag The "name" of the frequency. Displayed in brackets before the message

@param channel_color Color of the radio message

CircularRandomCoordinate

A circular random coordinate pair from 0, unit by default, scaled by radius, then rounded if round.

CircularRandomTurf

Pick a random turf using BoundedCircularRandomCoordinate about x,y on level z

CircularRandomTurfAround

Pick a random turf using BoundedCircularRandomCoordinate around the turf of target

CreateBans

DEBUG

Drand

Returns a random real from an arbitrary XdY dice roll

GetAnomalySusceptibility

returns 0..1, with 1 being no protection and 0 being fully protected

Interpolate

Returns a linear interpolation from a to b according to weight. weight 0 is a, weight 1 is b, weight 0.5 is half-way between the two.

Mean

Returns the mean of either a list or variadic arguments: Mean(list(1, 2, 3)) = 2 , Mean(1, 2, 3) = 2

Uptime

% appears to round down floats, hence below values all being integers Real time since the server started. Same concept as REALTIMEOFDAY.

VecMag

Returns the euclidian magnitude of a vector of either a list or variadic arguments: VecMag(list(3, 4)) = 5 , VecMag(3, 4) = 5

VecSquareMag

Returns the euclidian square magnitude of a vector of either a list or variadic arguments: VecSquareMag(list(1, 2, 3)) = 14 , VecSquareMag(1, 2, 3) = 14

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

all_hearers

Hear Helpers

all_viewers

View Helpers

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.

ckey2client

Get the client associated with ckey text if it is currently connected

clients_in_range

Range Helpers

copy_health

Copies the state of health from one atom to another.

deltimer

Delete a timer

Arguments:

empulse

Generates an EMP pulse on the turf of the provided origin point, for the given range as a radius value. Calls emp_act() on every atom within range.

Parameters:

Returns FALSE if the emp failed to generate, TRUE otherwise.

findNullRod

Construct Spells

generate_padding

Builds a string of padding repeated until its character count meets or exceeds size

getOPressureDifferential

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

get_base_turf_by_area

Fetches the area's base_turf, if defined, or the z level's base_turf as a default.

get_compass_direction_string

Returns direction-string, rounded to multiples of 22.5, from the first parameter to the second N, NNE, NE, ENE, E, ESE, SE, SSE, S, SSW, SW, WSW, W, WNW, NW, NNW

get_default_outfit_backpack

Helpers

get_fax_machines_by_department

Retrieves a list of all fax machines matching the given department tag.

get_mannequin

Initial Building

Support procs

get_wound_type

WOUND DEFINITIONS

html_page

Page matter from #30904, to be replaced by that behavior later

is_abstract

Passed a path or instance, returns whether it is abstract. Otherwise null.

is_special_character

ADMIN HELPER PROCS

join_url

Connects either a list or variadic arguments with "/" and cleans up multiple joins. eg: join_url("a", "b", "c") => "a/b/c" join_url(list("a", "b", "c")) => "a/b/c" join_url("https://some.tld/", "/cats", "~", "//dogs") => "https://some.tld/cats/~/dogs"

key2client

Get the client associated with key text if it is currently connected

pad_left

Pads the matter of padding onto the start of text until the result length is size

pad_right

Pads the matter of padding onto the start of text until the result length is size

resolve_client

Null, or a client if thing is a client, a mob with a client, a connected ckey, or null

resolve_species

Helpers related to /datum/species Null, or a species if thing is a species, a species path, or a species name

select_client

Null or a client from the list of connected clients, chosen by actor if actor is valid

send_fax_loop

Handles the loop of sending a fax to all machines matching the department tag. Returns TRUE if at least one fax machine successfully received the fax. Does not include sending faxes to admins.

set_scent_by_reagents

Reagents have the following vars, which coorelate to the vars on the standard scent extension: scent, scent_intensity, scent_descriptor, scent_range To add a scent extension to an atom using a reagent's info, where R. is the reagent, use set_scent_by_reagents().

time_to_readable

Converts an integer of world.time to a user-readable string split into time measurements from seconds to years.

timeleft

Get the remaining deciseconds on a timer

Arguments:

typecache_filter_list

Returns a new list with only atoms that are in typecache L

typecacheof

Like typesof() or subtypesof(), but returns a typecache instead of a list

valid_ckey

Duck check to see if text looks like a ckey

valid_key

Duck check to see if text looks like a key