Jump to content

OutSoundForCoalition

From CMM Wiki
Revision as of 10:12, 11 November 2025 by Ozdeadmeat (talk | contribs) (outSoundForCoalition – created via PowerShell script (2025-11-11T21:12:38Z))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Return to CMM Command Reference
Environment: Mission Scripting
Function: outSoundForCoalition
Function Description: Plays a sound specific to a coalition, with support for either a single sound string or a table of sound strings. The coalition is defined by a number (0=NEUTRAL, 1=RED, 2=BLUE), defaulting to BLUE if invalid. A random sound is selected from a table or played directly if a string is provided.
File Location: cmm.soundFunctions.lua
Syntax: CMM.outSoundForCoalition( number COAL , table or string SOUND )
Return Value: nil
Parameters: Name Description
COALREQUIRED, coalition value (0 = NEUTRAL, 1 = RED, 2 = BLUE); defaults to 2 if outside valid range.
SOUNDREQUIRED, either a string path to a sound file or a table of sound file paths. If a table, a random entry is selected; if a string, the sound is played directly.
Example: CMM.outSoundForCoalition(2, "SOUNDS/CMM/XP_Banked_3.ogg") or CMM.outSoundForCoalition(2, CMM.SOUNDS.XPBanked)
Example Description: Plays a BLUE-specific sound, either a single file or a randomly selected file from a predefined list, simulating a banked event with coalition-aware audio feedback.
Related Functions:
Notes: