Vault Lobby Exit
Based on game build 714014 | Last updated: 2026-03-07
Overview
vault_lobby_exit is a prefab that serves as a terminal exit point for teleportation events—specifically for transitions from the Caves to the Vault Lobby. It functions primarily as a teleporter target and provides support for sound playback and travel state coordination. The prefab does not move or respond to gameplay logic directly; instead, it acts as a destination anchor managed externally by other systems (e.g., player stategraphs or worldgen tasks). It registers itself globally via the "ms_register_vault_lobby_exit" event and integrates with the teleporter and talker components during activation.
Usage example
local exit = SpawnPrefab("vault_lobby_exit")
exit.Transform:SetPosition(x, y, z)
-- Later, associate it as a teleport target
local entrance = SpawnPrefab("some_teleporter_prefab")
entrance.components.teleporter:Target(exit)
exit:SetExitTarget(exit) -- ensures cleanup on removal
Dependencies & tags
Components used: teleporter, talker (external, via doer.components.talker:ShutUp()), inspectable
Tags: Adds groundhole, blocker
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
scrapbook_facing | number | FACING_LEFT | Facing direction used for scrapbook UI rendering (not networked). |
StartTravelSound | function | StartTravelSound | Callback function invoked on "starttravelsound" event to trigger travel audio. |
SetExitTarget | function | SetExitTarget(inst, targetinst) | Public method to assign or clear the teleporter target and manage listener cleanup. |
Main functions
StartTravelSound(inst, doer)
- Description: Plays the travel sound and pushes a
"wormholetravel"event on thedoer. Used when initiating travel via the exit. - Parameters:
inst(Entity) — the vault lobby exit prefab instance.
doer(Entity) — the entity initiating travel (e.g., player). - Returns: Nothing.
- Error states: If
doerlacks atalkercomponent, noShutUp()call is made.
OnActivate(inst, doer)
- Description: Handler assigned to
teleporter.onActivate. Handles silence and sound playback on teleport activation. - Parameters:
inst(Entity) — the vault lobby exit prefab instance.
doer(Entity) — the entity teleporting into this exit. - Returns: Nothing.
- Error states: Sound only plays if
inst.SoundEmitterexists; no-op for non-playerdoers lackingtalker.
SetExitTarget(inst, targetinst)
- Description: Assigns
targetinstas the teleport destination and manages event listeners for cleanup when the target is removed. Sets enabled state based on validity. - Parameters:
inst(Entity) — the vault lobby exit prefab instance (implicitself).
targetinst(Entity?) — the destination teleporter, ornilto clear. - Returns: Nothing.
- Error states: If
targetinstis removed while assigned, the callback_exittarget_onremovetriggers automatically, clearing the target.
Events & listeners
- Listens to:
"starttravelsound"— invokesStartTravelSound(inst, doer).
"onremove"(on target) — invokes_exittarget_onremove, which clears the teleporter target. - Pushes:
"ms_register_vault_lobby_exit"— firesTheWorld:PushEvent("ms_register_vault_lobby_exit", inst)on server during initialization to register the exit globally.
"wormholetravel"— pushed on thedoerduring travel initiation.