Verse for Builders: Stop Making "The Maze of Doom"
verse-library
# INITIALIZATION: This runs ONCE when the island starts.
# Think of this as the "Pre-Game Lobby" setup.
# OnBegin is the real entry-point for creative_device subclasses.
OnBegin<override>()<suspends> : void =
# Subscribe to the game's elimination event through the experience.
# GetPlayspace() returns the current fort_playspace, which exposes
# PlayerRemovedEvent — fired whenever a player is eliminated or leaves.
# note: UEFN does not expose a single global OnElimination event;
# PlayerRemovedEvent on the playspace is the closest real equivalent
# for reacting to a player leaving active play.
Playspace := GetPlayspace()
Playspace.PlayerRemovedEvent().Subscribe(OnPlayerRemoved)
# EVENT: This is the "Elimination" listener.
# The game fires this event when a player is removed from the playspace.
OnPlayerRemoved(RemovedPlayer : player) : void =
# LOGIC: Who died? Where should they go?
# For simplicity, send every removed player to SpawnPad1 and
# trigger the flash sequence so they know they are ready to go.
# In a real game, you would track per-player state for richer logic!
# Respawn the player at SpawnPad1.
# player_spawner_device.Activate() respawns the player
# the next time that spawn pad is used; to force immediate
# teleport we move the player to the pad's transform.
# note: player does not expose Set_location directly; we use
# TeleportTo on the fort_character wrapped in a guard check.
if (FortCharacter := RemovedPlayer.GetFortCharacter[]):
PadTransform := SpawnPad1.GetTransform()
if (FortCharacter.TeleportTo[PadTransform.Translation, PadTransform.Rotation]):
false
# Make the light flash by playing the cinematic sequence!
# The sequence should be set up in the editor to flash your
# chosen light from red back to off over ~1 second.
FlashSequence.Play()