Jump to content

OutSoundForCoalition: Difference between revisions

From CMM Wiki
outSoundForCoalition – created via PowerShell script (2025-11-11T21:12:38Z)
Tag: Recreated
 
m outSoundForCoalition – created via PowerShell script (2026-02-11T01:16:35Z)
Tag: Manual revert
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:FunctionInfo|fName=          outSoundForCoalition|fDescription=  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.|parentFile=    cmm.soundFunctions.lua|syntax=        CMM.outSoundForCoalition(COAL <number>, SOUND <table|string>)|return=        nil|returnDesc=    Returns nothing, plays the selected sound using trigger.action.outSoundForCoalition.|example=        CMM.outSoundForCoalition(2, "SOUNDS/CMM/XP_Banked_3.ogg") or CMM.outSoundForCoalition(2, CMM.SOUNDS.XPBanked)|exampleDesc=    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=        |note=          |envType= CMM|par1=        number COAL|reqType1=    number|reqName1=    COAL|desc1=      REQUIRED, coalition value (0 = NEUTRAL, 1 = RED, 2 = BLUE); defaults to 2 if outside valid range.|par2=        table or string SOUND|reqType2=    table or string|reqName2=    SOUND|desc2=      REQUIRED, 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.}}
{{Template:FunctionInfo|fName=          outSoundForCoalition|fDescription=  Plays a randomly selected sound from a table or a single sound string, with support for both string and table inputs. If a table is provided, a random entry is chosen; if a string is provided, that sound is played directly.|parentFile=    cmm.soundFunctions.lua|syntax=        CMM.outSoundForCoalition(SOUND <table|string>)|return=        nil|returnDesc=    Returns nothing, plays the selected sound using trigger.action.outSound.|example=        CMM.outSoundForCoalition({"SOUNDS/CMM/XP_Banked_1.ogg", "SOUNDS/CMM/XP_Banked_2.ogg"})|exampleDesc=    Plays a randomly selected sound from the provided list of sound files, simulating a banked event with varied audio feedback.|related=        |note=          |envType= CMM|par1=        table or string SOUND|reqType1=    table or string|reqName1=    SOUND|desc1=      REQUIRED, 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.}}

Latest revision as of 14:16, 10 February 2026

Return to CMM Command Reference
Environment: Mission Scripting
Function: outSoundForCoalition
Function Description: Plays a randomly selected sound from a table or a single sound string, with support for both string and table inputs. If a table is provided, a random entry is chosen; if a string is provided, that sound is played directly.
File Location: cmm.soundFunctions.lua
Syntax: CMM.outSoundForCoalition( table or string SOUND )
Return Value: nil
Parameters: Name Description
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({"SOUNDS/CMM/XP_Banked_1.ogg", "SOUNDS/CMM/XP_Banked_2.ogg"})
Example Description: Plays a randomly selected sound from the provided list of sound files, simulating a banked event with varied audio feedback.
Related Functions:
Notes: