Lift
constLift:object
Defined in: server/api.d.ts:1938
Controls the game’s lifts by lift id: which floor each one is at, and whether players can use its buttons. A lift id is the lift’s baked frame hash as a “0x”-prefixed hex string; getCatalog lists every base-game lift with its id. The server decides every move: a player’s button press only asks for one, and every player sees the lift travel with the game’s own motion, doors and sounds. Lift state is kept per virtual world: a player only sees and moves the lifts of their own world.
Type Declaration
Section titled “Type Declaration”getCatalog()
Section titled “getCatalog()”getCatalog():
LiftInfo[]
Lists every lift of the base game.
Returns
Section titled “Returns”LiftInfo[]
Every catalogued lift.
getInteractionEnabled()
Section titled “getInteractionEnabled()”getInteractionEnabled(
liftId,virtualWorld?):boolean|null
Returns a lift’s button override in a virtual world.
Parameters
Section titled “Parameters”liftId
Section titled “liftId”string
Lift id, a “0x”-prefixed hex string as getCatalog lists it.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world whose lift state to use; 0 when omitted.
Returns
Section titled “Returns”boolean | null
True or false when overridden, null when the buttons are left as the game sets them up.
getState()
Section titled “getState()”getState(
liftId,virtualWorld?):LiftState
Returns the synchronized state of a lift in a virtual world. A lift the server has never moved reads as idle at the floor the game starts it at.
Parameters
Section titled “Parameters”liftId
Section titled “liftId”string
Lift id, a “0x”-prefixed hex string as getCatalog lists it.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world whose lift state to use; 0 when omitted.
Returns
Section titled “Returns”The lift’s synchronized state.
reset()
Section titled “reset()”reset(
liftId,virtualWorld?):void
Hands a lift in a virtual world back to the game: it skips back to the floor the game starts it at, its buttons go back to how the game sets them up, and the server forgets it. No liftArrive is dispatched for the trip back.
Parameters
Section titled “Parameters”liftId
Section titled “liftId”string
Lift id, a “0x”-prefixed hex string as getCatalog lists it.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world whose lift state to use; 0 when omitted.
Returns
Section titled “Returns”void
setFloor()
Section titled “setFloor()”setFloor(
liftId,floor,instant?,virtualWorld?):boolean
Sends a lift to a floor for every player in the virtual world. Players who stream the lift in later, or join mid-move, see it where the move has got to.
Parameters
Section titled “Parameters”liftId
Section titled “liftId”string
Lift id, a “0x”-prefixed hex string as getCatalog lists it.
number
Floor to send the lift to; 0 is the lowest, up to the lift’s floorCount - 1.
instant?
Section titled “instant?”boolean
True for the game’s fast travel: the cab accelerates, jumps to just short of the floor with its riders, and brakes. False or omitted to travel the whole shaft.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world whose lift state to use; 0 when omitted.
Returns
Section titled “Returns”boolean
True when the lift is on its way or already idle at that floor; false while it is still moving, or for a floor it does not have.
setInteractionEnabled()
Section titled “setInteractionEnabled()”setInteractionEnabled(
liftId,enabled,virtualWorld?):boolean
Overrides whether players in a virtual world can use a lift’s buttons. A lift whose buttons are disabled still follows setFloor.
Parameters
Section titled “Parameters”liftId
Section titled “liftId”string
Lift id, a “0x”-prefixed hex string as getCatalog lists it.
enabled
Section titled “enabled”boolean | null
True to let players use the cab button and the call buttons, false to remove their prompts, null to leave them as the game sets them up.
virtualWorld?
Section titled “virtualWorld?”number
Virtual world whose lift state to use; 0 when omitted.
Returns
Section titled “Returns”boolean
False for an unknown lift id, or when the world’s lift registry is full.
