Module UserSound
Core (WIP) -- Manage user sound.
Management of DCS User Sound.
Author: Sven Van de Velde (FlightControl)
Global(s)
| USERSOUND |
USERSOUND class, extends Base#BASEManagement of DCS User Sound. |
Type USERSOUND
| USERSOUND:New(UserSoundFileName) |
USERSOUND Constructor. |
| USERSOUND:SetFileName(UserSoundFileName) |
Set usersound filename. |
| USERSOUND:ToAll() |
Play the usersound to all players. |
| USERSOUND:ToCoalition(Coalition) |
Play the usersound to the given coalition. |
| USERSOUND:ToCountry(Country) |
Play the usersound to the given country. |
| USERSOUND:ToGroup(Group) |
Play the usersound to the given Group. |
| USERSOUND.UserSoundFileName |
Global(s)
- #USERSOUND USERSOUND
-
USERSOUND class, extends Base#BASE
Management of DCS User Sound.
1. USERSOUND constructor
- USERSOUND.New(): Creates a new USERSOUND object.
Type UserSound
Type USERSOUND
Field(s)
- USERSOUND:New(UserSoundFileName)
-
USERSOUND Constructor.
Parameter
-
#string UserSoundFileName: The filename of the usersound.
Return value
-
- USERSOUND:SetFileName(UserSoundFileName)
-
Set usersound filename.
Parameter
-
#string UserSoundFileName: The filename of the usersound.
Return value
#USERSOUND: The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" ) BlueVictory:SetFileName( "BlueVictoryLoud.ogg" ) -- Set the BlueVictory to change the file name to play a louder sound. -
- USERSOUND:ToAll()
-
Play the usersound to all players.
Return value
#USERSOUND: The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" ) BlueVictory:ToAll() -- Play the sound that Blue has won.
- USERSOUND:ToCoalition(Coalition)
-
Play the usersound to the given coalition.
Parameter
-
Dcs.DCScoalition#coalition Coalition: The coalition to play the usersound to.
Return value
#USERSOUND: The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" ) BlueVictory:ToCoalition( coalition.side.BLUE ) -- Play the sound that Blue has won to the blue coalition. -
- USERSOUND:ToCountry(Country)
-
Play the usersound to the given country.
Parameter
-
Dcs.DCScountry#country Country: The country to play the usersound to.
Return value
#USERSOUND: The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" ) BlueVictory:ToCountry( country.id.USA ) -- Play the sound that Blue has won to the USA country. -
- USERSOUND:ToGroup(Group)
-
Play the usersound to the given Group.
Parameter
-
Wrapper.Group#GROUP Group: The Group to play the usersound to.
Return value
#USERSOUND: The usersound instance.
Usage:
local BlueVictory = USERSOUND:New( "BlueVictory.ogg" ) local PlayerGroup = GROUP:FindByName( "PlayerGroup" ) -- Search for the active group named "PlayerGroup", that contains a human player. BlueVictory:ToGroup( PlayerGroup ) -- Play the sound that Blue has won to the player group. -