Space Station 13 - Modules - TypesVar Details - Proc Details

wires

Vars

assembliesAn associative list of signalers attached to the wires. The wire color is the key, and the signaler object reference is the value.
colorsAn associative list with the wire color as the key, and the wire define as the value.
cut_wiresA list of all cut wires. The same values that can go into wires will get added and removed from this list.
holderThe atom the wires belong too. For example: an airlock.
holder_typeThe holder type; used to make sure that the holder is the correct type.
labelledTRUE if the wires are labelled for every user
proper_nameThe display name for the TGUI window. For example, given the var is "APC"... When the TGUI window is opened, "wires" will be appended to it's title, and it would become "APC wires".
randomizeTRUE if the wires will be different every time a new wire datum is created.
wire_countThe total number of wires that our holder atom has.
wiresA list of all wires. For a list of valid wires defines that can go here, see code/__DEFINES/wires.dm

Procs

InteractProc called when the user attempts to interact with wires UI.
add_dudsAdds in dud wires, which do nothing when cut/pulsed.
attach_assemblyProc called when a mob tries to attach a signaler to a wire.
cutCut or mend a wire. Calls on_cut().
cut_allCuts all wires.
cut_colorCut the wire which corresponds with the passed in color.
cut_randomCuts a random wire.
detach_assemblyProc called when a mob tries to detach a signaler from a wire.
emp_pulseUse this proc if you want wires to be pulsed on EMP
get_attachedGets the signaler attached to the given wire color, if there is one.
get_statusBase proc, intended to be overwritten. Put wire information you'll see at the botton of the TGUI window here, such as "The red light is blinking".
get_wireGets the wire associated with the color passed in.
get_wire_nameGet the name of the wire passed in. If wires can't be read, may either return something scrambled or nothing at all. A null return here means that there should be no name displayed at all.
interactableBase proc, intended to be overriden. Wire datum specific checks you want to run before the TGUI is shown to the user should go here.
is_all_cutDetermines if all of the wires are cut. Returns TRUE they're all cut, FALSE otherwise.
is_attachedChecks if the given wire has a signaler on it.
is_color_cutDetermines if the wire associated with the passed in color, is cut or not. Returns TRUE if it's cut, FALSE otherwise.
is_cutDetermines if the passed in wire is cut or not. Returns TRUE if it's cut, FALSE otherwise.
is_dudDetermines if the passed in wire is a dud or not. Returns TRUE if the wire is a dud, FALSE otherwise.
is_dud_colorReturns TRUE if the wire that corresponds to the passed in color is a dud. FALSE otherwise.
on_cutProc called when any wire is cut.
on_pulseProc called when any wire is pulsed.
pulsePulses the given wire. Calls on_pulse().
pulse_assemblyProc called when an attached signaler receives a signal.
pulse_colorPulses the wire associated with the given color.
randomizeRandomly generates a new set of wires. and corresponding colors from the given pool. Assigns the information as an associative list, to colors.
repairRepairs all cut wires.
shuffle_wiresClears the colors list, and randomizes it to a new set of color-to-wire relations.
ui_hostUsers will be interacting with our holder object and not the wire datum directly, therefore we need to return the holder.

Var Details

assemblies

An associative list of signalers attached to the wires. The wire color is the key, and the signaler object reference is the value.

colors

An associative list with the wire color as the key, and the wire define as the value.

cut_wires

A list of all cut wires. The same values that can go into wires will get added and removed from this list.

holder

The atom the wires belong too. For example: an airlock.

holder_type

The holder type; used to make sure that the holder is the correct type.

labelled

TRUE if the wires are labelled for every user

proper_name

The display name for the TGUI window. For example, given the var is "APC"... When the TGUI window is opened, "wires" will be appended to it's title, and it would become "APC wires".

randomize

TRUE if the wires will be different every time a new wire datum is created.

wire_count

The total number of wires that our holder atom has.

wires

A list of all wires. For a list of valid wires defines that can go here, see code/__DEFINES/wires.dm

Proc Details

Interact

Proc called when the user attempts to interact with wires UI.

Checks if the user exists, is a mob, the wires are attached to something (holder) and makes sure interactable(user) returns TRUE. If all the checks succeed, open the TGUI interface for the user.

Arugments:

add_duds

Adds in dud wires, which do nothing when cut/pulsed.

Arguments:

attach_assembly

Proc called when a mob tries to attach a signaler to a wire.

Makes sure that S is actually a signaler and that something is not already attached to the wire. Adds the signaler to the assemblies list as a value, with the color as a the key.

Arguments:

cut

Cut or mend a wire. Calls on_cut().

Arugments:

cut_all

Cuts all wires.

cut_color

Cut the wire which corresponds with the passed in color.

Arugments:

cut_random

Cuts a random wire.

detach_assembly

Proc called when a mob tries to detach a signaler from a wire.

First checks if there is a signaler on the wire. If so, removes the signaler, and clears it from assemblies list.

Arguments:

emp_pulse

Use this proc if you want wires to be pulsed on EMP

get_attached

Gets the signaler attached to the given wire color, if there is one.

Arguments:

get_status

Base proc, intended to be overwritten. Put wire information you'll see at the botton of the TGUI window here, such as "The red light is blinking".

get_wire

Gets the wire associated with the color passed in.

Arugments:

get_wire_name

Get the name of the wire passed in. If wires can't be read, may either return something scrambled or nothing at all. A null return here means that there should be no name displayed at all.

Arguments:

interactable

Base proc, intended to be overriden. Wire datum specific checks you want to run before the TGUI is shown to the user should go here.

is_all_cut

Determines if all of the wires are cut. Returns TRUE they're all cut, FALSE otherwise.

is_attached

Checks if the given wire has a signaler on it.

Arguments:

is_color_cut

Determines if the wire associated with the passed in color, is cut or not. Returns TRUE if it's cut, FALSE otherwise.

Arugments:

is_cut

Determines if the passed in wire is cut or not. Returns TRUE if it's cut, FALSE otherwise.

Arugments:

is_dud

Determines if the passed in wire is a dud or not. Returns TRUE if the wire is a dud, FALSE otherwise.

Arugments:

is_dud_color

Returns TRUE if the wire that corresponds to the passed in color is a dud. FALSE otherwise.

Arugments:

on_cut

Proc called when any wire is cut.

Base proc, intended to be overriden. Place an behavior you want to happen when certain wires are cut, into this proc.

Arugments:

on_pulse

Proc called when any wire is pulsed.

Base proc, intended to be overriden. Place behavior you want to happen when certain wires are pulsed, into this proc.

Arugments:

pulse

Pulses the given wire. Calls on_pulse().

Arugments:

pulse_assembly

Proc called when an attached signaler receives a signal.

Searches through the assemblies list for the wire that the signaler is attached to. Pulses the wire when it's found.

Arugments:

pulse_color

Pulses the wire associated with the given color.

Arugments:

randomize

Randomly generates a new set of wires. and corresponding colors from the given pool. Assigns the information as an associative list, to colors.

In the colors list, the name of the color is the key, and the wire is the value. For example: colors["red"] = WIRE_ELECTRIFY. This will look like list("red" = WIRE_ELECTRIFY) internally.

repair

Repairs all cut wires.

shuffle_wires

Clears the colors list, and randomizes it to a new set of color-to-wire relations.

ui_host

Users will be interacting with our holder object and not the wire datum directly, therefore we need to return the holder.