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 @@
  • 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

    • -

      #string SubTitle :

      +

      #string Subtitle :

    • -

      #number SubTitleDuration : +

      #number SubtitleDuration : in s

    • @@ -765,6 +761,28 @@ 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
    +
    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
    -

    1) Scoring#SCORING class, extends Base#BASE

    -

    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) Scoring#SCORING class, extends Base#BASE

    +

    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
    -

    1) Scoring#SCORING class, extends Base#BASE

    -

    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.