FlightControl_Master b7183023c9 Documentation
2017-11-22 06:23:58 +01:00

5660 lines
124 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_A2A.html">AI_A2A</a></li>
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
<li><a href="AI_Bai.html">AI_Bai</a></li>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="AI_Cap.html">AI_Cap</a></li>
<li><a href="AI_Cas.html">AI_Cas</a></li>
<li><a href="AI_Formation.html">AI_Formation</a></li>
<li><a href="AI_Patrol.html">AI_Patrol</a></li>
<li><a href="ATC_Ground.html">ATC_Ground</a></li>
<li><a href="Account.html">Account</a></li>
<li><a href="Airbase.html">Airbase</a></li>
<li><a href="Assign.html">Assign</a></li>
<li><a href="Base.html">Base</a></li>
<li><a href="Cargo.html">Cargo</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="CommandCenter.html">CommandCenter</a></li>
<li><a href="Controllable.html">Controllable</a></li>
<li><a href="DCSAirbase.html">DCSAirbase</a></li>
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
<li><a href="DCSCommand.html">DCSCommand</a></li>
<li><a href="DCSController.html">DCSController</a></li>
<li><a href="DCSGroup.html">DCSGroup</a></li>
<li><a href="DCSObject.html">DCSObject</a></li>
<li><a href="DCSTask.html">DCSTask</a></li>
<li><a href="DCSTypes.html">DCSTypes</a></li>
<li><a href="DCSUnit.html">DCSUnit</a></li>
<li><a href="DCSVec3.html">DCSVec3</a></li>
<li><a href="DCSWorld.html">DCSWorld</a></li>
<li><a href="DCSZone.html">DCSZone</a></li>
<li><a href="DCScountry.html">DCScountry</a></li>
<li><a href="DCStimer.html">DCStimer</a></li>
<li><a href="DCStrigger.html">DCStrigger</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Designate.html">Designate</a></li>
<li><a href="Detection.html">Detection</a></li>
<li><a href="DetectionManager.html">DetectionManager</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li><a href="Fsm.html">Fsm</a></li>
<li><a href="Goal.html">Goal</a></li>
<li><a href="Group.html">Group</a></li>
<li><a href="Identifiable.html">Identifiable</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="Movement.html">Movement</a></li>
<li><a href="Object.html">Object</a></li>
<li><a href="Point.html">Point</a></li>
<li><a href="Positionable.html">Positionable</a></li>
<li><a href="Process_JTAC.html">Process_JTAC</a></li>
<li><a href="Process_Pickup.html">Process_Pickup</a></li>
<li><a href="Protect.html">Protect</a></li>
<li><a href="Radio.html">Radio</a></li>
<li>Rat</li>
<li><a href="Route.html">Route</a></li>
<li><a href="Scenery.html">Scenery</a></li>
<li><a href="ScheduleDispatcher.html">ScheduleDispatcher</a></li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li><a href="Set.html">Set</a></li>
<li><a href="Settings.html">Settings</a></li>
<li><a href="Smoke.html">Smoke</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="SpawnStatic.html">SpawnStatic</a></li>
<li><a href="Spot.html">Spot</a></li>
<li><a href="Static.html">Static</a></li>
<li><a href="StaticObject.html">StaticObject</a></li>
<li><a href="Task.html">Task</a></li>
<li><a href="TaskZoneCapture.html">TaskZoneCapture</a></li>
<li><a href="Task_A2A.html">Task_A2A</a></li>
<li><a href="Task_A2A_Dispatcher.html">Task_A2A_Dispatcher</a></li>
<li><a href="Task_A2G.html">Task_A2G</a></li>
<li><a href="Task_A2G_Dispatcher.html">Task_A2G_Dispatcher</a></li>
<li><a href="Task_Cargo.html">Task_Cargo</a></li>
<li><a href="Task_PICKUP.html">Task_PICKUP</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="UserFlag.html">UserFlag</a></li>
<li><a href="UserSound.html">UserSound</a></li>
<li><a href="Utils.html">Utils</a></li>
<li><a href="Velocity.html">Velocity</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="ZoneCaptureCoalition.html">ZoneCaptureCoalition</a></li>
<li><a href="ZoneGoal.html">ZoneGoal</a></li>
<li><a href="ZoneGoalCargo.html">ZoneGoalCargo</a></li>
<li><a href="ZoneGoalCoalition.html">ZoneGoalCoalition</a></li>
<li><a href="env.html">env</a></li>
<li><a href="land.html">land</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Rat</code></h1>
<ul>
<li><strong>Functional</strong> - Create random airtraffic in your missions.</li>
</ul>
<p>
<img src="..\Presentations\RAT\RAT.png" alt="Banner Image"/></p>
<hr/>
<p>The aim of the RAT class is to fill the empty DCS world with randomized air traffic and bring more life to your airports.</p>
<p>In particular, it is designed to spawn AI air units at random airports. These units will be assigned a random flight path to another random airport on the map.</p>
<p>Even the mission designer will not know where aircraft will be spawned and which route they follow.</p>
<h2>Features</h2>
<ul>
<li>Very simple interface. Just one unit and two lines of Lua code needed to fill your map.</li>
<li>High degree of randomization. Aircraft will spawn at random airports, have random routes and random destinations.</li>
<li>Specific departure and/or destination airports can be chosen.</li>
<li>Departure and destination airports can be restricted by coalition.</li>
<li>Planes and helicopters supported. Helicopters can also be send to FARPs and ships.</li>
<li>Units can also be spawned in air within pre-defined zones of the map.</li>
<li>Aircraft will be removed when they arrive at their destination (or get stuck on the ground).</li>
<li>When a unit is removed a new unit with a different flight plan is respawned.</li>
<li>Aircraft can report their status during the route.</li>
<li>All of the above can be customized by the user if necessary.</li>
<li>All current (Caucasus, Nevada, Normandy) and future maps are supported.</li>
</ul>
<p> The RAT class creates an entry in the F10 menu which allows to</p>
<ul>
<li>Create new groups on-the-fly, i.e. at run time within the mission,</li>
<li>Destroy specific groups (e.g. if they get stuck or damaged and block a runway),</li>
<li>Request the status of all RAT aircraft or individual groups,</li>
<li>Place markers at waypoints on the F10 map for each group.</li>
</ul>
<p>Note that by its very nature, this class is suited best for civil or transport aircraft. However, it also works perfectly fine for military aircraft of any kind.</p>
<p>More of the documentation include some simple examples can be found further down this page.</p>
<hr/>
<h1>Demo Missions</h1>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/Release/RAT%20-%20Random%20Air%20Traffic">RAT Demo Missions</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
<hr/>
<h1>YouTube Channel</h1>
<h3>RAT videos are work in progress.</h3>
<h3><a href="https://www.youtube.com/playlist?list=PL7ZUrU4zZUl1jirWIo4t4YxqN-HxjqRkL">MOOSE YouTube Channel</a></h3>
<hr/>
<h3>Author: <strong><a href="https://forums.eagle.ru/member.php?u=115026">funkyfranky</a></strong></h3>
<h3>Contributions: <strong>Sven van de Velde (<a href="https://forums.eagle.ru/member.php?u=89536">FlightControl</a>)</strong></h3>
<hr/>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#RAT">RAT</a></td>
<td class="summary">
<h1>RAT class, extends <a href="Spawn.html##(SPAWN)">Spawn#SPAWN</a></h1>
<p>The RAT class implements an easy to use way to randomly fill your map with AI aircraft.</p>
</td>
</tr>
</table>
<h2><a id="#(RAT)">Type <code>RAT</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ATC">RAT.ATC</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ATC_Clearance">RAT:ATC_Clearance(n)</a></td>
<td class="summary">
<p>Max number of planes that get landing clearance of the RAT ATC.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ATC_Delay">RAT:ATC_Delay(time)</a></td>
<td class="summary">
<p>Delay between granting landing clearance for simultanious landings.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ATCswitch">RAT.ATCswitch</a></td>
<td class="summary">
<p>Enable/disable ATC if set to true/false.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).AddFriendlyAirportsToDepartures">RAT:AddFriendlyAirportsToDepartures()</a></td>
<td class="summary">
<p>Add all friendly airports to the list of possible departures.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).AddFriendlyAirportsToDestinations">RAT:AddFriendlyAirportsToDestinations()</a></td>
<td class="summary">
<p>Add all friendly airports to the list of possible destinations</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).AlphaDescent">RAT.AlphaDescent</a></td>
<td class="summary">
<p>Default angle of descenti in degrees. A value of 3.6 follows the 3:1 rule of 3 miles of travel and 1000 ft descent.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ChangeAircraft">RAT:ChangeAircraft(actype)</a></td>
<td class="summary">
<p>Change aircraft type.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ClassName">RAT.ClassName</a></td>
<td class="summary">
<p>Name of the Class.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ClearForLanding">RAT:ClearForLanding(name)</a></td>
<td class="summary">
<p>Clear flight for landing.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Commute">RAT:Commute()</a></td>
<td class="summary">
<p>Aircraft will commute between their departure and destination airports or zones.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ContinueJourney">RAT:ContinueJourney()</a></td>
<td class="summary">
<p>Aircraft will continue their journey from their destination.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).DestinationZone">RAT:DestinationZone()</a></td>
<td class="summary">
<p>Destinations are treated as zones.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).EnableATC">RAT:EnableATC(switch)</a></td>
<td class="summary">
<p>Enable ATC, which manages the landing queue for RAT aircraft if they arrive simultaniously at the same airport.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ExcludedAirports">RAT:ExcludedAirports(ports)</a></td>
<td class="summary">
<p>Airports, FARPs and ships explicitly excluded as departures and destinations.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).FLcruise">RAT.FLcruise</a></td>
<td class="summary">
<p>Cruise altitude of aircraft. Default FL200 for planes and F005 for helos.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).FLmaxuser">RAT.FLmaxuser</a></td>
<td class="summary">
<p>Maximum flight level set by user.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).FLminuser">RAT.FLminuser</a></td>
<td class="summary">
<p>Minimum flight level set by user.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).FLuser">RAT.FLuser</a></td>
<td class="summary">
<p>Flight level set by users explicitly.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Livery">RAT:Livery(skins)</a></td>
<td class="summary">
<p>Set livery of aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Menu">RAT.Menu</a></td>
<td class="summary">
<p>F10 menu items for this RAT object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).MenuF10">RAT.MenuF10</a></td>
<td class="summary">
<p>Main F10 menu.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).MenuName">RAT:MenuName(name)</a></td>
<td class="summary">
<p>Set the name of the F10 submenu.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Ndeparture_Airports">RAT.Ndeparture_Airports</a></td>
<td class="summary">
<p>Number of departure airports set via SetDeparture().</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Ndeparture_Zones">RAT.Ndeparture_Zones</a></td>
<td class="summary">
<p>Number of departure zones set via SetDeparture.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Ndestination_Airports">RAT.Ndestination_Airports</a></td>
<td class="summary">
<p>Number of destination airports set via SetDestination().</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Ndestination_Zones">RAT.Ndestination_Zones</a></td>
<td class="summary">
<p>Number of destination zones set via SetDestination().</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).New">RAT:New(groupname, alias)</a></td>
<td class="summary">
<p>Create a new RAT object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).NoRespawn">RAT:NoRespawn()</a></td>
<td class="summary">
<p>Aircraft will not get respawned when they finished their route.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).PlaceMarkers">RAT:PlaceMarkers(switch)</a></td>
<td class="summary">
<p>Place markers of waypoints on the F10 map.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ROE">RAT.ROE</a></td>
<td class="summary">
<p>RAT rules of engagement.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ROT">RAT.ROT</a></td>
<td class="summary">
<p>RAT reaction to threat.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).RadioFrequency">RAT:RadioFrequency(frequency)</a></td>
<td class="summary">
<p>Set radio frequency.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).RadioModulation">RAT:RadioModulation(modulation)</a></td>
<td class="summary">
<p>Set radio modulation.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).RadioOFF">RAT:RadioOFF()</a></td>
<td class="summary">
<p>Disable Radio.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).RadioON">RAT:RadioON()</a></td>
<td class="summary">
<p>Enable Radio.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).RespawnAfterLanding">RAT:RespawnAfterLanding(delay)</a></td>
<td class="summary">
<p>Make aircraft respawn the moment they land rather than at engine shut down.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).RespawnAfterTakeoff">RAT:RespawnAfterTakeoff()</a></td>
<td class="summary">
<p>Aircraft will be respawned directly after take-off.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ReturnZone">RAT:ReturnZone()</a></td>
<td class="summary">
<p>Aircraft will fly to a random point within a zone and then return to its departure airport or zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetAISkill">RAT:SetAISkill(skill)</a></td>
<td class="summary">
<p>Set skill of AI aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetClimbRate">RAT:SetClimbRate(rate)</a></td>
<td class="summary">
<p>Set the climb rate.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetCoalition">RAT:SetCoalition(friendly)</a></td>
<td class="summary">
<p>Set the friendly coalitions from which the airports can be used as departure and destination.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetCoalitionAircraft">RAT:SetCoalitionAircraft(color)</a></td>
<td class="summary">
<p>Set coalition of RAT group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetCountry">RAT:SetCountry(id)</a></td>
<td class="summary">
<p>Set country of RAT group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetCruiseAltitude">RAT:SetCruiseAltitude(alt)</a></td>
<td class="summary">
<p>Set cruising altitude.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetDeparture">RAT:SetDeparture(departurenames)</a></td>
<td class="summary">
<p>Set possible departure ports.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetDeparturesFromZone">RAT:SetDeparturesFromZone(zone)</a></td>
<td class="summary">
<p>Include all airports which lie in a zone as possible destinations.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetDescentAngle">RAT:SetDescentAngle(angle)</a></td>
<td class="summary">
<p>Set the angle of descent.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetDestination">RAT:SetDestination(destinationnames)</a></td>
<td class="summary">
<p>Set name of destination airports or zones for the AI aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetDestinationsFromZone">RAT:SetDestinationsFromZone(zone)</a></td>
<td class="summary">
<p>Include all airports which lie in a zone as possible destinations.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetFL">RAT:SetFL(FL)</a></td>
<td class="summary">
<p>Set flight level.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetFLcruise">RAT:SetFLcruise(FL)</a></td>
<td class="summary">
<p>Set flight level of cruising part.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetFLmax">RAT:SetFLmax(FL)</a></td>
<td class="summary">
<p>Set max flight level.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetFLmin">RAT:SetFLmin(FL)</a></td>
<td class="summary">
<p>Set min flight level.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetMaxCruiseAltitude">RAT:SetMaxCruiseAltitude(alt)</a></td>
<td class="summary">
<p>Set max cruising altitude above sea level.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetMaxCruiseSpeed">RAT:SetMaxCruiseSpeed(speed)</a></td>
<td class="summary">
<p>Set the maximum cruise speed of the aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetMaxDistance">RAT:SetMaxDistance(dist)</a></td>
<td class="summary">
<p>Set maximum distance between departure and destination.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetMinCruiseAltitude">RAT:SetMinCruiseAltitude(alt)</a></td>
<td class="summary">
<p>Set min cruising altitude above sea level.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetMinDistance">RAT:SetMinDistance(dist)</a></td>
<td class="summary">
<p>Set minimum distance between departure and destination.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetParkingID">RAT:SetParkingID(id)</a></td>
<td class="summary">
<p>Set parking id of aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetROE">RAT:SetROE(roe)</a></td>
<td class="summary">
<p>Set rules of engagement (ROE).</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetROT">RAT:SetROT(rot)</a></td>
<td class="summary">
<p>Set reaction to threat (ROT).</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetSpawnDelay">RAT:SetSpawnDelay(delay)</a></td>
<td class="summary">
<p>Set the delay before first group is spawned. </p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetSpawnInterval">RAT:SetSpawnInterval(interval)</a></td>
<td class="summary">
<p>Set the interval between spawnings of the template group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SetTakeoff">RAT:SetTakeoff(type)</a></td>
<td class="summary">
<p>Set takeoff type.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Spawn">RAT:Spawn(naircraft)</a></td>
<td class="summary">
<p>Triggers the spawning of AI aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Status">RAT:Status(message, forID)</a></td>
<td class="summary">
<p>Report status of RAT groups.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).StatusReports">RAT:StatusReports(switch)</a></td>
<td class="summary">
<p>Aircraft report status update messages along the route.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).SubMenuName">RAT.SubMenuName</a></td>
<td class="summary">
<p>Submenu name for RAT object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).TimeDestroyInactive">RAT:TimeDestroyInactive(time)</a></td>
<td class="summary">
<p>Set the time after which inactive groups will be destroyed. </p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Tinactive">RAT.Tinactive</a></td>
<td class="summary">
<p>Time in seconds after which inactive units will be destroyed. Default is 300 seconds.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Uncontrolled">RAT:Uncontrolled()</a></td>
<td class="summary">
<p>Spawn aircraft in uncontolled state.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Vclimb">RAT.Vclimb</a></td>
<td class="summary">
<p>Default climb rate in ft/min.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).Vcruisemax">RAT.Vcruisemax</a></td>
<td class="summary">
<p>Max cruise speed in m/s (250 m/s = 900 km/h = 486 kt) set by user.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCAddFlight">RAT:_ATCAddFlight(name, dest)</a></td>
<td class="summary">
<p>Adds andd initializes a new flight after it was spawned.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCCheck">RAT:_ATCCheck()</a></td>
<td class="summary">
<p>Main ATC function.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCClearForLanding">RAT:_ATCClearForLanding(airport, flight)</a></td>
<td class="summary">
<p>Giving landing clearance for aircraft by setting user flag.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCDelFlight">RAT:_ATCDelFlight(t, entry)</a></td>
<td class="summary">
<p>Deletes a flight from ATC lists after it landed.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCFlightLanded">RAT:_ATCFlightLanded(name)</a></td>
<td class="summary">
<p>Takes care of organisational stuff after a plane has landed.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCInit">RAT:_ATCInit(airports_map)</a></td>
<td class="summary">
<p>Initializes the ATC arrays and starts schedulers.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCQueue">RAT:_ATCQueue()</a></td>
<td class="summary">
<p>Creates a landing queue for all flights holding at airports.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCRegisterFlight">RAT:_ATCRegisterFlight(name, time)</a></td>
<td class="summary">
<p>Registers a flight once it is near its holding point at the final destination.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ATCStatus">RAT:_ATCStatus()</a></td>
<td class="summary">
<p>ATC status report about flights.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._AddFriendlyAirports">RAT:_AddFriendlyAirports(ports)</a></td>
<td class="summary">
<p>Add names of all friendly airports to possible departure or destination airports if they are not already in the list. </p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._AirportExists">RAT:_AirportExists(name)</a></td>
<td class="summary">
<p>Test if an airport exists on the current map.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._AnticipatedGroupName">RAT:_AnticipatedGroupName(index)</a></td>
<td class="summary">
<p>Anticipated group name from alias and spawn index.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._CheckConsistency">RAT:_CheckConsistency()</a></td>
<td class="summary">
<p>Function checks consistency of user input and automatically adjusts parameters if necessary.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Course">RAT:_Course(a, b)</a></td>
<td class="summary">
<p>Determine the heading from point a to point b.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Debug">RAT:_Debug(switch)</a></td>
<td class="summary">
<p>Turn debug messages on or off.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._DeleteMarkers">RAT:_DeleteMarkers()</a></td>
<td class="summary">
<p>Delete all markers on F10 map.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Despawn">RAT:_Despawn(group)</a></td>
<td class="summary">
<p>Despawn unit.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._EngineStartup">RAT:_EngineStartup(EventData)</a></td>
<td class="summary">
<p>Function is executed when a unit starts its engines.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Excluded">RAT:_Excluded(port)</a></td>
<td class="summary">
<p>Check if airport is excluded from possible departures and destinations.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._FLmax">RAT:_FLmax(alpha, beta, d, phi, h0)</a></td>
<td class="summary">
<p>Calculate the max flight level for a given distance and fixed climb and descent rates.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._GetAirportsInZone">RAT:_GetAirportsInZone(zone)</a></td>
<td class="summary">
<p>Find airports within a zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._GetAirportsOfCoalition">RAT:_GetAirportsOfCoalition()</a></td>
<td class="summary">
<p>Get all "friendly" airports of the current map.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._GetAirportsOfMap">RAT:_GetAirportsOfMap()</a></td>
<td class="summary">
<p>Get all airports of the current map.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._GetLife">RAT:_GetLife(group)</a></td>
<td class="summary">
<p>Get (relative) life of first unit of a group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Heading">RAT:_Heading(course)</a></td>
<td class="summary">
<p>Determine the heading for an aircraft to be entered in the route template.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._InitAircraft">RAT:_InitAircraft(DCSgroup)</a></td>
<td class="summary">
<p>Initialize basic parameters of the aircraft based on its (template) group in the mission editor.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._IsFriendly">RAT:_IsFriendly(port)</a></td>
<td class="summary">
<p>Check if airport is friendly, i.e.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._MinDistance">RAT:_MinDistance(alpha, beta, ha, hb)</a></td>
<td class="summary">
<p>Calculate minimum distance between departure and destination for given minimum flight level and climb/decent rates.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ModifySpawnTemplate">RAT:_ModifySpawnTemplate(waypoints, livery)</a></td>
<td class="summary">
<p>Modifies the template of the group to be spawned.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._NameInList">RAT:_NameInList(liste, name)</a></td>
<td class="summary">
<p>Check if a name/string is in a list or not.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._OnBirth">RAT:_OnBirth(EventData)</a></td>
<td class="summary">
<p>Function is executed when a unit is spawned.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._OnCrash">RAT:_OnCrash(EventData)</a></td>
<td class="summary">
<p>Function is executed when a unit crashes.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._OnDead">RAT:_OnDead(EventData)</a></td>
<td class="summary">
<p>Function is executed when a unit is dead.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._OnEngineShutdown">RAT:_OnEngineShutdown(EventData)</a></td>
<td class="summary">
<p>Function is executed when a unit shuts down its engines.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._OnLand">RAT:_OnLand(EventData)</a></td>
<td class="summary">
<p>Function is executed when a unit lands.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._OnTakeoff">RAT:_OnTakeoff(EventData)</a></td>
<td class="summary">
<p>Function is executed when a unit takes off.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._PickDeparture">RAT:_PickDeparture(takeoff)</a></td>
<td class="summary">
<p>Set the departure airport of the AI.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._PickDestination">RAT:_PickDestination(departure, q, minrange, maxrange, random, landing)</a></td>
<td class="summary">
<p>Pick destination airport or zone depending on departure position.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._PlaceMarkers">RAT:_PlaceMarkers(waypoints, index)</a></td>
<td class="summary">
<p>Place markers of the waypoints.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Random_Gaussian">RAT._Random_Gaussian(x0, sigma, xmin, xmax, self)</a></td>
<td class="summary">
<p>Generate Gaussian pseudo-random numbers.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Randomize">RAT:_Randomize(value, fac, lower, upper)</a></td>
<td class="summary">
<p>Randomize a value by a certain amount.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Respawn">RAT:_Respawn(group)</a></td>
<td class="summary">
<p>Respawn a group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Routeinfo">RAT:_Routeinfo(waypoints, comment)</a></td>
<td class="summary">
<p>Provide information about the assigned flightplan.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._SetCoalitionTable">RAT:_SetCoalitionTable()</a></td>
<td class="summary">
<p>Create a table with the valid coalitions for departure and destination airports.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._SetMarker">RAT:_SetMarker(text, wp, index)</a></td>
<td class="summary">
<p>Set a marker visible for all on the F10 map.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._SetROE">RAT:_SetROE(group, roe)</a></td>
<td class="summary">
<p>Set ROE for a group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._SetROT">RAT:_SetROT(group, rot)</a></td>
<td class="summary">
<p>Set ROT for a group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._SetRoute">RAT:_SetRoute(Takeoff, Landing, _departure, _destination, takeoff, landing, _waypoint)</a></td>
<td class="summary">
<p>Set the route of the AI plane.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._SetStatus">RAT:_SetStatus(group, status)</a></td>
<td class="summary">
<p>Set status of group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._SpawnWithRoute">RAT:_SpawnWithRoute(_departure, _destination, _takeoff, _landing, _livery, _waypoint)</a></td>
<td class="summary">
<p>Spawn the AI aircraft with a route.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._TaskFunction">RAT:_TaskFunction(FunctionString, ...)</a></td>
<td class="summary">
<p>Task function.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._TaskHolding">RAT:_TaskHolding(P1, Altitude, Speed, Duration)</a></td>
<td class="summary">
<p>Orbit at a specified position at a specified alititude with a specified speed.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._Waypoint">RAT:_Waypoint(Running, Type, Coord, Speed, Altitude, Airport, index)</a></td>
<td class="summary">
<p>Create a waypoint that can be used with the Route command.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._WaypointFunction">RAT._WaypointFunction(group, rat, wp)</a></td>
<td class="summary">
<p>Function which is called after passing every waypoint.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT)._ZoneExists">RAT:_ZoneExists(name)</a></td>
<td class="summary">
<p>Test if a trigger zone defined in the mission editor exists.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).actype">RAT.actype</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).addfriendlydepartures">RAT.addfriendlydepartures</a></td>
<td class="summary">
<p>Add all friendly airports to departures.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).addfriendlydestinations">RAT.addfriendlydestinations</a></td>
<td class="summary">
<p>Add all friendly airports to destinations.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).aircraft">RAT.aircraft</a></td>
<td class="summary">
<p>Table which holds the basic aircraft properties (speed, range, ...).</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).airports">RAT.airports</a></td>
<td class="summary">
<p>All airports of friedly coalitions.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).airports_map">RAT.airports_map</a></td>
<td class="summary">
<p>All airports available on current map (Caucasus, Nevada, Normandy, ...).</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).alias">RAT.alias</a></td>
<td class="summary">
<p>Alias for spawned group.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).alive">RAT.alive</a></td>
<td class="summary">
<p>Number of groups which are alive.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).cat">RAT.cat</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).category">RAT.category</a></td>
<td class="summary">
<p>Category of aircarft: "plane" or "heli".</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).coal">RAT.coal</a></td>
<td class="summary">
<p>RAT friendly coalitions.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).coalition">RAT.coalition</a></td>
<td class="summary">
<p>Coalition of spawn group template.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).commute">RAT.commute</a></td>
<td class="summary">
<p>Aircraft commute between departure and destination, i.e. when respawned the departure airport becomes the new destiation.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).continuejourney">RAT.continuejourney</a></td>
<td class="summary">
<p>Aircraft will continue their journey, i.e. get respawned at their destination with a new random destination.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).country">RAT.country</a></td>
<td class="summary">
<p>Country of spawn group template.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ctable">RAT.ctable</a></td>
<td class="summary">
<p>Table with the valid coalitons from choice self.friendly.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).debug">RAT.debug</a></td>
<td class="summary">
<p>Turn debug messages on or off.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).departure_Azone">RAT.departure_Azone</a></td>
<td class="summary">
<p>Zone containing the departure airports.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).departure_ports">RAT.departure_ports</a></td>
<td class="summary">
<p>Array containing the names of the destination airports or zones.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).destination_Azone">RAT.destination_Azone</a></td>
<td class="summary">
<p>Zone containing the destination airports.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).destination_ports">RAT.destination_ports</a></td>
<td class="summary">
<p>Array containing the names of the destination airports or zones.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).destinationzone">RAT.destinationzone</a></td>
<td class="summary">
<p>Destination is a zone and not an airport.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).excluded_ports">RAT.excluded_ports</a></td>
<td class="summary">
<p>Array containing the names of explicitly excluded airports.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).f10menu">RAT.f10menu</a></td>
<td class="summary">
<p>Add an F10 menu for RAT.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).frequency">RAT.frequency</a></td>
<td class="summary">
<p>Radio frequency used by the RAT groups.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).friendly">RAT.friendly</a></td>
<td class="summary">
<p>Possible departure/destination airport: all=blue+red+neutral, same=spawn+neutral, spawnonly=spawn, blue=blue+neutral, blueonly=blue, red=red+neutral, redonly=red.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).id">RAT.id</a></td>
<td class="summary">
<p>Some ID to identify who we are in output of the DCS.log file.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).landing">RAT.landing</a></td>
<td class="summary">
<p>Landing type. Determines if we actually land at an airport or treat it as zone.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).livery">RAT.livery</a></td>
<td class="summary">
<p>Livery of the aircraft set by user.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).markerid">RAT.markerid</a></td>
<td class="summary">
<p>Running number of placed markers on the F10 map.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).markerids">RAT.markerids</a></td>
<td class="summary">
<p>Array with marker IDs.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).maxdist">RAT.maxdist</a></td>
<td class="summary">
<p>Max distance from departure to destination in meters. Default 5000 km.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).mindist">RAT.mindist</a></td>
<td class="summary">
<p>Min distance from departure to destination in meters. Default 5 km.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).modulation">RAT.modulation</a></td>
<td class="summary">
<p>Ratio modulation. Either "FM" or "AM".</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ngroups">RAT.ngroups</a></td>
<td class="summary">
<p>Number of groups to be spawned in total.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).norespawn">RAT.norespawn</a></td>
<td class="summary">
<p>Aircraft will not be respawned after they have finished their route.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).onboard_num">RAT.onboard_num</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).parking_id">RAT.parking_id</a></td>
<td class="summary">
<p>String with a special parking ID for the aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).placemarkers">RAT.placemarkers</a></td>
<td class="summary">
<p>Place markers of waypoints on F10 map.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).radio">RAT.radio</a></td>
<td class="summary">
<p>If true/false disables radio messages from the RAT groups.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).random_departure">RAT.random_departure</a></td>
<td class="summary">
<p>By default a random friendly airport is chosen as departure.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).random_destination">RAT.random_destination</a></td>
<td class="summary">
<p>By default a random friendly airport is chosen as destination.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).ratcraft">RAT.ratcraft</a></td>
<td class="summary">
<p>Array with the spawned RAT aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).reportstatus">RAT.reportstatus</a></td>
<td class="summary">
<p>Aircraft report status.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).respawn_after_takeoff">RAT.respawn_after_takeoff</a></td>
<td class="summary">
<p>Aircraft will be respawned directly after take-off.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).respawn_at_landing">RAT.respawn_at_landing</a></td>
<td class="summary">
<p>Respawn aircraft the moment they land rather than at engine shutdown.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).respawn_delay">RAT.respawn_delay</a></td>
<td class="summary">
<p>Delay in seconds until repawn happens after landing.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).return_zones">RAT.return_zones</a></td>
<td class="summary">
<p>Array containing the names of the return zones.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).returnzone">RAT.returnzone</a></td>
<td class="summary">
<p>Zone where aircraft will fly to before returning to their departure airport.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).roe">RAT.roe</a></td>
<td class="summary">
<p>ROE of spawned groups, default is weapon hold (this is a peaceful class for civil aircraft or ferry missions). Possible: "hold", "return", "free".</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).rot">RAT.rot</a></td>
<td class="summary">
<p>ROT of spawned groups, default is no reaction. Possible: "noreaction", "passive", "evade".</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).skill">RAT.skill</a></td>
<td class="summary">
<p>Skill of AI.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).spawndelay">RAT.spawndelay</a></td>
<td class="summary">
<p>Delay time in seconds before first spawning happens.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).spawninitialized">RAT.spawninitialized</a></td>
<td class="summary">
<p>If RAT:Spawn() was already called this RAT object is set to true to prevent users to call it again.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).spawninterval">RAT.spawninterval</a></td>
<td class="summary">
<p>Interval between spawning units/groups. Note that we add a randomization of 50%.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).status">RAT.status</a></td>
<td class="summary">
<p>RAT aircraft status.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).statusinterval">RAT.statusinterval</a></td>
<td class="summary">
<p>Intervall between status checks (and reports if enabled).</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).takeoff">RAT.takeoff</a></td>
<td class="summary">
<p>Takeoff type. 0=coldorhot.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).templategroup">RAT.templategroup</a></td>
<td class="summary">
<p>Group serving as template for the RAT aircraft.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).type">RAT.type</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).uncontrolled">RAT.uncontrolled</a></td>
<td class="summary">
<p>If true aircraft are spawned in uncontrolled state and will only sit on their parking spots. </p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).unit">RAT.unit</a></td>
<td class="summary">
<p>RAT unit conversions.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).version">RAT.version</a></td>
<td class="summary">
<p>RAT version.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).waypointdescriptions">RAT.waypointdescriptions</a></td>
<td class="summary">
<p>Table with strings for waypoint descriptions of markers.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).waypointstatus">RAT.waypointstatus</a></td>
<td class="summary">
<p>Table with strings of waypoint status.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(RAT).wp">RAT.wp</a></td>
<td class="summary">
<p>RAT waypoint type.</p>
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(RAT)">#RAT</a></em>
<a id="RAT" >
<strong>RAT</strong>
</a>
</dt>
<dd>
<h1>RAT class, extends <a href="Spawn.html##(SPAWN)">Spawn#SPAWN</a></h1>
<p>The RAT class implements an easy to use way to randomly fill your map with AI aircraft.</p>
<h2>Airport Selection</h2>
<p><img src="..\Presentations\RAT\RAT_Airport_Selection.png" alt="Process"/></p>
<h3>Default settings:</h3>
<ul>
<li>By default, aircraft are spawned at airports of their own coalition (blue or red) or neutral airports.</li>
<li>Destination airports are by default also of neutral or of the same coalition as the template group of the spawned aircraft.</li>
<li>Possible destinations are restricted by their distance to the departure airport. The maximal distance depends on the max range of spawned aircraft type and its initial fuel amount.</li>
</ul>
<h3>The default behavior can be changed:</h3>
<ul>
<li>A specific departure and/or destination airport can be chosen.</li>
<li>Valid coalitions can be set, e.g. only red, blue or neutral, all three "colours".</li>
<li>It is possible to start in air within a zone defined in the mission editor or within a zone above an airport of the map.</li>
</ul>
<h2>Flight Plan</h2>
<p><img src="..\Presentations\RAT\RAT_Flight_Plan.png" alt="Process"/></p>
<ul>
<li>A general flight plan has five main airborne segments: Climb, cruise, descent, holding and final approach.</li>
<li>Events monitored during the flight are: birth, engine-start, take-off, landing and engine-shutdown.</li>
<li>The default flight level (FL) is set to ~FL200, i.e. 20000 feet ASL but randomized for each aircraft.
Service ceiling of aircraft type is into account for max FL as well as the distance between departure and destination.</li>
<li>Maximal distance between destination and departure airports depends on range and initial fuel of aircraft.</li>
<li>Climb rate is set to a moderate value of ~1500 ft/min.</li>
<li>The standard descent rate follows the 3:1 rule, i.e. 1000 ft decent per 3 miles of travel. Hence, angle of descent is ~3.6 degrees.</li>
<li>A holding point is randomly selected at a distance between 5 and 10 km away from destination airport.</li>
<li>The altitude of theholding point is ~1200 m AGL. Holding patterns might or might not happen with variable duration.</li>
<li>If an aircraft is spawned in air, the procedure omitts taxi and take-off and starts with the climb/cruising part.</li>
<li>All values are randomized for each spawned aircraft.</li>
</ul>
<h2>Mission Editor Setup</h2>
<p><img src="..\Presentations\RAT\RAT_Mission_Setup.png" alt="Process"/></p>
<p>Basic mission setup is very simple and essentially a three step process:</p>
<ul>
<li>Place your aircraft <strong>anywhere</strong> on the map. It really does not matter where you put it.</li>
<li>Give the group a good name. In the example above the group is named "RAT_YAK".</li>
<li>Activate the "LATE ACTIVATION" tick box. Note that this aircraft will not be spawned itself but serves a template for each RAT aircraft spawned when the mission starts. </li>
</ul>
<p>Voilà, your already done!</p>
<p>Optionally, you can set a specific livery for the aircraft or give it some weapons.
However, the aircraft will by default not engage any enemies. Think of them as beeing on a peaceful or ferry mission.</p>
<h2>Basic Lua Script</h2>
<p><img src="..\Presentations\RAT\RAT_Basic_Lua_Script.png" alt="Process"/></p>
<p>The basic Lua script for one template group consits of two simple lines as shown in the picture above.</p>
<ul>
<li><strong>Line 2</strong> creates a new RAT object "yak". The only required parameter for the constructor <a href="##(RAT).New">RAT.New</a>() is the name of the group as defined in the mission editor. In this example it is "RAT_YAK".</li>
<li><strong>Line 5</strong> trigger the command to spawn the aircraft. The (optional) parameter for the <a href="##(RAT).Spawn">RAT.Spawn</a>() function is the number of aircraft to be spawned of this object.
By default each of these aircraft gets a random departure airport anywhere on the map and a random destination airport, which lies within range of the of the selected aircraft type.</li>
</ul>
<p>In this simple example aircraft are respawned with a completely new flightplan when they have reached their destination airport.
The "old" aircraft is despawned (destroyed) after it has shut-down its engines and a new aircraft of the same type is spawned at a random departure airport anywhere on the map.
Hence, the default flight plan for a RAT aircraft will be: Fly from airport A to B, get respawned at C and fly to D, get respawned at E and fly to F, ...
This ensures that you always have a constant number of AI aircraft on your map.</p>
<h2>Examples</h2>
<p>Here are a few examples, how you can modify the default settings of RAT class objects.</p>
<h3>Specify Departure and Destinations</h3>
<p><img src="..\Presentations\RAT\RAT_Examples_Specify_Departure_and_Destination.png" alt="Process"/></p>
<p>In the picture above you find a few possibilities how to modify the default behaviour to spawn at random airports and fly to random destinations.</p>
<p>In particular, you can specify fixed departure and/or destination airports. This is done via the <a href="##(RAT).SetDeparture">RAT.SetDeparture</a>() or <a href="##(RAT).SetDestination">RAT.SetDestination</a>() functions, respectively.</p>
<ul>
<li>If you only fix a specific departure airport via <a href="##(RAT).SetDeparture">RAT.SetDeparture</a>() all aircraft will be spawned at that airport and get random destination airports.</li>
<li>If you only fix the destination airport via <a href="##(RAT).SetDestination">RAT.SetDestination</a>(), aircraft a spawned at random departure airports but will all fly to the destination airport.</li>
<li>If you fix departure and destination airports, aircraft will only travel from between those airports.
When the aircraft reaches its destination, it will be respawned at its departure and fly again to its destination. </li>
</ul>
<p>There is also an option that allows aircraft to "continue their journey" from their destination. This is achieved by the <a href="##(RAT).ContinueJourney">RAT.ContinueJourney</a>() function.
In that case, when the aircraft arrives at its first destination it will be respawned at that very airport and get a new random destination.
So the flight plan in this case would be: Fly from airport A to B, then from B to C, then from C to D, ...</p>
<p>It is also possible to make aircraft "commute" between two airports, i.e. flying from airport A to B and then back from B to A, etc.
This can be done by the <a href="##(RAT).Commute">RAT.Commute</a>() function. Note that if no departure or destination airports are specified, the first departure and destination are chosen randomly.
Then the aircraft will fly back and forth between those two airports indefinetly.</p>
<h3>Spawn in Air</h3>
<p><img src="..\Presentations\RAT\RAT_Examples_Spawn_in_Air.png" alt="Process"/></p>
<p>Aircraft can also be spawned in air rather than at airports on the ground. This is done by setting <a href="##(RAT).SetTakeoff">RAT.SetTakeoff</a>() to "air".</p>
<p>By default, aircraft are spawned randomly above airports of the map.</p>
<p>The <a href="##(RAT).SetDeparture">RAT.SetDeparture</a>() option can be used to specify zones, which have been defined in the mission editor as departure zones.
Aircraft will then be spawned at a random point within the zone or zones.</p>
<p>Note that <a href="##(RAT).SetDeparture">RAT.SetDeparture</a>() also accepts airport names. For an air takeoff these are treated like zones with a radius of XX kilometers.
Again, aircraft are spawned at random points within these zones around the airport.</p>
<h3>Misc Options</h3>
<p><img src="..\Presentations\RAT\RAT_Examples_Misc.png" alt="Process"/></p>
<p>The default "takeoff" type of RAT aircraft is that they are spawned with hot or cold engines.
The choice is random, so 50% of aircraft will be spawned with hot engines while the other 50% will be spawned with cold engines.
This setting can be changed using the <a href="##(RAT).SetTakeoff">RAT.SetTakeoff</a>() function. The possible parameters for starting on ground are:</p>
<ul>
<li><a href="##(RAT).SetTakeoff">RAT.SetTakeoff</a>("cold"), which means that all aircraft are spawned with their engines off,</li>
<li><a href="##(RAT).SetTakeoff">RAT.SetTakeoff</a>("hot"), which means that all aircraft are spawned with their engines on,</li>
<li><a href="##(RAT).SetTakeoff">RAT.SetTakeoff</a>("runway"), which means that all aircraft are spawned already at the runway ready to takeoff.
Note that in this case the default spawn intervall is set to 180 seconds in order to avoid aircraft jamms on the runway. Generally, this takeoff at runways should be used with care and problems are to be expected.</li>
</ul>
<p>The options <a href="##(RAT).SetMinDistance">RAT.SetMinDistance</a>() and <a href="##(RAT).SetMaxDistance">RAT.SetMaxDistance</a>() can be used to restrict the range from departure to destination. For example</p>
<ul>
<li><a href="##(RAT).SetMinDistance">RAT.SetMinDistance</a>(100) will cause only random destination airports to be selected which are <strong>at least</strong> 100 km away from the departure airport.</li>
<li><a href="##(RAT).SetMaxDistance">RAT.SetMaxDistance</a>(150) will allow only destination airports which are <strong>less than</strong> 150 km away from the departure airport.</li>
</ul>
<p><img src="..\Presentations\RAT\RAT_Gaussian.png" alt="Process"/></p>
<p>By default planes get a cruise altitude of ~20,000 ft ASL. The actual altitude is sampled from a Gaussian distribution. The picture shows this distribution
if one would spawn 1000 planes. As can be seen most planes get a cruising alt of around FL200. Other values are possible but less likely the further away
one gets from the expectation value.</p>
<p>The expectation value, i.e. the altitude most aircraft get, can be set with the function <a href="##(RAT).SetFLcruise">RAT.SetFLcruise</a>().
It is possible to restrict the minimum cruise altitude by <a href="##(RAT).SetFLmin">RAT.SetFLmin</a>() and the maximum cruise altitude by <a href="##(RAT).SetFLmax">RAT.SetFLmax</a>()</p>
<p>The cruise altitude can also be given in meters ASL by the functions <a href="##(RAT).SetCruiseAltitude">RAT.SetCruiseAltitude</a>(), <a href="##(RAT).SetMinCruiseAltitude">RAT.SetMinCruiseAltitude</a>() and <a href="##(RAT).SetMaxCruiseAltitude">RAT.SetMaxCruiseAltitude</a>().</p>
<p>For example:</p>
<ul>
<li><a href="##(RAT).SetFLcruise">RAT.SetFLcruise</a>(300) will cause most planes fly around FL300.</li>
<li><a href="##(RAT).SetFLmin">RAT.SetFLmin</a>(100) restricts the cruising alt such that no plane will fly below FL100. Note that this automatically changes the minimum distance from departure to destination.
That means that only destinations are possible for which the aircraft has had enought time to reach that flight level and descent again. </li>
<li><a href="##(RAT).SetFLmax">RAT.SetFLmax</a>(200) will restrict the cruise alt to maximum FL200, i.e. no aircraft will travel above this height.</li>
</ul>
</dd>
</dl>
<h2><a id="#(Rat)" >Type <code>Rat</code></a></h2>
<h2><a id="#(RAT)" >Type <code>RAT</code></a></h2>
<ul>
<li>RAT class</li>
</ul>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).ATC" >
<strong>RAT.ATC</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).ATC_Clearance" >
<strong>RAT:ATC_Clearance(n)</strong>
</a>
</dt>
<dd>
<p>Max number of planes that get landing clearance of the RAT ATC.</p>
<p>This setting effects all RAT objects and groups! </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number n </em></code>:
Number of aircraft that are allowed to land simultaniously. Default is 2.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).ATC_Delay" >
<strong>RAT:ATC_Delay(time)</strong>
</a>
</dt>
<dd>
<p>Delay between granting landing clearance for simultanious landings.</p>
<p>This setting effects all RAT objects and groups! </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number time </em></code>:
Delay time when the next aircraft will get landing clearance event if the previous one did not land yet. Default is 240 sec.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).ATCswitch" >
<strong>RAT.ATCswitch</strong>
</a>
</dt>
<dd>
<p>Enable/disable ATC if set to true/false.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).AddFriendlyAirportsToDepartures" >
<strong>RAT:AddFriendlyAirportsToDepartures()</strong>
</a>
</dt>
<dd>
<p>Add all friendly airports to the list of possible departures.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).AddFriendlyAirportsToDestinations" >
<strong>RAT:AddFriendlyAirportsToDestinations()</strong>
</a>
</dt>
<dd>
<p>Add all friendly airports to the list of possible destinations</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).AlphaDescent" >
<strong>RAT.AlphaDescent</strong>
</a>
</dt>
<dd>
<p>Default angle of descenti in degrees. A value of 3.6 follows the 3:1 rule of 3 miles of travel and 1000 ft descent.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).ChangeAircraft" >
<strong>RAT:ChangeAircraft(actype)</strong>
</a>
</dt>
<dd>
<p>Change aircraft type.</p>
<p>This is a dirty hack which allows to change the aircraft type of the template group.
Note that all parameters like cruise speed, climb rate, range etc are still taken from the template group which likely leads to strange behaviour.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string actype </em></code>:
Type of aircraft which is spawned independent of the template group. Use with care and expect problems!</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).ClassName" >
<strong>RAT.ClassName</strong>
</a>
</dt>
<dd>
<p>Name of the Class.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).ClearForLanding" >
<strong>RAT:ClearForLanding(name)</strong>
</a>
</dt>
<dd>
<p>Clear flight for landing.</p>
<p>Sets tigger value to 1.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string name </em></code>:
Name of flight to be cleared for landing.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).Commute" >
<strong>RAT:Commute()</strong>
</a>
</dt>
<dd>
<p>Aircraft will commute between their departure and destination airports or zones.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).ContinueJourney" >
<strong>RAT:ContinueJourney()</strong>
</a>
</dt>
<dd>
<p>Aircraft will continue their journey from their destination.</p>
<p>This means they are respawned at their destination and get a new random destination.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).DestinationZone" >
<strong>RAT:DestinationZone()</strong>
</a>
</dt>
<dd>
<p>Destinations are treated as zones.</p>
<p>Aircraft will not land but rather be despawned when they reach a random point in the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).EnableATC" >
<strong>RAT:EnableATC(switch)</strong>
</a>
</dt>
<dd>
<p>Enable ATC, which manages the landing queue for RAT aircraft if they arrive simultaniously at the same airport.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#boolean switch </em></code>:
Enable ATC (true) or Disable ATC (false). No argument means ATC enabled. </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).ExcludedAirports" >
<strong>RAT:ExcludedAirports(ports)</strong>
</a>
</dt>
<dd>
<p>Airports, FARPs and ships explicitly excluded as departures and destinations.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string ports </em></code>:
Name or table of names of excluded airports.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).FLcruise" >
<strong>RAT.FLcruise</strong>
</a>
</dt>
<dd>
<p>Cruise altitude of aircraft. Default FL200 for planes and F005 for helos.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).FLmaxuser" >
<strong>RAT.FLmaxuser</strong>
</a>
</dt>
<dd>
<p>Maximum flight level set by user.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).FLminuser" >
<strong>RAT.FLminuser</strong>
</a>
</dt>
<dd>
<p>Minimum flight level set by user.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).FLuser" >
<strong>RAT.FLuser</strong>
</a>
</dt>
<dd>
<p>Flight level set by users explicitly.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).Livery" >
<strong>RAT:Livery(skins)</strong>
</a>
</dt>
<dd>
<p>Set livery of aircraft.</p>
<p>If more than one livery is specified in a table, the actually used one is chosen randomly from the selection.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#table skins </em></code>:
Name of livery or table of names of liveries.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).Menu" >
<strong>RAT.Menu</strong>
</a>
</dt>
<dd>
<p>F10 menu items for this RAT object.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).MenuF10" >
<strong>RAT.MenuF10</strong>
</a>
</dt>
<dd>
<p>Main F10 menu.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).MenuName" >
<strong>RAT:MenuName(name)</strong>
</a>
</dt>
<dd>
<p>Set the name of the F10 submenu.</p>
<p>Default is the name of the template group.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string name </em></code>:
Submenu name.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).Ndeparture_Airports" >
<strong>RAT.Ndeparture_Airports</strong>
</a>
</dt>
<dd>
<p>Number of departure airports set via SetDeparture().</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).Ndeparture_Zones" >
<strong>RAT.Ndeparture_Zones</strong>
</a>
</dt>
<dd>
<p>Number of departure zones set via SetDeparture.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).Ndestination_Airports" >
<strong>RAT.Ndestination_Airports</strong>
</a>
</dt>
<dd>
<p>Number of destination airports set via SetDestination().</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).Ndestination_Zones" >
<strong>RAT.Ndestination_Zones</strong>
</a>
</dt>
<dd>
<p>Number of destination zones set via SetDestination().</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).New" >
<strong>RAT:New(groupname, alias)</strong>
</a>
</dt>
<dd>
<p>Create a new RAT object.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string groupname </em></code>:
Name of the group as defined in the mission editor. This group is serving as a template for all spawned units.</p>
</li>
<li>
<p><code><em>#string alias </em></code>:
(Optional) Alias of the group. This is and optional parameter but must(!) be used if the same template group is used for more than one RAT object. </p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="##(RAT)">#RAT</a>:</em>
Object of RAT class.</p>
</li>
<li>
<p><em>#nil:</em>
If the group does not exist in the mission editor.</p>
</li>
</ol>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>yak1:RAT("RAT_YAK") will create a RAT object called "yak1". The template group in the mission editor must have the name "RAT_YAK".</code></pre></li>
<li><pre class="example"><code>yak2:RAT("RAT_YAK", "Yak2") will create a RAT object "yak2". The template group in the mission editor must have the name "RAT_YAK" but the group will be called "Yak2" in e.g. the F10 menu.</code></pre></li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).NoRespawn" >
<strong>RAT:NoRespawn()</strong>
</a>
</dt>
<dd>
<p>Aircraft will not get respawned when they finished their route.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).PlaceMarkers" >
<strong>RAT:PlaceMarkers(switch)</strong>
</a>
</dt>
<dd>
<p>Place markers of waypoints on the F10 map.</p>
<p>Default is off.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#boolean switch </em></code>:
true=yes, false=no.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).ROE" >
<strong>RAT.ROE</strong>
</a>
</dt>
<dd>
<p>RAT rules of engagement.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).ROT" >
<strong>RAT.ROT</strong>
</a>
</dt>
<dd>
<p>RAT reaction to threat.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).RadioFrequency" >
<strong>RAT:RadioFrequency(frequency)</strong>
</a>
</dt>
<dd>
<p>Set radio frequency.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number frequency </em></code>:
Radio frequency.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).RadioModulation" >
<strong>RAT:RadioModulation(modulation)</strong>
</a>
</dt>
<dd>
<p>Set radio modulation.</p>
<p>Default is AM.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string modulation </em></code>:
Either "FM" or "AM". If no value is given, modulation is set to AM.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).RadioOFF" >
<strong>RAT:RadioOFF()</strong>
</a>
</dt>
<dd>
<p>Disable Radio.</p>
<p>Overrules the ME setting.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).RadioON" >
<strong>RAT:RadioON()</strong>
</a>
</dt>
<dd>
<p>Enable Radio.</p>
<p>Overrules the ME setting.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).RespawnAfterLanding" >
<strong>RAT:RespawnAfterLanding(delay)</strong>
</a>
</dt>
<dd>
<p>Make aircraft respawn the moment they land rather than at engine shut down.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number delay </em></code>:
(Optional) Delay in seconds until respawn happens after landing. Default is 180 seconds. Minimum is 0.5 seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).RespawnAfterTakeoff" >
<strong>RAT:RespawnAfterTakeoff()</strong>
</a>
</dt>
<dd>
<p>Aircraft will be respawned directly after take-off.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).ReturnZone" >
<strong>RAT:ReturnZone()</strong>
</a>
</dt>
<dd>
<p>Aircraft will fly to a random point within a zone and then return to its departure airport or zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetAISkill" >
<strong>RAT:SetAISkill(skill)</strong>
</a>
</dt>
<dd>
<p>Set skill of AI aircraft.</p>
<p>Default is "High". </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string skill </em></code>:
Skill, options are "Average", "Good", "High", "Excellent" and "Random". Parameter is case insensitive.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetClimbRate" >
<strong>RAT:SetClimbRate(rate)</strong>
</a>
</dt>
<dd>
<p>Set the climb rate.</p>
<p>This automatically sets the climb angle.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number rate </em></code>:
Climb rate in ft/min. Default is 1500 ft/min. Minimum is 100 ft/min. Maximum is 15,000 ft/min.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetCoalition" >
<strong>RAT:SetCoalition(friendly)</strong>
</a>
</dt>
<dd>
<p>Set the friendly coalitions from which the airports can be used as departure and destination.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string friendly </em></code>:
"same"=own coalition+neutral (default), "sameonly"=own coalition only, "neutral"=all neutral airports.
Default is "same", so aircraft will use airports of the coalition their spawn template has plus all neutral airports.</p>
</li>
</ul>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>yak:SetCoalition("neutral") will spawn aircraft randomly on all neutral airports.</code></pre></li>
<li><pre class="example"><code>yak:SetCoalition("sameonly") will spawn aircraft randomly on airports belonging to the same coalition only as the template.</code></pre></li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetCoalitionAircraft" >
<strong>RAT:SetCoalitionAircraft(color)</strong>
</a>
</dt>
<dd>
<p>Set coalition of RAT group.</p>
<p>You can make red templates blue and vice versa.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string color </em></code>:
Color of coalition, i.e. "red" or blue".</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetCountry" >
<strong>RAT:SetCountry(id)</strong>
</a>
</dt>
<dd>
<p>Set country of RAT group.</p>
<p>This overrules the coalition settings.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number id </em></code>:
DCS country enumerator ID. For example country.id.USA or country.id.RUSSIA.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetCruiseAltitude" >
<strong>RAT:SetCruiseAltitude(alt)</strong>
</a>
</dt>
<dd>
<p>Set cruising altitude.</p>
<p>This is still be checked for consitancy with selected route and prone to radomization.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number alt </em></code>:
Cruising altitude ASL in meters.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetDeparture" >
<strong>RAT:SetDeparture(departurenames)</strong>
</a>
</dt>
<dd>
<p>Set possible departure ports.</p>
<p>This can be an airport or a zone defined in the mission editor.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string departurenames </em></code>:
Name or table of names of departure airports or zones.</p>
</li>
</ul>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>RAT:SetDeparture("Sochi-Adler") will spawn RAT objects at Sochi-Adler airport.</code></pre></li>
<li><pre class="example"><code>RAT:SetDeparture({"Sochi-Adler", "Gudauta"}) will spawn RAT aircraft radomly at Sochi-Adler or Gudauta airport.</code></pre></li>
<li><pre class="example"><code>RAT:SetDeparture({"Zone A", "Gudauta"}) will spawn RAT aircraft in air randomly within Zone A, which has to be defined in the mission editor, or within a zone around Gudauta airport. Note that this also requires RAT:takeoff("air") to be set.</code></pre></li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetDeparturesFromZone" >
<strong>RAT:SetDeparturesFromZone(zone)</strong>
</a>
</dt>
<dd>
<p>Include all airports which lie in a zone as possible destinations.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> zone </em></code>:
Zone in which the destination airports lie. Has to be a MOOSE zone.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetDescentAngle" >
<strong>RAT:SetDescentAngle(angle)</strong>
</a>
</dt>
<dd>
<p>Set the angle of descent.</p>
<p>Default is 3.6 degrees, which corresponds to 3000 ft descent after one mile of travel.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number angle </em></code>:
Angle of descent in degrees. Minimum is 0.5 deg. Maximum 50 deg.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetDestination" >
<strong>RAT:SetDestination(destinationnames)</strong>
</a>
</dt>
<dd>
<p>Set name of destination airports or zones for the AI aircraft.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string destinationnames </em></code>:
Name of the destination airport or table of destination airports.</p>
</li>
</ul>
<h3>Usage:</h3>
<pre class="example"><code>RAT:SetDestination("Krymsk") makes all aircraft of this RAT oject fly to Krymsk airport.</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetDestinationsFromZone" >
<strong>RAT:SetDestinationsFromZone(zone)</strong>
</a>
</dt>
<dd>
<p>Include all airports which lie in a zone as possible destinations.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> zone </em></code>:
Zone in which the departure airports lie. Has to be a MOOSE zone.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetFL" >
<strong>RAT:SetFL(FL)</strong>
</a>
</dt>
<dd>
<p>Set flight level.</p>
<p>Setting this value will overrule all other logic. Aircraft will try to fly at this height regardless.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number FL </em></code>:
Fight Level in hundrets of feet. E.g. FL200 = 20000 ft ASL.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetFLcruise" >
<strong>RAT:SetFLcruise(FL)</strong>
</a>
</dt>
<dd>
<p>Set flight level of cruising part.</p>
<p>This is still be checked for consitancy with selected route and prone to radomization.
Default is FL200 for planes and FL005 for helicopters.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number FL </em></code>:
Flight level in hundrets of feet. E.g. FL200 = 20000 ft ASL.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetFLmax" >
<strong>RAT:SetFLmax(FL)</strong>
</a>
</dt>
<dd>
<p>Set max flight level.</p>
<p>Setting this value will overrule all other logic. Aircraft will try to fly at less than this FL regardless.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number FL </em></code>:
Maximum Fight Level in hundrets of feet.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetFLmin" >
<strong>RAT:SetFLmin(FL)</strong>
</a>
</dt>
<dd>
<p>Set min flight level.</p>
<p>Setting this value will overrule all other logic. Aircraft will try to fly at higher than this FL regardless.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number FL </em></code>:
Maximum Fight Level in hundrets of feet.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetMaxCruiseAltitude" >
<strong>RAT:SetMaxCruiseAltitude(alt)</strong>
</a>
</dt>
<dd>
<p>Set max cruising altitude above sea level.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number alt </em></code>:
Altitude ASL in meters.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetMaxCruiseSpeed" >
<strong>RAT:SetMaxCruiseSpeed(speed)</strong>
</a>
</dt>
<dd>
<p>Set the maximum cruise speed of the aircraft.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number speed </em></code>:
Speed in km/h.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetMaxDistance" >
<strong>RAT:SetMaxDistance(dist)</strong>
</a>
</dt>
<dd>
<p>Set maximum distance between departure and destination.</p>
<p>Default is 5000 km but aircarft range is also taken into account automatically.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number dist </em></code>:
Distance in km.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetMinCruiseAltitude" >
<strong>RAT:SetMinCruiseAltitude(alt)</strong>
</a>
</dt>
<dd>
<p>Set min cruising altitude above sea level.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number alt </em></code>:
Altitude ASL in meters.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetMinDistance" >
<strong>RAT:SetMinDistance(dist)</strong>
</a>
</dt>
<dd>
<p>Set minimum distance between departure and destination.</p>
<p>Default is 5 km.
Minimum distance should not be smaller than maybe ~500 meters to ensure that departure and destination are different.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number dist </em></code>:
Distance in km.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetParkingID" >
<strong>RAT:SetParkingID(id)</strong>
</a>
</dt>
<dd>
<p>Set parking id of aircraft.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string id </em></code>:
Parking ID of the aircraft.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetROE" >
<strong>RAT:SetROE(roe)</strong>
</a>
</dt>
<dd>
<p>Set rules of engagement (ROE).</p>
<p>Default is weapon hold. This is a peaceful class.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string roe </em></code>:
"hold" = weapon hold, "return" = return fire, "free" = weapons free.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetROT" >
<strong>RAT:SetROT(rot)</strong>
</a>
</dt>
<dd>
<p>Set reaction to threat (ROT).</p>
<p>Default is no reaction, i.e. aircraft will simply ignore all enemies.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string rot </em></code>:
"noreaction" = no reaction to threats, "passive" = passive defence, "evade" = evade enemy attacks.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetSpawnDelay" >
<strong>RAT:SetSpawnDelay(delay)</strong>
</a>
</dt>
<dd>
<p>Set the delay before first group is spawned. </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number delay </em></code>:
Delay in seconds. Default is 5 seconds. Minimum delay is 0.5 seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetSpawnInterval" >
<strong>RAT:SetSpawnInterval(interval)</strong>
</a>
</dt>
<dd>
<p>Set the interval between spawnings of the template group.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number interval </em></code>:
Interval in seconds. Default is 5 seconds. Minimum is 0.5 seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).SetTakeoff" >
<strong>RAT:SetTakeoff(type)</strong>
</a>
</dt>
<dd>
<p>Set takeoff type.</p>
<p>Starting cold at airport, starting hot at airport, starting at runway, starting in the air.
Default is "takeoff-coldorhot". So there is a 50% chance that the aircraft starts with cold engines and 50% that it starts with hot engines. </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string type </em></code>:
Type can be "takeoff-cold" or "cold", "takeoff-hot" or "hot", "takeoff-runway" or "runway", "air".</p>
</li>
</ul>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>RAT:Takeoff("hot") will spawn RAT objects at airports with engines started.</code></pre></li>
<li><pre class="example"><code>RAT:Takeoff("cold") will spawn RAT objects at airports with engines off.</code></pre></li>
<li><pre class="example"><code>RAT:Takeoff("air") will spawn RAT objects in air over random airports or within pre-defined zones. </code></pre></li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).Spawn" >
<strong>RAT:Spawn(naircraft)</strong>
</a>
</dt>
<dd>
<p>Triggers the spawning of AI aircraft.</p>
<p>Note that all additional options should be set before giving the spawn command.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number naircraft </em></code>:
(Optional) Number of aircraft to spawn. Default is one aircraft.</p>
</li>
</ul>
<h3>Usage:</h3>
<pre class="example"><code>yak:Spawn(5) will spawn five aircraft. By default aircraft will spawn at neutral and red airports if the template group is part of the red coaliton.</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).Status" >
<strong>RAT:Status(message, forID)</strong>
</a>
</dt>
<dd>
<p>Report status of RAT groups.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#boolean message </em></code>:
(Optional) Send message with report to all if true.</p>
</li>
<li>
<p><code><em>#number forID </em></code>:
(Optional) Send message only for this ID.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).StatusReports" >
<strong>RAT:StatusReports(switch)</strong>
</a>
</dt>
<dd>
<p>Aircraft report status update messages along the route.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#boolean switch </em></code>:
Swtich reports on (true) or off (false). No argument is on.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).SubMenuName" >
<strong>RAT.SubMenuName</strong>
</a>
</dt>
<dd>
<p>Submenu name for RAT object.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).TimeDestroyInactive" >
<strong>RAT:TimeDestroyInactive(time)</strong>
</a>
</dt>
<dd>
<p>Set the time after which inactive groups will be destroyed. </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number time </em></code>:
Time in seconds. Default is 600 seconds = 10 minutes. Minimum is 60 seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).Tinactive" >
<strong>RAT.Tinactive</strong>
</a>
</dt>
<dd>
<p>Time in seconds after which inactive units will be destroyed. Default is 300 seconds.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT).Uncontrolled" >
<strong>RAT:Uncontrolled()</strong>
</a>
</dt>
<dd>
<p>Spawn aircraft in uncontolled state.</p>
<p>Aircraft will only sit at their parking spots. Only for populating airfields. </p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).Vclimb" >
<strong>RAT.Vclimb</strong>
</a>
</dt>
<dd>
<p>Default climb rate in ft/min.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).Vcruisemax" >
<strong>RAT.Vcruisemax</strong>
</a>
</dt>
<dd>
<p>Max cruise speed in m/s (250 m/s = 900 km/h = 486 kt) set by user.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCAddFlight" >
<strong>RAT:_ATCAddFlight(name, dest)</strong>
</a>
</dt>
<dd>
<p>Adds andd initializes a new flight after it was spawned.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string name </em></code>:
Group name of the flight.</p>
</li>
<li>
<p><code><em>#string dest </em></code>:
Name of the destination airport.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCCheck" >
<strong>RAT:_ATCCheck()</strong>
</a>
</dt>
<dd>
<p>Main ATC function.</p>
<p>Updates the landing queue of all airports and inceases holding time for all flights.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCClearForLanding" >
<strong>RAT:_ATCClearForLanding(airport, flight)</strong>
</a>
</dt>
<dd>
<p>Giving landing clearance for aircraft by setting user flag.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string airport </em></code>:
Name of destination airport.</p>
</li>
<li>
<p><code><em>#string flight </em></code>:
Group name of flight, which gets landing clearence.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCDelFlight" >
<strong>RAT:_ATCDelFlight(t, entry)</strong>
</a>
</dt>
<dd>
<p>Deletes a flight from ATC lists after it landed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table t </em></code>:
Table.</p>
</li>
<li>
<p><code><em>#string entry </em></code>:
Flight name which shall be deleted.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCFlightLanded" >
<strong>RAT:_ATCFlightLanded(name)</strong>
</a>
</dt>
<dd>
<p>Takes care of organisational stuff after a plane has landed.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string name </em></code>:
Group name of flight.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCInit" >
<strong>RAT:_ATCInit(airports_map)</strong>
</a>
</dt>
<dd>
<p>Initializes the ATC arrays and starts schedulers.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#table airports_map </em></code>:
List of all airports of the map.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCQueue" >
<strong>RAT:_ATCQueue()</strong>
</a>
</dt>
<dd>
<p>Creates a landing queue for all flights holding at airports.</p>
<p>Aircraft with longest holding time gets first permission to land.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCRegisterFlight" >
<strong>RAT:_ATCRegisterFlight(name, time)</strong>
</a>
</dt>
<dd>
<p>Registers a flight once it is near its holding point at the final destination.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string name </em></code>:
Group name of the flight.</p>
</li>
<li>
<p><code><em>#number time </em></code>:
Time the fight first registered.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ATCStatus" >
<strong>RAT:_ATCStatus()</strong>
</a>
</dt>
<dd>
<p>ATC status report about flights.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._AddFriendlyAirports" >
<strong>RAT:_AddFriendlyAirports(ports)</strong>
</a>
</dt>
<dd>
<p>Add names of all friendly airports to possible departure or destination airports if they are not already in the list. </p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#table ports </em></code>:
List of departure or destination airports/zones that will be added.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._AirportExists" >
<strong>RAT:_AirportExists(name)</strong>
</a>
</dt>
<dd>
<p>Test if an airport exists on the current map.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string name </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
True if airport exsits, false otherwise. </p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._AnticipatedGroupName" >
<strong>RAT:_AnticipatedGroupName(index)</strong>
</a>
</dt>
<dd>
<p>Anticipated group name from alias and spawn index.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number index </em></code>:
Spawnindex of group if given or self.SpawnIndex+1 by default. </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#string:</em>
Name the group will get after it is spawned.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._CheckConsistency" >
<strong>RAT:_CheckConsistency()</strong>
</a>
</dt>
<dd>
<p>Function checks consistency of user input and automatically adjusts parameters if necessary.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Course" >
<strong>RAT:_Course(a, b)</strong>
</a>
</dt>
<dd>
<p>Determine the heading from point a to point b.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a> a </em></code>:
Point from.</p>
</li>
<li>
<p><code><em><a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a> b </em></code>:
Point to.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
Heading/angle in degrees. </p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Debug" >
<strong>RAT:_Debug(switch)</strong>
</a>
</dt>
<dd>
<p>Turn debug messages on or off.</p>
<p>Default is off.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#boolean switch </em></code>:
Turn debug on=true or off=false. No argument means on.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._DeleteMarkers" >
<strong>RAT:_DeleteMarkers()</strong>
</a>
</dt>
<dd>
<p>Delete all markers on F10 map.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Despawn" >
<strong>RAT:_Despawn(group)</strong>
</a>
</dt>
<dd>
<p>Despawn unit.</p>
<p>Unit gets destoyed and group is set to nil.
Index of ratcraft array is taken from spawned group name.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> group </em></code>:
Group to be despawned.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._EngineStartup" >
<strong>RAT:_EngineStartup(EventData)</strong>
</a>
</dt>
<dd>
<p>Function is executed when a unit starts its engines.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Excluded" >
<strong>RAT:_Excluded(port)</strong>
</a>
</dt>
<dd>
<p>Check if airport is excluded from possible departures and destinations.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string port </em></code>:
Name of airport, FARP or ship to check.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
true if airport is excluded and false otherwise.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._FLmax" >
<strong>RAT:_FLmax(alpha, beta, d, phi, h0)</strong>
</a>
</dt>
<dd>
<p>Calculate the max flight level for a given distance and fixed climb and descent rates.</p>
<p>In other words we have a distance between two airports and want to know how high we
can climb before we must descent again to arrive at the destination without any level/cruising part.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number alpha </em></code>:
Angle of climb [rad].</p>
</li>
<li>
<p><code><em>#number beta </em></code>:
Angle of descent [rad].</p>
</li>
<li>
<p><code><em>#number d </em></code>:
Distance between the two airports [m].</p>
</li>
<li>
<p><code><em>#number phi </em></code>:
Angle between departure and destination [rad].</p>
</li>
<li>
<p><code><em>#number h0 </em></code>:
Height [m] of departure airport. Note we implicitly assume that the height difference between departure and destination is negligible.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
Maximal flight level in meters.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._GetAirportsInZone" >
<strong>RAT:_GetAirportsInZone(zone)</strong>
</a>
</dt>
<dd>
<p>Find airports within a zone.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a> zone </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(list)">#list</a>:</em>
Table with airport names that lie within the zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._GetAirportsOfCoalition" >
<strong>RAT:_GetAirportsOfCoalition()</strong>
</a>
</dt>
<dd>
<p>Get all "friendly" airports of the current map.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._GetAirportsOfMap" >
<strong>RAT:_GetAirportsOfMap()</strong>
</a>
</dt>
<dd>
<p>Get all airports of the current map.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._GetLife" >
<strong>RAT:_GetLife(group)</strong>
</a>
</dt>
<dd>
<p>Get (relative) life of first unit of a group.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> group </em></code>:
Group of unit.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
Life of unit in percent.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Heading" >
<strong>RAT:_Heading(course)</strong>
</a>
</dt>
<dd>
<p>Determine the heading for an aircraft to be entered in the route template.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number course </em></code>:
The course between two points in degrees.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
heading Heading in rad.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._InitAircraft" >
<strong>RAT:_InitAircraft(DCSgroup)</strong>
</a>
</dt>
<dd>
<p>Initialize basic parameters of the aircraft based on its (template) group in the mission editor.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSWrapper.Group.html##(Group)">Dcs.DCSWrapper.Group#Group</a> DCSgroup </em></code>:
Group of the aircraft in the mission editor.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._IsFriendly" >
<strong>RAT:_IsFriendly(port)</strong>
</a>
</dt>
<dd>
<p>Check if airport is friendly, i.e.</p>
<p>belongs to the right coalition.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string port </em></code>:
Name of airport, FARP or ship to check.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
true if airport is friendly and false otherwise.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._MinDistance" >
<strong>RAT:_MinDistance(alpha, beta, ha, hb)</strong>
</a>
</dt>
<dd>
<p>Calculate minimum distance between departure and destination for given minimum flight level and climb/decent rates.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number alpha </em></code>:
Angle of climb [rad].</p>
</li>
<li>
<p><code><em>#number beta </em></code>:
Angle of descent [rad].</p>
</li>
<li>
<p><code><em>#number ha </em></code>:
Height difference between departure and cruise altiude. </p>
</li>
<li>
<p><code><em>#number hb </em></code>:
Height difference between cruise altitude and destination.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em>#number:</em>
d1 Minimum distance for climb phase to reach cruise altitude.</p>
</li>
<li>
<p><em>#number:</em>
d2 Minimum distance for descent phase to reach destination height.</p>
</li>
<li>
<p><em>#number:</em>
dtot Minimum total distance to climb and descent.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ModifySpawnTemplate" >
<strong>RAT:_ModifySpawnTemplate(waypoints, livery)</strong>
</a>
</dt>
<dd>
<p>Modifies the template of the group to be spawned.</p>
<p>In particular, the waypoints of the group's flight plan are copied into the spawn template.
This allows to spawn at airports and also land at other airports, i.e. circumventing the DCS "landing bug".</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table waypoints </em></code>:
The waypoints of the AI flight plan.</p>
</li>
<li>
<p><code><em>#string livery </em></code>:
(Optional) Livery of the aircraft. All members of a flight will get the same livery.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._NameInList" >
<strong>RAT:_NameInList(liste, name)</strong>
</a>
</dt>
<dd>
<p>Check if a name/string is in a list or not.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table liste </em></code>:
List of names to be checked.</p>
</li>
<li>
<p><code><em>#string name </em></code>:
Name to be checked for.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._OnBirth" >
<strong>RAT:_OnBirth(EventData)</strong>
</a>
</dt>
<dd>
<p>Function is executed when a unit is spawned.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._OnCrash" >
<strong>RAT:_OnCrash(EventData)</strong>
</a>
</dt>
<dd>
<p>Function is executed when a unit crashes.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._OnDead" >
<strong>RAT:_OnDead(EventData)</strong>
</a>
</dt>
<dd>
<p>Function is executed when a unit is dead.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._OnEngineShutdown" >
<strong>RAT:_OnEngineShutdown(EventData)</strong>
</a>
</dt>
<dd>
<p>Function is executed when a unit shuts down its engines.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._OnLand" >
<strong>RAT:_OnLand(EventData)</strong>
</a>
</dt>
<dd>
<p>Function is executed when a unit lands.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._OnTakeoff" >
<strong>RAT:_OnTakeoff(EventData)</strong>
</a>
</dt>
<dd>
<p>Function is executed when a unit takes off.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventData </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._PickDeparture" >
<strong>RAT:_PickDeparture(takeoff)</strong>
</a>
</dt>
<dd>
<p>Set the departure airport of the AI.</p>
<p>If no airport name is given explicitly an airport from the coalition is chosen randomly.
If takeoff style is set to "air", we use zones around the airports or the zones specified by user input.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number takeoff </em></code>:
Takeoff type.</p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a>:</em>
Departure airport if spawning at airport.</p>
</li>
<li>
<p><em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a>:</em>
Departure zone if spawning in air.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._PickDestination" >
<strong>RAT:_PickDestination(departure, q, minrange, maxrange, random, landing)</strong>
</a>
</dt>
<dd>
<p>Pick destination airport or zone depending on departure position.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a> departure </em></code>:
Departure airport or zone.</p>
</li>
<li>
<p><code><em><a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a> q </em></code>:
Coordinate of the departure point.</p>
</li>
<li>
<p><code><em>#number minrange </em></code>:
Minimum range to q in meters.</p>
</li>
<li>
<p><code><em>#number maxrange </em></code>:
Maximum range to q in meters.</p>
</li>
<li>
<p><code><em>#boolean random </em></code>:
Destination is randomly selected from friendly airport (true) or from destinations specified by user input (false).</p>
</li>
<li>
<p><code><em>#number landing </em></code>:
Number indicating whether we land at a destination airport or fly to a zone object.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a>:</em>
destination Destination airport or zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._PlaceMarkers" >
<strong>RAT:_PlaceMarkers(waypoints, index)</strong>
</a>
</dt>
<dd>
<p>Place markers of the waypoints.</p>
<p>Note we assume a very specific number and type of waypoints here.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table waypoints </em></code>:
Table with waypoints.</p>
</li>
<li>
<p><code><em>#number index </em></code>:
Spawn index of group.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Random_Gaussian" >
<strong>RAT._Random_Gaussian(x0, sigma, xmin, xmax, self)</strong>
</a>
</dt>
<dd>
<p>Generate Gaussian pseudo-random numbers.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number x0 </em></code>:
Expectation value of distribution.</p>
</li>
<li>
<p><code><em>#number sigma </em></code>:
(Optional) Standard deviation. Default 10.</p>
</li>
<li>
<p><code><em>#number xmin </em></code>:
(Optional) Lower cut-off value.</p>
</li>
<li>
<p><code><em>#number xmax </em></code>:
(Optional) Upper cut-off value.</p>
</li>
<li>
<p><code><em> self </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
Gaussian random number.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Randomize" >
<strong>RAT:_Randomize(value, fac, lower, upper)</strong>
</a>
</dt>
<dd>
<p>Randomize a value by a certain amount.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number value </em></code>:
The value which should be randomized</p>
</li>
<li>
<p><code><em>#number fac </em></code>:
Randomization factor.</p>
</li>
<li>
<p><code><em>#number lower </em></code>:
(Optional) Lower limit of the returned value.</p>
</li>
<li>
<p><code><em>#number upper </em></code>:
(Optional) Upper limit of the returned value.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
Randomized value.</p>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>_Randomize(100, 0.1) returns a value between 90 and 110, i.e. a plus/minus ten percent variation.</code></pre></li>
<li><pre class="example"><code>_Randomize(100, 0.5, nil, 120) returns a value between 50 and 120, i.e. a plus/minus fivty percent variation with upper bound 120.</code></pre></li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Respawn" >
<strong>RAT:_Respawn(group)</strong>
</a>
</dt>
<dd>
<p>Respawn a group.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> group </em></code>:
Group to be repawned.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Routeinfo" >
<strong>RAT:_Routeinfo(waypoints, comment)</strong>
</a>
</dt>
<dd>
<p>Provide information about the assigned flightplan.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table waypoints </em></code>:
Waypoints of the flight plan.</p>
</li>
<li>
<p><code><em>#string comment </em></code>:
Some comment to identify the provided information.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#number:</em>
total Total route length in meters.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._SetCoalitionTable" >
<strong>RAT:_SetCoalitionTable()</strong>
</a>
</dt>
<dd>
<p>Create a table with the valid coalitions for departure and destination airports.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._SetMarker" >
<strong>RAT:_SetMarker(text, wp, index)</strong>
</a>
</dt>
<dd>
<p>Set a marker visible for all on the F10 map.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string text </em></code>:
Info text displayed at maker.</p>
</li>
<li>
<p><code><em>#table wp </em></code>:
Position of marker coming in as waypoint, i.e. has x, y and alt components.</p>
</li>
<li>
<p><code><em>#number index </em></code>:
Spawn index of group. </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._SetROE" >
<strong>RAT:_SetROE(group, roe)</strong>
</a>
</dt>
<dd>
<p>Set ROE for a group.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> group </em></code>:
Group for which the ROE is set.</p>
</li>
<li>
<p><code><em>#string roe </em></code>:
ROE of group.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._SetROT" >
<strong>RAT:_SetROT(group, rot)</strong>
</a>
</dt>
<dd>
<p>Set ROT for a group.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> group </em></code>:
Group for which the ROT is set.</p>
</li>
<li>
<p><code><em>#string rot </em></code>:
ROT of group.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._SetRoute" >
<strong>RAT:_SetRoute(Takeoff, Landing, _departure, _destination, takeoff, landing, _waypoint)</strong>
</a>
</dt>
<dd>
<p>Set the route of the AI plane.</p>
<p>Due to DCS landing bug, this has to be done before the unit is spawned.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="takeoff.html##(RAT.wp)">takeoff#RAT.wp</a> Takeoff </em></code>:
type. Could also be air start.</p>
</li>
<li>
<p><code><em><a href="landing.html##(RAT.wp)">landing#RAT.wp</a> Landing </em></code>:
type. Could also be a destination in air.</p>
</li>
<li>
<p><code><em><a href="Wrapper.Airport.html##(AIRBASE)">Wrapper.Airport#AIRBASE</a> _departure </em></code>:
(Optional) Departure airbase.</p>
</li>
<li>
<p><code><em><a href="Wrapper.Airport.html##(AIRBASE)">Wrapper.Airport#AIRBASE</a> _destination </em></code>:
(Optional) Destination airbase.</p>
</li>
<li>
<p><code><em> takeoff </em></code>: </p>
</li>
<li>
<p><code><em> landing </em></code>: </p>
</li>
<li>
<p><code><em> _waypoint </em></code>: </p>
</li>
</ul>
<h3>Return values</h3>
<ol>
<li>
<p><em><a href="Wrapper.Airport.html##(AIRBASE)">Wrapper.Airport#AIRBASE</a>:</em>
Departure airbase.</p>
</li>
<li>
<p><em><a href="Wrapper.Airport.html##(AIRBASE)">Wrapper.Airport#AIRBASE</a>:</em>
Destination airbase.</p>
</li>
<li>
<p><em>#table:</em>
Table of flight plan waypoints.</p>
</li>
<li>
<p><em>#nil:</em>
If no valid departure or destination airport could be found.</p>
</li>
</ol>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._SetStatus" >
<strong>RAT:_SetStatus(group, status)</strong>
</a>
</dt>
<dd>
<p>Set status of group.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> group </em></code>: </p>
</li>
<li>
<p><code><em> status </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._SpawnWithRoute" >
<strong>RAT:_SpawnWithRoute(_departure, _destination, _takeoff, _landing, _livery, _waypoint)</strong>
</a>
</dt>
<dd>
<p>Spawn the AI aircraft with a route.</p>
<p>Sets the departure and destination airports and waypoints.
Modifies the spawn template.
Sets ROE/ROT.
Initializes the ratcraft array and group menu.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string _departure </em></code>:
(Optional) Name of departure airbase.</p>
</li>
<li>
<p><code><em>#string _destination </em></code>:
(Optional) Name of destination airbase.</p>
</li>
<li>
<p><code><em>#number _takeoff </em></code>:
Takeoff type id.</p>
</li>
<li>
<p><code><em> _landing </em></code>: </p>
</li>
<li>
<p><code><em> _livery </em></code>: </p>
</li>
<li>
<p><code><em> _waypoint </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._TaskFunction" >
<strong>RAT:_TaskFunction(FunctionString, ...)</strong>
</a>
</dt>
<dd>
<p>Task function.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string FunctionString </em></code>:
Name of the function to be called.</p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._TaskHolding" >
<strong>RAT:_TaskHolding(P1, Altitude, Speed, Duration)</strong>
</a>
</dt>
<dd>
<p>Orbit at a specified position at a specified alititude with a specified speed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec2)">Dcs.DCSTypes#Vec2</a> P1 </em></code>:
The point to hold the position.</p>
</li>
<li>
<p><code><em>#number Altitude </em></code>:
The altitude ASL at which to hold the position.</p>
</li>
<li>
<p><code><em>#number Speed </em></code>:
The speed flying when holding the position in m/s.</p>
</li>
<li>
<p><code><em>#number Duration </em></code>:
Duration of holding pattern in seconds.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Dcs.DCSTasking.Task.html##(Task)">Dcs.DCSTasking.Task#Task</a>:</em>
DCSTask</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._Waypoint" >
<strong>RAT:_Waypoint(Running, Type, Coord, Speed, Altitude, Airport, index)</strong>
</a>
</dt>
<dd>
<p>Create a waypoint that can be used with the Route command.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#number Running </em></code>:
index of waypoints. Starts with 1 which is normally departure/spawn waypoint.</p>
</li>
<li>
<p><code><em>#number Type </em></code>:
Type of waypoint.</p>
</li>
<li>
<p><code><em><a href="Core.Point.html##(COORDINATE)">Core.Point#COORDINATE</a> Coord </em></code>:
3D coordinate of the waypoint.</p>
</li>
<li>
<p><code><em>#number Speed </em></code>:
Speed in m/s.</p>
</li>
<li>
<p><code><em>#number Altitude </em></code>:
Altitude in m.</p>
</li>
<li>
<p><code><em><a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a> Airport </em></code>:
Airport of object to spawn.</p>
</li>
<li>
<p><code><em> index </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#table:</em>
Waypoints for DCS task route or spawn template.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._WaypointFunction" >
<strong>RAT._WaypointFunction(group, rat, wp)</strong>
</a>
</dt>
<dd>
<p>Function which is called after passing every waypoint.</p>
<p>Info on waypoint is given and special functions are executed.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Core.Group.html##(GROUP)">Core.Group#GROUP</a> group </em></code>:
Group of aircraft.</p>
</li>
<li>
<p><code><em><a href="##(RAT)">#RAT</a> rat </em></code>:
RAT object.</p>
</li>
<li>
<p><code><em>#number wp </em></code>:
Waypoint index. Running number of the waypoints. Determines the actions to be executed.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(RAT)._ZoneExists" >
<strong>RAT:_ZoneExists(name)</strong>
</a>
</dt>
<dd>
<p>Test if a trigger zone defined in the mission editor exists.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string name </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
True if zone exsits, false otherwise. </p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).actype" >
<strong>RAT.actype</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).addfriendlydepartures" >
<strong>RAT.addfriendlydepartures</strong>
</a>
</dt>
<dd>
<p>Add all friendly airports to departures.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).addfriendlydestinations" >
<strong>RAT.addfriendlydestinations</strong>
</a>
</dt>
<dd>
<p>Add all friendly airports to destinations.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).aircraft" >
<strong>RAT.aircraft</strong>
</a>
</dt>
<dd>
<p>Table which holds the basic aircraft properties (speed, range, ...).</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).airports" >
<strong>RAT.airports</strong>
</a>
</dt>
<dd>
<p>All airports of friedly coalitions.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).airports_map" >
<strong>RAT.airports_map</strong>
</a>
</dt>
<dd>
<p>All airports available on current map (Caucasus, Nevada, Normandy, ...).</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).alias" >
<strong>RAT.alias</strong>
</a>
</dt>
<dd>
<p>Alias for spawned group.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).alive" >
<strong>RAT.alive</strong>
</a>
</dt>
<dd>
<p>Number of groups which are alive.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).cat" >
<strong>RAT.cat</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).category" >
<strong>RAT.category</strong>
</a>
</dt>
<dd>
<p>Category of aircarft: "plane" or "heli".</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).coal" >
<strong>RAT.coal</strong>
</a>
</dt>
<dd>
<p>RAT friendly coalitions.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).coalition" >
<strong>RAT.coalition</strong>
</a>
</dt>
<dd>
<p>Coalition of spawn group template.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).commute" >
<strong>RAT.commute</strong>
</a>
</dt>
<dd>
<p>Aircraft commute between departure and destination, i.e. when respawned the departure airport becomes the new destiation.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).continuejourney" >
<strong>RAT.continuejourney</strong>
</a>
</dt>
<dd>
<p>Aircraft will continue their journey, i.e. get respawned at their destination with a new random destination.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).country" >
<strong>RAT.country</strong>
</a>
</dt>
<dd>
<p>Country of spawn group template.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).ctable" >
<strong>RAT.ctable</strong>
</a>
</dt>
<dd>
<p>Table with the valid coalitons from choice self.friendly.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).debug" >
<strong>RAT.debug</strong>
</a>
</dt>
<dd>
<p>Turn debug messages on or off.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a></em>
<a id="#(RAT).departure_Azone" >
<strong>RAT.departure_Azone</strong>
</a>
</dt>
<dd>
<p>Zone containing the departure airports.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).departure_ports" >
<strong>RAT.departure_ports</strong>
</a>
</dt>
<dd>
<p>Array containing the names of the destination airports or zones.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Core.Zone.html##(ZONE)">Core.Zone#ZONE</a></em>
<a id="#(RAT).destination_Azone" >
<strong>RAT.destination_Azone</strong>
</a>
</dt>
<dd>
<p>Zone containing the destination airports.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).destination_ports" >
<strong>RAT.destination_ports</strong>
</a>
</dt>
<dd>
<p>Array containing the names of the destination airports or zones.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).destinationzone" >
<strong>RAT.destinationzone</strong>
</a>
</dt>
<dd>
<p>Destination is a zone and not an airport.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).excluded_ports" >
<strong>RAT.excluded_ports</strong>
</a>
</dt>
<dd>
<p>Array containing the names of explicitly excluded airports.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).f10menu" >
<strong>RAT.f10menu</strong>
</a>
</dt>
<dd>
<p>Add an F10 menu for RAT.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).frequency" >
<strong>RAT.frequency</strong>
</a>
</dt>
<dd>
<p>Radio frequency used by the RAT groups.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).friendly" >
<strong>RAT.friendly</strong>
</a>
</dt>
<dd>
<p>Possible departure/destination airport: all=blue+red+neutral, same=spawn+neutral, spawnonly=spawn, blue=blue+neutral, blueonly=blue, red=red+neutral, redonly=red.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).id" >
<strong>RAT.id</strong>
</a>
</dt>
<dd>
<p>Some ID to identify who we are in output of the DCS.log file.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).landing" >
<strong>RAT.landing</strong>
</a>
</dt>
<dd>
<p>Landing type. Determines if we actually land at an airport or treat it as zone.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).livery" >
<strong>RAT.livery</strong>
</a>
</dt>
<dd>
<p>Livery of the aircraft set by user.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).markerid" >
<strong>RAT.markerid</strong>
</a>
</dt>
<dd>
<p>Running number of placed markers on the F10 map.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).markerids" >
<strong>RAT.markerids</strong>
</a>
</dt>
<dd>
<p>Array with marker IDs.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).maxdist" >
<strong>RAT.maxdist</strong>
</a>
</dt>
<dd>
<p>Max distance from departure to destination in meters. Default 5000 km.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).mindist" >
<strong>RAT.mindist</strong>
</a>
</dt>
<dd>
<p>Min distance from departure to destination in meters. Default 5 km.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).modulation" >
<strong>RAT.modulation</strong>
</a>
</dt>
<dd>
<p>Ratio modulation. Either "FM" or "AM".</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).ngroups" >
<strong>RAT.ngroups</strong>
</a>
</dt>
<dd>
<p>Number of groups to be spawned in total.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).norespawn" >
<strong>RAT.norespawn</strong>
</a>
</dt>
<dd>
<p>Aircraft will not be respawned after they have finished their route.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).onboard_num" >
<strong>RAT.onboard_num</strong>
</a>
</dt>
<dd>
<p> Onboard number.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).parking_id" >
<strong>RAT.parking_id</strong>
</a>
</dt>
<dd>
<p>String with a special parking ID for the aircraft.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).placemarkers" >
<strong>RAT.placemarkers</strong>
</a>
</dt>
<dd>
<p>Place markers of waypoints on F10 map.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).radio" >
<strong>RAT.radio</strong>
</a>
</dt>
<dd>
<p>If true/false disables radio messages from the RAT groups.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).random_departure" >
<strong>RAT.random_departure</strong>
</a>
</dt>
<dd>
<p>By default a random friendly airport is chosen as departure.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).random_destination" >
<strong>RAT.random_destination</strong>
</a>
</dt>
<dd>
<p>By default a random friendly airport is chosen as destination.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).ratcraft" >
<strong>RAT.ratcraft</strong>
</a>
</dt>
<dd>
<p>Array with the spawned RAT aircraft.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).reportstatus" >
<strong>RAT.reportstatus</strong>
</a>
</dt>
<dd>
<p>Aircraft report status.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).respawn_after_takeoff" >
<strong>RAT.respawn_after_takeoff</strong>
</a>
</dt>
<dd>
<p>Aircraft will be respawned directly after take-off.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).respawn_at_landing" >
<strong>RAT.respawn_at_landing</strong>
</a>
</dt>
<dd>
<p>Respawn aircraft the moment they land rather than at engine shutdown.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).respawn_delay" >
<strong>RAT.respawn_delay</strong>
</a>
</dt>
<dd>
<p>Delay in seconds until repawn happens after landing.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).return_zones" >
<strong>RAT.return_zones</strong>
</a>
</dt>
<dd>
<p>Array containing the names of the return zones.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).returnzone" >
<strong>RAT.returnzone</strong>
</a>
</dt>
<dd>
<p>Zone where aircraft will fly to before returning to their departure airport.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).roe" >
<strong>RAT.roe</strong>
</a>
</dt>
<dd>
<p>ROE of spawned groups, default is weapon hold (this is a peaceful class for civil aircraft or ferry missions). Possible: "hold", "return", "free".</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).rot" >
<strong>RAT.rot</strong>
</a>
</dt>
<dd>
<p>ROT of spawned groups, default is no reaction. Possible: "noreaction", "passive", "evade".</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).skill" >
<strong>RAT.skill</strong>
</a>
</dt>
<dd>
<p>Skill of AI.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).spawndelay" >
<strong>RAT.spawndelay</strong>
</a>
</dt>
<dd>
<p>Delay time in seconds before first spawning happens.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).spawninitialized" >
<strong>RAT.spawninitialized</strong>
</a>
</dt>
<dd>
<p>If RAT:Spawn() was already called this RAT object is set to true to prevent users to call it again.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).spawninterval" >
<strong>RAT.spawninterval</strong>
</a>
</dt>
<dd>
<p>Interval between spawning units/groups. Note that we add a randomization of 50%.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).status" >
<strong>RAT.status</strong>
</a>
</dt>
<dd>
<p>RAT aircraft status.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).statusinterval" >
<strong>RAT.statusinterval</strong>
</a>
</dt>
<dd>
<p>Intervall between status checks (and reports if enabled).</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(RAT).takeoff" >
<strong>RAT.takeoff</strong>
</a>
</dt>
<dd>
<p>Takeoff type. 0=coldorhot.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Core.Group.html##(GROUP)">Core.Group#GROUP</a></em>
<a id="#(RAT).templategroup" >
<strong>RAT.templategroup</strong>
</a>
</dt>
<dd>
<p>Group serving as template for the RAT aircraft.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).type" >
<strong>RAT.type</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em>#boolean</em>
<a id="#(RAT).uncontrolled" >
<strong>RAT.uncontrolled</strong>
</a>
</dt>
<dd>
<p>If true aircraft are spawned in uncontrolled state and will only sit on their parking spots. </p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).unit" >
<strong>RAT.unit</strong>
</a>
</dt>
<dd>
<p>RAT unit conversions.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(RAT).version" >
<strong>RAT.version</strong>
</a>
</dt>
<dd>
<p>RAT version.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).waypointdescriptions" >
<strong>RAT.waypointdescriptions</strong>
</a>
</dt>
<dd>
<p>Table with strings for waypoint descriptions of markers.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#table</em>
<a id="#(RAT).waypointstatus" >
<strong>RAT.waypointstatus</strong>
</a>
</dt>
<dd>
<p>Table with strings of waypoint status.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(RAT).wp" >
<strong>RAT.wp</strong>
</a>
</dt>
<dd>
<p>RAT waypoint type.</p>
</dd>
</dl>
<h2><a id="#(list)" >Type <code>list</code></a></h2>
</div>
</div>
</body>
</html>