-
ESCORT.ReportTargetsScheduler
diff --git a/Documentation/MissileTrainer.html b/Documentation/MissileTrainer.html
index 15b467d1f..2eebd576b 100644
--- a/Documentation/MissileTrainer.html
+++ b/Documentation/MissileTrainer.html
@@ -55,6 +55,90 @@
Provides missile training functions.
+
+
+
+The #MISSILETRAINER class uses the DCS world messaging system to be alerted of any missiles fired, and when a missile would hit your aircraft,
+the class will destroy the missile within a certain range, to avoid damage to your aircraft.
+It suports the following functionality:
+
+
+ - Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.
+ - Provide alerts of missile launches, including detailed information of the units launching, including bearing, range …
+ - Provide alerts when a missile would have killed your aircraft.
+ - Provide alerts when the missile self destructs.
+ - Enable / Disable and Configure the Missile Trainer using the various menu options.
+
+
+ When running a mission where MISSILETRAINER is used, the following radio menu structure ( 'Radio Menu' -> 'Other (F10)' -> 'MissileTrainer' ) options are available for the players:
+
+
+ - Messages: Menu to configure all messages.
+
+ - Messages On: Show all messages.
+ - Messages Off: Disable all messages.
+
+ - Tracking: Menu to configure missile tracking messages.
+
+ - To All: Shows missile tracking messages to all players.
+ - To Target: Shows missile tracking messages only to the player where the missile is targetted at.
+ - Tracking On: Show missile tracking messages.
+ - Tracking Off: Disable missile tracking messages.
+ - Frequency Increase: Increases the missile tracking message frequency with one second.
+ - Frequency Decrease: Decreases the missile tracking message frequency with one second.
+
+ - Alerts: Menu to configure alert messages.
+
+ - To All: Shows alert messages to all players.
+ - To Target: Shows alter messages only to the player where the missile is (was) targetted at.
+ - Hits On: Show missile hit alert messages.
+ - Hits Off: Disable missile hit altert messages.
+ - Launches On: Show missile launch messages.
+ - Launches Off: Disable missile launch messages.
+
+ - Details: Menu to configure message details.
+
+ - Range On: Shows range information when a missile is fired to a target.
+ - Range Off: Disable range information when a missile is fired to a target.
+ - Bearing On: Shows bearing information when a missile is fired to a target.
+ - Bearing Off: Disable bearing information when a missile is fired to a target.
+
+ - Distance: Menu to configure the distance when a missile needs to be destroyed when near to a player, during tracking. This will improve/influence hit calculation accuracy, but has the risk of damaging the aircraft when the missile reaches the aircraft before the distance is measured.
+
+ - 50 meter: Destroys the missile when the distance to the aircraft is below or equal to 50 meter.
+ - 100 meter: Destroys the missile when the distance to the aircraft is below or equal to 100 meter.
+ - 150 meter: Destroys the missile when the distance to the aircraft is below or equal to 150 meter.
+ - 200 meter: Destroys the missile when the distance to the aircraft is below or equal to 200 meter.
+
+
+
+
+MISSILETRAINER construction methods:
+Create a new MISSILETRAINER object with the MISSILETRAINER.New method:
+
+
+ - MISSILETRAINER.New: Creates a new MISSILETRAINER object taking the maximum distance to your aircraft to evaluate when a missile needs to be destroyed.
+
+
+MISSILETRAINER will collect each unit declared in the mission with a skill level "Client" and "Player", and will monitor the missiles shot at those.
+
+MISSILETRAINER initialization methods:
+A MISSILETRAINER object will behave differently based on the usage of initialization methods:
+
+
+
+
Global(s)
@@ -175,7 +259,7 @@
- | MISSILETRAINER:New(Distance) |
+ MISSILETRAINER:New(Distance, Briefing) |
Creates the main object which is handling missile tracking.
|
@@ -641,7 +725,7 @@ self
-MISSILETRAINER:New(Distance)
+MISSILETRAINER:New(Distance, Briefing)
@@ -651,13 +735,19 @@ self
When a missile is fired a SCHEDULER is set off that follows the missile. When near a certain a client player, the missile will be destroyed.
- Parameter
+ Parameters
-
#number Distance :
The distance in meters when a tracked missile needs to be destroyed when close to a player.
+
+ -
+
+
#string Briefing :
+(Optional) Will show a text to the players when starting their mission. Can be used for briefing purposes.
+
Return value
diff --git a/Embedded/Moose_Embedded.lua b/Embedded/Moose_Embedded.lua
index 775f5ed65..bbe45fd13 100644
--- a/Embedded/Moose_Embedded.lua
+++ b/Embedded/Moose_Embedded.lua
@@ -15275,7 +15275,6 @@ function ESCORT:_ReportTargetsScheduler()
end
end
--- Provides missile training functions.
--- @module MissileTrainer
--
-- @{#MISSILETRAINER} class
-- ========================
@@ -15343,6 +15342,7 @@ end
-- * @{#MISSILETRAINER.InitBearingOnOff}: Sets by default the display of bearing information of missiles ON of OFF.
-- * @{#MISSILETRAINER.InitMenusOnOff}: Allows to configure the options through the radio menu.
--
+-- @module MissileTrainer
-- @author FlightControl
@@ -15360,11 +15360,16 @@ MISSILETRAINER = {
-- When a missile is fired a SCHEDULER is set off that follows the missile. When near a certain a client player, the missile will be destroyed.
-- @param #MISSILETRAINER self
-- @param #number Distance The distance in meters when a tracked missile needs to be destroyed when close to a player.
+-- @param #string Briefing (Optional) Will show a text to the players when starting their mission. Can be used for briefing purposes.
-- @return #MISSILETRAINER
-function MISSILETRAINER:New( Distance )
+function MISSILETRAINER:New( Distance, Briefing )
local self = BASE:Inherit( self, BASE:New() )
self:F( Distance )
+ if Briefing then
+ self.Briefing = Briefing
+ end
+
self.Schedulers = {}
self.SchedulerID = 0
@@ -15383,7 +15388,9 @@ function MISSILETRAINER:New( Distance )
local function _Alive( Client )
- Client:Message( "Hello trainee, welcome to the Missile Trainer.\nGood luck!", 15, "HELLO WORLD", "Trainer" )
+ if self.Briefing then
+ Client:Message( self.Briefing, 15, "HELLO WORLD", "Trainer" )
+ end
if self.MenusOnOff == true then
Client:Message( "Use the 'Radio Menu' -> 'Other (F10)' -> 'Missile Trainer' menu options to change the Missile Trainer settings (for all players).", 15, "MENU", "Trainer" )
diff --git a/Moose/MissileTrainer.lua b/Moose/MissileTrainer.lua
index 5454f1287..db8083430 100644
--- a/Moose/MissileTrainer.lua
+++ b/Moose/MissileTrainer.lua
@@ -1,5 +1,4 @@
--- Provides missile training functions.
--- @module MissileTrainer
--
-- @{#MISSILETRAINER} class
-- ========================
@@ -67,6 +66,7 @@
-- * @{#MISSILETRAINER.InitBearingOnOff}: Sets by default the display of bearing information of missiles ON of OFF.
-- * @{#MISSILETRAINER.InitMenusOnOff}: Allows to configure the options through the radio menu.
--
+-- @module MissileTrainer
-- @author FlightControl
@@ -84,11 +84,16 @@ MISSILETRAINER = {
-- When a missile is fired a SCHEDULER is set off that follows the missile. When near a certain a client player, the missile will be destroyed.
-- @param #MISSILETRAINER self
-- @param #number Distance The distance in meters when a tracked missile needs to be destroyed when close to a player.
+-- @param #string Briefing (Optional) Will show a text to the players when starting their mission. Can be used for briefing purposes.
-- @return #MISSILETRAINER
-function MISSILETRAINER:New( Distance )
+function MISSILETRAINER:New( Distance, Briefing )
local self = BASE:Inherit( self, BASE:New() )
self:F( Distance )
+ if Briefing then
+ self.Briefing = Briefing
+ end
+
self.Schedulers = {}
self.SchedulerID = 0
@@ -107,7 +112,9 @@ function MISSILETRAINER:New( Distance )
local function _Alive( Client )
- Client:Message( "Hello trainee, welcome to the Missile Trainer.\nGood luck!", 15, "HELLO WORLD", "Trainer" )
+ if self.Briefing then
+ Client:Message( self.Briefing, 15, "HELLO WORLD", "Trainer" )
+ end
if self.MenusOnOff == true then
Client:Message( "Use the 'Radio Menu' -> 'Other (F10)' -> 'Missile Trainer' menu options to change the Missile Trainer settings (for all players).", 15, "MENU", "Trainer" )
diff --git a/Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua b/Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua
index b5922291c..c8d4596ff 100644
--- a/Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua
+++ b/Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua
@@ -6,16 +6,15 @@ Include.File("MissileTrainer")
-- This is an example of a global
local Trainer = MISSILETRAINER
- :New( 200 )
+ :New( 200, "Trainer: Welcome to the missile training, trainee! Missiles will be fired at you. Try to evade them. Good luck!" )
:InitMessagesOnOff(true)
- :InitAlertsToAll(true) -- I'll correct it below ...
+ :InitAlertsToAll(true)
:InitAlertsHitsOnOff(true)
- :InitAlertsLaunchesOnOff(false)
+ :InitAlertsLaunchesOnOff(false) -- I'll put it on below ...
:InitBearingOnOff(true)
:InitRangeOnOff(true)
:InitTrackingOnOff(true)
:InitTrackingToAll(true)
- :InitMenusOnOff(false) -- Disable menus
- :InitTrackingFrequency( 1 ) -- Make Tracking Frequency 4 seconds ...
-
--- Trainer:InitAlertsToAll(true) -- Now alerts are also on
+ :InitMenusOnOff(false)
+
+Trainer:InitAlertsToAll(true) -- Now alerts are also on
diff --git a/Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz b/Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz
index 9daed4d43..009a8dcde 100644
Binary files a/Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz and b/Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz differ