/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 lift_master datum we control
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_lift_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").

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 lift can continue to move.
get_associated_liftFind the elevator associated with our lift button.
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 lift is away from, and opening doors on the z the lift 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 lift_master datum we control

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_lift_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").

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 lift can continue to move.

get_associated_lift

Find the elevator associated with our lift button.

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 lift is away from, and opening doors on the z the lift is