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

Elevator control panel

A wallmounted simple machine that controls elevators, allowing users to enter a UI to move it up or down

These can be placed in two methods:

Vars

door_reset_timeridTimerID to our door reset timer, made by emergency opening doors
last_move_targetWhat z-level did we move to last? Used for showing the user in the UI which direction we're moving.
lift_weakrefA weakref to the transport_controller datum we control
light_powerThe light mask overlay we use
linked_elevator_destinationA list of all possible destinations this elevator can travel. Assoc list of "Floor name" to "z level of destination". By default the floor names will auto-generate ("Floor 1", "Floor 2", etc).
linked_elevator_idWhat specific_transport_id do we link with?
maploadedWere we instantiated at mapload? Used to determine when we should link / throw errors
preset_destination_namesIf you want to override what each floor is named as, you can do so with this list. Make this an assoc list of "z level you want to rename" to "desired name". So, if you want the z-level 2 destination to be named "Cargo", you would do list("2" = "Cargo"). (Reminder: Z1 gets loaded as Central Command, so your map's bottom Z will be Z2!)

Procs

add_destinations_in_a_direction_recursivelyRecursively adds destinations to the list of linked_elevator_destination until it fails to find a valid stopping point in the passed direction.
check_panelCallback for move_to_zlevel to ensure the elevator can continue to move.
get_associated_liftFind the elevator associated with our lift button.
link_with_liftLink with associated transport controllers, only log failure to find a lift in LateInit because those are mapped in
populate_destinations_listGoes through and populates the linked_elevator_destination list with all possible destinations the lift can go.
reset_doorsHelper proc to go through all of our desetinations and reset all elevator doors, closing doors on z-levels the elevator is away from, and opening doors on the z the elevator is

Var Details

door_reset_timerid

TimerID to our door reset timer, made by emergency opening doors

last_move_target

What z-level did we move to last? Used for showing the user in the UI which direction we're moving.

lift_weakref

A weakref to the transport_controller datum we control

light_power

The light mask overlay we use

linked_elevator_destination

A list of all possible destinations this elevator can travel. Assoc list of "Floor name" to "z level of destination". By default the floor names will auto-generate ("Floor 1", "Floor 2", etc).

linked_elevator_id

What specific_transport_id do we link with?

maploaded

Were we instantiated at mapload? Used to determine when we should link / throw errors

preset_destination_names

If you want to override what each floor is named as, you can do so with this list. Make this an assoc list of "z level you want to rename" to "desired name". So, if you want the z-level 2 destination to be named "Cargo", you would do list("2" = "Cargo"). (Reminder: Z1 gets loaded as Central Command, so your map's bottom Z will be Z2!)

Proc Details

add_destinations_in_a_direction_recursively

Recursively adds destinations to the list of linked_elevator_destination until it fails to find a valid stopping point in the passed direction.

check_panel

Callback for move_to_zlevel to ensure the elevator can continue to move.

get_associated_lift

Find the elevator associated with our lift button.

Link with associated transport controllers, only log failure to find a lift in LateInit because those are mapped in

populate_destinations_list

Goes through and populates the linked_elevator_destination list with all possible destinations the lift can go.

reset_doors

Helper proc to go through all of our desetinations and reset all elevator doors, closing doors on z-levels the elevator is away from, and opening doors on the z the elevator is