Module Radio
Core - The RADIO class is responsible for transmitting radio communications.
What are radio communications in DCS ?
- Radio transmissions consist of sound files that are broadcasted on a specific frequency (e.g. 115MHz) and modulation (e.g. AM),
- They can be subtitled for a specific duration, the power in Watts of the transmiter's antenna can be set, and the transmission can be looped.
How to supply DCS my own Sound Files ?
- Your sound files need to be encoded in .ogg or .wav,
- Your sound files should be as tiny as possible. It is suggested you encode in .ogg with low bitrate and sampling settings,
- They need to be added in .\l10n\DEFAULT\ in you .miz file (wich can be decompressed like a .zip file),
- For simplicty sake, you can let DCS' Mission Editor add the file itself, by creating a new Trigger with the action "Sound to Country", and choosing your sound file and a country you don't use in your mission.
Due to weird DCS quirks, radio communications behave differently if sent by a Unit#UNIT or a Group#GROUP or by any other Positionable#POSITIONABLE
- If the transmitter is a Unit#UNIT or a Group#GROUP, DCS will set the power of the transmission automatically,
- If the transmitter is any other Positionable#POSITIONABLE, the transmisison can't be subtitled or looped.
Note that obviously, the frequency and the modulation of the transmission are important only if the players are piloting an Advanced System Modelling enabled aircraft, like the A10C or the Mirage 2000C. They will hear the transmission if they are tuned on the right frequency and modulation (and if they are close enough - more on that below). If a FC3 airacraft is used, it will hear every communication, whatever the frequency and the modulation is set to.
Author: Hugues "Grey_Echo" Bousquet
Global(s)
| RADIO |
Type RADIO
| RADIO:Broadcast() |
Actually Broadcast the transmission |
| RADIO.ClassName | |
| RADIO.FileName |
Name of the sound file |
| RADIO.Frequency |
Frequency of the transmission in Hz |
| RADIO.Loop | |
| RADIO.Modulation |
Modulation of the transmission (either radio.modulation.AM or radio.modulation.FM) |
| RADIO:New(Positionable) |
Create a new RADIO Object. |
| RADIO:NewGenericTransmission(FileName, Frequency, Modulation, Power) |
Create a new transmission, that is to say, populate the RADIO with relevant data |
| RADIO:NewUnitTransmission(FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop) |
Create a new transmission, that is to say, populate the RADIO with relevant data |
| RADIO.Positionable |
The transmiter |
| RADIO.Power |
Power of the antenna is Watts |
| RADIO:SetFileName(FileName) |
Check validity of the filename passed and sets RADIO.FileName |
| RADIO:SetFrequency(Frequency) |
Check validity of the frequency passed and sets RADIO.Frequency |
| RADIO:SetLoop(Loop) |
Check validity of the loop passed and sets RADIO.Loop |
| RADIO:SetModulation(Modulation) |
Check validity of the frequency passed and sets RADIO.Modulation |
| RADIO:SetPower(Power) |
Check validity of the power passed and sets RADIO.Power |
| RADIO:SetSubtitle(Subtitle, SubtitleDuration) |
Check validity of the subtitle and the subtitleDuration passed and sets RADIO.subtitle and RADIO.subtitleDuration |
| RADIO:StopBroadcast() |
Stops a transmission |
| RADIO.Subtitle |
Subtitle of the transmission |
| RADIO.SubtitleDuration |
Duration of the Subtitle in seconds |
Global(s)
Type Radio
Type RADIO
1) RADIO class, extends Base#BASE
1.1) RADIO usage
There are 3 steps to a successful radio transmission.
- First, you need to **"add a #RADIO object** to your Positionable#POSITIONABLE. This is done using the Positionable#POSITIONABLE.GetRadio() function,
- Then, you will set the relevant parameters to the transmission (see below),
- When done, you can actually broadcast the transmission (i.e. play the sound) with the RADIO.Broadcast() function.
Methods to set relevant parameters for both a Unit#UNIT or a Group#GROUP or any other Positionable#POSITIONABLE
- RADIO.SetFileName() : Sets the file name of your sound file (e.g. "Noise.ogg"),
- RADIO.SetFrequency() : Sets the frequency of your transmission,
- RADIO.SetModulation() : Sets the modulation of your transmission.
Additional Methods to set relevant parameters if the transmiter is a Unit#UNIT or a Group#GROUP
- RADIO.SetLoop() : Choose if you want the transmission to be looped,
- RADIO.SetSubtitle() : Set both the subtitle and its duration,
- RADIO.NewUnitTransmission() : Shortcut to set all the relevant parameters in one method call
Additional Methods to set relevant parameters if the transmiter is any other Positionable#POSITIONABLE
- RADIO.SetPower() : Sets the power of the antenna in Watts
- RADIO.NewGenericTransmission() : Shortcut to set all the relevant parameters in one method call
What is this power thing ?
- If your transmission is sent by a Positionable#POSITIONABLE other than a Unit#UNIT or a Group#GROUP, you can set the power of the antenna,
- Otherwise, DCS sets it automatically, depending on what's available on your Unit,
- If the player gets too far from the transmiter, or if the antenna is too weak, the transmission will fade and become noisyer,
- This an automated DCS calculation you have no say on,
- For reference, a standard VOR station has a 100W antenna, a standard AA TACAN has a 120W antenna, and civilian ATC's antenna usually range between 300 and 500W,
- Note that if the transmission has a subtitle, it will be readable, regardless of the quality of the transmission.
Field(s)
- RADIO:Broadcast()
-
Actually Broadcast the transmission
Return value
#RADIO: self
Usage:
-- The Radio has to be populated with the new transmission before broadcasting. -- Please use RADIO setters or either @{Radio#RADIO.NewGenericTransmission} or @{Radio#RADIO.NewUnitTransmission} -- This class is in fact pretty smart, it determines the right DCS function to use depending on the type of POSITIONABLE -- If the POSITIONABLE is not a UNIT or a GROUP, we use the generic (but limited) trigger.action.radioTransmission() -- If the POSITIONABLE is a UNIT or a GROUP, we use the "TransmitMessage" Command -- If your POSITIONABLE is a UNIT or a GROUP, the Power is ignored. -- If your POSITIONABLE is not a UNIT or a GROUP, the Subtitle, SubtitleDuration and Loop are ignored
- #string RADIO.ClassName
- #string RADIO.FileName
-
Name of the sound file
- #number RADIO.Frequency
-
Frequency of the transmission in Hz
- #boolean RADIO.Loop
- #number RADIO.Modulation
-
Modulation of the transmission (either radio.modulation.AM or radio.modulation.FM)
- RADIO:New(Positionable)
-
Create a new RADIO Object.
This doesn't broadcast a transmission, though, use RADIO.Broadcast to actually broadcast
Parameter
-
Wrapper.Positionable#POSITIONABLE Positionable: The Positionable that will receive radio capabilities.
Return values
-
#RADIO: Radio
-
#nil: If Positionable is invalid
Usage:
-- If you want to create a RADIO, you probably should use @{Positionable#POSITIONABLE.GetRadio}() instead -
- RADIO:NewGenericTransmission(FileName, Frequency, Modulation, Power)
-
Create a new transmission, that is to say, populate the RADIO with relevant data
Parameters
-
#string FileName: -
#number Frequency: in MHz -
#number Modulation: either radio.modulation.AM or radio.modulation.FM -
#number Power: in W
Return value
#RADIO: self
Usage:
-- In this function the data is especially relevant if the broadcaster is anything but a UNIT or a GROUP, but it will work with a UNIT or a GROUP anyway -- Only the RADIO and the Filename are mandatory -
- RADIO:NewUnitTransmission(FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop)
-
Create a new transmission, that is to say, populate the RADIO with relevant data
Parameters
-
#string FileName: -
#string Subtitle: -
#number SubtitleDuration: in s -
#number Frequency: in MHz -
#number Modulation: either radio.modulation.AM or radio.modulation.FM -
#boolean Loop:
Return value
#RADIO: self
Usage:
-- In this function the data is especially relevant if the broadcaster is a UNIT or a GROUP, but it will work for any POSITIONABLE -- Only the RADIO and the Filename are mandatory -
- Positionable#POSITIONABLE RADIO.Positionable
-
The transmiter
- #number RADIO.Power
-
Power of the antenna is Watts
- RADIO:SetFileName(FileName)
-
Check validity of the filename passed and sets RADIO.FileName
Parameter
-
#string FileName: File name of the sound file (i.e. "Noise.ogg")
Return value
#RADIO: self
-
- RADIO:SetFrequency(Frequency)
-
Check validity of the frequency passed and sets RADIO.Frequency
Parameter
-
#number Frequency: in MHz (Ranges allowed for radio transmissions in DCS : 30-88 / 108-152 / 225-400MHz)
Return value
#RADIO: self
-
- RADIO:SetLoop(Loop)
-
Check validity of the loop passed and sets RADIO.Loop
Parameter
-
#boolean Loop:
Return value
#RADIO: self
Usage:
-
- RADIO:SetModulation(Modulation)
-
Check validity of the frequency passed and sets RADIO.Modulation
Parameter
-
#number Modulation: either radio.modulation.AM or radio.modulation.FM
Return value
#RADIO: self
-
- RADIO:SetPower(Power)
-
Check validity of the power passed and sets RADIO.Power
Parameter
-
#number Power: in W
Return value
#RADIO: self
-
- RADIO:SetSubtitle(Subtitle, SubtitleDuration)
-
Check validity of the subtitle and the subtitleDuration passed and sets RADIO.subtitle and RADIO.subtitleDuration
Parameters
-
#string Subtitle: -
#number SubtitleDuration: in s
Return value
#RADIO: self
Usage:
-- Both parameters are mandatory, since it wouldn't make much sense to change the Subtitle and not its duration -
- RADIO:StopBroadcast()
-
Stops a transmission
Return value
#RADIO: self
Usage:
-- Especially usefull to stop the broadcast of looped transmissions -- Only works with broadcasts from UNIT or GROUP
- #string RADIO.Subtitle
-
Subtitle of the transmission
- #number RADIO.SubtitleDuration
-
Duration of the Subtitle in seconds