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:
- You can place the control panel on the same turf as an elevator. It will move up and down with the elevator
- You can place the control panel to the side of an elevator, NOT attached to the elevator. It will remain in position
- I don't recommend using both methods on the same elevator, as it might result in some jank, but it's functional.
Vars | |
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!) |
Procs | |
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_lift | 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 |
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_lift
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