Merge remote-tracking branch 'refs/remotes/origin/master' into MissileTrainer

# Conflicts:
#	Embedded/Moose_Embedded.lua
#	Moose/MissileTrainer.lua
#	Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.lua
#	Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz
This commit is contained in:
Sven Van de Velde 2016-05-18 11:09:21 +02:00
parent df783226cb
commit 1cb97aca38
6 changed files with 119 additions and 17 deletions

View File

@ -1835,7 +1835,6 @@ self</p>
<dl class="function">
<dt>
<em></em>
<a id="#(ESCORT).ReportTargetsScheduler" >
<strong>ESCORT.ReportTargetsScheduler</strong>
</a>

View File

@ -55,6 +55,90 @@
<p>Provides missile training functions.</p>
<h1><a href="##(MISSILETRAINER)">#MISSILETRAINER</a> class</h1>
<p>The <a href="##(MISSILETRAINER)">#MISSILETRAINER</a> 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:</p>
<ul>
<li>Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.</li>
<li>Provide alerts of missile launches, including detailed information of the units launching, including bearing, range …</li>
<li>Provide alerts when a missile would have killed your aircraft.</li>
<li>Provide alerts when the missile self destructs.</li>
<li>Enable / Disable and Configure the Missile Trainer using the various menu options.</li>
</ul>
<p> When running a mission where MISSILETRAINER is used, the following radio menu structure ( 'Radio Menu' -> 'Other (F10)' -> 'MissileTrainer' ) options are available for the players:</p>
<ul>
<li><strong>Messages</strong>: Menu to configure all messages.
<ul>
<li><strong>Messages On</strong>: Show all messages.</li>
<li><strong>Messages Off</strong>: Disable all messages.</li>
</ul></li>
<li><strong>Tracking</strong>: Menu to configure missile tracking messages.
<ul>
<li><strong>To All</strong>: Shows missile tracking messages to all players.</li>
<li><strong>To Target</strong>: Shows missile tracking messages only to the player where the missile is targetted at.</li>
<li><strong>Tracking On</strong>: Show missile tracking messages.</li>
<li><strong>Tracking Off</strong>: Disable missile tracking messages.</li>
<li><strong>Frequency Increase</strong>: Increases the missile tracking message frequency with one second.</li>
<li><strong>Frequency Decrease</strong>: Decreases the missile tracking message frequency with one second.</li>
</ul></li>
<li><strong>Alerts</strong>: Menu to configure alert messages.
<ul>
<li><strong>To All</strong>: Shows alert messages to all players.</li>
<li><strong>To Target</strong>: Shows alter messages only to the player where the missile is (was) targetted at.</li>
<li><strong>Hits On</strong>: Show missile hit alert messages.</li>
<li><strong>Hits Off</strong>: Disable missile hit altert messages.</li>
<li><strong>Launches On</strong>: Show missile launch messages.</li>
<li><strong>Launches Off</strong>: Disable missile launch messages.</li>
</ul></li>
<li><strong>Details</strong>: Menu to configure message details.
<ul>
<li><strong>Range On</strong>: Shows range information when a missile is fired to a target.</li>
<li><strong>Range Off</strong>: Disable range information when a missile is fired to a target.</li>
<li><strong>Bearing On</strong>: Shows bearing information when a missile is fired to a target.</li>
<li><strong>Bearing Off</strong>: Disable bearing information when a missile is fired to a target.</li>
</ul></li>
<li><strong>Distance</strong>: 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.
<ul>
<li><strong>50 meter</strong>: Destroys the missile when the distance to the aircraft is below or equal to 50 meter.</li>
<li><strong>100 meter</strong>: Destroys the missile when the distance to the aircraft is below or equal to 100 meter.</li>
<li><strong>150 meter</strong>: Destroys the missile when the distance to the aircraft is below or equal to 150 meter.</li>
<li><strong>200 meter</strong>: Destroys the missile when the distance to the aircraft is below or equal to 200 meter.</li>
</ul></li>
</ul>
<h1>MISSILETRAINER construction methods:</h1>
<p>Create a new MISSILETRAINER object with the <a href="##(MISSILETRAINER).New">MISSILETRAINER.New</a> method:</p>
<ul>
<li><a href="##(MISSILETRAINER).New">MISSILETRAINER.New</a>: Creates a new MISSILETRAINER object taking the maximum distance to your aircraft to evaluate when a missile needs to be destroyed.</li>
</ul>
<p>MISSILETRAINER will collect each unit declared in the mission with a skill level "Client" and "Player", and will monitor the missiles shot at those.</p>
<h1>MISSILETRAINER initialization methods:</h1>
<p>A MISSILETRAINER object will behave differently based on the usage of initialization methods:</p>
<ul>
<li><a href="##(MISSILETRAINER).InitMessagesOnOff">MISSILETRAINER.InitMessagesOnOff</a>: Sets by default the display of any message to be ON or OFF.</li>
<li><a href="##(MISSILETRAINER).InitTrackingToAll">MISSILETRAINER.InitTrackingToAll</a>: Sets by default the missile tracking report for all players or only for those missiles targetted to you.</li>
<li><a href="##(MISSILETRAINER).InitTrackingOnOff">MISSILETRAINER.InitTrackingOnOff</a>: Sets by default the display of missile tracking report to be ON or OFF.</li>
<li><a href="##(MISSILETRAINER).InitTrackingFrequency">MISSILETRAINER.InitTrackingFrequency</a>: Increases, decreases the missile tracking message display frequency with the provided time interval in seconds.</li>
<li><a href="##(MISSILETRAINER).InitAlertsToAll">MISSILETRAINER.InitAlertsToAll</a>: Sets by default the display of alerts to be shown to all players or only to you.</li>
<li><a href="##(MISSILETRAINER).InitAlertsHitsOnOff">MISSILETRAINER.InitAlertsHitsOnOff</a>: Sets by default the display of hit alerts ON or OFF.</li>
<li><a href="##(MISSILETRAINER).InitAlertsLaunchesOnOff">MISSILETRAINER.InitAlertsLaunchesOnOff</a>: Sets by default the display of launch alerts ON or OFF.</li>
<li><a href="##(MISSILETRAINER).InitRangeOnOff">MISSILETRAINER.InitRangeOnOff</a>: Sets by default the display of range information of missiles ON of OFF.</li>
<li><a href="##(MISSILETRAINER).InitBearingOnOff">MISSILETRAINER.InitBearingOnOff</a>: Sets by default the display of bearing information of missiles ON of OFF.</li>
<li><a href="##(MISSILETRAINER).InitMenusOnOff">MISSILETRAINER.InitMenusOnOff</a>: Allows to configure the options through the radio menu.</li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
@ -175,7 +259,7 @@
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(MISSILETRAINER).New">MISSILETRAINER:New(Distance)</a></td>
<td class="name" nowrap="nowrap"><a href="##(MISSILETRAINER).New">MISSILETRAINER:New(Distance, Briefing)</a></td>
<td class="summary">
<p>Creates the main object which is handling missile tracking.</p>
</td>
@ -641,7 +725,7 @@ self</p>
<dt>
<a id="#(MISSILETRAINER).New" >
<strong>MISSILETRAINER:New(Distance)</strong>
<strong>MISSILETRAINER:New(Distance, Briefing)</strong>
</a>
</dt>
<dd>
@ -651,13 +735,19 @@ self</p>
<p>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.</p>
<h3>Parameter</h3>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number Distance </em></code>:
The distance in meters when a tracked missile needs to be destroyed when close to a player.</p>
</li>
<li>
<p><code><em>#string Briefing </em></code>:
(Optional) Will show a text to the players when starting their mission. Can be used for briefing purposes. </p>
</li>
</ul>
<h3>Return value</h3>

View File

@ -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" )

View File

@ -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" )

View File

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