Banner Image

Module AI.AI_A2A_Dispatcher

AI - (R2.2) - Manages the process of an automatic A2A defense system based on an EWR network targets and coordinating CAP and GCI.


Features:

  • Setup quickly an A2A defense system for a coalition.
  • Setup (CAP) Control Air Patrols at defined zones to enhance your A2A defenses.
  • Setup (GCI) Ground Control Intercept at defined airbases to enhance your A2A defenses.
  • Define and use an EWR (Early Warning Radar) network.
  • Define squadrons at airbases.
  • Enable airbases for A2A defenses.
  • Add different plane types to different squadrons.
  • Add multiple squadrons to different airbases.
  • Define different ranges to engage upon intruders.
  • Establish an automatic in air refuel process for CAP using refuel tankers.
  • Setup default settings for all squadrons and A2A defenses.
  • Setup specific settings for specific squadrons.
  • Quickly setup an A2A defense system using #AI_A2A_GCICAP.
  • Setup a more advanced defense system using #AI_A2A_DISPATCHER.

Missions:

AID-A2A - AI A2A Dispatching


YouTube Channel:

DCS WORLD - MOOSE - A2A GCICAP - Build an automatic A2A Defense System


QUICK START GUIDE

There are basically two classes available to model an A2A defense system.

AI_A2A_DISPATCHER is the main A2A defense class that models the A2A defense system. AI_A2A_GCICAP derives or inherits from AI_A2A_DISPATCHER and is a more noob user friendly class, but is less flexible.

Before you start using the AI_A2A_DISPATCHER or AI_A2A_GCICAP ask youself the following questions.

0. Do I need AI_A2A_DISPATCHER or do I need AI_A2A_GCICAP?

AI_A2A_GCICAP, automates a lot of the below questions using the mission editor and requires minimal lua scripting. But the AI_A2A_GCICAP provides less flexibility and a lot of options are defaulted. With AI_A2A_DISPATCHER you can setup a much more fine grained A2A defense mechanism, but some more (easy) lua scripting is required.

1. Which Coalition am I modeling an A2A defense system for? blue or red?

One AI_A2A_DISPATCHER object can create a defense system for one coalition, which is blue or red. If you want to create a mutual defense system, for both blue and red, then you need to create two AI_A2A_DISPATCHER objects, each governing their defense system.

2. Which type of EWR will I setup? Grouping based per AREA, per TYPE or per UNIT? (Later others will follow).

The MOOSE framework leverages the Detection classes to perform the EWR detection. Several types of Detection classes exist, and the most common characteristics of these classes is that they:

  • Perform detections from multiple FACs as one co-operating entity.
  • Communicate with a Head Quarters, which consolidates each detection.
  • Groups detections based on a method (per area, per type or per unit).
  • Communicates detections.

3. Which EWR units will be used as part of the detection system? Only Ground or also Airborne?

Typically EWR networks are setup using 55G6 EWR, 1L13 EWR, Hawk sr and Patriot str ground based radar units. These radars have different ranges and 55G6 EWR and 1L13 EWR radars are Eastern Bloc units (eg Russia, Ukraine, Georgia) while the Hawk and Patriot radars are Western (eg US). Additionally, ANY other radar capable unit can be part of the EWR network! Also AWACS airborne units, planes, helicopters can help to detect targets, as long as they have radar. The position of these units is very important as they need to provide enough coverage to pick up enemy aircraft as they approach so that CAP and GCI flights can be tasked to intercept them.

4. Is a border required?

Is this a cold war or a hot war situation? In case of a cold war situation, a border can be set that will only trigger defenses if the border is crossed by enemy units.

5. What maximum range needs to be checked to allow defenses to engage any attacker?

A good functioning defense will have a "maximum range" evaluated to the enemy when CAP will be engaged or GCI will be spawned.

6. Which Airbases, Carrier Ships, Farps will take part in the defense system for the Coalition?

Carefully plan which airbases will take part in the coalition. Color each airbase in the color of the coalition.

7. Which Squadrons will I create and which name will I give each Squadron?

The defense system works with Squadrons. Each Squadron must be given a unique name, that forms the key to the defense system. Several options and activities can be set per Squadron.

8. Where will the Squadrons be located? On Airbases? On Carrier Ships? On Farps?

Squadrons are placed as the "home base" on an airfield, carrier or farp. Carefully plan where each Squadron will be located as part of the defense system.

9. Which plane models will I assign for each Squadron? Do I need one plane model or more plane models per squadron?

Per Squadron, one or multiple plane models can be allocated as Templates. These are late activated groups with one airplane or helicopter that start with a specific name, called the template prefix. The A2A defense system will select from the given templates a random template to spawn a new plane (group).

10. Which payloads, skills and skins will these plane models have?

Per Squadron, even if you have one plane model, you can still allocate multiple templates of one plane model, each having different payloads, skills and skins. The A2A defense system will select from the given templates a random template to spawn a new plane (group).

11. For each Squadron, which will perform CAP?

Per Squadron, evaluate which Squadrons will perform CAP. Not all Squadrons need to perform CAP.

12. For each Squadron doing CAP, in which ZONE(s) will the CAP be performed?

Per CAP, evaluate where the CAP will be performed, in other words, define the zone. Near the border or a bit further away?

13. For each Squadron doing CAP, which zone types will I create?

Per CAP zone, evaluate whether you want:

  • simple trigger zones
  • polygon zones
  • moving zones

Depending on the type of zone selected, a different Zone object needs to be created from a ZONE_ class.

14. For each Squadron doing CAP, what are the time intervals and CAP amounts to be performed?

For each CAP:

  • How many CAP you want to have airborne at the same time?
  • How frequent you want the defense mechanism to check whether to start a new CAP?

15. For each Squadron, which will perform GCI?

For each Squadron, evaluate which Squadrons will perform GCI? Not all Squadrons need to perform GCI.

16. For each Squadron, which takeoff method will I use?

For each Squadron, evaluate which takeoff method will be used:

  • Straight from the air
  • From the runway
  • From a parking spot with running engines
  • From a parking spot with cold engines

The default takeoff method is staight in the air.

17. For each Squadron, which landing method will I use?

For each Squadron, evaluate which landing method will be used:

  • Despawn near the airbase when returning
  • Despawn after landing on the runway
  • Despawn after engine shutdown after landing

The default landing method is despawn when near the airbase when returning.

18. For each Squadron, which overhead will I use?

For each Squadron, depending on the airplane type (modern, old) and payload, which overhead is required to provide any defense? In other words, if X attacker airplanes are detected, how many Y defense airplanes need to be spawned per squadron? The Y is dependent on the type of airplane (era), payload, fuel levels, skills etc. The overhead is a factor that will calculate dynamically how many Y defenses will be required based on X attackers detected.

The default overhead is 1. A value greater than 1, like 1.5 will increase the overhead with 50%, a value smaller than 1, like 0.5 will decrease the overhead with 50%.

19. For each Squadron, which grouping will I use?

When multiple targets are detected, how will defense airplanes be grouped when multiple defense airplanes are spawned for multiple attackers? Per one, two, three, four?

The default grouping is 1. That means, that each spawned defender will act individually.


Authors: FlightControl rework of GCICAP + introduction of new concepts (squadrons).

Authors: Stonehouse, SNAFU in terms of the advice, documentation, and the original GCICAP script.

Global(s)

Global AI_A2A_DISPATCHER

Create an automatic air defence system for a coalition.

#AI_A2A_DISPATCHER AI_A2A_DISPATCHER

Create an automatic air defence system for a coalition.


Banner Image

It includes automatic spawning of Combat Air Patrol aircraft (CAP) and Ground Controlled Intercept aircraft (GCI) in response to enemy air movements that are detected by a ground based radar network. CAP flights will take off and proceed to designated CAP zones where they will remain on station until the ground radars direct them to intercept detected enemy aircraft or they run short of fuel and must return to base (RTB). When a CAP flight leaves their zone to perform an interception or return to base a new CAP flight will spawn to take their place. If all CAP flights are engaged or RTB then additional GCI interceptors will scramble to intercept unengaged enemy aircraft under ground radar control. With a little time and with a little work it provides the mission designer with a convincing and completely automatic air defence system. In short it is a plug in very flexible and configurable air defence module for DCS World.

Note that in order to create a two way A2A defense system, two AI_A2A_DISPATCHER defense system may need to be created, for each coalition one. This is a good implementation, because maybe in the future, more coalitions may become available in DCS world.


USAGE GUIDE

1. AI_A2A_DISPATCHER constructor:

Banner Image

The AI_A2A_DISPATCHER.New() method creates a new AI_A2A_DISPATCHER instance.

1.1. Define the EWR network:

As part of the AI_A2A_DISPATCHER :New() constructor, an EWR network must be given as the first parameter. An EWR network, or, Early Warning Radar network, is used to early detect potential airborne targets and to understand the position of patrolling targets of the enemy.

Banner Image

Typically EWR networks are setup using 55G6 EWR, 1L13 EWR, Hawk sr and Patriot str ground based radar units. These radars have different ranges and 55G6 EWR and 1L13 EWR radars are Eastern Bloc units (eg Russia, Ukraine, Georgia) while the Hawk and Patriot radars are Western (eg US). Additionally, ANY other radar capable unit can be part of the EWR network! Also AWACS airborne units, planes, helicopters can help to detect targets, as long as they have radar. The position of these units is very important as they need to provide enough coverage to pick up enemy aircraft as they approach so that CAP and GCI flights can be tasked to intercept them.

Banner Image

Additionally in a hot war situation where the border is no longer respected the placement of radars has a big effect on how fast the war escalates. For example if they are a long way forward and can detect enemy planes on the ground and taking off they will start to vector CAP and GCI flights to attack them straight away which will immediately draw a response from the other coalition. Having the radars further back will mean a slower escalation because fewer targets will be detected and therefore less CAP and GCI flights will spawn and this will tend to make just the border area active rather than a melee over the whole map. It all depends on what the desired effect is.

EWR networks are dynamically constructed, that is, they form part of the Functional.Detection#DETECTION_BASE object that is given as the input parameter of the AI_A2A_DISPATCHER class. By defining in a smart way the names or name prefixes of the groups with EWR capable units, these groups will be automatically added or deleted from the EWR network, increasing or decreasing the radar coverage of the Early Warning System.

See the following example to setup an EWR network containing EWR stations and AWACS.

Banner Image Banner Image

-- Define a SET_GROUP object that builds a collection of groups that define the EWR network.
-- Here we build the network with all the groups that have a name starting with DF CCCP AWACS and DF CCCP EWR.
DetectionSetGroup = SET_GROUP:New()
DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } )
DetectionSetGroup:FilterStart()

-- Setup the detection and group targets to a 30km range!
Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )

-- Setup the A2A dispatcher, and initialize it.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

The above example creates a SET_GROUP instance, and stores this in the variable (object) DetectionSetGroup. DetectionSetGroup is then being configured to filter all active groups with a group name starting with DF CCCP AWACS or DF CCCP EWR to be included in the Set. DetectionSetGroup is then being ordered to start the dynamic filtering. Note that any destroy or new spawn of a group with the above names will be removed or added to the Set.

Then a new Detection object is created from the class DETECTION_AREAS. A grouping radius of 30000 is choosen, which is 30km. The Detection object is then passed to the AI_A2A_DISPATCHER.New() method to indicate the EWR network configuration and setup the A2A defense detection mechanism.

You could build a mutual defense system like this:

A2ADispatcher_Red = AI_A2A_DISPATCHER:New( EWR_Red )
A2ADispatcher_Blue = AI_A2A_DISPATCHER:New( EWR_Blue )

1.2. Define the detected target grouping radius:

The target grouping radius is a property of the Detection object, that was passed to the AI_A2A_DISPATCHER object, but can be changed. The grouping radius should not be too small, but also depends on the types of planes and the era of the simulation. Fast planes like in the 80s, need a larger radius than WWII planes. Typically I suggest to use 30000 for new generation planes and 10000 for older era aircraft.

Note that detected targets are constantly re-grouped, that is, when certain detected aircraft are moving further than the group radius, then these aircraft will become a separate group being detected. This may result in additional GCI being started by the dispatcher! So don't make this value too small!

3. Set the Engage Radius:

Define the Engage Radius to engage any target by airborne friendlies, which are executing cap or returning from an intercept mission.

Banner Image

If there is a target area detected and reported, then any friendlies that are airborne near this target area, will be commanded to (re-)engage that target when available (if no other tasks were commanded).

For example, if 50000 or 50km is given as a value, then any friendly that is airborne within 50km from the detected target, will be considered to receive the command to engage that target area.

You need to evaluate the value of this parameter carefully:

  • If too small, more intercept missions may be triggered upon detected target areas.
  • If too large, any airborne cap may not be able to reach the detected target area in time, because it is too far.

The default Engage Radius is defined as 100000 or 100km. Use the method AI_A2A_DISPATCHER.SetEngageRadius() to set a specific Engage Radius. The Engage Radius is defined for ALL squadrons which are operational.

Demonstration Mission: AID-019 - AI_A2A - Engage Range Test

In this example an Engage Radius is set to various values.

-- Set 50km as the radius to engage any target by airborne friendlies.
A2ADispatcher:SetEngageRadius( 50000 )

-- Set 100km as the radius to engage any target by airborne friendlies.
A2ADispatcher:SetEngageRadius() -- 100000 is the default value.

4. Set the Ground Controlled Intercept Radius or Gci radius:

When targets are detected that are still really far off, you don't want the AI_A2A_DISPATCHER to launch intercepts just yet. You want it to wait until a certain Gci range is reached, which is the distance of the closest airbase to target being smaller than the Ground Controlled Intercept radius or Gci radius.

The default Gci radius is defined as 200000 or 200km. Override the default Gci radius when the era of the warfare is early, or, when you don't want to let the AI_A2A_DISPATCHER react immediately when a certain border or area is not being crossed.

Use the method AI_A2A_DISPATCHER.SetGciRadius() to set a specific controlled ground intercept radius. The Ground Controlled Intercept radius is defined for ALL squadrons which are operational.

Demonstration Mission: AID-013 - AI_A2A - Intercept Test

In these examples, the Gci Radius is set to various values:

-- Now Setup the A2A dispatcher, and initialize it using the Detection object.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

-- Set 100km as the radius to ground control intercept detected targets from the nearest airbase.
A2ADispatcher:SetGciRadius( 100000 )

-- Set 200km as the radius to ground control intercept.
A2ADispatcher:SetGciRadius() -- 200000 is the default value.

5. Set the borders:

According to the tactical and strategic design of the mission broadly decide the shape and extent of red and blue territories. They should be laid out such that a border area is created between the two coalitions.

Banner Image

Define a border area to simulate a cold war scenario. Use the method AI_A2A_DISPATCHER.SetBorderZone() to create a border zone for the dispatcher.

A cold war is one where CAP aircraft patrol their territory but will not attack enemy aircraft or launch GCI aircraft unless enemy aircraft enter their territory. In other words the EWR may detect an enemy aircraft but will only send aircraft to attack it if it crosses the border. A hot war is one where CAP aircraft will intercept any detected enemy aircraft and GCI aircraft will launch against detected enemy aircraft without regard for territory. In other words if the ground radar can detect the enemy aircraft then it will send CAP and GCI aircraft to attack it.

Banner Image

If it's a cold war then the borders of red and blue territory need to be defined using a zone object derived from Core.Zone#ZONE_BASE. If a hot war is chosen then no borders actually need to be defined using the helicopter units other than it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. In a hot war the borders are effectively defined by the ground based radar coverage of a coalition.

Demonstration Mission: AID-009 - AI_A2A - Border Test

In this example a border is set for the CCCP A2A dispatcher:

Banner Image

-- Setup the A2A dispatcher, and initialize it.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

-- Setup the border.
-- Initialize the dispatcher, setting up a border zone. This is a polygon,
-- which takes the waypoints of a late activated group with the name CCCP Border as the boundaries of the border area.
-- Any enemy crossing this border will be engaged.

CCCPBorderZone = ZONE_POLYGON:New( "CCCP Border", GROUP:FindByName( "CCCP Border" ) )
A2ADispatcher:SetBorderZone( CCCPBorderZone )

6. Squadrons:

The AI_A2A_DISPATCHER works with Squadrons, that need to be defined using the different methods available.

Use the method AI_A2A_DISPATCHER.SetSquadron() to setup a new squadron active at an airfield, while defining which plane types are being used by the squadron and how many resources are available.

Squadrons:

  • Have name (string) that is the identifier or key of the squadron.
  • Have specific plane types.
  • Are located at one airbase.
  • Optionally have a limited set of resources. The default is that squadrons have unlimited resources.

The name of the squadron given acts as the squadron key in the AI_A2A_DISPATCHER:Squadron...() methods.

Additionally, squadrons have specific configuration options to:

  • Control how new aircraft are taking off from the airfield (in the air, cold, hot, at the runway).
  • Control how returning aircraft are landing at the airfield (in the air near the airbase, after landing, after engine shutdown).
  • Control the grouping of new aircraft spawned at the airfield. If there is more than one aircraft to be spawned, these may be grouped.
  • Control the overhead or defensive strength of the squadron. Depending on the types of planes and amount of resources, the mission designer can choose to increase or reduce the amount of planes spawned.

For performance and bug workaround reasons within DCS, squadrons have different methods to spawn new aircraft or land returning or damaged aircraft.

This example defines a couple of squadrons. Note the templates defined within the Mission Editor.

Banner Image Banner Image

 -- Setup the squadrons.
 A2ADispatcher:SetSquadron( "Mineralnye", AIRBASE.Caucasus.Mineralnye_Vody, { "SQ CCCP SU-27" }, 20 )
 A2ADispatcher:SetSquadron( "Maykop", AIRBASE.Caucasus.Maykop_Khanskaya, { "SQ CCCP MIG-31" }, 20 )
 A2ADispatcher:SetSquadron( "Mozdok", AIRBASE.Caucasus.Mozdok, { "SQ CCCP MIG-31" }, 20 )
 A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-27" }, 20 )
 A2ADispatcher:SetSquadron( "Novo", AIRBASE.Caucasus.Novorossiysk, { "SQ CCCP SU-27" }, 20 )

6.1. Set squadron take-off methods

Use the various SetSquadronTakeoff... methods to control how squadrons are taking-off from the airfield:

The default landing method is to spawn new aircraft directly in the air.

Use these methods to fine-tune for specific airfields that are known to create bottlenecks, or have reduced airbase efficiency. The more and the longer aircraft need to taxi at an airfield, the more risk there is that:

  • aircraft will stop waiting for each other or for a landing aircraft before takeoff.
  • aircraft may get into a "dead-lock" situation, where two aircraft are blocking each other.
  • aircraft may collide at the airbase.
  • aircraft may be awaiting the landing of a plane currently in the air, but never lands ...

Currently within the DCS engine, the airfield traffic coordination is erroneous and contains a lot of bugs. If you experience while testing problems with aircraft take-off or landing, please use one of the above methods as a solution to workaround these issues!

This example sets the default takeoff method to be from the runway. And for a couple of squadrons overrides this default method.

 -- Setup the Takeoff methods

 -- The default takeoff
 A2ADispatcher:SetDefaultTakeOffFromRunway()

 -- The individual takeoff per squadron
 A2ADispatcher:SetSquadronTakeoff( "Mineralnye", AI_A2A_DISPATCHER.Takeoff.Air )
 A2ADispatcher:SetSquadronTakeoffInAir( "Sochi" )
 A2ADispatcher:SetSquadronTakeoffFromRunway( "Mozdok" )
 A2ADispatcher:SetSquadronTakeoffFromParkingCold( "Maykop" )
 A2ADispatcher:SetSquadronTakeoffFromParkingHot( "Novo" )

6.1. Set Squadron takeoff altitude when spawning new aircraft in the air.

In the case of the AI_A2A_DISPATCHER.SetSquadronTakeoffInAir() there is also an other parameter that can be applied. That is modifying or setting the altitude from where planes spawn in the air. Use the method AI_A2A_DISPATCHER.SetSquadronTakeoffInAirAltitude() to set the altitude for a specific squadron. The default takeoff altitude can be modified or set using the method AI_A2A_DISPATCHER.SetSquadronTakeoffInAirAltitude(). As part of the method AI_A2A_DISPATCHER.SetSquadronTakeoffInAir() a parameter can be specified to set the takeoff altitude. If this parameter is not specified, then the default altitude will be used for the squadron.

6.2. Set squadron landing methods

In analogy with takeoff, the landing methods are to control how squadrons land at the airfield:

You can use these methods to minimize the airbase coodination overhead and to increase the airbase efficiency. When there are lots of aircraft returning for landing, at the same airbase, the takeoff process will be halted, which can cause a complete failure of the A2A defense system, as no new CAP or GCI planes can takeoff. Note that the method AI_A2A_DISPATCHER.SetSquadronLandingNearAirbase() will only work for returning aircraft, not for damaged or out of fuel aircraft. Damaged or out-of-fuel aircraft are returning to the nearest friendly airbase and will land, and are out of control from ground control.

This example defines the default landing method to be at the runway. And for a couple of squadrons overrides this default method.

 -- Setup the Landing methods

 -- The default landing method
 A2ADispatcher:SetDefaultLandingAtRunway()

 -- The individual landing per squadron
 A2ADispatcher:SetSquadronLandingAtRunway( "Mineralnye" )
 A2ADispatcher:SetSquadronLandingNearAirbase( "Sochi" )
 A2ADispatcher:SetSquadronLandingAtEngineShutdown( "Mozdok" )
 A2ADispatcher:SetSquadronLandingNearAirbase( "Maykop" )
 A2ADispatcher:SetSquadronLanding( "Novo", AI_A2A_DISPATCHER.Landing.AtRunway )

6.3. Set squadron grouping

Use the method AI_A2A_DISPATCHER.SetSquadronGrouping() to set the grouping of CAP or GCI flights that will take-off when spawned.

Banner Image

In the case of GCI, the AI_A2A_DISPATCHER.SetSquadronGrouping() method has additional behaviour. When there aren't enough CAP flights airborne, a GCI will be initiated for the remaining targets to be engaged. Depending on the grouping parameter, the spawned flights for GCI are grouped into this setting. For example with a group setting of 2, if 3 targets are detected and cannot be engaged by CAP or any airborne flight, a GCI needs to be started, the GCI flights will be grouped as follows: Group 1 of 2 flights and Group 2 of one flight!

Even more ... If one target has been detected, and the overhead is 1.5, grouping is 1, then two groups of planes will be spawned, with one unit each!

The grouping value is set for a Squadron, and can be dynamically adjusted during mission execution, so to adjust the defense flights grouping when the tactical situation changes.

6.4. Overhead and Balance the effectiveness of the air defenses in case of GCI.

The effectiveness can be set with the overhead parameter. This is a number that is used to calculate the amount of Units that dispatching command will allocate to GCI in surplus of detected amount of units. The default value of the overhead parameter is 1.0, which means equal balance.

Banner Image

However, depending on the (type of) aircraft (strength and payload) in the squadron and the amount of resources available, this parameter can be changed.

The AI_A2A_DISPATCHER.SetSquadronOverhead() method can be used to tweak the defense strength, taking into account the plane types of the squadron.

For example, a MIG-31 with full long-distance A2A missiles payload, may still be less effective than a F-15C with short missiles... So in this case, one may want to use the AI_A2A_DISPATCHER.SetOverhead() method to allocate more defending planes as the amount of detected attacking planes. The overhead must be given as a decimal value with 1 as the neutral value, which means that overhead values:

  • Higher than 1.0, for example 1.5, will increase the defense unit amounts. For 4 planes detected, 6 planes will be spawned.
  • Lower than 1, for example 0.75, will decrease the defense unit amounts. For 4 planes detected, only 3 planes will be spawned.

The amount of defending units is calculated by multiplying the amount of detected attacking planes as part of the detected group multiplied by the Overhead and rounded up to the smallest integer.

For example ... If one target has been detected, and the overhead is 1.5, grouping is 1, then two groups of planes will be spawned, with one unit each!

The overhead value is set for a Squadron, and can be dynamically adjusted during mission execution, so to adjust the defense overhead when the tactical situation changes.

6.5. Squadron fuel treshold.

When an airplane gets out of fuel to a certain %-tage, which is by default 15% (0.15), there are two possible actions that can be taken: - The defender will go RTB, and will be replaced with a new defender if possible. - The defender will refuel at a tanker, if a tanker has been specified for the squadron.

Use the method AI_A2A_DISPATCHER.SetSquadronFuelThreshold() to set the squadron fuel treshold of spawned airplanes for all squadrons.

7. Setup a squadron for CAP

7.1. Set the CAP zones

CAP zones are patrol areas where Combat Air Patrol (CAP) flights loiter until they either return to base due to low fuel or are assigned an interception task by ground control.

Banner Image

  • As the CAP flights wander around within the zone waiting to be tasked, these zones need to be large enough that the aircraft are not constantly turning but do not have to be big and numerous enough to completely cover a border.

  • CAP zones can be of any type, and are derived from the Core.Zone#ZONE_BASE class. Zones can be Core.Zone#ZONE, Core.Zone#ZONE_POLYGON, Core.Zone#ZONE_UNIT, Core.Zone#ZONE_GROUP, etc. This allows to setup static, moving and/or complex zones wherein aircraft will perform the CAP.

  • Typically 20000-50000 metres width is used and they are spaced so that aircraft in the zone waiting for tasks don't have to far to travel to protect their coalitions important targets. These targets are chosen as part of the mission design and might be an important airfield or town etc. Zone size is also determined somewhat by territory size, plane types (eg WW2 aircraft might mean smaller zones or more zones because they are slower and take longer to intercept enemy aircraft).

  • In a cold war it is important to make sure a CAP zone doesn't intrude into enemy territory as otherwise CAP flights will likely cross borders and spark a full scale conflict which will escalate rapidly.

  • CAP flights do not need to be in the CAP zone before they are "on station" and ready for tasking.

  • Typically if a CAP flight is tasked and therefore leaves their zone empty while they go off and intercept their target another CAP flight will spawn to take their place.

Banner Image

The following example illustrates how CAP zones are coded:

Banner Image

 -- CAP Squadron execution.
 CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) )
 A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 )
 A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 2, 30, 60, 1 )

Banner Image

 CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) )
 A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" )
 A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

Banner Image

 CAPZoneMiddle = ZONE:New( "CAP Zone Middle")
 A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" )
 A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

Note the different Zone MOOSE classes being used to create zones of different types. Please click the Zone link for more information about the different zone types. Zones can be circles, can be setup in the mission editor using trigger zones, but can also be setup in the mission editor as polygons and in this case GROUP objects are being used!

7.2. Set the squadron to execute CAP:

The method AI_A2A_DISPATCHER.SetSquadronCap() defines a CAP execution for a squadron.

Setting-up a CAP zone also requires specific parameters:

  • The minimum and maximum altitude
  • The minimum speed and maximum patrol speed
  • The minimum and maximum engage speed
  • The type of altitude measurement

These define how the squadron will perform the CAP while partrolling. Different terrain types requires different types of CAP.

The AI_A2A_DISPATCHER.SetSquadronCapInterval() method specifies how much and when CAP flights will takeoff.

It is recommended not to overload the air defense with CAP flights, as these will decrease the performance of the overall system.

For example, the following setup will create a CAP for squadron "Sochi":

 A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" )
 A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

7.3. Squadron tanker to refuel when executing CAP and defender is out of fuel.

Instead of sending CAP to RTB when out of fuel, you can let CAP refuel in mid air using a tanker. This greatly increases the efficiency of your CAP operations.

In the mission editor, setup a group with task Refuelling. A tanker unit of the correct coalition will be automatically selected. Then, use the method AI_A2A_DISPATCHER.SetDefaultTanker() to set the default tanker for the refuelling. You can also specify a specific tanker for refuelling for a squadron by using the method AI_A2A_DISPATCHER.SetSquadronTanker().

When the tanker specified is alive and in the air, the tanker will be used for refuelling.

For example, the following setup will create a CAP for squadron "Gelend" with a refuel task for the squadron:

Banner Image

 -- Define the CAP
 A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-30" }, 20 )
 A2ADispatcher:SetSquadronCap( "Gelend", ZONE:New( "PatrolZoneGelend" ), 4000, 8000, 600, 800, 1000, 1300 )
 A2ADispatcher:SetSquadronCapInterval( "Gelend", 2, 30, 600, 1 )
 A2ADispatcher:SetSquadronGci( "Gelend", 900, 1200 )

 -- Setup the Refuelling for squadron "Gelend", at tanker (group) "TankerGelend" when the fuel in the tank of the CAP defenders is less than 80%.
 A2ADispatcher:SetSquadronFuelThreshold( "Gelend", 0.8 )
 A2ADispatcher:SetSquadronTanker( "Gelend", "TankerGelend" )

7.4 Set up race track pattern

By default, flights patrol randomly within the CAP zone. It is also possible to let them fly a race track pattern using the AI_A2A_DISPATCHER.SetDefaultCapRacetrack(LeglengthMin, LeglengthMax, HeadingMin, HeadingMax, DurationMin, DurationMax) or AI_A2A_DISPATCHER.SetSquadronCapRacetrack(SquadronName, LeglengthMin, LeglengthMax, HeadingMin, HeadingMax, DurationMin, DurationMax) functions. The first function enables this for all squadrons, the latter only for specific squadrons. For example,

 -- Enable race track pattern for CAP squadron "Mineralnye".
 A2ADispatcher:SetSquadronCapRacetrack("Mineralnye", 10000, 20000, 90, 180, 10*60, 20*60)

In this case the squadron "Mineralnye" will a race track pattern at a random point in the CAP zone. The leg length will be randomly selected between 10,000 and 20,000 meters. The heading of the race track will randomly selected between 90 (West to East) and 180 (North to South) degrees. After a random duration between 10 and 20 minutes, the flight will get a new random orbit location.

Note that all parameters except the squadron name are optional. If not specified, default values are taken. Speed and altitude are taken from the

Also note that the center of the race track pattern is chosen randomly within the patrol zone and can be close the the boarder of the zone. Hence, it cannot be guaranteed that the whole pattern lies within the patrol zone.

8. Setup a squadron for GCI:

The method AI_A2A_DISPATCHER.SetSquadronGci() defines a GCI execution for a squadron.

Setting-up a GCI readiness also requires specific parameters:

  • The minimum speed and maximum patrol speed

Essentially this controls how many flights of GCI aircraft can be active at any time. Note allowing large numbers of active GCI flights can adversely impact mission performance on low or medium specification hosts/servers. GCI needs to be setup at strategic airbases. Too far will mean that the aircraft need to fly a long way to reach the intruders, too short will mean that the intruders may have alraedy passed the ideal interception point!

For example, the following setup will create a GCI for squadron "Sochi":

 A2ADispatcher:SetSquadronGci( "Mozdok", 900, 1200 )

9. Other configuration options

9.1. Set a tactical display panel:

Every 30 seconds, a tactical display panel can be shown that illustrates what the status is of the different groups controlled by AI_A2A_DISPATCHER. Use the method AI_A2A_DISPATCHER.SetTacticalDisplay() to switch on the tactical display panel. The default will not show this panel. Note that there may be some performance impact if this panel is shown.

10. Defaults settings.

This provides a good overview of the different parameters that are setup or hardcoded by default. For some default settings, a method is available that allows you to tweak the defaults.

10.1. Default takeoff method.

The default takeoff method is set to in the air, which means that new spawned airplanes will be spawned directly in the air above the airbase by default.

The default takeoff method can be set for ALL squadrons that don't have an individual takeoff method configured.

10.2. Default landing method.

The default landing method is set to near the airbase, which means that returning airplanes will be despawned directly in the air by default.

The default landing method can be set for ALL squadrons that don't have an individual landing method configured.

10.3. Default overhead.

The default overhead is set to 1. That essentially means that there isn't any overhead set by default.

The default overhead value can be set for ALL squadrons that don't have an individual overhead value configured.

Use the AI_A2A_DISPATCHER.SetDefaultOverhead() method can be used to set the default overhead or defense strength for ALL squadrons.

10.4. Default grouping.

The default grouping is set to one airplane. That essentially means that there won't be any grouping applied by default.

The default grouping value can be set for ALL squadrons that don't have an individual grouping value configured.

Use the method AI_A2A_DISPATCHER.SetDefaultGrouping() to set the default grouping of spawned airplanes for all squadrons.

10.5. Default RTB fuel treshold.

When an airplane gets out of fuel to a certain %-tage, which is 15% (0.15), it will go RTB, and will be replaced with a new airplane when applicable.

Use the method AI_A2A_DISPATCHER.SetDefaultFuelThreshold() to set the default fuel treshold of spawned airplanes for all squadrons.

10.6. Default RTB damage treshold.

When an airplane is damaged to a certain %-tage, which is 40% (0.40), it will go RTB, and will be replaced with a new airplane when applicable.

Use the method AI_A2A_DISPATCHER.SetDefaultDamageThreshold() to set the default damage treshold of spawned airplanes for all squadrons.

10.7. Default settings for CAP.

10.7.1. Default CAP Time Interval.

CAP is time driven, and will evaluate in random time intervals if a new CAP needs to be spawned. The default CAP time interval is between 180 and 600 seconds.

Use the method AI_A2A_DISPATCHER.SetDefaultCapTimeInterval() to set the default CAP time interval of spawned airplanes for all squadrons. Note that you can still change the CAP limit and CAP time intervals for each CAP individually using the AI_A2A_DISPATCHER.SetSquadronCapTimeInterval() method.

10.7.2. Default CAP limit.

Multiple CAP can be airborne at the same time for one squadron, which is controlled by the CAP limit. The default CAP limit is 1 CAP per squadron to be airborne at the same time. Note that the default CAP limit is used when a Squadron CAP is defined, and cannot be changed afterwards. So, ensure that you set the default CAP limit before you spawn the Squadron CAP.

Use the method AI_A2A_DISPATCHER.SetDefaultCapTimeInterval() to set the default CAP time interval of spawned airplanes for all squadrons. Note that you can still change the CAP limit and CAP time intervals for each CAP individually using the AI_A2A_DISPATCHER.SetSquadronCapTimeInterval() method.

10.7.3. Default tanker for refuelling when executing CAP.

Instead of sending CAP to RTB when out of fuel, you can let CAP refuel in mid air using a tanker. This greatly increases the efficiency of your CAP operations.

In the mission editor, setup a group with task Refuelling. A tanker unit of the correct coalition will be automatically selected. Then, use the method AI_A2A_DISPATCHER.SetDefaultTanker() to set the tanker for the dispatcher. Use the method AI_A2A_DISPATCHER.SetDefaultFuelThreshold() to set the %-tage left in the defender airplane tanks when a refuel action is needed.

When the tanker specified is alive and in the air, the tanker will be used for refuelling.

For example, the following setup will set the default refuel tanker to "Tanker":

Banner Image

 -- Define the CAP
 A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-34" }, 20 )
 A2ADispatcher:SetSquadronCap( "Sochi", ZONE:New( "PatrolZone" ), 4000, 8000, 600, 800, 1000, 1300 )
 A2ADispatcher:SetSquadronCapInterval("Sochi", 2, 30, 600, 1 )
 A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 )

 -- Set the default tanker for refuelling to "Tanker", when the default fuel treshold has reached 90% fuel left.
 A2ADispatcher:SetDefaultFuelThreshold( 0.9 )
 A2ADispatcher:SetDefaultTanker( "Tanker" )

10.8. Default settings for GCI.

10.8.1. Optimal intercept point calculation.

When intruders are detected, the intrusion path of the attackers can be monitored by the EWR. Although defender planes might be on standby at the airbase, it can still take some time to get the defenses up in the air if there aren't any defenses airborne. This time can easily take 2 to 3 minutes, and even then the defenders still need to fly towards the target, which takes also time.

Therefore, an optimal intercept point is calculated which takes a couple of parameters:

  • The average bearing of the intruders for an amount of seconds.
  • The average speed of the intruders for an amount of seconds.
  • An assumed time it takes to get planes operational at the airbase.

The intercept point will determine:

  • If there are any friendlies close to engage the target. These can be defenders performing CAP or defenders in RTB.
  • The optimal airbase from where defenders will takeoff for GCI.

Use the method AI_A2A_DISPATCHER.SetIntercept() to modify the assumed intercept delay time to calculate a valid interception.

10.8.2. Default Disengage Radius.

The radius to disengage any target when the distance of the defender to the home base is larger than the specified meters. The default Disengage Radius is 300km (300000 meters). Note that the Disengage Radius is applicable to ALL squadrons!

Use the method AI_A2A_DISPATCHER.SetDisengageRadius() to modify the default Disengage Radius to another distance setting.

11. Airbase capture:

Different squadrons can be located at one airbase. If the airbase gets captured, that is, when there is an enemy unit near the airbase, and there aren't anymore friendlies at the airbase, the airbase will change coalition ownership. As a result, the GCI and CAP will stop! However, the squadron will still stay alive. Any airplane that is airborne will continue its operations until all airborne airplanes of the squadron will be destroyed. This to keep consistency of air operations not to confuse the players.

12. Q & A:

12.1. Which countries will be selected for each coalition?

Which countries are assigned to a coalition influences which units are available to the coalition. For example because the mission calls for a EWR radar on the blue side the Ukraine might be chosen as a blue country so that the 55G6 EWR radar unit is available to blue. Some countries assign different tasking to aircraft, for example Germany assigns the CAP task to F-4E Phantoms but the USA does not. Therefore if F4s are wanted as a coalition's CAP or GCI aircraft Germany will need to be assigned to that coalition.

12.2. Country, type, load out, skill and skins for CAP and GCI aircraft?

  • Note these can be from any countries within the coalition but must be an aircraft with one of the main tasks being "CAP".
  • Obviously skins which are selected must be available to all players that join the mission otherwise they will see a default skin.
  • Load outs should be appropriate to a CAP mission eg perhaps drop tanks for CAP flights and extra missiles for GCI flights.
  • These decisions will eventually lead to template aircraft units being placed as late activation units that the script will use as templates for spawning CAP and GCI flights. Up to 4 different aircraft configurations can be chosen for each coalition. The spawned aircraft will inherit the characteristics of the template aircraft.
  • The selected aircraft type must be able to perform the CAP tasking for the chosen country.

Global AI_A2A_GCICAP

Create an automatic air defence system for a coalition setting up GCI and CAP air defenses.

#AI_A2A_GCICAP AI_A2A_GCICAP

Create an automatic air defence system for a coalition setting up GCI and CAP air defenses.

The class derives from #AI_A2A_DISPATCHER and thus, all the methods that are defined in the #AI_A2A_DISPATCHER class, can be used also in AI_A2A_GCICAP.


Demo Missions

AI_A2A_GCICAP for Caucasus

AI_A2A_GCICAP for NTTR

AI_A2A_GCICAP for Normandy

AI_A2A_GCICAP for beta testers


YouTube Channel

DCS WORLD - MOOSE - A2A GCICAP - Build an automatic A2A Defense System


Banner Image

AI_A2A_GCICAP includes automatic spawning of Combat Air Patrol aircraft (CAP) and Ground Controlled Intercept aircraft (GCI) in response to enemy air movements that are detected by an airborne or ground based radar network.

With a little time and with a little work it provides the mission designer with a convincing and completely automatic air defence system.

The AI_A2A_GCICAP provides a lightweight configuration method using the mission editor. Within a very short time, and with very little coding, the mission designer is able to configure a complete A2A defense system for a coalition using the DCS Mission Editor available functions. Using the DCS Mission Editor, you define borders of the coalition which are guarded by GCICAP, configure airbases to belong to the coalition, define squadrons flying certain types of planes or payloads per airbase, and define CAP zones. Very little lua needs to be applied, a one liner, which is fully explained below, which can be embedded right in a DO SCRIPT trigger action or in a larger DO SCRIPT FILE trigger action.

CAP flights will take off and proceed to designated CAP zones where they will remain on station until the ground radars direct them to intercept detected enemy aircraft or they run short of fuel and must return to base (RTB).

When a CAP flight leaves their zone to perform a GCI or return to base a new CAP flight will spawn to take its place. If all CAP flights are engaged or RTB then additional GCI interceptors will scramble to intercept unengaged enemy aircraft under ground radar control.

In short it is a plug in very flexible and configurable air defence module for DCS World.


The following actions need to be followed when using AI_A2A_GCICAP in your mission:

1) Configure a working AI_A2A_GCICAP defense system for ONE coalition.

1.1) Define which airbases are for which coalition.

Mission Editor Action

Color the airbases red or blue. You can do this by selecting the airbase on the map, and select the coalition blue or red.

1.2) Place groups of units given a name starting with a EWR prefix of your choice to build your EWR network.

Mission Editor Action

All EWR groups starting with the EWR prefix (text) will be included in the detection system.

An EWR network, or, Early Warning Radar network, is used to early detect potential airborne targets and to understand the position of patrolling targets of the enemy. Typically EWR networks are setup using 55G6 EWR, 1L13 EWR, Hawk sr and Patriot str ground based radar units. These radars have different ranges and 55G6 EWR and 1L13 EWR radars are Eastern Bloc units (eg Russia, Ukraine, Georgia) while the Hawk and Patriot radars are Western (eg US). Additionally, ANY other radar capable unit can be part of the EWR network! Also AWACS airborne units, planes, helicopters can help to detect targets, as long as they have radar. The position of these units is very important as they need to provide enough coverage to pick up enemy aircraft as they approach so that CAP and GCI flights can be tasked to intercept them.

Additionally in a hot war situation where the border is no longer respected the placement of radars has a big effect on how fast the war escalates. For example if they are a long way forward and can detect enemy planes on the ground and taking off they will start to vector CAP and GCI flights to attack them straight away which will immediately draw a response from the other coalition. Having the radars further back will mean a slower escalation because fewer targets will be detected and therefore less CAP and GCI flights will spawn and this will tend to make just the border area active rather than a melee over the whole map. It all depends on what the desired effect is.

EWR networks are dynamically maintained. By defining in a smart way the names or name prefixes of the groups with EWR capable units, these groups will be automatically added or deleted from the EWR network, increasing or decreasing the radar coverage of the Early Warning System.

1.3) Place Airplane or Helicopter Groups with late activation switched on above the airbases to define Squadrons.

Mission Editor Action

These are templates, with a given name starting with a Template prefix above each airbase that you wanna have a squadron. These templates need to be within 1.5km from the airbase center. They don't need to have a slot at the airplane, they can just be positioned above the airbase, without a route, and should only have ONE unit.

Mission Editor Action

All airplane or helicopter groups that are starting with any of the choosen Template Prefixes will result in a squadron created at the airbase.

1.4) Place floating helicopters to create the CAP zones defined by its route points.

Mission Editor Action

All airplane or helicopter groups that are starting with any of the choosen Template Prefixes will result in a squadron created at the airbase.

The helicopter indicates the start of the CAP zone. The route points define the form of the CAP zone polygon.

Mission Editor Action

The place of the helicopter is important, as the airbase closest to the helicopter will be the airbase from where the CAP planes will take off for CAP.

2) There are a lot of defaults set, which can be further modified using the methods in #AI_A2A_DISPATCHER:

2.1) Planes are taking off in the air from the airbases.

This prevents airbases to get cluttered with airplanes taking off, it also reduces the risk of human players colliding with taxiiing airplanes, resulting in the airbase to halt operations.

You can change the way how planes take off by using the inherited methods from AI_A2A_DISPATCHER:

Use these methods to fine-tune for specific airfields that are known to create bottlenecks, or have reduced airbase efficiency. The more and the longer aircraft need to taxi at an airfield, the more risk there is that:

  • aircraft will stop waiting for each other or for a landing aircraft before takeoff.
  • aircraft may get into a "dead-lock" situation, where two aircraft are blocking each other.
  • aircraft may collide at the airbase.
  • aircraft may be awaiting the landing of a plane currently in the air, but never lands ...

Currently within the DCS engine, the airfield traffic coordination is erroneous and contains a lot of bugs. If you experience while testing problems with aircraft take-off or landing, please use one of the above methods as a solution to workaround these issues!

2.2) Planes return near the airbase or will land if damaged.

When damaged airplanes return to the airbase, they will be routed and will dissapear in the air when they are near the airbase. There are exceptions to this rule, airplanes that aren't "listening" anymore due to damage or out of fuel, will return to the airbase and land.

You can change the way how planes land by using the inherited methods from AI_A2A_DISPATCHER:

You can use these methods to minimize the airbase coodination overhead and to increase the airbase efficiency. When there are lots of aircraft returning for landing, at the same airbase, the takeoff process will be halted, which can cause a complete failure of the A2A defense system, as no new CAP or GCI planes can takeoff. Note that the method AI_A2A_DISPATCHER.SetSquadronLandingNearAirbase() will only work for returning aircraft, not for damaged or out of fuel aircraft. Damaged or out-of-fuel aircraft are returning to the nearest friendly airbase and will land, and are out of control from ground control.

2.3) CAP operations setup for specific airbases, will be executed with the following parameters:

  • The altitude will range between 6000 and 10000 meters.
  • The CAP speed will vary between 500 and 800 km/h.
  • The engage speed between 800 and 1200 km/h.

You can change or add a CAP zone by using the inherited methods from AI_A2A_DISPATCHER:

The method AI_A2A_DISPATCHER.SetSquadronCap() defines a CAP execution for a squadron.

Setting-up a CAP zone also requires specific parameters:

  • The minimum and maximum altitude
  • The minimum speed and maximum patrol speed
  • The minimum and maximum engage speed
  • The type of altitude measurement

These define how the squadron will perform the CAP while partrolling. Different terrain types requires different types of CAP.

The AI_A2A_DISPATCHER.SetSquadronCapInterval() method specifies how much and when CAP flights will takeoff.

It is recommended not to overload the air defense with CAP flights, as these will decrease the performance of the overall system.

For example, the following setup will create a CAP for squadron "Sochi":

A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

2.4) Each airbase will perform GCI when required, with the following parameters:

  • The engage speed is between 800 and 1200 km/h.

You can change or add a GCI parameters by using the inherited methods from AI_A2A_DISPATCHER:

The method AI_A2A_DISPATCHER.SetSquadronGci() defines a GCI execution for a squadron.

Setting-up a GCI readiness also requires specific parameters:

  • The minimum speed and maximum patrol speed

Essentially this controls how many flights of GCI aircraft can be active at any time. Note allowing large numbers of active GCI flights can adversely impact mission performance on low or medium specification hosts/servers. GCI needs to be setup at strategic airbases. Too far will mean that the aircraft need to fly a long way to reach the intruders, too short will mean that the intruders may have alraedy passed the ideal interception point!

For example, the following setup will create a GCI for squadron "Sochi":

A2ADispatcher:SetSquadronGci( "Mozdok", 900, 1200 )

2.5) Grouping or detected targets.

Detected targets are constantly re-grouped, that is, when certain detected aircraft are moving further than the group radius, then these aircraft will become a separate group being detected.

Targets will be grouped within a radius of 30km by default.

The radius indicates that detected targets need to be grouped within a radius of 30km. The grouping radius should not be too small, but also depends on the types of planes and the era of the simulation. Fast planes like in the 80s, need a larger radius than WWII planes. Typically I suggest to use 30000 for new generation planes and 10000 for older era aircraft.

3) Additional notes:

In order to create a two way A2A defense system, two AI_A2A_GCICAP defense systems must need to be created, for each coalition one. Each defense system needs its own EWR network setup, airplane templates and CAP configurations.

This is a good implementation, because maybe in the future, more coalitions may become available in DCS world.

4) Coding examples how to use the AI_A2A_GCICAP class:

4.1) An easy setup:

 -- Setup the AI_A2A_GCICAP dispatcher for one coalition, and initialize it.
 GCI_Red = AI_A2A_GCICAP:New( "EWR CCCP", "SQUADRON CCCP", "CAP CCCP", 2 )

-- The following parameters were given to the :New method of AI_A2A_GCICAP, and mean the following:

  • "EWR CCCP": Groups of the blue coalition are placed that define the EWR network. These groups start with the name EWR CCCP.
  • "SQUADRON CCCP": Late activated Groups objects of the red coalition are placed above the relevant airbases that will contain these templates in the squadron. These late activated Groups start with the name SQUADRON CCCP. Each Group object contains only one Unit, and defines the weapon payload, skin and skill level.
  • "CAP CCCP": CAP Zones are defined using floating, late activated Helicopter Group objects, where the route points define the route of the polygon of the CAP Zone. These Helicopter Group objects start with the name CAP CCCP, and will be the locations wherein CAP will be performed.
  • 2 Defines how many CAP airplanes are patrolling in each CAP zone defined simulateneously.

4.2) A more advanced setup:

 -- Setup the AI_A2A_GCICAP dispatcher for the blue coalition.

 A2A_GCICAP_Blue = AI_A2A_GCICAP:New( { "BLUE EWR" }, { "104th", "105th", "106th" }, { "104th CAP" }, 4 )

The following parameters for the :New method have the following meaning:

  • { "BLUE EWR" }: An array of the group name prefixes of the groups of the blue coalition are placed that define the EWR network. These groups start with the name BLUE EWR.
  • { "104th", "105th", "106th" }: An array of the group name prefixes of the Late activated Groups objects of the blue coalition are placed above the relevant airbases that will contain these templates in the squadron. These late activated Groups start with the name 104th or 105th or 106th.
  • { "104th CAP" }: An array of the names of the CAP zones are defined using floating, late activated helicopter group objects, where the route points define the route of the polygon of the CAP Zone. These Helicopter Group objects start with the name 104th CAP, and will be the locations wherein CAP will be performed.
  • 4 Defines how many CAP airplanes are patrolling in each CAP zone defined simulateneously.

Type(s)

Fields and Methods inherited from AI_A2A_DISPATCHER Description

AI_A2A_DISPATCHER:AddDefenderToSquadron(Squadron, Defender, Size)

Add defender to squadron.

AI_A2A_DISPATCHER:CAP()

CAP Trigger for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:CanCAP(SquadronName)

Check if squadron can do CAP.

AI_A2A_DISPATCHER:CanGCI(SquadronName)

Check if squadron can do GCI.

AI_A2A_DISPATCHER:ClearDefenderTask(Defender)

AI_A2A_DISPATCHER:ClearDefenderTaskTarget(Defender)

AI_A2A_DISPATCHER:CountCapAirborne(SquadronName)

Count number of airborne CAP flights.

AI_A2A_DISPATCHER:CountDefendersEngaged(AttackerDetection)

Count number of engaging defender groups.

AI_A2A_DISPATCHER:CountDefendersToBeEngaged(AttackerDetection, DefenderCount)

Count defenders to be engaged if number of attackers larger than number of defenders.

AI_A2A_DISPATCHER.DefenderCAPIndex

AI_A2A_DISPATCHER.DefenderDefault

AI_A2A_DISPATCHER.DefenderSpawns

AI_A2A_DISPATCHER.DefenderSquadrons

AI_A2A_DISPATCHER.DefenderTasks

AI_A2A_DISPATCHER.Defenders

AI_A2A_DISPATCHER.Detection

AI_A2A_DISPATCHER.DisengageRadius

AI_A2A_DISPATCHER:ENGAGE(AttackerDetection, Defenders)

ENGAGE Trigger for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:EvaluateENGAGE(DetectedItem)

Creates an ENGAGE task when there are human friendlies airborne near the targets.

AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem)

Creates an GCI task when there are targets for it.

AI_A2A_DISPATCHER:EvaluateSWEEP(DetectedItem)

Creates an SWEEP task when there are targets for it.

AI_A2A_DISPATCHER:GCI(AttackerDetection, DefendersMissing, DefenderFriendlies)

GCI Trigger for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER.GciRadius

AI_A2A_DISPATCHER:GetAIFriendliesNearBy(DetectedItem)

Calculates which AI friendlies are nearby the area

AI_A2A_DISPATCHER:GetCAPDelay(SquadronName)

AI_A2A_DISPATCHER:GetDefaultLanding()

Gets the default method at which flights will land and despawn as part of the defense system.

AI_A2A_DISPATCHER:GetDefaultTakeoff()

Gets the default method at which new flights will spawn and take-off as part of the defense system.

AI_A2A_DISPATCHER:GetDefenderTask(Defender)

Get defender task.

AI_A2A_DISPATCHER:GetDefenderTaskFsm(Defender)

Get defender task FSM.

AI_A2A_DISPATCHER:GetDefenderTaskSquadronName(Defender)

AI_A2A_DISPATCHER:GetDefenderTaskTarget(Defender)

Get target of defender.

AI_A2A_DISPATCHER:GetDefenderTasks()

Return the defender tasks table.

AI_A2A_DISPATCHER:GetFriendliesNearBy(DetectedItem)

Calculates which friendlies are nearby the area.

AI_A2A_DISPATCHER:GetPlayerFriendliesNearBy(DetectedItem)

Calculates which HUMAN friendlies are nearby the area.

AI_A2A_DISPATCHER:GetSquadron(SquadronName)

Get an item from the Squadron table.

AI_A2A_DISPATCHER:GetSquadronFromDefender(Defender)

Get squadron from defender.

AI_A2A_DISPATCHER:GetSquadronLanding(SquadronName)

Gets the method at which flights will land and despawn as part of the defense system.

AI_A2A_DISPATCHER:GetSquadronTakeoff(SquadronName)

Gets the method at which new flights will spawn and take-off as part of the defense system.

AI_A2A_DISPATCHER:IsSquadronVisible(SquadronName)

Check if the Squadron is visible before startup of the dispatcher.

AI_A2A_DISPATCHER.Landing

Defnes Landing location.

AI_A2A_DISPATCHER:New(Detection)

AI_A2A_DISPATCHER constructor.

AI_A2A_DISPATCHER:OnAfterAssign(From, Event, To, Task, TaskUnit, PlayerName)

OnAfter Transition Handler for Event Assign.

AI_A2A_DISPATCHER:OnAfterCAP(From, Event, To)

CAP Handler OnAfter for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:OnAfterENGAGE(From, Event, To, AttackerDetection, Defenders)

ENGAGE Handler OnAfter for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:OnAfterGCI(From, Event, To, AttackerDetection, DefendersMissing, DefenderFriendlies)

GCI Handler OnAfter for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:OnBeforeCAP(From, Event, To)

CAP Handler OnBefore for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:OnBeforeENGAGE(From, Event, To, AttackerDetection, Defenders)

ENGAGE Handler OnBefore for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:OnBeforeGCI(From, Event, To)

GCI Handler OnBefore for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:OnEventBaseCaptured(EventData)

Event base captured.

AI_A2A_DISPATCHER:OnEventCrashOrDead(EventData)

Event dead or crash.

AI_A2A_DISPATCHER:OnEventEngineShutdown(EventData)

Event engine shutdown.

AI_A2A_DISPATCHER:OnEventLand(EventData)

Event land.

AI_A2A_DISPATCHER:Order(DetectedItem)

Assigns A2G AI Tasks in relation to the detected items.

AI_A2A_DISPATCHER:ParkDefender(DefenderSquadron)

Park defender.

AI_A2A_DISPATCHER:ProcessDetected(Detection)

Assigns A2A AI Tasks in relation to the detected items.

AI_A2A_DISPATCHER:RemoveDefenderFromSquadron(Squadron, Defender)

Remove defender from squadron.

AI_A2A_DISPATCHER:ResourceActivate(DefenderSquadron, DefendersNeeded)

Activate resource.

AI_A2A_DISPATCHER:SchedulerCAP(SquadronName)

Schedules a new CAP for the given SquadronName.

AI_A2A_DISPATCHER:SetBorderZone(BorderZone)

Define a border area to simulate a cold war scenario.

AI_A2A_DISPATCHER:SetDefaultCapLimit(CapLimit)

Set the default CAP limit for squadrons, which will be used to determine how many CAP can be airborne at the same time for the squadron.

AI_A2A_DISPATCHER:SetDefaultCapRacetrack(LeglengthMin, LeglengthMax, HeadingMin, HeadingMax, DurationMin, DurationMax, CapCoordinates)

Set race track pattern as default when any squadron is performing CAP.

AI_A2A_DISPATCHER:SetDefaultCapTimeInterval(CapMinSeconds, CapMaxSeconds)

Set the default CAP time interval for squadrons, which will be used to determine a random CAP timing.

AI_A2A_DISPATCHER:SetDefaultDamageThreshold(DamageThreshold)

Set the default damage treshold when defenders will RTB.

AI_A2A_DISPATCHER:SetDefaultFuelThreshold(FuelThreshold)

Set the default fuel treshold when defenders will RTB or Refuel in the air.

AI_A2A_DISPATCHER:SetDefaultGrouping(Grouping)

Sets the default grouping of new airplanes spawned.

AI_A2A_DISPATCHER:SetDefaultLanding(Landing)

Defines the default method at which flights will land and despawn as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultLandingAtEngineShutdown()

Sets flights by default to land and despawn at engine shutdown, as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultLandingAtRunway()

Sets flights by default to land and despawn at the runway, as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultLandingNearAirbase()

Sets flights by default to land and despawn near the airbase in the air, as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultOverhead(Overhead)

Defines the default amount of extra planes that will take-off as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultTakeoff(Takeoff)

Defines the default method at which new flights will spawn and take-off as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultTakeoffFromParkingCold()

Sets flights to by default take-off from the airbase at a cold location, as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultTakeoffFromParkingHot()

Sets flights by default to take-off from the airbase at a hot location, as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultTakeoffFromRunway()

Sets flights by default to take-off from the runway, as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultTakeoffInAir()

Sets flights to default take-off in the air, as part of the defense system.

AI_A2A_DISPATCHER:SetDefaultTakeoffInAirAltitude(TakeoffAltitude)

Defines the default altitude where airplanes will spawn in the air and take-off as part of the defense system, when the take-off in the air method has been selected.

AI_A2A_DISPATCHER:SetDefaultTanker(TankerName)

Set the default tanker where defenders will Refuel in the air.

AI_A2A_DISPATCHER:SetDefenderTask(SquadronName, Defender, Type, Fsm, Target)

Set defender task.

AI_A2A_DISPATCHER:SetDefenderTaskTarget(Defender, AttackerDetection)

Set defender task target.

AI_A2A_DISPATCHER:SetDisengageRadius(DisengageRadius)

Define the radius to disengage any target when the distance to the home base is larger than the specified meters.

AI_A2A_DISPATCHER:SetEngageRadius(EngageRadius)

Define the radius to engage any target by airborne friendlies, which are executing cap or returning from an intercept mission.

AI_A2A_DISPATCHER:SetGciRadius(GciRadius)

Define the radius to check if a target can be engaged by an ground controlled intercept.

AI_A2A_DISPATCHER:SetIntercept(InterceptDelay)

Set intercept.

AI_A2A_DISPATCHER:SetSquadron(SquadronName, AirbaseName, TemplatePrefixes, ResourceCount)

This is the main method to define Squadrons programmatically.

AI_A2A_DISPATCHER:SetSquadronCap(SquadronName, Zone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, EngageMinSpeed, EngageMaxSpeed, AltType)

Set a CAP for a Squadron.

AI_A2A_DISPATCHER:SetSquadronCap2(SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType, Zone, PatrolMinSpeed, PatrolMaxSpeed, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolAltType)

Set a CAP for a Squadron.

AI_A2A_DISPATCHER:SetSquadronCapInterval(SquadronName, CapLimit, LowInterval, HighInterval, Probability)

Set the squadron CAP parameters.

AI_A2A_DISPATCHER:SetSquadronCapRacetrack(SquadronName, LeglengthMin, LeglengthMax, HeadingMin, HeadingMax, DurationMin, DurationMax, CapCoordinates)

Set race track pattern when squadron is performing CAP.

AI_A2A_DISPATCHER:SetSquadronFuelThreshold(SquadronName, FuelThreshold)

Set the fuel treshold for the squadron when defenders will RTB or Refuel in the air.

AI_A2A_DISPATCHER:SetSquadronGci(SquadronName, EngageMinSpeed, EngageMaxSpeed)

Set squadron GCI.

AI_A2A_DISPATCHER:SetSquadronGci2(SquadronName, EngageMinSpeed, EngageMaxSpeed, EngageFloorAltitude, EngageCeilingAltitude, EngageAltType)

Set squadron GCI.

AI_A2A_DISPATCHER:SetSquadronGrouping(SquadronName, Grouping)

Sets the grouping of new airplanes spawned.

AI_A2A_DISPATCHER:SetSquadronLanding(SquadronName, Landing)

Defines the method at which flights will land and despawn as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronLandingAtEngineShutdown(SquadronName)

Sets flights to land and despawn at engine shutdown, as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronLandingAtRunway(SquadronName)

Sets flights to land and despawn at the runway, as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronLandingNearAirbase(SquadronName)

Sets flights to land and despawn near the airbase in the air, as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronLanguage(SquadronName, Language)

Set the squadron language.

AI_A2A_DISPATCHER:SetSquadronOverhead(SquadronName, Overhead)

Defines the amount of extra planes that will take-off as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronRadioFrequency(SquadronName, RadioFrequency, RadioModulation, RadioPower)

Set the frequency of communication and the mode of communication for voice overs.

AI_A2A_DISPATCHER:SetSquadronTakeoff(SquadronName, Takeoff)

Defines the method at which new flights will spawn and take-off as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronTakeoffFromParkingCold(SquadronName)

Sets flights to take-off from the airbase at a cold location, as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronTakeoffFromParkingHot(SquadronName)

Sets flights to take-off from the airbase at a hot location, as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronTakeoffFromRunway(SquadronName)

Sets flights to take-off from the runway, as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronTakeoffInAir(SquadronName, TakeoffAltitude)

Sets flights to take-off in the air, as part of the defense system.

AI_A2A_DISPATCHER:SetSquadronTakeoffInAirAltitude(SquadronName, TakeoffAltitude)

Defines the default altitude where airplanes will spawn in the air and take-off as part of the defense system, when the take-off in the air method has been selected.

AI_A2A_DISPATCHER:SetSquadronTanker(SquadronName, TankerName)

Set the squadron tanker where defenders will Refuel in the air.

AI_A2A_DISPATCHER:SetSquadronVisible(SquadronName)

Set the Squadron visible before startup of the dispatcher.

AI_A2A_DISPATCHER:SetTacticalDisplay(TacticalDisplay)

Display a tactical report every 30 seconds about which aircraft are: * Patrolling * Engaging * Returning * Damaged * Out of Fuel * ...

AI_A2A_DISPATCHER:ShowTacticalDisplay(Detection)

Shows the tactical display.

AI_A2A_DISPATCHER.TacticalDisplay

AI_A2A_DISPATCHER.Takeoff

AI_A2A_DISPATCHER:__CAP(Delay)

CAP Asynchronous Trigger for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:__ENGAGE(Delay, AttackerDetection, Defenders)

ENGAGE Asynchronous Trigger for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:__GCI(Delay, AttackerDetection, DefendersMissing, DefenderFriendlies)

GCI Asynchronous Trigger for AI_A2A_DISPATCHER

AI_A2A_DISPATCHER:onafterCAP(From, Event, To, SquadronName)

On after "CAP" event.

AI_A2A_DISPATCHER:onafterENGAGE(From, Event, To, AttackerDetection, Defenders)

On after "ENGAGE" event.

AI_A2A_DISPATCHER:onafterGCI(From, Event, To, AttackerDetection, DefendersMissing, DefenderFriendlies)

On after "GCI" event.

AI_A2A_DISPATCHER:onafterStart(From, Event, To)

On after "Start" event.

AI_A2A_DISPATCHER.uncontrolled

Fields and Methods inherited from DETECTION_MANAGER Description

AI_A2A_DISPATCHER.CC

The command center that is used to communicate with the players.

AI_A2A_DISPATCHER.Detection

The DETECTION_BASE object that is used to report the detected objects.

AI_A2A_DISPATCHER:GetCommandCenter()

Get the command center to communicate actions to the players.

AI_A2A_DISPATCHER:GetReportDisplayTime()

Get the reporting message display time.

AI_A2A_DISPATCHER:MessageToPlayers(Squadron, Message, SoundFile, SoundDuration, SoundPath, DefenderGroup)

Send an information message to the players reporting to the command center.

AI_A2A_DISPATCHER:New(SetGroup, Detection)

FAC constructor.

AI_A2A_DISPATCHER:OnAfterAborted(From, Event, To, Task)

Aborted Handler OnAfter for DETECTION_MANAGER

AI_A2A_DISPATCHER:OnAfterCancelled(From, Event, To, Task)

Cancelled Handler OnAfter for DETECTION_MANAGER

AI_A2A_DISPATCHER:OnAfterFailed(From, Event, To, Task)

Failed Handler OnAfter for DETECTION_MANAGER

AI_A2A_DISPATCHER:OnAfterStart(From, Event, To)

Start Handler OnAfter for DETECTION_MANAGER

AI_A2A_DISPATCHER:OnAfterStop(From, Event, To)

Stop Handler OnAfter for DETECTION_MANAGER

AI_A2A_DISPATCHER:OnAfterSuccess(From, Event, To, Task)

Success Handler OnAfter for DETECTION_MANAGER

AI_A2A_DISPATCHER:OnBeforeStart(From, Event, To)

Start Handler OnBefore for DETECTION_MANAGER

AI_A2A_DISPATCHER:OnBeforeStop(From, Event, To)

Stop Handler OnBefore for DETECTION_MANAGER

AI_A2A_DISPATCHER:ProcessDetected(Detection)

Reports the detected items to the Core.Set#SET_GROUP.

AI_A2A_DISPATCHER:SetCommandCenter(CommandCenter)

Set a command center to communicate actions to the players reporting to the command center.

AI_A2A_DISPATCHER.SetGroup

The groups to which the FAC will report to.

AI_A2A_DISPATCHER:SetRefreshTimeInterval(RefreshTimeInterval)

Set the reporting time interval.

AI_A2A_DISPATCHER:SetReportDisplayTime(ReportDisplayTime)

Set the reporting message display time.

AI_A2A_DISPATCHER:SetTacticalMenu(DispatcherMainMenuText, DispatcherMenuText)

Set a command center to communicate actions to the players reporting to the command center.

AI_A2A_DISPATCHER:Start()

Start Trigger for DETECTION_MANAGER

AI_A2A_DISPATCHER:Stop()

Stop Trigger for DETECTION_MANAGER

AI_A2A_DISPATCHER._RefreshTimeInterval

AI_A2A_DISPATCHER._ReportDisplayTime

AI_A2A_DISPATCHER:__Start(Delay)

Start Asynchronous Trigger for DETECTION_MANAGER

AI_A2A_DISPATCHER:__Stop(Delay)

Stop Asynchronous Trigger for DETECTION_MANAGER

AI_A2A_DISPATCHER:onafterReport(From, Event, To)

AI_A2A_DISPATCHER:onafterStart(From, Event, To)

Fields and Methods inherited from FSM Description

AI_A2A_DISPATCHER:AddEndState(State)

Adds an End state.

AI_A2A_DISPATCHER:AddProcess(From, Event, Process, ReturnEvents)

Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

AI_A2A_DISPATCHER:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

AI_A2A_DISPATCHER:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

AI_A2A_DISPATCHER:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

AI_A2A_DISPATCHER.CallScheduler

AI_A2A_DISPATCHER.Events

AI_A2A_DISPATCHER:GetCurrentState()

AI_A2A_DISPATCHER:GetEndStates()

Returns the End states.

AI_A2A_DISPATCHER:GetProcess(From, Event)

AI_A2A_DISPATCHER:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

AI_A2A_DISPATCHER:GetScores()

Returns a table with the scores defined.

AI_A2A_DISPATCHER:GetStartState()

Returns the start state of the FSM.

AI_A2A_DISPATCHER:GetState()

AI_A2A_DISPATCHER:GetSubs()

Returns a table with the Subs defined.

AI_A2A_DISPATCHER:GetTransitions()

Returns a table of the transition rules defined within the FSM.

AI_A2A_DISPATCHER:Is(State)

AI_A2A_DISPATCHER:LoadCallBacks(CallBackTable)

AI_A2A_DISPATCHER:New()

Creates a new FSM object.

AI_A2A_DISPATCHER.Scores

AI_A2A_DISPATCHER:SetProcess(From, Event, Fsm)

AI_A2A_DISPATCHER:SetStartState(State)

Sets the start state of the FSM.

AI_A2A_DISPATCHER._EndStates

AI_A2A_DISPATCHER._EventSchedules

AI_A2A_DISPATCHER._Processes

AI_A2A_DISPATCHER._Scores

AI_A2A_DISPATCHER._StartState

AI_A2A_DISPATCHER._Transitions

AI_A2A_DISPATCHER:_add_to_map(Map, Event)

AI_A2A_DISPATCHER:_call_handler(step, trigger, params, EventName)

AI_A2A_DISPATCHER:_create_transition(EventName)

AI_A2A_DISPATCHER:_delayed_transition(EventName)

AI_A2A_DISPATCHER:_eventmap(Events, EventStructure)

AI_A2A_DISPATCHER:_gosub(ParentFrom, ParentEvent)

AI_A2A_DISPATCHER:_handler(EventName, ...)

AI_A2A_DISPATCHER:_isendstate(Current)

AI_A2A_DISPATCHER:_submap(subs, sub, name)

AI_A2A_DISPATCHER:can(e)

AI_A2A_DISPATCHER:cannot(e)

AI_A2A_DISPATCHER.current

AI_A2A_DISPATCHER.endstates

AI_A2A_DISPATCHER:is(state)

AI_A2A_DISPATCHER.options

AI_A2A_DISPATCHER.subs

Fields and Methods inherited from BASE Description

AI_A2A_DISPATCHER.ClassID

The ID number of the class.

AI_A2A_DISPATCHER.ClassName

The name of the class.

AI_A2A_DISPATCHER.ClassNameAndID

The name of the class concatenated with the ID number of the class.

AI_A2A_DISPATCHER:ClearState(Object, StateName)

Clear the state of an object.

AI_A2A_DISPATCHER:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace)

Creation of a Birth Event.

AI_A2A_DISPATCHER:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

AI_A2A_DISPATCHER:CreateEventDead(EventTime, Initiator)

Creation of a Dead Event.

AI_A2A_DISPATCHER:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

AI_A2A_DISPATCHER:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

AI_A2A_DISPATCHER:E(Arguments)

Log an exception which will be traced always.

AI_A2A_DISPATCHER:EventDispatcher()

Returns the event dispatcher

AI_A2A_DISPATCHER:EventRemoveAll()

Remove all subscribed events

AI_A2A_DISPATCHER:F(Arguments)

Trace a function call.

AI_A2A_DISPATCHER:F2(Arguments)

Trace a function call level 2.

AI_A2A_DISPATCHER:F3(Arguments)

Trace a function call level 3.

AI_A2A_DISPATCHER:GetClassID()

Get the ClassID of the class instance.

AI_A2A_DISPATCHER:GetClassName()

Get the ClassName of the class instance.

AI_A2A_DISPATCHER:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

AI_A2A_DISPATCHER:GetEventPriority()

Get the Class Event processing Priority.

AI_A2A_DISPATCHER:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

AI_A2A_DISPATCHER:GetState(Object, Key)

Get a Value given a Key from the Object.

AI_A2A_DISPATCHER:HandleEvent(Event, EventFunction)

Subscribe to a DCS Event.

AI_A2A_DISPATCHER:I(Arguments)

Log an information which will be traced always.

AI_A2A_DISPATCHER:Inherit(Child, Parent)

This is the worker method to inherit from a parent class.

AI_A2A_DISPATCHER:IsInstanceOf(ClassName)

This is the worker method to check if an object is an (sub)instance of a class.

AI_A2A_DISPATCHER:IsTrace()

Enquires if tracing is on (for the class).

AI_A2A_DISPATCHER:New()

BASE constructor.

AI_A2A_DISPATCHER:OnEvent(EventData)

Occurs when an object is completely destroyed.

AI_A2A_DISPATCHER:OnEventBaseCaptured(EventData)

Occurs when a ground unit captures either an airbase or a farp.

AI_A2A_DISPATCHER:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

AI_A2A_DISPATCHER:OnEventCrash(EventData)

Occurs when any aircraft crashes into the ground and is completely destroyed.

AI_A2A_DISPATCHER:OnEventDead(EventData)

Occurs when an object is dead.

AI_A2A_DISPATCHER:OnEventDetailedFailure(EventData)

Unknown precisely what creates this event, likely tied into newer damage model.

AI_A2A_DISPATCHER:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

AI_A2A_DISPATCHER:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

AI_A2A_DISPATCHER:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

AI_A2A_DISPATCHER:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

AI_A2A_DISPATCHER:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

AI_A2A_DISPATCHER:OnEventKill(EventData)

Occurs on the death of a unit.

AI_A2A_DISPATCHER:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

AI_A2A_DISPATCHER:OnEventLandingAfterEjection(EventData)

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

AI_A2A_DISPATCHER:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

AI_A2A_DISPATCHER:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

AI_A2A_DISPATCHER:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

AI_A2A_DISPATCHER:OnEventMissionEnd(EventData)

Occurs when a mission ends

AI_A2A_DISPATCHER:OnEventMissionStart(EventData)

Occurs when a mission starts

AI_A2A_DISPATCHER:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

AI_A2A_DISPATCHER:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

AI_A2A_DISPATCHER:OnEventPlayerLeaveUnit(EventData)

Occurs when any player relieves control of a unit to the AI.

AI_A2A_DISPATCHER:OnEventRefueling(EventData)

Occurs when an aircraft connects with a tanker and begins taking on fuel.

AI_A2A_DISPATCHER:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

AI_A2A_DISPATCHER:OnEventScore(EventData)

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

AI_A2A_DISPATCHER:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

AI_A2A_DISPATCHER:OnEventShootingStart(EventData)

Occurs when any unit begins firing a weapon that has a high rate of fire.

AI_A2A_DISPATCHER:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

AI_A2A_DISPATCHER:OnEventTakeoff(EventData)

Occurs when an aircraft takes off from an airbase, farp, or ship.

AI_A2A_DISPATCHER:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

AI_A2A_DISPATCHER:ScheduleOnce(Start, SchedulerFunction, ...)

Schedule a new time event.

AI_A2A_DISPATCHER:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...)

Schedule a new time event.

AI_A2A_DISPATCHER:ScheduleStop(SchedulerFunction)

Stops the Schedule.

AI_A2A_DISPATCHER.Scheduler

AI_A2A_DISPATCHER:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

AI_A2A_DISPATCHER:SetState(Object, Key, Value)

Set a state or property of the Object given a Key and a Value.

AI_A2A_DISPATCHER:T(Arguments)

Trace a function logic level 1.

AI_A2A_DISPATCHER:T2(Arguments)

Trace a function logic level 2.

AI_A2A_DISPATCHER:T3(Arguments)

Trace a function logic level 3.

AI_A2A_DISPATCHER:TraceAll(TraceAll)

Trace all methods in MOOSE

AI_A2A_DISPATCHER:TraceClass(Class)

Set tracing for a class

AI_A2A_DISPATCHER:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

AI_A2A_DISPATCHER:TraceLevel(Level)

Set trace level

AI_A2A_DISPATCHER:TraceOff()

Set trace off.

AI_A2A_DISPATCHER:TraceOn()

Set trace on.

AI_A2A_DISPATCHER:TraceOnOff(TraceOnOff)

Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.

AI_A2A_DISPATCHER:UnHandleEvent(Event)

UnSubscribe to a DCS event.

AI_A2A_DISPATCHER._

AI_A2A_DISPATCHER:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

AI_A2A_DISPATCHER:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

AI_A2A_DISPATCHER.__

AI_A2A_DISPATCHER:onEvent(event)

Fields and Methods inherited from AI_A2A_DISPATCHER.Squadron Description

AI_A2A_DISPATCHER.Squadron.Airbase

The home airbase of the squadron.

AI_A2A_DISPATCHER.Squadron.AirbaseName

Name of the home airbase.

AI_A2A_DISPATCHER.Squadron.Captured

If true, airbase of the squadron was captured.

AI_A2A_DISPATCHER.Squadron.FuelThreshold

Fuel threshold [0,1] for RTB.

AI_A2A_DISPATCHER.Squadron.Gci

GCI.

AI_A2A_DISPATCHER.Squadron.Grouping

Squadron flight group size.

AI_A2A_DISPATCHER.Squadron.Landing

Landing type.

AI_A2A_DISPATCHER.Squadron.Name

Name of the squadron.

AI_A2A_DISPATCHER.Squadron.Overhead

Squadron overhead.

AI_A2A_DISPATCHER.Squadron.Racetrack

If true, CAP flights will perform a racetrack pattern rather than randomly patrolling the zone.

AI_A2A_DISPATCHER.Squadron.RacetrackDurationMax

Max duration in seconds before the CAP flight changes its orbit position. Default never.

AI_A2A_DISPATCHER.Squadron.RacetrackDurationMin

Min duration in seconds before the CAP flight changes its orbit position. Default never.

AI_A2A_DISPATCHER.Squadron.RacetrackHeadingMax

Max heading of race track in degrees. Default 180 deg, i.e. from North to South.

AI_A2A_DISPATCHER.Squadron.RacetrackHeadingMin

Min heading of race track in degrees. Default 0 deg, i.e. from South to North.

AI_A2A_DISPATCHER.Squadron.RacetrackLengthMax

Max Length of race track in meters. Default 15,000 m.

AI_A2A_DISPATCHER.Squadron.RacetrackLengthMin

Min Length of race track in meters. Default 10,000 m.

AI_A2A_DISPATCHER.Squadron.ResourceCount

Number of resources.

AI_A2A_DISPATCHER.Squadron.Resources

Flight group resources Resources[TemplateID][GroupName] = SpawnGroup.

AI_A2A_DISPATCHER.Squadron.Spawn

Table of spaws Core.Spawn#SPAWN.

AI_A2A_DISPATCHER.Squadron.Table

of template group names of the squadron.

AI_A2A_DISPATCHER.Squadron.Takeoff

Takeoff type.

AI_A2A_DISPATCHER.Squadron.TakeoffAltitude

Altitude in meters for spawn in air.

AI_A2A_DISPATCHER.Squadron.TankerName

Name of the refuelling tanker.

AI_A2A_DISPATCHER.Squadron.TemplatePrefixes

AI_A2A_DISPATCHER.Squadron.Uncontrolled

If true, flight groups are spawned uncontrolled and later activated.

AI_A2A_DISPATCHER class.

Field(s)

#table AI_A2A_DISPATCHER.DefenderDefault

The Defender Default Settings over all Squadrons.

#table AI_A2A_DISPATCHER.DefenderSquadrons

The Defender Squadrons.

#table AI_A2A_DISPATCHER.DefenderTasks

The Defenders Tasks.

#table AI_A2A_DISPATCHER.Landing

Defnes Landing location.

Function(s)

Add defender to squadron.

Resource count will get smaller.

Defined in:

AI_A2A_DISPATCHER

Parameters:

The squadron.

The defender group.

#number Size

Size of the group.

CAP Trigger for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Check if squadron can do CAP.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The squadron name.

Return value:

DefenderSquadron

Check if squadron can do GCI.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The squadron name.

Return value:

#table:

DefenderSquadron

Defined in:

AI_A2A_DISPATCHER

Parameter:

The defender group.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The defender group.

Count number of airborne CAP flights.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

Name of the squadron.

Return value:

#number:

Number of defender CAP groups.

Count number of engaging defender groups.

Defined in:

AI_A2A_DISPATCHER

Parameter:

Detection object.

Return value:

#number:

Number of defender groups engaging.

Count defenders to be engaged if number of attackers larger than number of defenders.

Defined in:

AI_A2A_DISPATCHER

Parameters:

Detected item.

#number DefenderCount

Number of defenders.

Return value:

#table:

Table of friendly groups.

ENGAGE Trigger for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

Detected item.

#table Defenders

Defenders table.

Creates an ENGAGE task when there are human friendlies airborne near the targets.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The detected item.

Return value:

TargetSetUnit: The target set of units or nil.

Creates an GCI task when there are targets for it.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The detected item.

Return values:

TargetSetUnit: The target set of units or nil if there are no targets to be set.

#table:

Table of friendly groups.

Creates an SWEEP task when there are targets for it.

Defined in:

AI_A2A_DISPATCHER

Parameter:

Return value:

TargetSetUnit: The target set of units.

GCI Trigger for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

Detected item.

#number DefendersMissing

Number of missing defenders.

#table DefenderFriendlies

Friendly defenders.

Calculates which AI friendlies are nearby the area

Defined in:

AI_A2A_DISPATCHER

Parameter:

Return value:

#table:

A list of the friendlies nearby.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The squadron name.

Return value:

Gets the default method at which flights will land and despawn as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

#number:

Landing The landing method which can be NearAirbase, AtRunway, AtEngineShutdown

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights by default despawn near the airbase when returning.
  local LandingMethod = A2ADispatcher:GetDefaultLanding( AI_A2A_Dispatcher.Landing.NearAirbase )
  if LandingMethod == AI_A2A_Dispatcher.Landing.NearAirbase then
   ...
  end

Gets the default method at which new flights will spawn and take-off as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

#number:

Takeoff From the airbase hot, from the airbase cold, in the air, from the runway.

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights by default take-off in the air.
  local TakeoffMethod = A2ADispatcher:GetDefaultTakeoff()
  if TakeOffMethod == , AI_A2A_Dispatcher.Takeoff.InAir then
    ...
  end

Get defender task.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The defender group.

Return value:

#table:

Defender task.

Get defender task FSM.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The defender group.

Return value:

The FSM.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The defender group.

Return value:

#string:

Squadron name of the defender task.

Get target of defender.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The defender group.

Return value:

Target

Return the defender tasks table.

Defined in:

AI_A2A_DISPATCHER

Return value:

#table:

Defender tasks as table.

Calculates which friendlies are nearby the area.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The detected item.

Return value:

#number, Core.Report#REPORT:

The amount of friendlies and a text string explaining which friendlies of which type.

Calculates which HUMAN friendlies are nearby the area.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The detected item.

Return value:

#number, Core.Report#REPORT:

The amount of friendlies and a text string explaining which friendlies of which type.

Get an item from the Squadron table.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

Name of the squadron.

Return value:

Defender squadron table.

Get squadron from defender.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The defender group.

Return value:

Squadron The squadron.

Gets the method at which flights will land and despawn as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The name of the squadron.

Return value:

#number:

Landing The landing method which can be NearAirbase, AtRunway, AtEngineShutdown

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights despawn near the airbase when returning.
  local LandingMethod = A2ADispatcher:GetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.NearAirbase )
  if LandingMethod == AI_A2A_Dispatcher.Landing.NearAirbase then
   ...
  end

Gets the method at which new flights will spawn and take-off as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The name of the squadron.

Return value:

#number:

Takeoff From the airbase hot, from the airbase cold, in the air, from the runway.

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights take-off in the air.
  local TakeoffMethod = A2ADispatcher:GetSquadronTakeoff( "SquadronName" )
  if TakeOffMethod == , AI_A2A_Dispatcher.Takeoff.InAir then
    ...
  end

Check if the Squadron is visible before startup of the dispatcher.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The squadron name.

Return value:

#boolean:

true if visible.

Usage:


       -- Set the Squadron visible before startup of dispatcher.
       local IsVisible = A2ADispatcher:IsSquadronVisible( "Mineralnye" )

AI_A2A_DISPATCHER constructor.

This is defining the A2A DISPATCHER for one coaliton. The Dispatcher works with a Functional.Detection#DETECTION_BASE object that is taking of the detection of targets using the EWR units. The Detection object is polymorphic, depending on the type of detection object choosen, the detection will work differently.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The DETECTION object that will detects targets using the the Early Warning Radar network.

Return value:

Usage:


  -- Setup the Detection, using DETECTION_AREAS.
  -- First define the SET of GROUPs that are defining the EWR network.
  -- Here with prefixes DF CCCP AWACS, DF CCCP EWR.
  DetectionSetGroup = SET_GROUP:New()
  DetectionSetGroup:FilterPrefixes( { "DF CCCP AWACS", "DF CCCP EWR" } )
  DetectionSetGroup:FilterStart()

  -- Define the DETECTION_AREAS, using the DetectionSetGroup, with a 30km grouping radius.
  Detection = DETECTION_AREAS:New( DetectionSetGroup, 30000 )

  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )  --

OnAfter Transition Handler for Event Assign.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

The From State string.

#string Event

The Event string.

#string To

The To State string.

#string PlayerName

CAP Handler OnAfter for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

#string Event

#string To

ENGAGE Handler OnAfter for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

#string Event

#string To

Detected item.

#table Defenders

Defenders table.

GCI Handler OnAfter for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

#string Event

#string To

Detected item.

#number DefendersMissing

Number of missing defenders.

#table DefenderFriendlies

Friendly defenders.

CAP Handler OnBefore for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

#string Event

#string To

Return value:

#boolean:

ENGAGE Handler OnBefore for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

#string Event

#string To

Detected item.

#table Defenders

Defenders table.

Return value:

#boolean:

GCI Handler OnBefore for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

#string Event

#string To

Return value:

#boolean:

Event base captured.

Defined in:

AI_A2A_DISPATCHER

Parameter:

Event dead or crash.

Defined in:

AI_A2A_DISPATCHER

Parameter:

Event engine shutdown.

Defined in:

AI_A2A_DISPATCHER

Parameter:

Event land.

Defined in:

AI_A2A_DISPATCHER

Parameter:

Assigns A2G AI Tasks in relation to the detected items.

Defined in:

AI_A2A_DISPATCHER

Parameter:

DetectedItem

Park defender.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#AI_A2A_DISPATCHER.Squadron DefenderSquadron

The squadron.

Assigns A2A AI Tasks in relation to the detected items.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The detection created by the Functional.Detection#DETECTION_BASE derived object.

Return value:

#boolean:

Return true if you want the task assigning to continue... false will cancel the loop.

Remove defender from squadron.

Resource count will increase.

Defined in:

AI_A2A_DISPATCHER

Parameters:

The squadron.

The defender group.

Activate resource.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#AI_A2A_DISPATCHER.Squadron DefenderSquadron

The defender squadron.

#number DefendersNeeded

Number of defenders needed. Default 4.

Return values:

The defender group.

#boolean:

Grouping.

Schedules a new CAP for the given SquadronName.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The squadron name.

Define a border area to simulate a cold war scenario.

A cold war is one where CAP aircraft patrol their territory but will not attack enemy aircraft or launch GCI aircraft unless enemy aircraft enter their territory. In other words the EWR may detect an enemy aircraft but will only send aircraft to attack it if it crosses the border. A hot war is one where CAP aircraft will intercept any detected enemy aircraft and GCI aircraft will launch against detected enemy aircraft without regard for territory. In other words if the ground radar can detect the enemy aircraft then it will send CAP and GCI aircraft to attack it. If it's a cold war then the borders of red and blue territory need to be defined using a zone object derived from Core.Zone#ZONE_BASE. This method needs to be used for this. If a hot war is chosen then no borders actually need to be defined using the helicopter units other than it makes it easier sometimes for the mission maker to envisage where the red and blue territories roughly are. In a hot war the borders are effectively defined by the ground based radar coverage of a coalition. Set the noborders parameter to 1

Defined in:

AI_A2A_DISPATCHER

Parameter:

Core.Zone#ZONE_BASE BorderZone

An object derived from ZONE_BASE, or a list of objects derived from ZONE_BASE.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Set one ZONE_POLYGON object as the border for the A2A dispatcher.
  local BorderZone = ZONE_POLYGON( "CCCP Border", GROUP:FindByName( "CCCP Border" ) ) -- The GROUP object is a late activate helicopter unit.
  A2ADispatcher:SetBorderZone( BorderZone )

or

  -- Set two ZONE_POLYGON objects as the border for the A2A dispatcher.
  local BorderZone1 = ZONE_POLYGON( "CCCP Border1", GROUP:FindByName( "CCCP Border1" ) ) -- The GROUP object is a late activate helicopter unit.
  local BorderZone2 = ZONE_POLYGON( "CCCP Border2", GROUP:FindByName( "CCCP Border2" ) ) -- The GROUP object is a late activate helicopter unit.
  A2ADispatcher:SetBorderZone( { BorderZone1, BorderZone2 } )

Set the default CAP limit for squadrons, which will be used to determine how many CAP can be airborne at the same time for the squadron.

The default CAP limit is 1 CAP, which means one CAP group being spawned.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number CapLimit

The maximum amount of CAP that can be airborne at the same time for the squadron.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Now Setup the default CAP limit.
  A2ADispatcher:SetDefaultCapLimit( 2 ) -- Maximum 2 CAP per squadron.

Set race track pattern as default when any squadron is performing CAP.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#number LeglengthMin

Min length of the race track leg in meters. Default 10,000 m.

#number LeglengthMax

Max length of the race track leg in meters. Default 15,000 m.

#number HeadingMin

Min heading of the race track in degrees. Default 0 deg, i.e. counter clockwise from South to North.

#number HeadingMax

Max heading of the race track in degrees. Default 180 deg, i.e. counter clockwise from North to South.

#number DurationMin

(Optional) Min duration in seconds before switching the orbit position. Default is keep same orbit until RTB or engage.

#number DurationMax

(Optional) Max duration in seconds before switching the orbit position. Default is keep same orbit until RTB or engage.

#table CapCoordinates

Table of coordinates of first race track point. Second point is determined by leg length and heading.

Return value:

Set the default CAP time interval for squadrons, which will be used to determine a random CAP timing.

The default CAP time interval is between 180 and 600 seconds.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#number CapMinSeconds

The minimum amount of seconds for the random time interval.

#number CapMaxSeconds

The maximum amount of seconds for the random time interval.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Now Setup the default CAP time interval.
  A2ADispatcher:SetDefaultCapTimeInterval( 300, 1200 ) -- Between 300 and 1200 seconds.

Set the default damage treshold when defenders will RTB.

The default damage treshold is by default set to 40%, which means that when the airplane is 40% damaged, it will go RTB.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number DamageThreshold

A decimal number between 0 and 1, that expresses the %-tage of the damage treshold before going RTB.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Now Setup the default damage treshold.
  A2ADispatcher:SetDefaultDamageThreshold( 0.90 ) -- Go RTB when the airplane 90% damaged.

Set the default fuel treshold when defenders will RTB or Refuel in the air.

The fuel treshold is by default set to 15%, which means that an airplane will stay in the air until 15% of its fuel has been consumed.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number FuelThreshold

A decimal number between 0 and 1, that expresses the %-tage of the treshold of fuel remaining in the tank when the plane will go RTB or Refuel.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Now Setup the default fuel treshold.
  A2ADispatcher:SetDefaultFuelThreshold( 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank.

Sets the default grouping of new airplanes spawned.

Grouping will trigger how new airplanes will be grouped if more than one airplane is spawned for defense.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number Grouping

The level of grouping that will be applied of the CAP or GCI defenders.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Set a grouping by default per 2 airplanes.
  A2ADispatcher:SetDefaultGrouping( 2 )

Defines the default method at which flights will land and despawn as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number Landing

The landing method which can be NearAirbase, AtRunway, AtEngineShutdown

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights by default despawn near the airbase when returning.
  A2ADispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.NearAirbase )

  -- Let new flights by default despawn after landing land at the runway.
  A2ADispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.AtRunway )

  -- Let new flights by default despawn after landing and parking, and after engine shutdown.
  A2ADispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.AtEngineShutdown )

Sets flights by default to land and despawn at engine shutdown, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let flights by default land and despawn at engine shutdown.
  A2ADispatcher:SetDefaultLandingAtEngineShutdown()

Sets flights by default to land and despawn at the runway, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let flights by default land at the runway and despawn.
  A2ADispatcher:SetDefaultLandingAtRunway()

Sets flights by default to land and despawn near the airbase in the air, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let flights by default to land near the airbase and despawn.
  A2ADispatcher:SetDefaultLandingNearAirbase()

Defines the default amount of extra planes that will take-off as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number Overhead

The %-tage of Units that dispatching command will allocate to intercept in surplus of detected amount of units. The default overhead is 1, so equal balance. The AI_A2A_DISPATCHER.SetOverhead() method can be used to tweak the defense strength, taking into account the plane types of the squadron. For example, a MIG-31 with full long-distance A2A missiles payload, may still be less effective than a F-15C with short missiles... So in this case, one may want to use the Overhead method to allocate more defending planes as the amount of detected attacking planes. The overhead must be given as a decimal value with 1 as the neutral value, which means that Overhead values:

  • Higher than 1, will increase the defense unit amounts.
  • Lower than 1, will decrease the defense unit amounts.

The amount of defending units is calculated by multiplying the amount of detected attacking planes as part of the detected group multiplied by the Overhead and rounded up to the smallest integer.

The Overhead value set for a Squadron, can be programmatically adjusted (by using this SetOverhead method), to adjust the defense overhead during mission execution.

See example below.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- An overhead of 1,5 with 1 planes detected, will allocate 2 planes ( 1 * 1,5 ) = 1,5 => rounded up gives 2.
  -- An overhead of 1,5 with 2 planes detected, will allocate 3 planes ( 2 * 1,5 ) = 3 =>  rounded up gives 3.
  -- An overhead of 1,5 with 3 planes detected, will allocate 5 planes ( 3 * 1,5 ) = 4,5 => rounded up gives 5 planes.
  -- An overhead of 1,5 with 4 planes detected, will allocate 6 planes ( 4 * 1,5 ) = 6  => rounded up gives 6 planes.

  A2ADispatcher:SetDefaultOverhead( 1.5 )

Defines the default method at which new flights will spawn and take-off as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number Takeoff

From the airbase hot, from the airbase cold, in the air, from the runway.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights by default take-off in the air.
  A2ADispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Air )

  -- Let new flights by default take-off from the runway.
  A2ADispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Runway )

  -- Let new flights by default take-off from the airbase hot.
  A2ADispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Hot )

  -- Let new flights by default take-off from the airbase cold.
  A2ADispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Cold )

Sets flights to by default take-off from the airbase at a cold location, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights take-off from a cold parking spot.
  A2ADispatcher:SetDefaultTakeoffFromParkingCold()

Sets flights by default to take-off from the airbase at a hot location, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights by default take-off at a hot parking spot.
  A2ADispatcher:SetDefaultTakeoffFromParkingHot()

Sets flights by default to take-off from the runway, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights by default take-off from the runway.
  A2ADispatcher:SetDefaultTakeoffFromRunway()

Sets flights to default take-off in the air, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights by default take-off in the air.
  A2ADispatcher:SetDefaultTakeoffInAir()

Defines the default altitude where airplanes will spawn in the air and take-off as part of the defense system, when the take-off in the air method has been selected.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number TakeoffAltitude

The altitude in meters above the ground.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Set the default takeoff altitude when taking off in the air.
  A2ADispatcher:SetDefaultTakeoffInAirAltitude( 2000 )  -- This makes planes start at 2000 meters above the ground.

Set the default tanker where defenders will Refuel in the air.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string TankerName

A string defining the group name of the Tanker as defined within the Mission Editor.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Now Setup the default fuel treshold.
  A2ADispatcher:SetDefaultFuelThreshold( 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank.

  -- Now Setup the default tanker.
  A2ADispatcher:SetDefaultTanker( "Tanker" ) -- The group name of the tanker is "Tanker" in the Mission Editor.

Set defender task.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

Name of the squadron.

The defender group.

#table Type

Type of the defender task

The defender task FSM.

The defender detected item.

Return value:

Set defender task target.

Defined in:

AI_A2A_DISPATCHER

Parameters:

The defender group.

The detection object.

Return value:

Define the radius to disengage any target when the distance to the home base is larger than the specified meters.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number DisengageRadius

(Optional, Default = 300000) The radius in meters to disengage a target when too far from the home base.

Return value:

Usage:


  -- Set 50km as the Disengage Radius.
  A2ADispatcher:SetDisengageRadius( 50000 )

  -- Set 100km as the Disengage Radius.
  A2ADispatcher:SetDisngageRadius() -- 300000 is the default value.

Define the radius to engage any target by airborne friendlies, which are executing cap or returning from an intercept mission.

If there is a target area detected and reported, then any friendlies that are airborne near this target area, will be commanded to (re-)engage that target when available (if no other tasks were commanded).

For example, if 100000 is given as a value, then any friendly that is airborne within 100km from the detected target, will be considered to receive the command to engage that target area.

You need to evaluate the value of this parameter carefully:

  • If too small, more intercept missions may be triggered upon detected target areas.
  • If too large, any airborne cap may not be able to reach the detected target area in time, because it is too far.

**Use the method AI_A2A_DISPATCHER.SetEngageRadius() to modify the default Engage Radius for ALL squadrons.**

Demonstration Mission: AID-019 - AI_A2A - Engage Range Test

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number EngageRadius

(Optional, Default = 100000) The radius to report friendlies near the target.

Return value:

Usage:


  -- Set 50km as the radius to engage any target by airborne friendlies.
  A2ADispatcher:SetEngageRadius( 50000 )

  -- Set 100km as the radius to engage any target by airborne friendlies.
  A2ADispatcher:SetEngageRadius() -- 100000 is the default value.

Define the radius to check if a target can be engaged by an ground controlled intercept.

When targets are detected that are still really far off, you don't want the AI_A2A_DISPATCHER to launch intercepts just yet. You want it to wait until a certain Gci range is reached, which is the distance of the closest airbase to target being smaller than the Ground Controlled Intercept radius or Gci radius.

The default Gci radius is defined as 200000 or 200km. Override the default Gci radius when the era of the warfare is early, or, when you don't want to let the AI_A2A_DISPATCHER react immediately when a certain border or area is not being crossed.

Use the method AI_A2A_DISPATCHER.SetGciRadius() to set a specific controlled ground intercept radius. The Ground Controlled Intercept radius is defined for ALL squadrons which are operational.

Demonstration Mission: AID-013 - AI_A2A - Intercept Test

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number GciRadius

(Optional, Default = 200000) The radius to ground control intercept detected targets from the nearest airbase.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Set 100km as the radius to ground control intercept detected targets from the nearest airbase.
  A2ADispatcher:SetGciRadius( 100000 )

  -- Set 200km as the radius to ground control intercept.
  A2ADispatcher:SetGciRadius() -- 200000 is the default value.

Set intercept.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number InterceptDelay

Delay in seconds before intercept.

Return value:

This is the main method to define Squadrons programmatically.

Squadrons:

  • Have a name or key that is the identifier or key of the squadron.
  • Have specific plane types defined by templates.
  • Are located at one specific airbase. Multiple squadrons can be located at one airbase through.
  • Optionally have a limited set of resources. The default is that squadrons have unlimited resources.

The name of the squadron given acts as the squadron key in the AI_A2A_DISPATCHER:Squadron...() methods.

Additionally, squadrons have specific configuration options to:

  • Control how new aircraft are taking off from the airfield (in the air, cold, hot, at the runway).
  • Control how returning aircraft are landing at the airfield (in the air near the airbase, after landing, after engine shutdown).
  • Control the grouping of new aircraft spawned at the airfield. If there is more than one aircraft to be spawned, these may be grouped.
  • Control the overhead or defensive strength of the squadron. Depending on the types of planes and amount of resources, the mission designer can choose to increase or reduce the amount of planes spawned.

For performance and bug workaround reasons within DCS, squadrons have different methods to spawn new aircraft or land returning or damaged aircraft.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

A string (text) that defines the squadron identifier or the key of the Squadron. It can be any name, for example "104th Squadron" or "SQ SQUADRON1", whatever. As long as you remember that this name becomes the identifier of your squadron you have defined. You need to use this name in other methods too!

#string AirbaseName

The airbase name where you want to have the squadron located. You need to specify here EXACTLY the name of the airbase as you see it in the mission editor. Examples are "Batumi" or "Tbilisi-Lochini". EXACTLY the airbase name, between quotes "". To ease the airbase naming when using the LDT editor and IntelliSense, the Wrapper.Airbase#AIRBASE class contains enumerations of the airbases of each map.

#string TemplatePrefixes

A string or an array of strings specifying the prefix names of the templates (not going to explain what is templates here again). Examples are { "104th", "105th" } or "104th" or "Template 1" or "BLUE PLANES". Just remember that your template (groups late activated) need to start with the prefix you have specified in your code. If you have only one prefix name for a squadron, you don't need to use the { }, otherwise you need to use the brackets.

#number ResourceCount

(optional) A number that specifies how many resources are in stock of the squadron. If not specified, the squadron will have infinite resources available.

Return value:

Usages:

  •   -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
      A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )
    
  •   -- This will create squadron "Squadron1" at "Batumi" airbase, and will use plane types "SQ1" and has 40 planes in stock...
      A2ADispatcher:SetSquadron( "Squadron1", "Batumi", "SQ1", 40 )
    
  •   -- This will create squadron "Sq 1" at "Batumi" airbase, and will use plane types "Mig-29" and "Su-27" and has 20 planes in stock...
      -- Note that in this implementation, the A2A dispatcher will select a random plane type when a new plane (group) needs to be spawned for defenses.
      -- Note the usage of the {} for the airplane templates list.
      A2ADispatcher:SetSquadron( "Sq 1", "Batumi", { "Mig-29", "Su-27" }, 40 )
    
  •   -- This will create 2 squadrons "104th" and "23th" at "Batumi" airbase, and will use plane types "Mig-29" and "Su-27" respectively and each squadron has 10 planes in stock...
      A2ADispatcher:SetSquadron( "104th", "Batumi", "Mig-29", 10 )
      A2ADispatcher:SetSquadron( "23th", "Batumi", "Su-27", 10 )
    
  •   -- This is an example like the previous, but now with infinite resources.
      -- The ResourceCount parameter is not given in the SetSquadron method.
      A2ADispatcher:SetSquadron( "104th", "Batumi", "Mig-29" )
      A2ADispatcher:SetSquadron( "23th", "Batumi", "Su-27" )
    
    

Set a CAP for a Squadron.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The squadron name.

The Zone object derived from Core.Zone#ZONE_BASE that defines the zone wherein the CAP will be executed.

#number PatrolFloorAltitude

The minimum altitude at which the cap can be executed.

#number PatrolCeilingAltitude

the maximum altitude at which the cap can be executed.

#number PatrolMinSpeed

The minimum speed at which the cap can be executed.

#number PatrolMaxSpeed

The maximum speed at which the cap can be executed.

#number EngageMinSpeed

The minimum speed at which the engage can be executed.

#number EngageMaxSpeed

The maximum speed at which the engage can be executed.

#number AltType

The altitude type, which is a string "BARO" defining Barometric or "RADIO" defining radio controlled altitude.

Return value:

Usage:


       -- CAP Squadron execution.
       CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) )
       A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 )
       A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 2, 30, 60, 1 )

       CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) )
       A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" )
       A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

       CAPZoneMiddle = ZONE:New( "CAP Zone Middle")
       A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" )
       A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

Set a CAP for a Squadron.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The squadron name.

#number EngageMinSpeed

The minimum speed at which the engage can be executed.

#number EngageMaxSpeed

The maximum speed at which the engage can be executed.

DCS#Altitude EngageFloorAltitude

The lowest altitude in meters where to execute the engagement.

DCS#Altitude EngageCeilingAltitude

The highest altitude in meters where to execute the engagement.

#number EngageAltType

The altitude type to engage, which is a string "BARO" defining Barometric or "RADIO" defining radio controlled altitude.

The Zone object derived from Core.Zone#ZONE_BASE that defines the zone wherein the CAP will be executed.

#number PatrolMinSpeed

The minimum speed at which the cap can be executed.

#number PatrolMaxSpeed

The maximum speed at which the cap can be executed.

#number PatrolFloorAltitude

The minimum altitude at which the cap can be executed.

#number PatrolCeilingAltitude

the maximum altitude at which the cap can be executed.

#number PatrolAltType

The altitude type to patrol, which is a string "BARO" defining Barometric or "RADIO" defining radio controlled altitude.

Return value:

Usage:


       -- CAP Squadron execution.
       CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) )
       -- Setup a CAP, engaging between 800 and 900 km/h, altitude 30 (above the sea), radio altitude measurement,
       -- patrolling speed between 500 and 600 km/h, altitude between 4000 and 10000 meters, barometric altitude measurement.
       A2ADispatcher:SetSquadronCapV2( "Mineralnye", 800, 900, 30, 30, "RADIO", CAPZoneEast, 500, 600, 4000, 10000, "BARO" )
       A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 2, 30, 60, 1 )

       CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) )
       -- Setup a CAP, engaging between 800 and 1200 km/h, altitude between 4000 and 10000 meters, radio altitude measurement,
       -- patrolling speed between 600 and 800 km/h, altitude between 4000 and 8000, barometric altitude measurement.
       A2ADispatcher:SetSquadronCapV2( "Sochi", 800, 1200, 2000, 3000, "RADIO", CAPZoneWest, 600, 800, 4000, 8000, "BARO" )
       A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

       CAPZoneMiddle = ZONE:New( "CAP Zone Middle")
       -- Setup a CAP, engaging between 800 and 1200 km/h, altitude between 5000 and 8000 meters, barometric altitude measurement,
       -- patrolling speed between 600 and 800 km/h, altitude between 4000 and 8000, radio altitude.
       A2ADispatcher:SetSquadronCapV2( "Maykop", 800, 1200, 5000, 8000, "BARO", CAPZoneMiddle, 600, 800, 4000, 8000, "RADIO" )
       A2ADispatcher:SetSquadronCapInterval( "Maykop", 2, 30, 120, 1 )

Set the squadron CAP parameters.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The squadron name.

#number CapLimit

(optional) The maximum amount of CAP groups to be spawned. Note that a CAP is a group, so can consist out of 1 to 4 airplanes. The default is 1 CAP group.

#number LowInterval

(optional) The minimum time boundary in seconds when a new CAP will be spawned. The default is 180 seconds.

#number HighInterval

(optional) The maximum time boundary in seconds when a new CAP will be spawned. The default is 600 seconds.

#number Probability

Is not in use, you can skip this parameter.

Return value:

Usage:


       -- CAP Squadron execution.
       CAPZoneEast = ZONE_POLYGON:New( "CAP Zone East", GROUP:FindByName( "CAP Zone East" ) )
       A2ADispatcher:SetSquadronCap( "Mineralnye", CAPZoneEast, 4000, 10000, 500, 600, 800, 900 )
       A2ADispatcher:SetSquadronCapInterval( "Mineralnye", 2, 30, 60, 1 )

       CAPZoneWest = ZONE_POLYGON:New( "CAP Zone West", GROUP:FindByName( "CAP Zone West" ) )
       A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" )
       A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

       CAPZoneMiddle = ZONE:New( "CAP Zone Middle")
       A2ADispatcher:SetSquadronCap( "Maykop", CAPZoneMiddle, 4000, 8000, 600, 800, 800, 1200, "RADIO" )
       A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 )

Set race track pattern when squadron is performing CAP.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

Name of the squadron.

#number LeglengthMin

Min length of the race track leg in meters. Default 10,000 m.

#number LeglengthMax

Max length of the race track leg in meters. Default 15,000 m.

#number HeadingMin

Min heading of the race track in degrees. Default 0 deg, i.e. from South to North.

#number HeadingMax

Max heading of the race track in degrees. Default 180 deg, i.e. from North to South.

#number DurationMin

(Optional) Min duration in seconds before switching the orbit position. Default is keep same orbit until RTB or engage.

#number DurationMax

(Optional) Max duration in seconds before switching the orbit position. Default is keep same orbit until RTB or engage.

#table CapCoordinates

Table of coordinates of first race track point. Second point is determined by leg length and heading.

Return value:

Set the fuel treshold for the squadron when defenders will RTB or Refuel in the air.

The fuel treshold is by default set to 15%, which means that an airplane will stay in the air until 15% of its fuel has been consumed.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#number FuelThreshold

A decimal number between 0 and 1, that expresses the %-tage of the treshold of fuel remaining in the tank when the plane will go RTB or Refuel.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Now Setup the default fuel treshold.
  A2ADispatcher:SetSquadronRefuelThreshold( "SquadronName", 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank.

Set squadron GCI.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The squadron name.

#number EngageMinSpeed

The minimum speed [km/h] at which the GCI can be executed.

#number EngageMaxSpeed

The maximum speed [km/h] at which the GCI can be executed.

Return value:

Usage:


       -- GCI Squadron execution.
       A2ADispatcher:SetSquadronGci( "Mozdok", 900, 1200 )
       A2ADispatcher:SetSquadronGci( "Novo", 900, 2100 )
       A2ADispatcher:SetSquadronGci( "Maykop", 900, 1200 )

Set squadron GCI.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The squadron name.

#number EngageMinSpeed

The minimum speed [km/h] at which the GCI can be executed.

#number EngageMaxSpeed

The maximum speed [km/h] at which the GCI can be executed.

DCS#Altitude EngageFloorAltitude

The lowest altitude in meters where to execute the engagement.

DCS#Altitude EngageCeilingAltitude

The highest altitude in meters where to execute the engagement.

DCS#AltitudeType EngageAltType

The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to "RADIO".

Return value:

Usage:


       -- GCI Squadron execution.
       A2ADispatcher:SetSquadronGci2( "Mozdok", 900, 1200, 5000, 5000, "BARO" )
       A2ADispatcher:SetSquadronGci2( "Novo", 900, 2100, 30, 30, "RADIO" )
       A2ADispatcher:SetSquadronGci2( "Maykop", 900, 1200, 100, 300, "RADIO" )

Sets the grouping of new airplanes spawned.

Grouping will trigger how new airplanes will be grouped if more than one airplane is spawned for defense.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#number Grouping

The level of grouping that will be applied of the CAP or GCI defenders.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Set a grouping per 2 airplanes.
  A2ADispatcher:SetSquadronGrouping( "SquadronName", 2 )

Defines the method at which flights will land and despawn as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#number Landing

The landing method which can be NearAirbase, AtRunway, AtEngineShutdown

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights despawn near the airbase when returning.
  A2ADispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.NearAirbase )

  -- Let new flights despawn after landing land at the runway.
  A2ADispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.AtRunway )

  -- Let new flights despawn after landing and parking, and after engine shutdown.
  A2ADispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.AtEngineShutdown )

Sets flights to land and despawn at engine shutdown, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The name of the squadron.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let flights land and despawn at engine shutdown.
  A2ADispatcher:SetSquadronLandingAtEngineShutdown( "SquadronName" )

Sets flights to land and despawn at the runway, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The name of the squadron.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let flights land at the runway and despawn.
  A2ADispatcher:SetSquadronLandingAtRunway( "SquadronName" )

Sets flights to land and despawn near the airbase in the air, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The name of the squadron.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let flights to land near the airbase and despawn.
  A2ADispatcher:SetSquadronLandingNearAirbase( "SquadronName" )

Set the squadron language.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#string Language

A string defining the language to be embedded within the miz file.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Set for English.
  A2ADispatcher:SetSquadronLanguage( "SquadronName", "EN" ) -- This squadron speaks English.

  -- Set for Russian.
  A2ADispatcher:SetSquadronLanguage( "SquadronName", "RU" ) -- This squadron speaks Russian.

Defines the amount of extra planes that will take-off as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#number Overhead

The %-tage of Units that dispatching command will allocate to intercept in surplus of detected amount of units. The default overhead is 1, so equal balance. The AI_A2A_DISPATCHER.SetOverhead() method can be used to tweak the defense strength, taking into account the plane types of the squadron. For example, a MIG-31 with full long-distance A2A missiles payload, may still be less effective than a F-15C with short missiles... So in this case, one may want to use the Overhead method to allocate more defending planes as the amount of detected attacking planes. The overhead must be given as a decimal value with 1 as the neutral value, which means that Overhead values:

  • Higher than 1, will increase the defense unit amounts.
  • Lower than 1, will decrease the defense unit amounts.

The amount of defending units is calculated by multiplying the amount of detected attacking planes as part of the detected group multiplied by the Overhead and rounded up to the smallest integer.

The Overhead value set for a Squadron, can be programmatically adjusted (by using this SetOverhead method), to adjust the defense overhead during mission execution.

See example below.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- An overhead of 1,5 with 1 planes detected, will allocate 2 planes ( 1 * 1,5 ) = 1,5 => rounded up gives 2.
  -- An overhead of 1,5 with 2 planes detected, will allocate 3 planes ( 2 * 1,5 ) = 3 =>  rounded up gives 3.
  -- An overhead of 1,5 with 3 planes detected, will allocate 5 planes ( 3 * 1,5 ) = 4,5 => rounded up gives 5 planes.
  -- An overhead of 1,5 with 4 planes detected, will allocate 6 planes ( 4 * 1,5 ) = 6  => rounded up gives 6 planes.

  A2ADispatcher:SetSquadronOverhead( "SquadronName", 1.5 )

Set the frequency of communication and the mode of communication for voice overs.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#number RadioFrequency

The frequency of communication.

#number RadioModulation

The modulation of communication.

#number RadioPower

The power in Watts of communication.

Defines the method at which new flights will spawn and take-off as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#number Takeoff

From the airbase hot, from the airbase cold, in the air, from the runway.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights take-off in the air.
  A2ADispatcher:SetSquadronTakeoff( "SquadronName", AI_A2A_Dispatcher.Takeoff.Air )

  -- Let new flights take-off from the runway.
  A2ADispatcher:SetSquadronTakeoff( "SquadronName", AI_A2A_Dispatcher.Takeoff.Runway )

  -- Let new flights take-off from the airbase hot.
  A2ADispatcher:SetSquadronTakeoff( "SquadronName", AI_A2A_Dispatcher.Takeoff.Hot )

  -- Let new flights take-off from the airbase cold.
  A2ADispatcher:SetSquadronTakeoff( "SquadronName", AI_A2A_Dispatcher.Takeoff.Cold )

Sets flights to take-off from the airbase at a cold location, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The name of the squadron.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights take-off from a cold parking spot.
  A2ADispatcher:SetSquadronTakeoffFromParkingCold( "SquadronName" )

Sets flights to take-off from the airbase at a hot location, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The name of the squadron.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights take-off in the air.
  A2ADispatcher:SetSquadronTakeoffFromParkingHot( "SquadronName" )

Sets flights to take-off from the runway, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The name of the squadron.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights take-off from the runway.
  A2ADispatcher:SetSquadronTakeoffFromRunway( "SquadronName" )

Sets flights to take-off in the air, as part of the defense system.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#number TakeoffAltitude

(optional) The altitude in meters above the ground. If not given, the default takeoff altitude will be used.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Let new flights take-off in the air.
  A2ADispatcher:SetSquadronTakeoffInAir( "SquadronName" )

Defines the default altitude where airplanes will spawn in the air and take-off as part of the defense system, when the take-off in the air method has been selected.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#number TakeoffAltitude

The altitude in meters above the ground.

Return value:

Usage:



  local A2ADispatcher = AI_A2A_DISPATCHER:New( ... )

  -- Set the default takeoff altitude when taking off in the air.
  A2ADispatcher:SetSquadronTakeoffInAirAltitude( "SquadronName", 2000 ) -- This makes planes start at 2000 meters above the ground.

Set the squadron tanker where defenders will Refuel in the air.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string SquadronName

The name of the squadron.

#string TankerName

A string defining the group name of the Tanker as defined within the Mission Editor.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Now Setup the squadron fuel treshold.
  A2ADispatcher:SetSquadronRefuelThreshold( "SquadronName", 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank.

  -- Now Setup the squadron tanker.
  A2ADispatcher:SetSquadronTanker( "SquadronName", "Tanker" ) -- The group name of the tanker is "Tanker" in the Mission Editor.

Set the Squadron visible before startup of the dispatcher.

All planes will be spawned as uncontrolled on the parking spot. They will lock the parking spot.

Defined in:

AI_A2A_DISPATCHER

Parameter:

#string SquadronName

The squadron name.

Return value:

Usage:


       -- Set the Squadron visible before startup of dispatcher.
       A2ADispatcher:SetSquadronVisible( "Mineralnye" )

Display a tactical report every 30 seconds about which aircraft are: * Patrolling * Engaging * Returning * Damaged * Out of Fuel * ...

Defined in:

AI_A2A_DISPATCHER

Parameter:

#boolean TacticalDisplay

Provide a value of true to display every 30 seconds a tactical overview.

Return value:

Usage:


  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )

  -- Now Setup the Tactical Display for debug mode.
  A2ADispatcher:SetTacticalDisplay( true )

Shows the tactical display.

Defined in:

AI_A2A_DISPATCHER

Parameter:

The detection created by the Functional.Detection#DETECTION_BASE derived object.

CAP Asynchronous Trigger for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameter:

#number Delay

ENGAGE Asynchronous Trigger for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

#number Delay

Detected item.

#table Defenders

Defenders table.

GCI Asynchronous Trigger for AI_A2A_DISPATCHER

Defined in:

AI_A2A_DISPATCHER

Parameters:

#number Delay

Detected item.

#number DefendersMissing

Number of missing defenders.

#table DefenderFriendlies

Friendly defenders.

On after "CAP" event.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

#string SquadronName

Name of the squadron.

On after "ENGAGE" event.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Detected item.

#table Defenders

Defenders table.

On after "GCI" event.

Defined in:

AI_A2A_DISPATCHER

Parameters:

#string From

From state.

#string Event

Event.

#string To

To state.

Detected item.

#number DefendersMissing

Number of missing defenders.

#table DefenderFriendlies

Friendly defenders.

On after "Start" event.

Defined in:

AI_A2A_DISPATCHER

Parameters:

From

Event

To

Field(s)

#table AI_A2A_DISPATCHER.DefenderDefault

The Defender Default Settings over all Squadrons.

#table AI_A2A_DISPATCHER.DefenderSquadrons

The Defender Squadrons.

#table AI_A2A_DISPATCHER.DefenderTasks

The Defenders Tasks.

#table AI_A2A_DISPATCHER.Landing

Defnes Landing location.

Function(s)

Get the command center to communicate actions to the players.

Get the reporting message display time.

Defined in:

Return value:

#number:

ReportDisplayTime The display time in seconds when a report needs to be done.

Send an information message to the players reporting to the command center.

Defined in:

Parameters:

#table Squadron

The squadron table.

#string Message

The message to be sent.

#string SoundFile

The name of the sound file .wav or .ogg.

#number SoundDuration

The duration of the sound.

#string SoundPath

The path pointing to the folder in the mission file.

Wrapper.Group#GROUP DefenderGroup

The defender group sending the message.

Return value:

Aborted Handler OnAfter for DETECTION_MANAGER

Defined in:

Parameters:

#string From

#string Event

#string To

Cancelled Handler OnAfter for DETECTION_MANAGER

Defined in:

Parameters:

#string From

#string Event

#string To

Failed Handler OnAfter for DETECTION_MANAGER

Defined in:

Parameters:

#string From

#string Event

#string To

Start Handler OnAfter for DETECTION_MANAGER

Defined in:

Parameters:

#string From

#string Event

#string To

Stop Handler OnAfter for DETECTION_MANAGER

Defined in:

Parameters:

#string From

#string Event

#string To

Success Handler OnAfter for DETECTION_MANAGER

Defined in:

Parameters:

#string From

#string Event

#string To

Start Handler OnBefore for DETECTION_MANAGER

Defined in:

Parameters:

#string From

#string Event

#string To

Return value:

#boolean:

Stop Handler OnBefore for DETECTION_MANAGER

Defined in:

Parameters:

#string From

#string Event

#string To

Return value:

#boolean:

Set a command center to communicate actions to the players reporting to the command center.

Defined in:

Parameter:

The command center.

Return value:

Set the reporting time interval.

Defined in:

Parameter:

#number RefreshTimeInterval

The interval in seconds when a report needs to be done.

Return value:

Set the reporting message display time.

Defined in:

Parameter:

#number ReportDisplayTime

The display time in seconds when a report needs to be done.

Return value:

Set a command center to communicate actions to the players reporting to the command center.

Defined in:

Parameters:

DispatcherMainMenuText

DispatcherMenuText

Return value:

Start Trigger for DETECTION_MANAGER

Stop Trigger for DETECTION_MANAGER

Start Asynchronous Trigger for DETECTION_MANAGER

Defined in:

Parameter:

#number Delay

Stop Asynchronous Trigger for DETECTION_MANAGER

Defined in:

Parameter:

#number Delay

Field(s)

#table AI_A2A_DISPATCHER.DefenderDefault

The Defender Default Settings over all Squadrons.

#table AI_A2A_DISPATCHER.DefenderSquadrons

The Defender Squadrons.

#table AI_A2A_DISPATCHER.DefenderTasks

The Defenders Tasks.

#table AI_A2A_DISPATCHER.Landing

Defnes Landing location.

Function(s)

Adds an End state.

Defined in:

Parameter:

State

Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Returns the End states.

Defined in:

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Returns a table with the scores defined.

Defined in:

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Returns a table with the Subs defined.

Defined in:

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Defined in:

Parameter:

State

Defined in:

Parameter:

CallBackTable

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Defined in:

Parameters:

Map

Event

Defined in:

Parameters:

step

trigger

params

EventName

Defined in:

Parameters:

Events

EventStructure

Defined in:

Parameters:

ParentFrom

ParentEvent

Defined in:

Parameters:

EventName

...

Defined in:

Parameter:

Current

Defined in:

Parameters:

subs

sub

name

Defined in:

Parameter:

e

Defined in:

Parameter:

e

Defined in:

Parameter:

state

Field(s)

#table AI_A2A_DISPATCHER.DefenderDefault

The Defender Default Settings over all Squadrons.

#table AI_A2A_DISPATCHER.DefenderSquadrons

The Defender Squadrons.

#table AI_A2A_DISPATCHER.DefenderTasks

The Defenders Tasks.

#table AI_A2A_DISPATCHER.Landing

Defnes Landing location.

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Remove Unit Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Takeoff Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Log an exception which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#string:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

The ClassName + ClassID is formatted as '%s#%09d'.

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the Class Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Return value:

#number:

The Event processing Priority.

This is the worker method to retrieve the Parent class.

Note that the Parent class must be passed to call the parent class method.

self:GetParent(self):ParentMethod()


Defined in:

Parameters:

#BASE Child

This is the Child class from which the Parent class needs to be retrieved.

#BASE FromClass

(Optional) The class from which to get the parent.

Return value:

Get a Value given a Key from the Object.

Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

The key that is used to retrieve the value. Note that the key can be a #string, but it can also be any other type!

Return value:

The Value retrieved or nil if the Key was not found and thus the Value could not be retrieved.

Subscribe to a DCS Event.

Defined in:

Parameters:

#function EventFunction

(optional) The function to be called when the event occurs for the unit.

Return value:

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

This is the worker method to inherit from a parent class.

Defined in:

Parameters:

Child

is the Child class that inherits.

#BASE Parent

is the Parent class that the Child inherits from.

Return value:

Child

This is the worker method to check if an object is an (sub)instance of a class.

Examples:

  • ZONE:New( 'some zone' ):IsInstanceOf( ZONE ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'ZONE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'zone' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'BASE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'GROUP' ) will return false

Defined in:

Parameter:

ClassName

is the name of the class or the class itself to run the check against

Return value:

#boolean:

Enquires if tracing is on (for the class).

Defined in:

Return value:

#boolean:

BASE constructor.

This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.

function EVENT:New()
  local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
  return self
end
  

Defined in:

Return value:

Occurs when an object is completely destroyed.

initiator : The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Occurs when a ground unit captures either an airbase or a farp.

initiator : The unit that captured the base place: The airbase that was captured, can be a FARP or Airbase. When calling place:getCoalition() the faction will already be the new owning faction.

Defined in:

Parameter:

The EventData structure.

Occurs when any object is spawned into the mission.

initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft crashes into the ground and is completely destroyed.

initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

Unknown precisely what creates this event, likely tied into newer damage model.

Will update this page when new information become available.

  • initiator: The unit that had the failure.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.

Defined in:

Parameter:

The EventData structure.

Occurs when any system fails on a human controlled aircraft.

initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs on the death of a unit.

Contains more and different information. Similar to unit_lost it will occur for aircraft before the aircraft crash event occurs.

  • initiator: The unit that killed the target
  • target: Target Object
  • weapon: Weapon Object

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

Event does not occur if the pilot lands in the water and sub combs to Davey Jones Locker.

  • initiator: Static object representing the ejected pilot. Place : Aircraft that the pilot ejected from.
  • place: may not return as a valid object if the aircraft has crashed into the ground and no longer exists.
  • subplace: is always 0 for unknown reasons.

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts

Defined in:

Parameter:

The EventData structure.

Occurs when the pilot of an aircraft is killed.

Can occur either if the player is alive and crashes or if a weapon kills the pilot without completely destroying the plane. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player relieves control of a unit to the AI.

initiator : The unit that the player left.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft connects with a tanker and begins taking on fuel.

initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

There is no information on what values the score was changed to. Event is likely similar to player_comment in this regard.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. initiator : The unit that was doing the shooting.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit begins firing a weapon that has a high rate of fire.

Most common with aircraft cannons (GAU-8), autocannons, and machine guns. initiator : The unit that is doing the shooting. target: The unit that is being targeted.

Defined in:

Parameter:

The EventData structure.

Occurs whenever any unit in a mission fires a weapon.

But not any machine gun or autocannon based weapon, those are handled by EVENT.ShootingStart.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft takes off from an airbase, farp, or ship.

initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Occurs when the game thinks an object is destroyed.

  • initiator: The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Schedule a new time event.

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

#table ...

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#number:

The ScheduleID of the planned schedule.

Schedule a new time event.

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

#number Repeat

Specifies the interval in seconds when the scheduler will call the event function.

#number RandomizeFactor

Specifies a randomization factor between 0 and 1 to randomize the Repeat.

#number Stop

Specifies the amount of seconds when the scheduler will be stopped.

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

#table ...

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#number:

The ScheduleID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

Set the Class Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Parameter:

#number EventPriority

The Event processing Priority.

Return value:

self

Set a state or property of the Object given a Key and a Value.

Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that will hold the Value set by the Key.

Key

The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

true = trace all methods in MOOSE.

Set tracing for a class

Defined in:

Parameter:

#string Class

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

#string Method

Set trace level

Defined in:

Parameter:

#number Level

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

Set trace on or off Note that when trace is off, no BASE.Debug statement is performed, increasing performance! When Moose is loaded statically, (as one file), tracing is switched off by default.

So tracing must be switched on manually in your mission if you are using Moose statically. When moose is loading dynamically (for moose class development), tracing is switched on by default.

Defined in:

Parameter:

#boolean TraceOnOff

Switch the tracing on or off.

Usage:

-- Switch the tracing On
BASE:TraceOnOff( true )

-- Switch the tracing Off
BASE:TraceOnOff( false )

UnSubscribe to a DCS event.

Defined in:

Parameter:

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

TODO: Complete DCS#Event structure.
- The main event handling function... This function captures all events generated for the class. @param #BASE self @param DCS#Event event

Defined in:

Parameter:

event

Squadron data structure.

Field(s)

#string AI_A2A_DISPATCHER.Squadron.AirbaseName

Name of the home airbase.

#boolean AI_A2A_DISPATCHER.Squadron.Captured

If true, airbase of the squadron was captured.

#number AI_A2A_DISPATCHER.Squadron.FuelThreshold

Fuel threshold [0,1] for RTB.

#number AI_A2A_DISPATCHER.Squadron.Grouping

Squadron flight group size.

#number AI_A2A_DISPATCHER.Squadron.Landing

Landing type.

#string AI_A2A_DISPATCHER.Squadron.Name

Name of the squadron.

#number AI_A2A_DISPATCHER.Squadron.Overhead

Squadron overhead.

#boolean AI_A2A_DISPATCHER.Squadron.Racetrack

If true, CAP flights will perform a racetrack pattern rather than randomly patrolling the zone.

#number AI_A2A_DISPATCHER.Squadron.RacetrackDurationMax

Max duration in seconds before the CAP flight changes its orbit position. Default never.

#number AI_A2A_DISPATCHER.Squadron.RacetrackDurationMin

Min duration in seconds before the CAP flight changes its orbit position. Default never.

#number AI_A2A_DISPATCHER.Squadron.RacetrackHeadingMax

Max heading of race track in degrees. Default 180 deg, i.e. from North to South.

#number AI_A2A_DISPATCHER.Squadron.RacetrackHeadingMin

Min heading of race track in degrees. Default 0 deg, i.e. from South to North.

#number AI_A2A_DISPATCHER.Squadron.RacetrackLengthMax

Max Length of race track in meters. Default 15,000 m.

#number AI_A2A_DISPATCHER.Squadron.RacetrackLengthMin

Min Length of race track in meters. Default 10,000 m.

#number AI_A2A_DISPATCHER.Squadron.ResourceCount

Number of resources.

#table AI_A2A_DISPATCHER.Squadron.Resources

Flight group resources Resources[TemplateID][GroupName] = SpawnGroup.

#table AI_A2A_DISPATCHER.Squadron.Spawn

Table of spaws Core.Spawn#SPAWN.

#table AI_A2A_DISPATCHER.Squadron.Table

of template group names of the squadron.

#number AI_A2A_DISPATCHER.Squadron.Takeoff

Takeoff type.

#number AI_A2A_DISPATCHER.Squadron.TakeoffAltitude

Altitude in meters for spawn in air.

#string AI_A2A_DISPATCHER.Squadron.TankerName

Name of the refuelling tanker.

#boolean AI_A2A_DISPATCHER.Squadron.Uncontrolled

If true, flight groups are spawned uncontrolled and later activated.

Function(s)

Field(s)

Function(s)

AI_A2A_GCICAP constructor.

Defined in:

AI_A2A_GCICAP

Parameters:

#string EWRPrefixes

A list of prefixes that of groups that setup the Early Warning Radar network.

#string TemplatePrefixes

A list of template prefixes.

#string CapPrefixes

A list of CAP zone prefixes (polygon zones).

#number CapLimit

A number of how many CAP maximum will be spawned.

#number GroupingRadius

The radius in meters wherein detected planes are being grouped as one target area. For airplanes, 6000 (6km) is recommended, and is also the default value of this parameter.

#number EngageRadius

The radius in meters wherein detected airplanes will be engaged by airborne defenders without a task.

#number GciRadius

The radius in meters wherein detected airplanes will GCI.

#number ResourceCount

The amount of resources that will be allocated to each squadron.

Return value:

Usages:

  • 
      -- Setup a new GCICAP dispatcher object. Each squadron has unlimited resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2 )
    
  • 
      -- Setup a new GCICAP dispatcher object. Each squadron has unlimited resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      -- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
      A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2, 20000 )
    
  • 
      -- Setup a new GCICAP dispatcher object. Each squadron has unlimited resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      -- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
      -- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
      -- will be considered a defense task if the target is within 60km from the defender.
      A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2, 20000, 60000 )
    
  • 
      -- Setup a new GCICAP dispatcher object. Each squadron has unlimited resources.
      -- The EWR network group prefix is DF CCCP. All groups starting with DF CCCP will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      -- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
      -- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
      -- will be considered a defense task if the target is within 60km from the defender.
      -- The GCI Radius is set to 150000. Any target detected within 150km will be considered for GCI engagement.
      A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2, 20000, 60000, 150000 )
    
  • 
      -- Setup a new GCICAP dispatcher object. Each squadron has 30 resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      -- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
      -- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
      -- will be considered a defense task if the target is within 60km from the defender.
      -- The GCI Radius is set to 150000. Any target detected within 150km will be considered for GCI engagement.
      -- The amount of resources for each squadron is set to 30. Thus about 30 resources are allocated to each squadron created.
    
      A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2, 20000, 60000, 150000, 30 )
    
  • 
      -- Setup a new GCICAP dispatcher object. Each squadron has 30 resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The CAP Zone prefix is nil. No CAP is created.
      -- The CAP Limit is nil.
      -- The Grouping Radius is nil. The default range of 6km radius will be grouped as a group of targets.
      -- The Engage Radius is set nil. The default Engage Radius will be used to consider a defenser being assigned to a task.
      -- The GCI Radius is nil. Any target detected within the default GCI Radius will be considered for GCI engagement.
      -- The amount of resources for each squadron is set to 30. Thus about 30 resources are allocated to each squadron created.
    
      A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, nil, nil, nil, nil, nil, 30 )
    

AI_A2A_GCICAP constructor with border.

Defined in:

AI_A2A_GCICAP

Parameters:

#string EWRPrefixes

A list of prefixes that of groups that setup the Early Warning Radar network.

#string TemplatePrefixes

A list of template prefixes.

#string BorderPrefix

A Border Zone Prefix.

#string CapPrefixes

A list of CAP zone prefixes (polygon zones).

#number CapLimit

A number of how many CAP maximum will be spawned.

#number GroupingRadius

The radius in meters wherein detected planes are being grouped as one target area. For airplanes, 6000 (6km) is recommended, and is also the default value of this parameter.

#number EngageRadius

The radius in meters wherein detected airplanes will be engaged by airborne defenders without a task.

#number GciRadius

The radius in meters wherein detected airplanes will GCI.

#number ResourceCount

The amount of resources that will be allocated to each squadron.

Return value:

Usages:

  • 
      -- Setup a new GCICAP dispatcher object with a border. Each squadron has unlimited resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
    
      A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2 )
    
  • 
      -- Setup a new GCICAP dispatcher object with a border. Each squadron has unlimited resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      -- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
    
      A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2, 20000 )
    
  • 
      -- Setup a new GCICAP dispatcher object with a border. Each squadron has unlimited resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      -- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
      -- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
      -- will be considered a defense task if the target is within 60km from the defender.
    
      A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2, 20000, 60000 )
    
  • 
      -- Setup a new GCICAP dispatcher object with a border. Each squadron has unlimited resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      -- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
      -- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
      -- will be considered a defense task if the target is within 60km from the defender.
      -- The GCI Radius is set to 150000. Any target detected within 150km will be considered for GCI engagement.
    
      A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2, 20000, 60000, 150000 )
    
  • 
      -- Setup a new GCICAP dispatcher object with a border. Each squadron has 30 resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
      -- The CAP Zone prefix is "CAP Zone".
      -- The CAP Limit is 2.
      -- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
      -- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
      -- will be considered a defense task if the target is within 60km from the defender.
      -- The GCI Radius is set to 150000. Any target detected within 150km will be considered for GCI engagement.
      -- The amount of resources for each squadron is set to 30. Thus about 30 resources are allocated to each squadron created.
    
      A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2, 20000, 60000, 150000, 30 )
    
  • 
      -- Setup a new GCICAP dispatcher object with a border. Each squadron has 30 resources.
      -- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
      -- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
      -- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
      -- The CAP Zone prefix is nil. No CAP is created.
      -- The CAP Limit is nil.
      -- The Grouping Radius is nil. The default range of 6km radius will be grouped as a group of targets.
      -- The Engage Radius is set nil. The default Engage Radius will be used to consider a defenser being assigned to a task.
      -- The GCI Radius is nil. Any target detected within the default GCI Radius will be considered for GCI engagement.
      -- The amount of resources for each squadron is set to 30. Thus about 30 resources are allocated to each squadron created.
    
      A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", nil, nil, nil, nil, nil, 30 )