Space Station 13 - Modules - TypesVar Details - Proc Details

machinery

Machines in the world, such as computers, pipes, and airlocks.

Overview: Used to create objects that need a per step proc call. Default definition of 'Initialize()' stores a reference to src machine in global 'machines list'. Default definition of 'Destroy' removes reference to src machine in global 'machines list'.

Class Variables: use_power (num) current state of auto power use. Possible Values: NO_POWER_USE -- no auto power use IDLE_POWER_USE -- machine is using power at its idle power level ACTIVE_POWER_USE -- machine is using power at its active power level

active_power_usage (num) Value for the amount of power to use when in active power mode

idle_power_usage (num) Value for the amount of power to use when in idle power mode

power_channel (num) What channel to draw from when drawing power for power mode Possible Values: AREA_USAGE_EQUIP:1 -- Equipment Channel AREA_USAGE_LIGHT:2 -- Lighting Channel AREA_USAGE_ENVIRON:3 -- Environment Channel

component_parts (list) A list of component parts of machine used by frame based machines.

stat (bitflag) Machine status bit flags. Possible bit flags: BROKEN -- Machine is broken NOPOWER -- No power is being supplied to machine. MAINT -- machine is currently under going maintenance. EMPED -- temporary broken by EMP pulse

Class Procs: Initialize()

Destroy()

update_mode_power_usage()
	updates the static_power_usage var of this machine and makes its static power usage from its area accurate.
	called after the idle or active power usage has been changed.

update_power_channel()
	updates the static_power_usage var of this machine and makes its static power usage from its area accurate.
	called after the power_channel var has been changed or called to change the var itself.

unset_static_power()
	completely removes the current static power usage of this machine from its area.
	used in the other power updating procs to then readd the correct power usage.


 Default definition uses 'use_power', 'power_channel', 'active_power_usage',
 'idle_power_usage', 'powered()', and 'use_energy()' implement behavior.

powered(chan = -1) 'modules/power/power.dm' Checks to see if area that contains the object has power available for power channel given in 'chan'. -1 defaults to power_channel

use_energy(amount, chan=-1) 'modules/power/power.dm' Deducts 'amount' from the power channel 'chan' of the area that contains the object.

power_change() 'modules/power/power.dm' Called by the area that contains the object when ever that area under goes a power state change (area runs out of power, or area channel is turned off).

RefreshParts() 'game/machinery/machine.dm' Called to refresh the variables in the machine that are contributed to by parts contained in the component_parts list. (example: glass and material amounts for the autolathe)

 Default definition does nothing.

process() 'game/machinery/machine.dm' Called by the 'machinery subsystem' once per machinery tick for each machine that is listed in its 'machines' list.

process_atmos() Called by the 'air subsystem' once per atmos tick for each machine that is listed in its 'atmos_machines' list. Compiled by Aygar

Vars

being_repairedThis is if the machinery is being repaired
frequencyThe frequency on which the machine can communicate. Used with /datum/radio_frequency.
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.
radio_connectionA reference to a datum/radio_frequency. Gives the machine the ability to interact with things using radio signals.
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

AI_notify_hackAlerts the AI that a hack is in progress.
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.

Var Details

being_repaired

This is if the machinery is being repaired

frequency

The frequency on which the machine can communicate. Used with /datum/radio_frequency.

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.

radio_connection

A reference to a datum/radio_frequency. Gives the machine the ability to interact with things using radio signals.

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

AI_notify_hack

Alerts the AI that a hack is in progress.

Sends all AIs a message that a hack is occurring. Specifically used for space ninja tampering as this proc was originally in the ninja files. However, the proc may also be used elsewhere.

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.