/tg/ Station 13 - Modules - TypesVar Details - Proc Details

machinery

Vars

is_operationalA combination of factors such as having power, not being broken and so on. Boolean.
processing_flagsViable flags to go here are START_PROCESSING_ON_INIT, or START_PROCESSING_MANUALLY. See code__DEFINES\machines.dm for more information on these flags.
subsystem_typeWhat subsystem this machine will use, which is generally SSmachines or SSfastprocess. By default all machinery use SSmachines. This fires a machine's process() roughly every 2 seconds.

Procs

assign_random_nameGenerate a name devices
begin_processingHelper proc for telling a machine to start processing with the subsystem type that is located in its subsystem_type var.
end_processingHelper proc for telling a machine to stop processing with the subsystem type that is located in its subsystem_type var.
on_set_is_operationalCalled when the value of is_operational changes, so we can react to it.
on_set_machine_statCalled when the value of machine_stat changes, so we can react to it.
power_changeCalled whenever the power settings of the containing area change
set_is_operationalCalled when we want to change the value of the is_operational variable. Boolean.
set_machine_statCalled when we want to change the value of the machine_stat variable. Holds bitflags.
try_put_in_handPuts passed object in to user's hand

Var Details

is_operational

A combination of factors such as having power, not being broken and so on. Boolean.

processing_flags

Viable flags to go here are START_PROCESSING_ON_INIT, or START_PROCESSING_MANUALLY. See code__DEFINES\machines.dm for more information on these flags.

subsystem_type

What subsystem this machine will use, which is generally SSmachines or SSfastprocess. By default all machinery use SSmachines. This fires a machine's process() roughly every 2 seconds.

Proc Details

assign_random_name

Generate a name devices

Creates a randomly generated tag or name for devices5 The length of the generated name can be set by passing in an int args:

begin_processing

Helper proc for telling a machine to start processing with the subsystem type that is located in its subsystem_type var.

end_processing

Helper proc for telling a machine to stop processing with the subsystem type that is located in its subsystem_type var.

on_set_is_operational

Called when the value of is_operational changes, so we can react to it.

on_set_machine_stat

Called when the value of machine_stat changes, so we can react to it.

power_change

Called whenever the power settings of the containing area change

by default, check equipment channel & set flag, can override if needed

Returns TRUE if the NOPOWER flag was toggled

set_is_operational

Called when we want to change the value of the is_operational variable. Boolean.

set_machine_stat

Called when we want to change the value of the machine_stat variable. Holds bitflags.

try_put_in_hand

Puts passed object in to user's hand

Puts the passed object in to the users hand if they are adjacent. If the user is not adjacent then place the object on top of the machine.

Vars: