Shiptest 13 - Modules - TypesVar Details - Proc Details

elevator_master

Vars

buttonThe button machine used by the elevator "car" to control its destination floor.
cur_indexThe index into the floor list at which the current floor datum resides. Numbers displayed to players are modified by floor_offset and fake_floors.
cur_stateThe elevator's current state. The elevator clears all pending calls / destinations through a chain of procs linked by timers: check_move() -> move_elevator() -> arrive_on_floor() -> optionally, cycle_doors() -> check_move(). Occasionally, cycle_doors() will be the entry point instead. During this chain, cur_state is ELEVATOR_BUSY. Otherwise, the elevator is in ELEVATOR_IDLE, and may be activated if a new call or destination is registered.
displayThe button machine used by the elevator "car" to display its current floor, heading direction, and to play sounds from.
door_open_timeamount of time spent on a floor after arriving but before opening doors
fake_floorsIf this variable is a positive integer, the status display and elevator buttons will act as though the first fake_floors floors exist, but are inaccessible. For example, with a floor_offset of -1 and a fake_floors of 2, the floor controls will display 2 unreachable floors at the bottom of the panel with values "0" and "1". This only affects player-facing displays: floor_list and cur_index behave exactly the same regardless of this value.
floor_idle_timeamount of time spent between opening doors and closing them
floor_listList of floor datums that the elevator may move between.
floor_move_timeamount of time spent between floors while moving
floor_offsetPlayer-facing floor numbers are offset by this value. Thus, with the default floor_offset as -1, the first floor will show as floor "0", the second as floor "1", and so on. This only affects player-facing displays: floor_list and cur_index behave exactly the same regardless of this value.
platformsThe list of elevator platforms to be moved by the elevator master. This is the part of the elevator that players and items are moved by.
seeking_dirThe direction the elevator is looking for future stops in. This enables the elevator to skip a floor with an order to go DOWN when it is heading UP. Value is either the dir UP or the dir DOWN, for simplicity.

Procs

add_floorAdds a floor to the elevator's floor list. Default behavior is to append the floor. Index passed should not exceed the floor list's current length.
add_floor_landmarksGiven an elevator landmark and list of elevator machine landmarks, creates a floor by calling add_floor and qdeletes the passed landmarks after pulling the objects they mark.
add_platformAdds an elevator platform to the list of linked platforms.
remove_floorRemoves a floor from the elevator's floor list. If the floor is equal to the elevator's current floor, fails and returns FALSE. Otherwise, the floor is removed, the current floor's number is updated if necessary, and returns TRUE. Currently unused.
remove_platformRemoves an elevator platform from the list of linked platforms.

Var Details

button

The button machine used by the elevator "car" to control its destination floor.

cur_index

The index into the floor list at which the current floor datum resides. Numbers displayed to players are modified by floor_offset and fake_floors.

cur_state

The elevator's current state. The elevator clears all pending calls / destinations through a chain of procs linked by timers: check_move() -> move_elevator() -> arrive_on_floor() -> optionally, cycle_doors() -> check_move(). Occasionally, cycle_doors() will be the entry point instead. During this chain, cur_state is ELEVATOR_BUSY. Otherwise, the elevator is in ELEVATOR_IDLE, and may be activated if a new call or destination is registered.

display

The button machine used by the elevator "car" to display its current floor, heading direction, and to play sounds from.

door_open_time

amount of time spent on a floor after arriving but before opening doors

fake_floors

If this variable is a positive integer, the status display and elevator buttons will act as though the first fake_floors floors exist, but are inaccessible. For example, with a floor_offset of -1 and a fake_floors of 2, the floor controls will display 2 unreachable floors at the bottom of the panel with values "0" and "1". This only affects player-facing displays: floor_list and cur_index behave exactly the same regardless of this value.

floor_idle_time

amount of time spent between opening doors and closing them

floor_list

List of floor datums that the elevator may move between.

floor_move_time

amount of time spent between floors while moving

floor_offset

Player-facing floor numbers are offset by this value. Thus, with the default floor_offset as -1, the first floor will show as floor "0", the second as floor "1", and so on. This only affects player-facing displays: floor_list and cur_index behave exactly the same regardless of this value.

platforms

The list of elevator platforms to be moved by the elevator master. This is the part of the elevator that players and items are moved by.

seeking_dir

The direction the elevator is looking for future stops in. This enables the elevator to skip a floor with an order to go DOWN when it is heading UP. Value is either the dir UP or the dir DOWN, for simplicity.

Proc Details

add_floor

Adds a floor to the elevator's floor list. Default behavior is to append the floor. Index passed should not exceed the floor list's current length.

add_floor_landmarks

Given an elevator landmark and list of elevator machine landmarks, creates a floor by calling add_floor and qdeletes the passed landmarks after pulling the objects they mark.

add_platform

Adds an elevator platform to the list of linked platforms.

remove_floor

Removes a floor from the elevator's floor list. If the floor is equal to the elevator's current floor, fails and returns FALSE. Otherwise, the floor is removed, the current floor's number is updated if necessary, and returns TRUE. Currently unused.

remove_platform

Removes an elevator platform from the list of linked platforms.