Space Station 13 - Modules - Types — Proc Details

atom

Procs

DestroyTop level of the destroy chain for most atoms
GenerateTagGenerate a tag for this atom
InitializeThe primary method that objects are setup in SS13 with
LateInitializeLate Intialization, for code that should run after all atoms have run Intialization
NewCalled when an atom is created in byond (built in engine proc)
SetNameName Set Handling
get_alarm_zAssisting procs
set_densityDensity Handling
set_dirDirection Handling
set_invisibilityInvisibility Set Handling
set_opacityOpacity Handling
singuloCanEatNar-Sie Act/Pull

Proc Details

Destroy

Top level of the destroy chain for most atoms

Cleans up the following:

GenerateTag

Generate a tag for this atom

Initialize

The primary method that objects are setup in SS13 with

we don't use New as we have better control over when this is called and we can choose to delay calls or hook other logic in and so forth

During roundstart map parsing, atoms are queued for intialization in the base atom/New(), After the map has loaded, then Initalize is called on all atoms one by one. NB: this is also true for loading map templates as well, so they don't Initalize until all objects in the map file are parsed and present in the world

If you're creating an object at any point after SSInit has run then this proc will be immediately be called from New.

mapload: This parameter is true if the atom being loaded is either being intialized during the Atom subsystem intialization, or if the atom is being loaded from the map template. If the item is being created at runtime any time after the Atom subsystem is intialized then it's false.

You must always call the parent of this proc, otherwise failures will occur as the item will not be seen as initalized (this can lead to all sorts of strange behaviour, like the item being completely unclickable)

You must not sleep in this proc, or any subprocs

Any parameters from new are passed through (excluding loc), naturally if you're loading from a map there are no other arguments

Must return an initialization hint or a runtime will occur.

Note: the following functions don't call the base for optimization and must copypasta handling:

LateInitialize

Late Intialization, for code that should run after all atoms have run Intialization

To have your LateIntialize proc be called, your atoms Initalization proc must return the hint INITIALIZE_HINT_LATELOAD otherwise you will never be called.

useful for doing things like finding other machines on GLOB.machines because you can guarantee that all atoms will actually exist in the "WORLD" at this time and that all their Intialization code has been run

New

Called when an atom is created in byond (built in engine proc)

Not a lot happens here in SS13 code, as we offload most of the work to the Intialization proc, mostly we run the preloader if the preloader is being used and then call InitAtom of which the ultimate result is that the Intialize proc is called.

We also generate a tag here if the DF_USE_TAG flag is set on the atom

SetName

Name Set Handling

get_alarm_z

Assisting procs

set_density

Density Handling

set_dir

Direction Handling

set_invisibility

Invisibility Set Handling

set_opacity

Opacity Handling

singuloCanEat

Nar-Sie Act/Pull