Quagmire Coins
Based on game build 714014 | Last updated: 2026-03-06
Overview
This file defines prefabs for the four distinct quagmire coin variants (quagmire_coin1 through quagmire_coin4) and a supporting FX prefab (quagmire_coin_fx). Each coin is an entity with inventory physics, a banked animation state, and network synchronization. A special FX prefab plays a looping animation during interactions (e.g., when coins are picked up or used). The prefabs are constructed using MakeCoin helper function and rely on the game's event_server_data system for server-side initialization.
Usage example
-- Spawn a quagmire coin of type 3 (with FX support)
local coin3 = SpawnPrefabs("quagmire_coin3")
-- Spawn the FX entity for coin-related visual effects
local fx = SpawnPrefabs("quagmire_coin_fx")
Dependencies & tags
Components used: None identified
Components added internally (via inst.entity:AddX()): Transform, AnimState, SoundEmitter, Network
Tags: Adds quagmire_coin to coin entities; adds FX and NOCLICK to FX entity.
Properties
No public properties.
Main functions
MakeCoin(id, hasfx)
- Description: Factory function that creates and returns a
Prefabfor a specific quagmire coin variant (1–4). Configures the entity’s appearance, tags, physics, and network behavior. Whenhasfxis true, includes the FX prefab as a dependency. - Parameters:
id(number) – Coin variant identifier (1 to 4), determines which symbol variant is used.hasfx(boolean) – Whether this coin type triggers FX. If true,quagmire_coin_fxis included in prefabs.
- Returns: A
Prefabobject. - Error states: Returns
nilfor invalididvalues outside 1–4 (implementation not shown but implied by context).
fxfn()
- Description: Constructor function for the
quagmire_coin_fxprefab. Sets up a non-interactive FX entity that plays a looping animation (opal_loop) and is marked as FX and non-clickable. - Parameters: None.
- Returns: A
Prefabobject (returned viaPrefab(..., fxfn, assets)).
Events & listeners
- Listens to: None identified
- Pushes: None identified
Note: Server-side initialization is delegated to external
event_server_datacallbacks (master_postinitandmaster_postinit_fx) that are called only on the master sim. These are not defined in this file and are assumed to be part of the Quagmire event’s shared Lua context.