Skip to main content

Quagmire Music

Based on game build 714014 | Last updated: 2026-03-03

Overview

QuagmireMusic is a world-level component responsible for playing background music tracks in the Quagmire arena. It activates when a player enters the arena, plays music dynamically based on the current level (via networked state), and plays a victory sound upon winning. The component handles client-server synchronization using network variables and events, ensuring consistent audio behavior across all clients.

Usage example

-- Typically added automatically to TheWorld in quagmire worlds
-- No direct manual usage required by modders
-- Example of manual usage (advanced use only):
inst:AddComponent("quagmire_music")
inst.components.quagmire_music._netvars.level:set(2)

Dependencies & tags

Components used: TheFocalPoint.SoundEmitter, TheWorld (global), event_server_data (internal server utility) Tags: None identified

Properties

PropertyTypeDefault ValueDescription
instGEntity(passed in)The entity instance the component is attached to (typically TheWorld).
_netvars.levelnet_tinybyte1Networked variable representing the current arena level; values correspond to indices in MUSIC.
_netvars.wonnet_event(unused in client code)Network event fired when the arena is won.
_activatedplayerGActivePlayernilCached reference to the player who activated the music session.
_levelplayingnumber?nilTracks the level index currently playing to prevent redundant sound restarts.

Main functions

The component has no publicly exposed methods. All functionality is encapsulated in private event handlers and initialization logic.

Events & listeners

  • Listens to:
    playeractivated (on TheWorld) — triggers activation of music playback when a player enters the arena.
    playerdeactivated (on TheWorld) — deactivates and cleans up music when the active player exits.
    leveldirty (on inst) — triggers music change if the networked level changes.
    lavaarenamusic._netvars.won (on inst) — plays the victory sound.
  • Pushes: None identified.