From 24a166826a02645eac8e0c21687329b96fb05e22 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Wed, 22 Mar 2017 10:17:53 +0100
Subject: [PATCH 1/8] Add RADIO:StopBroadcast()
---
Moose Development/Moose/Core/Radio.lua | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/Moose Development/Moose/Core/Radio.lua b/Moose Development/Moose/Core/Radio.lua
index 88863ad86..8bc26a11a 100644
--- a/Moose Development/Moose/Core/Radio.lua
+++ b/Moose Development/Moose/Core/Radio.lua
@@ -289,7 +289,7 @@ end
-- -- If your POSITIONABLE is not a UNIT or a GROUP, the Subtitle, SubtitleDuration and Loop are ignored
function RADIO:Broadcast()
self:F()
- -- If the POSITIONABLE is actually a Unit or a Group, use the more complicated DCS command system
+ -- If the POSITIONABLE is actually a UNIT or a GROUP, use the more complicated DCS command system
if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
self:T2("Broadcasting from a UNIT or a GROUP")
self.Positionable:GetDCSObject():getController():setCommand({
@@ -309,3 +309,22 @@ function RADIO:Broadcast()
return self
end
+--- Stops a transmission
+-- @param #RADIO self
+-- @return #RADIO self
+-- @usage
+-- -- Especially usefull to stop the broadcast of looped transmissions
+-- -- Only works with broadcasts from UNIT or GROUP
+function RADIO:StopBroadcast()
+ self:F()
+ -- If the POSITIONABLE is a UNIT or a GROUP, stop the transmission with the DCS "StopTransmission" command
+ if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
+ self.Positionable:GetDCSObject():getController():setCommand({
+ id = "StopTransmission",
+ params = {}
+ })
+ else
+ self:E("This broadcast can't be stopped. It's not looped either, so please wait for the end of the sound file playback")
+ end
+ return self
+end
\ No newline at end of file
From 4563e7e30033cba5f5de027845896b4d3941f4f6 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Wed, 22 Mar 2017 10:22:04 +0100
Subject: [PATCH 2/8] in RADIO, use the MOOSE way to setCommand()
self.Positionable:GetDCSObject():getController():setCommand() => self.Positionable:SetCommand()
---
Moose Development/Moose/Core/Radio.lua | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Moose Development/Moose/Core/Radio.lua b/Moose Development/Moose/Core/Radio.lua
index 8bc26a11a..bb4daccf8 100644
--- a/Moose Development/Moose/Core/Radio.lua
+++ b/Moose Development/Moose/Core/Radio.lua
@@ -142,7 +142,7 @@ function RADIO:SetFrequency(Frequency)
self.Frequency = Frequency * 1000000 -- Conversion in Hz
-- If the RADIO is attached to a UNIT or a GROUP, we need to send the DCS Command "SetFrequency" to change the UNIT or GROUP frequency
if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
- self.Positionable:GetDCSObject():getController():setCommand({
+ self.Positionable:SetCommand({
id = "SetFrequency",
params = {
frequency = self.Frequency,
@@ -292,7 +292,7 @@ function RADIO:Broadcast()
-- If the POSITIONABLE is actually a UNIT or a GROUP, use the more complicated DCS command system
if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
self:T2("Broadcasting from a UNIT or a GROUP")
- self.Positionable:GetDCSObject():getController():setCommand({
+ self.Positionable:SetCommand({
id = "TransmitMessage",
params = {
file = self.FileName,
@@ -319,7 +319,7 @@ function RADIO:StopBroadcast()
self:F()
-- If the POSITIONABLE is a UNIT or a GROUP, stop the transmission with the DCS "StopTransmission" command
if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
- self.Positionable:GetDCSObject():getController():setCommand({
+ self.Positionable:SetCommand({
id = "StopTransmission",
params = {}
})
From b1b07891136b20f23d271b57c235a065f42d5ed0 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Wed, 22 Mar 2017 10:40:22 +0100
Subject: [PATCH 3/8] Doc update for RADIO:StopBroadcast Fix
---
docs/Documentation/Base.html | 1 +
docs/Documentation/Cargo.html | 1 -
docs/Documentation/Client.html | 9 +-
docs/Documentation/Event.html | 99 +++++++++++++++++++++
docs/Documentation/Fsm.html | 3 +-
docs/Documentation/MOVEMENT.html | 4 +
docs/Documentation/Radio.html | 62 ++++++++-----
docs/Documentation/Scoring.html | 6 +-
docs/Documentation/Spawn.html | 15 ++--
docs/Documentation/Task_A2G_Dispatcher.html | 1 +
docs/Documentation/Zone.html | 1 +
docs/Documentation/index.html | 2 -
12 files changed, 162 insertions(+), 42 deletions(-)
diff --git a/docs/Documentation/Base.html b/docs/Documentation/Base.html
index 1a38dc885..90dbeb3ac 100644
--- a/docs/Documentation/Base.html
+++ b/docs/Documentation/Base.html
@@ -49,6 +49,7 @@
Positionable
Process_JTAC
Process_Pickup
+ Radio
Route
Scenery
ScheduleDispatcher
diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html
index e522dd17f..d0b6aea75 100644
--- a/docs/Documentation/Cargo.html
+++ b/docs/Documentation/Cargo.html
@@ -2426,7 +2426,6 @@ The UNIT carrying the package.
-
-
AI_CARGO_UNIT.CargoCarrier
diff --git a/docs/Documentation/Client.html b/docs/Documentation/Client.html
index bd0f23bb2..565f34b9b 100644
--- a/docs/Documentation/Client.html
+++ b/docs/Documentation/Client.html
@@ -210,7 +210,7 @@ If the DCS Unit object does not exist or is nil, the CLIENT methods will return
- | CLIENT:Find(ClientName, ClientBriefing, DCSUnit) |
+ CLIENT:Find(ClientName, ClientBriefing, DCSUnit, Error) |
Finds a CLIENT from the _DATABASE using the relevant DCS Unit.
|
@@ -594,7 +594,7 @@ Create a function that will be called when a player joins the slot.
-
-CLIENT:Find(ClientName, ClientBriefing, DCSUnit)
+CLIENT:Find(ClientName, ClientBriefing, DCSUnit, Error)
-
@@ -619,6 +619,11 @@ Text that describes the briefing of the mission when a Player logs into the Clie
DCSUnit :
+
+ -
+
+
Error :
+
Return value
diff --git a/docs/Documentation/Event.html b/docs/Documentation/Event.html
index 19fb2f047..da27fb360 100644
--- a/docs/Documentation/Event.html
+++ b/docs/Documentation/Event.html
@@ -601,18 +601,48 @@ YYYY-MM-DD: CLASS:NewFunction( Params ) added
EVENTDATA.Weapon |
+ |
+
+
+ | EVENTDATA.WeaponCategory |
+
+
+ |
+
+
+ | EVENTDATA.WeaponCoalition |
+
+
|
| EVENTDATA.WeaponName |
+ |
+
+
+ | EVENTDATA.WeaponPlayerName |
+
+
|
| EVENTDATA.WeaponTgtDCSUnit |
+ |
+
+
+ | EVENTDATA.WeaponTypeName |
+
+
+ |
+
+
+ | EVENTDATA.WeaponUNIT |
+
+
|
@@ -1930,6 +1960,32 @@ Note that at the beginning of each field description, there is an indication whi
+
+
+
+-
+
+
+EVENTDATA.WeaponCategory
+
+
+-
+
+
+
+
+
+
+-
+
+
+EVENTDATA.WeaponCoalition
+
+
+-
+
+
+
@@ -1943,6 +1999,19 @@ Note that at the beginning of each field description, there is an indication whi
+
+
+
+-
+
+
+EVENTDATA.WeaponPlayerName
+
+
+-
+
+
+
@@ -1956,6 +2025,36 @@ Note that at the beginning of each field description, there is an indication whi
+
+
+
+-
+
+
+EVENTDATA.WeaponTypeName
+
+
+-
+
+
+
+
+
+
+-
+
+
+
+EVENTDATA.WeaponUNIT
+
+
+-
+
+
+
+
+
Sometimes, the weapon is a player unit!
+
diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html
index 02ff1ee96..f62491c1d 100644
--- a/docs/Documentation/Fsm.html
+++ b/docs/Documentation/Fsm.html
@@ -1555,7 +1555,7 @@ A string defining the start state.
-
-
+ #string
FSM._StartState
@@ -1854,7 +1854,6 @@ A string defining the start state.
-
-
FSM.current
diff --git a/docs/Documentation/MOVEMENT.html b/docs/Documentation/MOVEMENT.html
index 2ec03bdbd..53e309a7e 100644
--- a/docs/Documentation/MOVEMENT.html
+++ b/docs/Documentation/MOVEMENT.html
@@ -191,6 +191,7 @@ on defined intervals (currently every minute).
-
+ #number
MOVEMENT.AliveUnits
@@ -199,6 +200,9 @@ on defined intervals (currently every minute).
+
+
Contains the counter how many units are currently alive
+
diff --git a/docs/Documentation/Radio.html b/docs/Documentation/Radio.html
index 1046d3a15..3b47dc1f1 100644
--- a/docs/Documentation/Radio.html
+++ b/docs/Documentation/Radio.html
@@ -39,11 +39,11 @@
- Fsm
- Group
- Identifiable
- - MOVEMENT
- Menu
- Message
- MissileTrainer
- Mission
+ - Movement
- Object
- Point
- Positionable
@@ -62,8 +62,8 @@
- Static
- Task
- Task_A2G
+ - Task_A2G_Dispatcher
- Task_PICKUP
- - Task_SEAD
- Unit
- Utils
- Zone
@@ -167,13 +167,13 @@ If a FC3 airacraft is used, it will hear every communication, whatever t
- | RADIO:NewGenericTransmission(Filename, Frequency, Modulation, Power, ...) |
+ 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, ...) |
+ RADIO:NewUnitTransmission(FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop) |
Create a new transmission, that is to say, populate the RADIO with relevant data
|
@@ -221,9 +221,15 @@ If a FC3 airacraft is used, it will hear every communication, whatever t
- | RADIO:SetSubtitle(SubTitle, SubTitleDuration) |
+ 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
|
@@ -453,7 +459,7 @@ If Positionable is invalid
-
-RADIO:NewGenericTransmission(Filename, Frequency, Modulation, Power, ...)
+RADIO:NewGenericTransmission(FileName, Frequency, Modulation, Power)
-
@@ -464,7 +470,7 @@ If Positionable is invalid
-
-
#string Filename :
+#string FileName :
-
@@ -484,11 +490,6 @@ either radio.modulation.AM or radio.modulation.FM
#number Power :
in W
-
- -
-
-
... :
-
Return value
@@ -507,7 +508,7 @@ but it will work with a UNIT or a GROUP anyway
-
-RADIO:NewUnitTransmission(Filename, Subtitle, SubtitleDuration, Frequency, Modulation, Loop, ...)
+RADIO:NewUnitTransmission(FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop)
-
@@ -518,7 +519,7 @@ but it will work with a UNIT or a GROUP anyway
-
-
#string Filename :
+#string FileName :
-
@@ -548,11 +549,6 @@ either radio.modulation.AM or radio.modulation.FM
#boolean Loop :
-
- -
-
-
... :
-
Return value
@@ -736,7 +732,7 @@ self
-
-RADIO:SetSubtitle(SubTitle, SubTitleDuration)
+RADIO:SetSubtitle(Subtitle, SubtitleDuration)
-
@@ -747,12 +743,12 @@ self
-- 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
+
diff --git a/docs/Documentation/Scoring.html b/docs/Documentation/Scoring.html
index 38fdb4cc8..0d635d4ef 100644
--- a/docs/Documentation/Scoring.html
+++ b/docs/Documentation/Scoring.html
@@ -80,8 +80,6 @@ and create a CSV file logging the scoring events for use at team or squadron web
-
-
The #SCORING class administers the scoring of player achievements,
and creates a CSV file logging the scoring events and results for use at team or squadron websites.
@@ -136,6 +134,8 @@ These CSV files can be used to:
Use the radio menu F10 to consult the scores while running the mission.
Scores can be reported for your user, or an overall score can be reported of all players currently active in the mission.
+
+
1.1) Set the destroy score or penalty scale
Score scales can be set for scores granted when enemies or friendlies are destroyed.
@@ -169,8 +169,6 @@ For example, this can be done as follows:
Scoring:RemoveUnitScore( UNIT:FindByName( "Unit #001" ) )
-
-
1.3) Define destruction zones that will give extra scores.
Define zones of destruction. Any object destroyed within the zone of the given category will give extra points.
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index 5a1b23f25..f90276a23 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -1871,6 +1871,9 @@ The group that was spawned. You can use this group for further actions.
+
+ Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.
+
@@ -2324,9 +2327,6 @@ when nothing was spawned.
-
- Overwrite unit names by default with group name.
-
@@ -2341,9 +2341,6 @@ when nothing was spawned.
-
- By default, no InitLimit
-
@@ -2379,7 +2376,7 @@ when nothing was spawned.
-
- #number
+
SPAWN.SpawnMaxGroups
@@ -2396,7 +2393,7 @@ when nothing was spawned.
-
- #number
+
SPAWN.SpawnMaxUnitsAlive
@@ -2714,7 +2711,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
- #boolean
+
SPAWN.SpawnUnControlled
diff --git a/docs/Documentation/Task_A2G_Dispatcher.html b/docs/Documentation/Task_A2G_Dispatcher.html
index f9d59507a..96bc84a59 100644
--- a/docs/Documentation/Task_A2G_Dispatcher.html
+++ b/docs/Documentation/Task_A2G_Dispatcher.html
@@ -49,6 +49,7 @@
- Positionable
- Process_JTAC
- Process_Pickup
+ - Radio
- Route
- Scenery
- ScheduleDispatcher
diff --git a/docs/Documentation/Zone.html b/docs/Documentation/Zone.html
index 7931424c8..5a14b0488 100644
--- a/docs/Documentation/Zone.html
+++ b/docs/Documentation/Zone.html
@@ -49,6 +49,7 @@
- Positionable
- Process_JTAC
- Process_Pickup
+ - Radio
- Route
- Scenery
- ScheduleDispatcher
diff --git a/docs/Documentation/index.html b/docs/Documentation/index.html
index 07f2692db..7af2f212e 100644
--- a/docs/Documentation/index.html
+++ b/docs/Documentation/index.html
@@ -353,8 +353,6 @@ and create a CSV file logging the scoring events for use at team or squadron web
-
-
The #SCORING class administers the scoring of player achievements,
and creates a CSV file logging the scoring events and results for use at team or squadron websites.
From ea3ca25c2327a3d340b319e66945f0432d111ad9 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Wed, 22 Mar 2017 18:05:38 +0100
Subject: [PATCH 4/8] Update RAD-002 to use SCHEDULER properly
---
...RAD-002 - Transmission Tips and Tricks.lua | 12 ++++++------
...RAD-002 - Transmission Tips and Tricks.miz | Bin 271722 -> 271895 bytes
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua b/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua
index 600036db5..0d7a473f1 100644
--- a/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua
+++ b/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.lua
@@ -50,7 +50,7 @@ BatumiRadio:Broadcast()
-- Now, if Viktor answered imedately, the two radio broadcasts would overlap. We need to delay Viktor's answer.
------------------------------------------------------------------------------------------------------------------------------------------------------
-SCHEDULER:New( nil,
+CommunitcationScheduler = SCHEDULER:New( nil,
function()
ViktorRadio:SetFileName("Viktor - Enter left base ack.ogg"):SetFrequency(115):SetModulation(radio.modulation.AM):Broadcast() -- We don't specify a subtitle since we don't want one
end, {}, 10 -- 10s delay
@@ -58,7 +58,7 @@ SCHEDULER:New( nil,
-- Viktor takes 145s to be 5km final, and need to contact Batumi Tower.
------------------------------------------------------------------------------------------------------------------------------------------------------
-SCHEDULER:New( nil,
+CommunitcationScheduler:Schedule( nil,
function()
ViktorRadio:SetFileName("Viktor - Request landing clearance.ogg"):Broadcast() --We only specify the new file name, since frequency and modulation didn't change
end, {}, 145
@@ -66,25 +66,25 @@ SCHEDULER:New( nil,
-- Now that you understand everything about the RADIO class, the rest is pretty trivial
-------------------------------------------------------------------------------------------------------------------------------------------------------
-SCHEDULER:New( nil,
+CommunitcationScheduler:Schedule( nil,
function()
BatumiRadio:SetFileName("Batumi Tower - Clear to land.ogg"):Broadcast()
end, {}, 154
)
-SCHEDULER:New( nil,
+CommunitcationScheduler:Schedule( nil,
function()
ViktorRadio:SetFileName("Viktor - Clear to land ack.ogg"):Broadcast()
end, {}, 160
)
-SCHEDULER:New( nil,
+CommunitcationScheduler:Schedule( nil,
function()
ViktorRadio:SetFileName("Viktor - Touchdown.ogg"):Broadcast()
end, {}, 210
)
-SCHEDULER:New( nil,
+CommunitcationScheduler:Schedule( nil,
function()
BatumiRadio:SetFileName("Batumi Tower - Taxi to parking.ogg"):Broadcast()
end, {}, 215
diff --git a/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz b/Moose Test Missions/RAD - Radio/RAD-002 - Transmission Tips and Tricks/RAD-002 - Transmission Tips and Tricks.miz
index de1730acd43bc834524d9bb0249e30a7c47a8b16..5ae7b0a412196575aa871552c53c0dbf35ce7a72 100644
GIT binary patch
delta 6004
zcmV-)7mMiX$`F^#5Pwih0|XQR0ssgA001BW+Ly%UtPcPHK%f8s2LJ#7ZE16JX>V@r
z9bJ=~w)TC01;c$wW}F>MfWdR851UQWW|}ma?54e)wBwOMwwcA?3fR=?^uJ#aU}GUb
z2-ev)EB0KxA@O!0ZcADEr%Dx(IP>|cNX@O`9u-J5dsQRb~fxa
zTkADj?={=#HGg~7Yc^kwdM{nGC`@IWS-@qg_Lr;Jw-d16`L0)9?eB^5?3sdnM+sJC
zJ1E%(zQ=x4YZ?rIVsL4`9fwh{6`WrTF3nFdZ#2w|S?=nTU_0;~mr|1qc=A+*YT1V*R5%wZ-w|Ie85hhQ-Q{`zr$IC=ibm=BSB#L*PRO&E?(X19&B~~>k7-&{7
zP*t!JgB#$&X1K5huGR)uYlf={8N?|^nE}~WoA0|0iZFlQ{S_lZ-@qvVlhTV9XiuM?
zJbWAY(SL?Mo=td*X6xjOZqc9VzWLh8;G2{DIl*D%BDnU-a=Otz=&o;(YrtV
zEMhcgCy(vD?RBt|&`K
zlX~xl?$Y(#C<}?9!47b+9~N)T`j|a9%@Z@|x*L*etVfE&h%hMyP<0+El
z${@?)@PgP0yKo6kr%i0Ayj-F%!%wSDbaw>XyU4HbpVfjKOP;$tC}82EH_3xspMTYB
z6x%3_L$yd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ne8ZA_PPM1eaAJ1VsTSmzyF4
zHvzzx(;@^k0}L7fmvAKn7n4F76_++61S$a#mti9WKpVjbmt)Zd005&B001`t00000
z0003100000xR<;m1Y`r=BLSCiB?K3jza#+{mo_5=5SPT80T2rS00001000000120T
zBm_eOww#y2Bm`RmuW^@eB?K6kka7YIm!u^G5SLRW1R4QRmu@8lU;#gu&m{yx1_L1k
G0002{ejP~w
From cd267b1ed52605c64233cac1cdd35438472c678c Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Wed, 22 Mar 2017 21:28:57 +0100
Subject: [PATCH 5/8] Cleaned conditions with nil in RADIO
---
Moose Development/Moose/Core/Radio.lua | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Moose Development/Moose/Core/Radio.lua b/Moose Development/Moose/Core/Radio.lua
index bb4daccf8..38735de28 100644
--- a/Moose Development/Moose/Core/Radio.lua
+++ b/Moose Development/Moose/Core/Radio.lua
@@ -100,7 +100,7 @@ function RADIO:New(Positionable)
self:F(Positionable)
- if Positionable:GetPointVec2() ~= nil then -- It's stupid, but the only way I found to make sure positionable is valid
+ if Positionable:GetPointVec2() then -- It's stupid, but the only way I found to make sure positionable is valid
self.Positionable = Positionable
return self
end
@@ -117,8 +117,8 @@ function RADIO:SetFileName(FileName)
self:F2(FileName)
if type(FileName) == "string" then
- if FileName:find(".ogg") ~= nil or FileName:find(".wav") ~= nil then
- if FileName:find("l10n/DEFAULT/") == nil then
+ if FileName:find(".ogg") or FileName:find(".wav") then
+ if not FileName:find("l10n/DEFAULT/") then
FileName = "l10n/DEFAULT/" .. FileName
end
self.FileName = FileName
From f42a02e1f4175817632e05f9aa3c66bd76153d27 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Wed, 22 Mar 2017 21:41:08 +0100
Subject: [PATCH 6/8] Generate Static Moose.lua
---
.../Moose Mission Update/l10n/DEFAULT/Moose.lua | 15 ++++++++++-----
Moose Mission Setup/Moose.lua | 15 ++++++++++-----
2 files changed, 20 insertions(+), 10 deletions(-)
diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
index 9585e6212..961d42423 100644
--- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
+++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20170321_1213' )
+env.info( 'Moose Generation Timestamp: 20170322_2138' )
local base = _G
Include = {}
@@ -13424,10 +13424,14 @@ function POSITIONABLE:Message( Message, Duration, Name )
return nil
end
-
-
-
-
+--- Create a @{Radio#RADIO}, to allow radio transmission for this POSITIONABLE.
+-- Set parameters with the methods provided, then use RADIO:Broadcast() to actually broadcast the message
+-- @param #POSITIONABLE self
+-- @return #RADIO Radio
+function POSITIONABLE:GetRadio()
+ self:F2(self)
+ return RADIO:New(self)
+end
--- This module contains the CONTROLLABLE class.
--
-- 1) @{Controllable#CONTROLLABLE} class, extends @{Positionable#POSITIONABLE}
@@ -35349,6 +35353,7 @@ Include.File( "Core/Set" )
Include.File( "Core/Point" )
Include.File( "Core/Message" )
Include.File( "Core/Fsm" )
+Include.File( "Core/Radio" )
--- Wrapper Classes
Include.File( "Wrapper/Object" )
diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua
index 9585e6212..961d42423 100644
--- a/Moose Mission Setup/Moose.lua
+++ b/Moose Mission Setup/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20170321_1213' )
+env.info( 'Moose Generation Timestamp: 20170322_2138' )
local base = _G
Include = {}
@@ -13424,10 +13424,14 @@ function POSITIONABLE:Message( Message, Duration, Name )
return nil
end
-
-
-
-
+--- Create a @{Radio#RADIO}, to allow radio transmission for this POSITIONABLE.
+-- Set parameters with the methods provided, then use RADIO:Broadcast() to actually broadcast the message
+-- @param #POSITIONABLE self
+-- @return #RADIO Radio
+function POSITIONABLE:GetRadio()
+ self:F2(self)
+ return RADIO:New(self)
+end
--- This module contains the CONTROLLABLE class.
--
-- 1) @{Controllable#CONTROLLABLE} class, extends @{Positionable#POSITIONABLE}
@@ -35349,6 +35353,7 @@ Include.File( "Core/Set" )
Include.File( "Core/Point" )
Include.File( "Core/Message" )
Include.File( "Core/Fsm" )
+Include.File( "Core/Radio" )
--- Wrapper Classes
Include.File( "Wrapper/Object" )
From 24d7ed16b3efdeb9b4e03083a9f63772f32f2df5 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Wed, 22 Mar 2017 21:50:02 +0100
Subject: [PATCH 7/8] Generated Static Moose.lua (for real this time !)
---
.../l10n/DEFAULT/Moose.lua | 333 +++++++++++++++++-
Moose Mission Setup/Moose.lua | 333 +++++++++++++++++-
Moose Mission Setup/Moose_Create.bat | 1 +
3 files changed, 663 insertions(+), 4 deletions(-)
diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
index 961d42423..c617f3129 100644
--- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
+++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20170322_2138' )
+env.info( 'Moose Generation Timestamp: 20170322_2149' )
local base = _G
Include = {}
@@ -12679,7 +12679,336 @@ do -- FSM_SET
end -- FSM_SET
---- This module contains the OBJECT class.
+--- **Core** - The RADIO class is responsible for **transmitting radio communications**.
+--
+-- --- bitmap
+--
+-- ===
+--
+-- 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.
+--
+-- ===
+--
+-- ### Authors: Hugues "Grey_Echo" Bousquet
+--
+-- @module 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 @{Positionable#POSITIONABLE.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 @{Wrapper.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.
+--
+-- @type RADIO
+-- @field Wrapper.Positionable#POSITIONABLE Positionable The transmiter
+-- @field #string FileName Name of the sound file
+-- @field #number Frequency Frequency of the transmission in Hz
+-- @field #number Modulation Modulation of the transmission (either radio.modulation.AM or radio.modulation.FM)
+-- @field #string Subtitle Subtitle of the transmission
+-- @field #number SubtitleDuration Duration of the Subtitle in seconds
+-- @field #number Power Power of the antenna is Watts
+-- @field #boolean Loop
+-- @extends Core.Base#BASE
+RADIO = {
+ ClassName = "RADIO",
+ FileName = "",
+ Frequency = 0,
+ Modulation = radio.modulation.AM,
+ Subtitle = "",
+ SubtitleDuration = 0,
+ Power = 100,
+ Loop = 0,
+}
+
+--- Create a new RADIO Object. This doesn't broadcast a transmission, though, use @{#RADIO.Broadcast} to actually broadcast
+-- @param #RADIO self
+-- @param Wrapper.Positionable#POSITIONABLE Positionable The @{Positionable} that will receive radio capabilities.
+-- @return #RADIO Radio
+-- @return #nil If Positionable is invalid
+-- @usage
+-- -- If you want to create a RADIO, you probably should use @{Positionable#POSITIONABLE.GetRadio}() instead
+function RADIO:New(Positionable)
+ local self = BASE:Inherit( self, BASE:New() ) -- Core.Radio#RADIO
+
+ self:F(Positionable)
+
+ if Positionable:GetPointVec2() then -- It's stupid, but the only way I found to make sure positionable is valid
+ self.Positionable = Positionable
+ return self
+ end
+
+ self:E({"The passed positionable is invalid, no RADIO created", Positionable})
+ return nil
+end
+
+--- Check validity of the filename passed and sets RADIO.FileName
+-- @param #RADIO self
+-- @param #string FileName File name of the sound file (i.e. "Noise.ogg")
+-- @return #RADIO self
+function RADIO:SetFileName(FileName)
+ self:F2(FileName)
+
+ if type(FileName) == "string" then
+ if FileName:find(".ogg") or FileName:find(".wav") then
+ if not FileName:find("l10n/DEFAULT/") then
+ FileName = "l10n/DEFAULT/" .. FileName
+ end
+ self.FileName = FileName
+ return self
+ end
+ end
+
+ self:E({"File name invalid. Maybe something wrong with the extension ?", self.FileName})
+ return self
+end
+
+--- Check validity of the frequency passed and sets RADIO.Frequency
+-- @param #RADIO self
+-- @param #number Frequency in MHz (Ranges allowed for radio transmissions in DCS : 30-88 / 108-152 / 225-400MHz)
+-- @return #RADIO self
+function RADIO:SetFrequency(Frequency)
+ self:F2(Frequency)
+ if type(Frequency) == "number" then
+ -- If frequency is in range
+ if (Frequency >= 30 and Frequency < 88) or (Frequency >= 108 and Frequency < 152) or (Frequency >= 225 and Frequency < 400) then
+ self.Frequency = Frequency * 1000000 -- Conversion in Hz
+ -- If the RADIO is attached to a UNIT or a GROUP, we need to send the DCS Command "SetFrequency" to change the UNIT or GROUP frequency
+ if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
+ self.Positionable:SetCommand({
+ id = "SetFrequency",
+ params = {
+ frequency = self.Frequency,
+ modulation = self.Modulation,
+ }
+ })
+ end
+ return self
+ end
+ end
+ self:E({"Frequency is outside of DCS Frequency ranges (30-80, 108-152, 225-400). Frequency unchanged.", self.Frequency})
+ return self
+end
+
+--- Check validity of the frequency passed and sets RADIO.Modulation
+-- @param #RADIO self
+-- @param #number Modulation either radio.modulation.AM or radio.modulation.FM
+-- @return #RADIO self
+function RADIO:SetModulation(Modulation)
+ self:F2(Modulation)
+ if type(Modulation) == "number" then
+ if Modulation == radio.modulation.AM or Modulation == radio.modulation.FM then --TODO Maybe make this future proof if ED decides to add an other modulation ?
+ self.Modulation = Modulation
+ return self
+ end
+ end
+ self:E({"Modulation is invalid. Use DCS's enum radio.modulation. Modulation unchanged.", self.Modulation})
+ return self
+end
+
+--- Check validity of the power passed and sets RADIO.Power
+-- @param #RADIO self
+-- @param #number Power in W
+-- @return #RADIO self
+function RADIO:SetPower(Power)
+ self:F2(Power)
+ if type(Power) == "number" then
+ self.Power = math.floor(math.abs(Power)) --TODO Find what is the maximum power allowed by DCS and limit power to that
+ return self
+ end
+ self:E({"Power is invalid. Power unchanged.", self.Power})
+ return self
+end
+
+--- Check validity of the loop passed and sets RADIO.Loop
+-- @param #RADIO self
+-- @param #boolean Loop
+-- @return #RADIO self
+-- @usage
+function RADIO:SetLoop(Loop)
+ self:F2(Loop)
+ if type(Loop) == "boolean" then
+ self.Loop = Loop
+ return self
+ end
+ self:E({"Loop is invalid. Loop unchanged.", self.Loop})
+ return self
+end
+
+--- Check validity of the subtitle and the subtitleDuration passed and sets RADIO.subtitle and RADIO.subtitleDuration
+-- @param #RADIO self
+-- @param #string Subtitle
+-- @param #number SubtitleDuration in s
+-- @return #RADIO self
+-- @usage
+-- -- Both parameters are mandatory, since it wouldn't make much sense to change the Subtitle and not its duration
+function RADIO:SetSubtitle(Subtitle, SubtitleDuration)
+ self:F2({Subtitle, SubtitleDuration})
+ if type(Subtitle) == "string" then
+ self.Subtitle = Subtitle
+ else
+ self.Subtitle = ""
+ self:E({"Subtitle is invalid. Subtitle reset.", self.Subtitle})
+ end
+ if type(SubtitleDuration) == "number" then
+ if math.floor(math.abs(SubtitleDuration)) == SubtitleDuration then
+ self.SubtitleDuration = SubtitleDuration
+ return self
+ end
+ end
+ self.SubtitleDuration = 0
+ self:E({"SubtitleDuration is invalid. SubtitleDuration reset.", self.SubtitleDuration})
+end
+
+--- Create a new transmission, that is to say, populate the RADIO with relevant data
+-- @param #RADIO self
+-- @param #string FileName
+-- @param #number Frequency in MHz
+-- @param #number Modulation either radio.modulation.AM or radio.modulation.FM
+-- @param #number Power in W
+-- @return #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
+function RADIO:NewGenericTransmission(FileName, Frequency, Modulation, Power)
+ self:F({FileName, Frequency, Modulation, Power})
+
+ self:SetFileName(FileName)
+ if Frequency then self:SetFrequency(Frequency) end
+ if Modulation then self:SetModulation(Modulation) end
+ if Power then self:SetPower(Power) end
+
+ return self
+end
+
+
+--- Create a new transmission, that is to say, populate the RADIO with relevant data
+-- @param #RADIO self
+-- @param #string FileName
+-- @param #string Subtitle
+-- @param #number SubtitleDuration in s
+-- @param #number Frequency in MHz
+-- @param #number Modulation either radio.modulation.AM or radio.modulation.FM
+-- @param #boolean Loop
+-- @return #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
+function RADIO:NewUnitTransmission(FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop)
+ self:F({FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop})
+
+ self:SetFileName(FileName)
+ if Subtitle then self:SetSubtitle(Subtitle) end
+ if SubtitleDuration then self:SetSubtitleDuration(SubtitleDuration) end
+ if Frequency then self:SetFrequency(Frequency) end
+ if Modulation then self:SetModulation(Modulation) end
+ if Loop then self:SetLoop(Loop) end
+
+ return self
+end
+
+--- Actually Broadcast the transmission
+-- @param #RADIO self
+-- @return #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
+function RADIO:Broadcast()
+ self:F()
+ -- If the POSITIONABLE is actually a UNIT or a GROUP, use the more complicated DCS command system
+ if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
+ self:T2("Broadcasting from a UNIT or a GROUP")
+ self.Positionable:SetCommand({
+ id = "TransmitMessage",
+ params = {
+ file = self.FileName,
+ duration = self.SubtitleDuration,
+ subtitle = self.Subtitle,
+ loop = self.Loop,
+ }
+ })
+ else
+ -- If the POSITIONABLE is anything else, we revert to the general singleton function
+ self:T2("Broadcasting from a POSITIONABLE")
+ trigger.action.radioTransmission(self.FileName, self.Positionable:GetPositionVec3(), self.Modulation, false, self.Frequency, self.Power)
+ end
+ return self
+end
+
+--- Stops a transmission
+-- @param #RADIO self
+-- @return #RADIO self
+-- @usage
+-- -- Especially usefull to stop the broadcast of looped transmissions
+-- -- Only works with broadcasts from UNIT or GROUP
+function RADIO:StopBroadcast()
+ self:F()
+ -- If the POSITIONABLE is a UNIT or a GROUP, stop the transmission with the DCS "StopTransmission" command
+ if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
+ self.Positionable:SetCommand({
+ id = "StopTransmission",
+ params = {}
+ })
+ else
+ self:E("This broadcast can't be stopped. It's not looped either, so please wait for the end of the sound file playback")
+ end
+ return self
+end--- This module contains the OBJECT class.
--
-- 1) @{Object#OBJECT} class, extends @{Base#BASE}
-- ===========================================================
diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua
index 961d42423..c617f3129 100644
--- a/Moose Mission Setup/Moose.lua
+++ b/Moose Mission Setup/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20170322_2138' )
+env.info( 'Moose Generation Timestamp: 20170322_2149' )
local base = _G
Include = {}
@@ -12679,7 +12679,336 @@ do -- FSM_SET
end -- FSM_SET
---- This module contains the OBJECT class.
+--- **Core** - The RADIO class is responsible for **transmitting radio communications**.
+--
+-- --- bitmap
+--
+-- ===
+--
+-- 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.
+--
+-- ===
+--
+-- ### Authors: Hugues "Grey_Echo" Bousquet
+--
+-- @module 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 @{Positionable#POSITIONABLE.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 @{Wrapper.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.
+--
+-- @type RADIO
+-- @field Wrapper.Positionable#POSITIONABLE Positionable The transmiter
+-- @field #string FileName Name of the sound file
+-- @field #number Frequency Frequency of the transmission in Hz
+-- @field #number Modulation Modulation of the transmission (either radio.modulation.AM or radio.modulation.FM)
+-- @field #string Subtitle Subtitle of the transmission
+-- @field #number SubtitleDuration Duration of the Subtitle in seconds
+-- @field #number Power Power of the antenna is Watts
+-- @field #boolean Loop
+-- @extends Core.Base#BASE
+RADIO = {
+ ClassName = "RADIO",
+ FileName = "",
+ Frequency = 0,
+ Modulation = radio.modulation.AM,
+ Subtitle = "",
+ SubtitleDuration = 0,
+ Power = 100,
+ Loop = 0,
+}
+
+--- Create a new RADIO Object. This doesn't broadcast a transmission, though, use @{#RADIO.Broadcast} to actually broadcast
+-- @param #RADIO self
+-- @param Wrapper.Positionable#POSITIONABLE Positionable The @{Positionable} that will receive radio capabilities.
+-- @return #RADIO Radio
+-- @return #nil If Positionable is invalid
+-- @usage
+-- -- If you want to create a RADIO, you probably should use @{Positionable#POSITIONABLE.GetRadio}() instead
+function RADIO:New(Positionable)
+ local self = BASE:Inherit( self, BASE:New() ) -- Core.Radio#RADIO
+
+ self:F(Positionable)
+
+ if Positionable:GetPointVec2() then -- It's stupid, but the only way I found to make sure positionable is valid
+ self.Positionable = Positionable
+ return self
+ end
+
+ self:E({"The passed positionable is invalid, no RADIO created", Positionable})
+ return nil
+end
+
+--- Check validity of the filename passed and sets RADIO.FileName
+-- @param #RADIO self
+-- @param #string FileName File name of the sound file (i.e. "Noise.ogg")
+-- @return #RADIO self
+function RADIO:SetFileName(FileName)
+ self:F2(FileName)
+
+ if type(FileName) == "string" then
+ if FileName:find(".ogg") or FileName:find(".wav") then
+ if not FileName:find("l10n/DEFAULT/") then
+ FileName = "l10n/DEFAULT/" .. FileName
+ end
+ self.FileName = FileName
+ return self
+ end
+ end
+
+ self:E({"File name invalid. Maybe something wrong with the extension ?", self.FileName})
+ return self
+end
+
+--- Check validity of the frequency passed and sets RADIO.Frequency
+-- @param #RADIO self
+-- @param #number Frequency in MHz (Ranges allowed for radio transmissions in DCS : 30-88 / 108-152 / 225-400MHz)
+-- @return #RADIO self
+function RADIO:SetFrequency(Frequency)
+ self:F2(Frequency)
+ if type(Frequency) == "number" then
+ -- If frequency is in range
+ if (Frequency >= 30 and Frequency < 88) or (Frequency >= 108 and Frequency < 152) or (Frequency >= 225 and Frequency < 400) then
+ self.Frequency = Frequency * 1000000 -- Conversion in Hz
+ -- If the RADIO is attached to a UNIT or a GROUP, we need to send the DCS Command "SetFrequency" to change the UNIT or GROUP frequency
+ if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
+ self.Positionable:SetCommand({
+ id = "SetFrequency",
+ params = {
+ frequency = self.Frequency,
+ modulation = self.Modulation,
+ }
+ })
+ end
+ return self
+ end
+ end
+ self:E({"Frequency is outside of DCS Frequency ranges (30-80, 108-152, 225-400). Frequency unchanged.", self.Frequency})
+ return self
+end
+
+--- Check validity of the frequency passed and sets RADIO.Modulation
+-- @param #RADIO self
+-- @param #number Modulation either radio.modulation.AM or radio.modulation.FM
+-- @return #RADIO self
+function RADIO:SetModulation(Modulation)
+ self:F2(Modulation)
+ if type(Modulation) == "number" then
+ if Modulation == radio.modulation.AM or Modulation == radio.modulation.FM then --TODO Maybe make this future proof if ED decides to add an other modulation ?
+ self.Modulation = Modulation
+ return self
+ end
+ end
+ self:E({"Modulation is invalid. Use DCS's enum radio.modulation. Modulation unchanged.", self.Modulation})
+ return self
+end
+
+--- Check validity of the power passed and sets RADIO.Power
+-- @param #RADIO self
+-- @param #number Power in W
+-- @return #RADIO self
+function RADIO:SetPower(Power)
+ self:F2(Power)
+ if type(Power) == "number" then
+ self.Power = math.floor(math.abs(Power)) --TODO Find what is the maximum power allowed by DCS and limit power to that
+ return self
+ end
+ self:E({"Power is invalid. Power unchanged.", self.Power})
+ return self
+end
+
+--- Check validity of the loop passed and sets RADIO.Loop
+-- @param #RADIO self
+-- @param #boolean Loop
+-- @return #RADIO self
+-- @usage
+function RADIO:SetLoop(Loop)
+ self:F2(Loop)
+ if type(Loop) == "boolean" then
+ self.Loop = Loop
+ return self
+ end
+ self:E({"Loop is invalid. Loop unchanged.", self.Loop})
+ return self
+end
+
+--- Check validity of the subtitle and the subtitleDuration passed and sets RADIO.subtitle and RADIO.subtitleDuration
+-- @param #RADIO self
+-- @param #string Subtitle
+-- @param #number SubtitleDuration in s
+-- @return #RADIO self
+-- @usage
+-- -- Both parameters are mandatory, since it wouldn't make much sense to change the Subtitle and not its duration
+function RADIO:SetSubtitle(Subtitle, SubtitleDuration)
+ self:F2({Subtitle, SubtitleDuration})
+ if type(Subtitle) == "string" then
+ self.Subtitle = Subtitle
+ else
+ self.Subtitle = ""
+ self:E({"Subtitle is invalid. Subtitle reset.", self.Subtitle})
+ end
+ if type(SubtitleDuration) == "number" then
+ if math.floor(math.abs(SubtitleDuration)) == SubtitleDuration then
+ self.SubtitleDuration = SubtitleDuration
+ return self
+ end
+ end
+ self.SubtitleDuration = 0
+ self:E({"SubtitleDuration is invalid. SubtitleDuration reset.", self.SubtitleDuration})
+end
+
+--- Create a new transmission, that is to say, populate the RADIO with relevant data
+-- @param #RADIO self
+-- @param #string FileName
+-- @param #number Frequency in MHz
+-- @param #number Modulation either radio.modulation.AM or radio.modulation.FM
+-- @param #number Power in W
+-- @return #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
+function RADIO:NewGenericTransmission(FileName, Frequency, Modulation, Power)
+ self:F({FileName, Frequency, Modulation, Power})
+
+ self:SetFileName(FileName)
+ if Frequency then self:SetFrequency(Frequency) end
+ if Modulation then self:SetModulation(Modulation) end
+ if Power then self:SetPower(Power) end
+
+ return self
+end
+
+
+--- Create a new transmission, that is to say, populate the RADIO with relevant data
+-- @param #RADIO self
+-- @param #string FileName
+-- @param #string Subtitle
+-- @param #number SubtitleDuration in s
+-- @param #number Frequency in MHz
+-- @param #number Modulation either radio.modulation.AM or radio.modulation.FM
+-- @param #boolean Loop
+-- @return #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
+function RADIO:NewUnitTransmission(FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop)
+ self:F({FileName, Subtitle, SubtitleDuration, Frequency, Modulation, Loop})
+
+ self:SetFileName(FileName)
+ if Subtitle then self:SetSubtitle(Subtitle) end
+ if SubtitleDuration then self:SetSubtitleDuration(SubtitleDuration) end
+ if Frequency then self:SetFrequency(Frequency) end
+ if Modulation then self:SetModulation(Modulation) end
+ if Loop then self:SetLoop(Loop) end
+
+ return self
+end
+
+--- Actually Broadcast the transmission
+-- @param #RADIO self
+-- @return #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
+function RADIO:Broadcast()
+ self:F()
+ -- If the POSITIONABLE is actually a UNIT or a GROUP, use the more complicated DCS command system
+ if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
+ self:T2("Broadcasting from a UNIT or a GROUP")
+ self.Positionable:SetCommand({
+ id = "TransmitMessage",
+ params = {
+ file = self.FileName,
+ duration = self.SubtitleDuration,
+ subtitle = self.Subtitle,
+ loop = self.Loop,
+ }
+ })
+ else
+ -- If the POSITIONABLE is anything else, we revert to the general singleton function
+ self:T2("Broadcasting from a POSITIONABLE")
+ trigger.action.radioTransmission(self.FileName, self.Positionable:GetPositionVec3(), self.Modulation, false, self.Frequency, self.Power)
+ end
+ return self
+end
+
+--- Stops a transmission
+-- @param #RADIO self
+-- @return #RADIO self
+-- @usage
+-- -- Especially usefull to stop the broadcast of looped transmissions
+-- -- Only works with broadcasts from UNIT or GROUP
+function RADIO:StopBroadcast()
+ self:F()
+ -- If the POSITIONABLE is a UNIT or a GROUP, stop the transmission with the DCS "StopTransmission" command
+ if self.Positionable.ClassName == "UNIT" or self.Positionable.ClassName == "GROUP" then
+ self.Positionable:SetCommand({
+ id = "StopTransmission",
+ params = {}
+ })
+ else
+ self:E("This broadcast can't be stopped. It's not looped either, so please wait for the end of the sound file playback")
+ end
+ return self
+end--- This module contains the OBJECT class.
--
-- 1) @{Object#OBJECT} class, extends @{Base#BASE}
-- ===========================================================
diff --git a/Moose Mission Setup/Moose_Create.bat b/Moose Mission Setup/Moose_Create.bat
index 1c2850150..5f2979007 100644
--- a/Moose Mission Setup/Moose_Create.bat
+++ b/Moose Mission Setup/Moose_Create.bat
@@ -54,6 +54,7 @@ COPY /b Moose.lua + %1\Core\Set.lua Moose.lua
COPY /b Moose.lua + %1\Core\Point.lua Moose.lua
COPY /b Moose.lua + %1\Core\Message.lua Moose.lua
COPY /b Moose.lua + %1\Core\Fsm.lua Moose.lua
+COPY /b Moose.lua + %1\Core\Radio.lua Moose.lua
rem Wrapper Classes
COPY /b Moose.lua + %1\Wrapper\Object.lua Moose.lua
From c4ba4760fc88753633541c90a28ab81745df903e Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Thu, 23 Mar 2017 05:29:44 +0100
Subject: [PATCH 8/8] static moose.lua
---
.../Moose Mission Update/l10n/DEFAULT/Moose.lua | 6 +-----
Moose Mission Setup/Moose.lua | 6 +-----
2 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
index fba4cb4f3..fadf317fb 100644
--- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
+++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
@@ -1,9 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
-<<<<<<< HEAD
-env.info( 'Moose Generation Timestamp: 20170322_2149' )
-=======
-env.info( 'Moose Generation Timestamp: 20170322_1812' )
->>>>>>> refs/remotes/origin/master
+env.info( 'Moose Generation Timestamp: 20170323_0529' )
local base = _G
Include = {}
diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua
index fba4cb4f3..fadf317fb 100644
--- a/Moose Mission Setup/Moose.lua
+++ b/Moose Mission Setup/Moose.lua
@@ -1,9 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
-<<<<<<< HEAD
-env.info( 'Moose Generation Timestamp: 20170322_2149' )
-=======
-env.info( 'Moose Generation Timestamp: 20170322_1812' )
->>>>>>> refs/remotes/origin/master
+env.info( 'Moose Generation Timestamp: 20170323_0529' )
local base = _G
Include = {}