diff --git a/Moose Development/Moose/Core/Radio.lua b/Moose Development/Moose/Core/Radio.lua index 88863ad86..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 @@ -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, @@ -289,10 +289,10 @@ 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({ + self.Positionable:SetCommand({ id = "TransmitMessage", params = { file = self.FileName, @@ -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: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 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 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/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 @@
Finds a CLIENT from the _DATABASE using the relevant DCS Unit.
DCSUnit :
Error :
Sometimes, the weapon is a player unit!
+Contains the counter how many units are currently alive
+Create a new transmission, that is to say, populate the RADIO with relevant data
Create a new transmission, that is to say, populate the RADIO with relevant data
Check validity of the subtitle and the subtitleDuration passed and sets RADIO.subtitle and RADIO.subtitleDuration
+Stops a transmission
#string Filename :
#string FileName :
#number Power :
in W
... :
#string Filename :
#string FileName :
#boolean Loop :
... :
#string SubTitle :
#string Subtitle :
#number SubTitleDuration :
+
#number SubtitleDuration :
in s
-- Both parameters are mandatory, since it wouldn't make much sense to change the Subtitle and not its duration
+Stops a transmission
+ +#RADIO: +self
+ +-- Especially usefull to stop the broadcast of looped transmissions
+-- Only works with broadcasts from UNIT or GROUP
+
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. +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" ) )
-
-
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.
+Overwrite unit names by default with group name.
-By default, no InitLimit
-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.