Module MissileTrainer
Provides missile training functions.
#MISSILETRAINER class
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 alert messages only to the player where the missile is (was) targetted at.
- Hits On: Show missile hit alert messages.
- Hits Off: Disable missile hit alert 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:
- MISSILETRAINER.InitMessagesOnOff: Sets by default the display of any message to be ON or OFF.
- MISSILETRAINER.InitTrackingToAll: Sets by default the missile tracking report for all players or only for those missiles targetted to you.
- MISSILETRAINER.InitTrackingOnOff: Sets by default the display of missile tracking report to be ON or OFF.
- MISSILETRAINER.InitTrackingFrequency: Increases, decreases the missile tracking message display frequency with the provided time interval in seconds.
- MISSILETRAINER.InitAlertsToAll: Sets by default the display of alerts to be shown to all players or only to you.
- MISSILETRAINER.InitAlertsHitsOnOff: Sets by default the display of hit alerts ON or OFF.
- MISSILETRAINER.InitAlertsLaunchesOnOff: Sets by default the display of launch alerts ON or OFF.
- MISSILETRAINER.InitRangeOnOff: Sets by default the display of range information of missiles ON of OFF.
- 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.
Global(s)
| MISSILETRAINER |
Type MISSILETRAINER
Global(s)
Type MissileTrainer
Type MISSILETRAINER
The MISSILETRAINER class
Field(s)
- #string MISSILETRAINER.ClassName
- MISSILETRAINER:InitAlertsHitsOnOff(AlertsHitsOnOff)
-
Sets by default the display of hit alerts ON or OFF.
Parameter
-
#boolean AlertsHitsOnOff: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitAlertsLaunchesOnOff(AlertsLaunchesOnOff)
-
Sets by default the display of launch alerts ON or OFF.
Parameter
-
#boolean AlertsLaunchesOnOff: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitAlertsToAll(AlertsToAll)
-
Sets by default the display of alerts to be shown to all players or only to you.
Parameter
-
#boolean AlertsToAll: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitBearingOnOff(DetailsBearingOnOff)
-
Sets by default the display of bearing information of missiles ON of OFF.
Parameter
-
#boolean DetailsBearingOnOff: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitMenusOnOff(MenusOnOff)
-
Enables / Disables the menus.
Parameter
-
#boolean MenusOnOff: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitMessagesOnOff(MessagesOnOff)
-
Sets by default the display of any message to be ON or OFF.
Parameter
-
#boolean MessagesOnOff: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitRangeOnOff(DetailsRangeOnOff)
-
Sets by default the display of range information of missiles ON of OFF.
Parameter
-
#boolean DetailsRangeOnOff: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitTrackingFrequency(TrackingFrequency)
-
Increases, decreases the missile tracking message display frequency with the provided time interval in seconds.
The default frequency is a 3 second interval, so the Tracking Frequency parameter specifies the increase or decrease from the default 3 seconds or the last frequency update.
Parameter
-
#number TrackingFrequency: Provide a negative or positive value in seconds to incraese or decrease the display frequency.
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitTrackingOnOff(TrackingOnOff)
-
Sets by default the display of missile tracking report to be ON or OFF.
Parameter
-
#boolean TrackingOnOff: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:InitTrackingToAll(TrackingToAll)
-
Sets by default the missile tracking report for all players or only for those missiles targetted to you.
Parameter
-
#boolean TrackingToAll: true or false
Return value
#MISSILETRAINER: self
-
- MISSILETRAINER:New(Distance, Briefing)
-
Creates the main object which is handling missile tracking.
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.
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
-
- MISSILETRAINER:_AddBearing(Client, TrainerWeapon)
-
Parameters
-
Client: -
TrainerWeapon:
-
- MISSILETRAINER:_AddRange(Client, TrainerWeapon)
-
Parameters
-
Client: -
TrainerWeapon:
-
- MISSILETRAINER:_EventShot(Event)
-
Detects if an SA site was shot with an anti radiation missile.
In this case, take evasive actions based on the skill level set within the ME.
Parameter
-
Event#EVENTDATA Event:
-
- MISSILETRAINER._MenuMessages(MenuParameters)
-
Parameter
-
MenuParameters:
-