From 61fe3cf457bcc51f531dd4f5818fac63e6d9e4b7 Mon Sep 17 00:00:00 2001 From: FlightControl_Master Date: Thu, 27 Jul 2017 11:56:03 +0200 Subject: [PATCH] Following up on the requirement #636 a new default management system has been built... A lot of new methods have been added to set the default behaviour for: * function AI_A2A_DISPATCHER:SetDefaultTakeoff( Takeoff ) * function AI_A2A_DISPATCHER:SetDefaultTakeoffFromParkingCold() * function AI_A2A_DISPATCHER:SetDefaultTakeoffFromParkingHot() * function AI_A2A_DISPATCHER:SetDefaultTakeoffFromRunway() * function AI_A2A_DISPATCHER:SetDefaultTakeoffInAir() * function AI_A2A_DISPATCHER:SetDefaultLanding( Landing ) * function AI_A2A_DISPATCHER:SetDefaultLandingAtEngineShutdown() * function AI_A2A_DISPATCHER:SetDefaultLandingAtRunway() * function AI_A2A_DISPATCHER:SetDefaultLandingNearAirbase() * function AI_A2A_DISPATCHER:SetDefaultGrouping( Grouping ) * function AI_A2A_DISPATCHER:SetDefaultOverhead( Overhead ) --- .../Moose/AI/AI_A2A_Dispatcher.lua | 385 ++++++++++- docs/Documentation/AI_A2A_Dispatcher.html | 621 +++++++++++++++++- docs/Documentation/AI_Patrol.html | 3 + docs/Documentation/Cargo.html | 1 + docs/Documentation/CommandCenter.html | 57 ++ docs/Documentation/Designate.html | 1 + docs/Documentation/Detection.html | 70 +- docs/Documentation/Fsm.html | 3 +- docs/Documentation/Point.html | 1 + docs/Documentation/Settings.html | 2 +- docs/Documentation/Spawn.html | 10 +- docs/Documentation/SpawnStatic.html | 1 + docs/Documentation/Spot.html | 4 - docs/Documentation/Task_Cargo.html | 4 +- 14 files changed, 1076 insertions(+), 87 deletions(-) diff --git a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua index 0260cc4e4..df20a36a5 100644 --- a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua @@ -3,13 +3,6 @@ -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\Dia1.JPG) -- -- ==== --- --- ### Authors: **Sven Van de Velde (FlightControl)** rework of GCICAP + introduction of new concepts (squadrons). --- ### Authors: **Stonehouse**, **SNAFU** in terms of the advice, documentation, and the original GCICAP script. --- --- ### Contributions: --- --- ==== -- -- # QUICK START GUIDE -- @@ -18,7 +11,7 @@ -- 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: +-- 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? -- @@ -122,18 +115,22 @@ -- -- For each Squadron, evaluate which takeoff method will be used: -- --- * Straight from the air (default) +-- * 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: -- --- * Near the airbase when returning (default) --- * After landing on the runway --- * After engine shutdown after landing +-- * 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? -- @@ -142,11 +139,20 @@ -- 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: **Sven Van de Velde (FlightControl)** rework of GCICAP + introduction of new concepts (squadrons). +-- ### Authors: **Stonehouse**, **SNAFU** in terms of the advice, documentation, and the original GCICAP script. +-- -- @module AI_A2A_Dispatcher --BASE:TraceClass("AI_A2A_DISPATCHER") @@ -192,7 +198,7 @@ do -- AI_A2A_DISPATCHER -- 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 -- @@ -340,6 +346,15 @@ do -- AI_A2A_DISPATCHER -- * @{#AI_A2A_DISPATCHER.SetSquadronTakeoffFromParkingHot}() will spawn new aircraft in with running engines at a parking spot at the airfield. -- * @{#AI_A2A_DISPATCHER.SetSquadronTakeoffFromRunway}() will spawn new aircraft at the runway at the airfield. -- + -- **The default landing method is to spawn new aircraft directly in the air.** + -- **The default takeoff method can be set for ALL squadrons that don't have an individual takeoff method configured.** + -- + -- * @{#AI_A2A_DISPATCHER.SetDefaultTakeoff}() is the generic configuration method to control takeoff by default from the air, hot, cold or from the runway. See the method for further details. + -- * @{#AI_A2A_DISPATCHER.SetDefaultTakeoffInAir}() will spawn by default new aircraft from the squadron directly in the air. + -- * @{#AI_A2A_DISPATCHER.SetDefaultTakeoffFromParkingCold}() will spawn by default new aircraft in without running engines at a parking spot at the airfield. + -- * @{#AI_A2A_DISPATCHER.SetDefaultTakeoffFromParkingHot}() will spawn by default new aircraft in with running engines at a parking spot at the airfield. + -- * @{#AI_A2A_DISPATCHER.SetDefaultTakeoffFromRunway}() will spawn by default new aircraft at the runway at the airfield. + -- -- 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: -- @@ -360,6 +375,13 @@ do -- AI_A2A_DISPATCHER -- * @{#AI_A2A_DISPATCHER.SetSquadronLandingAtRunway}() will despawn the returning aircraft directly after landing at the runway. -- * @{#AI_A2A_DISPATCHER.SetSquadronLandingAtEngineShutdown}() will despawn the returning aircraft when the aircraft has returned to its parking spot and has turned off its engines. -- + -- **The default landing method can be set for ALL squadrons that don't have an individual landing method configured.** + -- + -- * @{#AI_A2A_DISPATCHER.SetDefaultLanding}() is the generic configuration method to control by default landing, namely despawn the aircraft near the airfield in the air, right after landing, or at engine shutdown. + -- * @{#AI_A2A_DISPATCHER.SetDefaultLandingNearAirbase}() will despawn by default the returning aircraft in the air when near the airfield. + -- * @{#AI_A2A_DISPATCHER.SetDefaultLandingAtRunway}() will despawn by default the returning aircraft directly after landing at the runway. + -- * @{#AI_A2A_DISPATCHER.SetDefaultLandingAtEngineShutdown}() will despawn by default the returning aircraft when the aircraft has returned to its parking spot and has turned off its engines. + -- -- 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. @@ -368,7 +390,7 @@ do -- AI_A2A_DISPATCHER -- -- ### 6.3. Set squadron grouping -- - -- Use the method @{#AI_A2A_DISPATCHER.SetSquadronGrouping}() to set the amount of CAP or GCI flights that will take-off when spawned. + -- Use the method @{#AI_A2A_DISPATCHER.SetSquadronGrouping}() to set the grouping of CAP or GCI flights that will take-off when spawned. -- -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\Dia12.JPG) -- @@ -379,6 +401,10 @@ do -- AI_A2A_DISPATCHER -- -- 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. -- + -- **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. + -- -- ### 6.4. Balance or setup 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. @@ -388,7 +414,7 @@ do -- AI_A2A_DISPATCHER -- -- 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.SetOverhead}() method can be used to tweak the defense strength, + -- 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... @@ -403,6 +429,10 @@ do -- AI_A2A_DISPATCHER -- -- 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. -- + -- **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 the defense strength for ALL squadrons. + -- -- ## 7. Setup a squadron for CAP -- -- ### 7.1. Set the CAP zones @@ -745,6 +775,7 @@ do -- AI_A2A_DISPATCHER self.DefenderSquadrons = {} -- The Defender Squadrons. self.DefenderSpawns = {} self.DefenderTasks = {} -- The Defenders Tasks. + self.DefenderDefault = {} -- The Defender Default Settings over all Squadrons. -- TODO: Check detection through radar. self.Detection:FilterCategories( { Unit.Category.AIRPLANE, Unit.Category.HELICOPTER } ) @@ -754,6 +785,12 @@ do -- AI_A2A_DISPATCHER self:SetEngageRadius() self:SetGciRadius() + self:SetDefaultTakeoff( AI_A2A_DISPATCHER.Takeoff.Air ) + self:SetDefaultLanding( AI_A2A_DISPATCHER.Landing.NearAirbase ) + self:SetDefaultOverhead( 1 ) + self:SetDefaultGrouping( 1 ) + + self:AddTransition( "Started", "Assign", "Started" ) --- OnAfter Transition Handler for Event Assign. @@ -1228,7 +1265,6 @@ do -- AI_A2A_DISPATCHER DefenderSquadron.Resources = Resources self:SetSquadronOverhead( SquadronName, 1 ) - self:SetSquadronTakeoffInAir( SquadronName ) self:SetSquadronLandingNearAirbase(SquadronName) return self @@ -1436,6 +1472,44 @@ do -- AI_A2A_DISPATCHER Intercept.EngageMaxSpeed = EngageMaxSpeed end + --- Defines the default amount of extra planes that will take-off as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @param #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. + -- + -- @usage: + -- + -- local Dispatcher = 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. + -- + -- Dispatcher:SetDefaultOverhead( 1.5 ) + -- + -- @return #AI_A2A_DISPATCHER + function AI_A2A_DISPATCHER:SetDefaultOverhead( Overhead ) + + self.DefenderDefault.Overhead = Overhead + + return self + end + + --- Defines the amount of extra planes that will take-off as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1464,8 +1538,7 @@ do -- AI_A2A_DISPATCHER -- -- 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. -- - -- Dispatcher:SetSquadronOverhead( 1,5 ) - -- + -- Dispatcher:SetSquadronOverhead( "SquadronName", 1.5 ) -- -- @return #AI_A2A_DISPATCHER function AI_A2A_DISPATCHER:SetSquadronOverhead( SquadronName, Overhead ) @@ -1476,13 +1549,38 @@ do -- AI_A2A_DISPATCHER return self end - --- + + --- 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. + -- @param #AI_A2A_DISPATCHER self + -- @param #number Grouping The level of grouping that will be applied of the CAP or GCI defenders. + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Set a grouping by default per 2 airplanes. + -- Dispatcher:SetDefaultGrouping( 2 ) + -- + -- + -- @return #AI_A2A_DISPATCHER + function AI_A2A_DISPATCHER:SetDefaultGrouping( Grouping ) + + self.DefenderDefault.Grouping = Grouping + + return self + end + + + --- 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. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. -- @param #number Grouping The level of grouping that will be applied of the CAP or GCI defenders. -- @usage: -- -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Set a grouping per 2 airplanes. -- Dispatcher:SetSquadronGrouping( "SquadronName", 2 ) -- -- @@ -1495,6 +1593,36 @@ do -- AI_A2A_DISPATCHER return self end + + --- Defines the default method at which new flights will spawn and take-off as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @param #number Takeoff From the airbase hot, from the airbase cold, in the air, from the runway. + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let new flights by default take-off in the air. + -- Dispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Air ) + -- + -- -- Let new flights by default take-off from the runway. + -- Dispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Runway ) + -- + -- -- Let new flights by default take-off from the airbase hot. + -- Dispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Hot ) + -- + -- -- Let new flights by default take-off from the airbase cold. + -- Dispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Cold ) + -- + -- + -- @return #AI_A2A_DISPATCHER + -- + function AI_A2A_DISPATCHER:SetDefaultTakeoff( Takeoff ) + + self.DefenderDefault.Takeoff = Takeoff + + return self + end + --- Defines the method at which new flights will spawn and take-off as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1527,6 +1655,24 @@ do -- AI_A2A_DISPATCHER end + --- Gets the default method at which new flights will spawn and take-off as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @return #number Takeoff From the airbase hot, from the airbase cold, in the air, from the runway. + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let new flights by default take-off in the air. + -- local TakeoffMethod = Dispatcher:GetDefaultTakeoff() + -- if TakeOffMethod == , AI_A2A_Dispatcher.Takeoff.InAir then + -- ... + -- end + -- + function AI_A2A_DISPATCHER:GetDefaultTakeoff( ) + + return self.DefenderDefault.Takeoff + end + --- Gets the method at which new flights will spawn and take-off as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1544,10 +1690,29 @@ do -- AI_A2A_DISPATCHER function AI_A2A_DISPATCHER:GetSquadronTakeoff( SquadronName ) local DefenderSquadron = self:GetSquadron( SquadronName ) - return DefenderSquadron.Takeoff + return DefenderSquadron.Takeoff or self.DefenderDefault.Takeoff end + --- Sets flights to default take-off in the air, as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let new flights by default take-off in the air. + -- Dispatcher:SetDefaultTakeoffInAir() + -- + -- @return #AI_A2A_DISPATCHER + -- + function AI_A2A_DISPATCHER:SetDefaultTakeoffInAir() + + self:SetDefaultTakeoff( AI_A2A_DISPATCHER.Takeoff.Air ) + + return self + end + + --- Sets flights to take-off in the air, as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1566,8 +1731,27 @@ do -- AI_A2A_DISPATCHER return self end - + + --- Sets flights by default to take-off from the runway, as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let new flights by default take-off from the runway. + -- Dispatcher:SetDefaultTakeoffFromRunway() + -- + -- @return #AI_A2A_DISPATCHER + -- + function AI_A2A_DISPATCHER:SetDefaultTakeoffFromRunway() + + self:SetDefaultTakeoff( AI_A2A_DISPATCHER.Takeoff.Runway ) + + return self + end + + --- Sets flights to take-off from the runway, as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1575,7 +1759,7 @@ do -- AI_A2A_DISPATCHER -- -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) -- - -- -- Let new flights take-off in the air. + -- -- Let new flights take-off from the runway. -- Dispatcher:SetSquadronTakeoffFromRunway( "SquadronName" ) -- -- @return #AI_A2A_DISPATCHER @@ -1588,6 +1772,24 @@ do -- AI_A2A_DISPATCHER end + --- Sets flights by default to take-off from the airbase at a hot location, as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let new flights by default take-off at a hot parking spot. + -- Dispatcher:SetDefaultTakeoffFromParkingHot() + -- + -- @return #AI_A2A_DISPATCHER + -- + function AI_A2A_DISPATCHER:SetDefaultTakeoffFromParkingHot() + + self:SetDefaultTakeoff( AI_A2A_DISPATCHER.Takeoff.Hot ) + + return self + end + --- Sets flights to take-off from the airbase at a hot location, as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1607,6 +1809,26 @@ do -- AI_A2A_DISPATCHER return self end + + --- Sets flights to by default take-off from the airbase at a cold location, as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let new flights take-off from a cold parking spot. + -- Dispatcher:SetDefaultTakeoffFromParkingCold() + -- + -- @return #AI_A2A_DISPATCHER + -- + function AI_A2A_DISPATCHER:SetDefaultTakeoffFromParkingCold() + + self:SetDefaultTakeoff( AI_A2A_DISPATCHER.Takeoff.Cold ) + + return self + end + + --- Sets flights to take-off from the airbase at a cold location, as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1614,7 +1836,7 @@ do -- AI_A2A_DISPATCHER -- -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) -- - -- -- Let new flights take-off in the air. + -- -- Let new flights take-off from a cold parking spot. -- Dispatcher:SetSquadronTakeoffFromParkingCold( "SquadronName" ) -- -- @return #AI_A2A_DISPATCHER @@ -1627,6 +1849,31 @@ do -- AI_A2A_DISPATCHER end + --- Defines the default method at which flights will land and despawn as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @param #number Landing The landing method which can be NearAirbase, AtRunway, AtEngineShutdown + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let new flights by default despawn near the airbase when returning. + -- Dispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.NearAirbase ) + -- + -- -- Let new flights by default despawn after landing land at the runway. + -- Dispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.AtRunway ) + -- + -- -- Let new flights by default despawn after landing and parking, and after engine shutdown. + -- Dispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.AtEngineShutdown ) + -- + -- @return #AI_A2A_DISPATCHER + function AI_A2A_DISPATCHER:SetDefaultLanding( Landing ) + + self.DefenderDefault.Landing = Landing + + return self + end + + --- Defines the method at which flights will land and despawn as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1635,13 +1882,13 @@ do -- AI_A2A_DISPATCHER -- -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) -- - -- -- Let new flights take-off in the air. + -- -- Let new flights despawn near the airbase when returning. -- Dispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.NearAirbase ) -- - -- -- Let new flights take-off from the runway. + -- -- Let new flights despawn after landing land at the runway. -- Dispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.AtRunway ) -- - -- -- Let new flights take-off from the airbase hot. + -- -- Let new flights despawn after landing and parking, and after engine shutdown. -- Dispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.AtEngineShutdown ) -- -- @return #AI_A2A_DISPATCHER @@ -1654,6 +1901,25 @@ do -- AI_A2A_DISPATCHER end + --- Gets the default method at which flights will land and despawn as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @return #number Landing The landing method which can be NearAirbase, AtRunway, AtEngineShutdown + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let new flights by default despawn near the airbase when returning. + -- local LandingMethod = Dispatcher:GetDefaultLanding( AI_A2A_Dispatcher.Landing.NearAirbase ) + -- if LandingMethod == AI_A2A_Dispatcher.Landing.NearAirbase then + -- ... + -- end + -- + function AI_A2A_DISPATCHER:GetDefaultLanding() + + return self.DefenderDefault.Landing + end + + --- Gets the method at which flights will land and despawn as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1662,7 +1928,7 @@ do -- AI_A2A_DISPATCHER -- -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) -- - -- -- Let new flights take-off in the air. + -- -- Let new flights despawn near the airbase when returning. -- local LandingMethod = Dispatcher:GetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.NearAirbase ) -- if LandingMethod == AI_A2A_Dispatcher.Landing.NearAirbase then -- ... @@ -1671,7 +1937,25 @@ do -- AI_A2A_DISPATCHER function AI_A2A_DISPATCHER:GetSquadronLanding( SquadronName ) local DefenderSquadron = self:GetSquadron( SquadronName ) - return DefenderSquadron.Landing + return DefenderSquadron.Landing or self.DefenderDefault.Landing + end + + + --- Sets flights by default to land and despawn near the airbase in the air, as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let flights by default to land near the airbase and despawn. + -- Dispatcher:SetDefaultLandingNearAirbase() + -- + -- @return #AI_A2A_DISPATCHER + function AI_A2A_DISPATCHER:SetDefaultLandingNearAirbase() + + self:SetDefaultLanding( AI_A2A_DISPATCHER.Landing.NearAirbase ) + + return self end @@ -1682,7 +1966,7 @@ do -- AI_A2A_DISPATCHER -- -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) -- - -- -- Let flights land in the air and despawn. + -- -- Let flights to land near the airbase and despawn. -- Dispatcher:SetSquadronLandingNearAirbase( "SquadronName" ) -- -- @return #AI_A2A_DISPATCHER @@ -1694,6 +1978,24 @@ do -- AI_A2A_DISPATCHER end + --- Sets flights by default to land and despawn at the runway, as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let flights by default land at the runway and despawn. + -- Dispatcher:SetDefaultLandingAtRunway() + -- + -- @return #AI_A2A_DISPATCHER + function AI_A2A_DISPATCHER:SetDefaultLandingAtRunway() + + self:SetDefaultLanding( AI_A2A_DISPATCHER.Landing.AtRunway ) + + return self + end + + --- Sets flights to land and despawn at the runway, as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1713,6 +2015,24 @@ do -- AI_A2A_DISPATCHER end + --- Sets flights by default to land and despawn at engine shutdown, as part of the defense system. + -- @param #AI_A2A_DISPATCHER self + -- @usage: + -- + -- local Dispatcher = AI_A2A_DISPATCHER:New( ... ) + -- + -- -- Let flights by default land and despawn at engine shutdown. + -- Dispatcher:SetDefaultLandingAtEngineShutdown() + -- + -- @return #AI_A2A_DISPATCHER + function AI_A2A_DISPATCHER:SetDefaultLandingAtEngineShutdown() + + self:SetDefaultLanding( AI_A2A_DISPATCHER.Landing.AtEngineShutdown ) + + return self + end + + --- Sets flights to land and despawn at engine shutdown, as part of the defense system. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The name of the squadron. @@ -1889,7 +2209,8 @@ do -- AI_A2A_DISPATCHER if Cap then local Spawn = DefenderSquadron.Spawn[ math.random( 1, #DefenderSquadron.Spawn ) ] -- Functional.Spawn#SPAWN - Spawn:InitGrouping( DefenderSquadron.Grouping ) + local DefenderGrouping = DefenderSquadron.Grouping or self.DefenderDefault.Grouping + Spawn:InitGrouping( DefenderGrouping ) local TakeoffMethod = self:GetSquadronTakeoff( SquadronName ) local DefenderCAP = Spawn:SpawnAtAirbase( DefenderSquadron.Airbase, TakeoffMethod ) @@ -2005,8 +2326,8 @@ do -- AI_A2A_DISPATCHER if Gci then - local DefenderOverhead = DefenderSquadron.Overhead - local DefenderGrouping = DefenderSquadron.Grouping + local DefenderOverhead = DefenderSquadron.Overhead or self.DefenderDefault.Overhead + local DefenderGrouping = DefenderSquadron.Grouping or self.DefenderDefault.Grouping local DefendersNeeded = math.ceil( DefendersCount * DefenderOverhead ) local Spawn = DefenderSquadron.Spawn[ math.random( 1, #DefenderSquadron.Spawn ) ] diff --git a/docs/Documentation/AI_A2A_Dispatcher.html b/docs/Documentation/AI_A2A_Dispatcher.html index 3daf54082..41fff7604 100644 --- a/docs/Documentation/AI_A2A_Dispatcher.html +++ b/docs/Documentation/AI_A2A_Dispatcher.html @@ -113,13 +113,6 @@
-

Authors: Sven Van de Velde (FlightControl) rework of GCICAP + introduction of new concepts (squadrons).

-

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

- -

Contributions:

- -
-

QUICK START GUIDE

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

@@ -127,7 +120,7 @@

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:

+

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?

@@ -238,22 +231,26 @@ Not all Squadrons need to perform GCI.

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

+

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:

+

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? @@ -261,11 +258,20 @@ In other words, if X attacker airplanes are detected, how many 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: Sven Van de Velde (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)

@@ -344,6 +350,12 @@ Per one, two, three, four?

+ + + + @@ -422,6 +434,18 @@ Per one, two, three, four?

+ + + + + + + + @@ -578,6 +602,72 @@ Per one, two, three, four?

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -631,7 +721,7 @@ Per one, two, three, four?

@@ -982,6 +1072,17 @@ while defining which plane types are being used by the squadron and how many res
  • AIA2ADISPATCHER.SetSquadronTakeoffFromRunway() will spawn new aircraft at the runway at the airfield.
  • +

    The default landing method is to spawn new aircraft directly in the air. +The default takeoff method can be set for ALL squadrons that don't have an individual takeoff method configured.

    + + +

    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:

    @@ -1006,6 +1107,15 @@ If you experience while testing problems with aircraft take-off or landing, plea
  • AIA2ADISPATCHER.SetSquadronLandingAtEngineShutdown() will despawn the returning aircraft when the aircraft has returned to its parking spot and has turned off its engines.
  • +

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

    + + +

    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. @@ -1014,7 +1124,7 @@ Damaged or out-of-fuel aircraft are returning to the nearest friendly airbase an

    6.3. Set squadron grouping

    -

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

    +

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

    Banner Image

    @@ -1025,6 +1135,10 @@ a GCI needs to be started, the GCI flights will be grouped as follows: Group 1 o

    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.

    +

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

    + +

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

    +

    6.4. Balance or setup 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. @@ -1034,7 +1148,7 @@ The default value of the overhead parameter is 1.0, which means

    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 AIA2ADISPATCHER.SetOverhead() method can be used to tweak the defense strength, +

    The AIA2ADISPATCHER.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... @@ -1051,6 +1165,10 @@ multiplied by the Overhead and rounded up to the smallest integer.

    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.

    +

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

    + +

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

    +

    7. Setup a squadron for CAP

    7.1. Set the CAP zones

    @@ -1833,6 +1951,23 @@ DefenderSquadron

    + + +
    +
    + + + +AI_A2A_DISPATCHER.DefenderDefault + +
    +
    + + + + +

    The Defender Default Settings over all Squadrons.

    +
    @@ -2113,6 +2248,66 @@ The squadron name.

    #AIA2ADISPATCHER:

    + +
    +
    +
    + + +AI_A2A_DISPATCHER:GetDefaultLanding() + +
    +
    + +

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

    + +

    Return value

    + +

    #number: +Landing The landing method which can be NearAirbase, AtRunway, AtEngineShutdown

    + +

    Usage:

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

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

    + +

    Return value

    + +

    #number: +Takeoff From the airbase hot, from the airbase cold, in the air, from the runway.

    + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let new flights by default take-off in the air.
    +  local TakeoffMethod = Dispatcher:GetDefaultTakeoff()
    +  if TakeOffMethod == , AI_A2A_Dispatcher.Takeoff.InAir then
    +    ...
    +  end
    +  
    +
    @@ -2325,7 +2520,7 @@ Landing The landing method which can be NearAirbase, AtRunway, AtEngineShutdown< local Dispatcher = AI_A2A_DISPATCHER:New( ... ) - -- Let new flights take-off in the air. + -- Let new flights despawn near the airbase when returning. local LandingMethod = Dispatcher:GetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.NearAirbase ) if LandingMethod == AI_A2A_Dispatcher.Landing.NearAirbase then ... @@ -2887,6 +3082,380 @@ or
    + +AI_A2A_DISPATCHER:SetDefaultGrouping(Grouping) + +
    +
    + +

    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.

    + +

    Parameter

    +
      +
    • + +

      #number Grouping : +The level of grouping that will be applied of the CAP or GCI defenders.

      + +
    • +
    +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Set a grouping by default per 2 airplanes.
    +  Dispatcher:SetDefaultGrouping( 2 )
    +
    +
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultLanding(Landing) + +
    +
    + +

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

    + +

    Parameter

    +
      +
    • + +

      #number Landing : +The landing method which can be NearAirbase, AtRunway, AtEngineShutdown

      + +
    • +
    +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let new flights by default despawn near the airbase when returning.
    +  Dispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.NearAirbase )
    +  
    +  -- Let new flights by default despawn after landing land at the runway.
    +  Dispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.AtRunway )
    +  
    +  -- Let new flights by default despawn after landing and parking, and after engine shutdown.
    +  Dispatcher:SetDefaultLanding( AI_A2A_Dispatcher.Landing.AtEngineShutdown )
    +
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultLandingAtEngineShutdown() + +
    +
    + +

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

    + +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let flights by default land and despawn at engine shutdown.
    +  Dispatcher:SetDefaultLandingAtEngineShutdown()
    +  
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultLandingAtRunway() + +
    +
    + +

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

    + +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let flights by default land at the runway and despawn.
    +  Dispatcher:SetDefaultLandingAtRunway()
    +  
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultLandingNearAirbase() + +
    +
    + +

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

    + +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let flights by default to land near the airbase and despawn.
    +  Dispatcher:SetDefaultLandingNearAirbase()
    +  
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultOverhead(Overhead) + +
    +
    + +

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

    + +

    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 AIA2ADISPATCHER.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

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = 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.
    +  
    +  Dispatcher:SetDefaultOverhead( 1.5 )
    +
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultTakeoff(Takeoff) + +
    +
    + +

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

    + +

    Parameter

    +
      +
    • + +

      #number Takeoff : +From the airbase hot, from the airbase cold, in the air, from the runway.

      + +
    • +
    +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let new flights by default take-off in the air.
    +  Dispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Air )
    +  
    +  -- Let new flights by default take-off from the runway.
    +  Dispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Runway )
    +  
    +  -- Let new flights by default take-off from the airbase hot.
    +  Dispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Hot )
    +
    +  -- Let new flights by default take-off from the airbase cold.
    +  Dispatcher:SetDefaultTakeoff( AI_A2A_Dispatcher.Takeoff.Cold )
    +
    +
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultTakeoffFromParkingCold() + +
    +
    + +

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

    + +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let new flights take-off from a cold parking spot.
    +  Dispatcher:SetDefaultTakeoffFromParkingCold()
    +  
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultTakeoffFromParkingHot() + +
    +
    + +

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

    + +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let new flights by default take-off at a hot parking spot.
    +  Dispatcher:SetDefaultTakeoffFromParkingHot()
    +  
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultTakeoffFromRunway() + +
    +
    + +

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

    + +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let new flights by default take-off from the runway.
    +  Dispatcher:SetDefaultTakeoffFromRunway()
    +  
    + +
    +
    +
    +
    + + +AI_A2A_DISPATCHER:SetDefaultTakeoffInAir() + +
    +
    + +

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

    + +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +
    +  local Dispatcher = AI_A2A_DISPATCHER:New( ... )
    +  
    +  -- Let new flights by default take-off in the air.
    +  Dispatcher:SetDefaultTakeoffInAir()
    +  
    + +
    +
    +
    +
    + AI_A2A_DISPATCHER:SetDefenderTask(Defender, Type, Fsm, Target) @@ -3362,7 +3931,10 @@ The maximum speed at which the gci can be executed.

    +

    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.

    Parameters

      @@ -3388,6 +3960,8 @@ The level of grouping that will be applied of the CAP or GCI defenders.

      
       
         local Dispatcher = AI_A2A_DISPATCHER:New( ... )
      +  
      +  -- Set a grouping per 2 airplanes.
         Dispatcher:SetSquadronGrouping( "SquadronName", 2 )
       
       
      @@ -3430,13 +4004,13 @@ The landing method which can be NearAirbase, AtRunway, AtEngineShutdown

      local Dispatcher = AI_A2A_DISPATCHER:New( ... ) - -- Let new flights take-off in the air. + -- Let new flights despawn near the airbase when returning. Dispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.NearAirbase ) - -- Let new flights take-off from the runway. + -- Let new flights despawn after landing land at the runway. Dispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.AtRunway ) - -- Let new flights take-off from the airbase hot. + -- Let new flights despawn after landing and parking, and after engine shutdown. Dispatcher:SetSquadronLanding( "SquadronName", AI_A2A_Dispatcher.Landing.AtEngineShutdown ) @@ -3544,7 +4118,7 @@ The name of the squadron.

      local Dispatcher = AI_A2A_DISPATCHER:New( ... ) - -- Let flights land in the air and despawn. + -- Let flights to land near the airbase and despawn. Dispatcher:SetSquadronLandingNearAirbase( "SquadronName" ) @@ -3608,8 +4182,7 @@ multiplied by the Overhead and rounded up to the smallest integer.

      -- 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. - Dispatcher:SetSquadronOverhead( 1,5 ) - + Dispatcher:SetSquadronOverhead( "SquadronName", 1.5 )
    @@ -3696,7 +4269,7 @@ The name of the squadron.

    local Dispatcher = AI_A2A_DISPATCHER:New( ... ) - -- Let new flights take-off in the air. + -- Let new flights take-off from a cold parking spot. Dispatcher:SetSquadronTakeoffFromParkingCold( "SquadronName" ) @@ -3768,7 +4341,7 @@ The name of the squadron.

    local Dispatcher = AI_A2A_DISPATCHER:New( ... ) - -- Let new flights take-off in the air. + -- Let new flights take-off from the runway. Dispatcher:SetSquadronTakeoffFromRunway( "SquadronName" ) diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html index 93a9f8ce6..43392b308 100644 --- a/docs/Documentation/AI_Patrol.html +++ b/docs/Documentation/AI_Patrol.html @@ -926,6 +926,9 @@ Use the method AIPATROLZONE.M + +

    This table contains the targets detected during patrol.

    +
    diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html index 9f6098452..fe4a4263b 100644 --- a/docs/Documentation/Cargo.html +++ b/docs/Documentation/Cargo.html @@ -3542,6 +3542,7 @@ The range till cargo will board.

    + #number CARGO_UNIT.RunCount diff --git a/docs/Documentation/CommandCenter.html b/docs/Documentation/CommandCenter.html index f6099f06c..704765ed0 100644 --- a/docs/Documentation/CommandCenter.html +++ b/docs/Documentation/CommandCenter.html @@ -292,6 +292,12 @@ and will be replaced by a navigation using Reference Zones.

    + + + + @@ -322,6 +328,12 @@ and will be replaced by a navigation using Reference Zones.

    + + + + @@ -997,6 +1009,24 @@ The name before the #-mark indicating the class of the Reference Zones.

    + + +
    +
    + + +REPORT:GetCount() + +
    +
    + +

    Gets the amount of report items contained in the report.

    + +

    Return value

    + +

    #number: +Returns the number of report items contained in the report. 0 is returned if no report items are contained in the report. The title is not counted for.

    +
    @@ -1095,6 +1125,33 @@ The name before the #-mark indicating the class of the Reference Zones.

    #REPORT:

    + +
    +
    +
    + + +REPORT:SetTitle(Title) + +
    +
    + +

    Sets the title of the report.

    + +

    Parameter

    +
      +
    • + +

      #string Title : +The title of the report.

      + +
    • +
    +

    Return value

    + +

    #REPORT:

    + +
    diff --git a/docs/Documentation/Designate.html b/docs/Documentation/Designate.html index c80c67564..36c6d0e0f 100644 --- a/docs/Documentation/Designate.html +++ b/docs/Documentation/Designate.html @@ -923,6 +923,7 @@ function below will use the range 1-7 just in case

    + DESIGNATE.LaserCodes diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html index 1fd6665f8..35fbfb9ab 100644 --- a/docs/Documentation/Detection.html +++ b/docs/Documentation/Detection.html @@ -217,7 +217,7 @@ DETECTION uses the in-built detection capabilities of DCS World, but adds new fu
    - + @@ -449,7 +449,7 @@ DETECTION uses the in-built detection capabilities of DCS World, but adds new fu - + @@ -1072,7 +1072,7 @@ The different values of Unit.Category can be:

    - + @@ -1154,7 +1154,7 @@ The different values of Unit.Category can be:

    - + @@ -1668,7 +1668,7 @@ self

    -DETECTION_AREAS:DetectedItemReportSummary(Index, AttackGroup) +DETECTION_AREAS:DetectedItemReportSummary(Index, AttackGroup, Settings)
    @@ -1684,7 +1684,14 @@ self

  • -

    AttackGroup :

    +

    Wrapper.Group#GROUP AttackGroup : +The group to get the settings for.

    + +
  • +
  • + +

    Core.Settings#SETTINGS Settings : +(Optional) Message formatting settings to use.

  • @@ -1724,7 +1731,8 @@ self

    @@ -2393,7 +2401,6 @@ The index of the DetectedItem.

    - #number DETECTION_BASE.DetectedItemCount @@ -2407,7 +2414,6 @@ The index of the DetectedItem.

    - #number DETECTION_BASE.DetectedItemMax @@ -2453,7 +2459,7 @@ The index of the DetectedItem.

    -DETECTION_BASE:DetectedItemReportSummary(Index, AttackGroup) +DETECTION_BASE:DetectedItemReportSummary(Index, AttackGroup, Settings)
    @@ -2469,7 +2475,14 @@ The index of the DetectedItem.

  • -

    AttackGroup :

    +

    Wrapper.Group#GROUP AttackGroup : +The group to generate the report for.

    + +
  • +
  • + +

    Core.Settings#SETTINGS Settings : +Message formatting settings to use.

  • @@ -2537,7 +2550,8 @@ The index of the DetectedItem.

    @@ -2565,7 +2579,7 @@ The index of the DetectedItem.

    - #number + DETECTION_BASE.DetectionInterval @@ -4820,7 +4834,7 @@ self

    -DETECTION_TYPES:DetectedItemReportSummary(Index, DetectedTypeName, AttackGroup) +DETECTION_TYPES:DetectedItemReportSummary(Index, AttackGroup, Settings, DetectedTypeName)
    @@ -4836,12 +4850,19 @@ self

  • -

    DetectedTypeName :

    +

    Wrapper.Group#GROUP AttackGroup : +The group to generate the report for.

  • -

    AttackGroup :

    +

    Core.Settings#SETTINGS Settings : +Message formatting settings to use.

    + +
  • +
  • + +

    DetectedTypeName :

  • @@ -4867,7 +4888,8 @@ self

    @@ -5099,7 +5121,7 @@ self

    -DETECTION_UNITS:DetectedItemReportSummary(Index, AttackGroup) +DETECTION_UNITS:DetectedItemReportSummary(Index, AttackGroup, Settings)
    @@ -5115,7 +5137,14 @@ self

  • -

    AttackGroup :

    +

    Wrapper.Group#GROUP AttackGroup : +The group to generate the report for.

    + +
  • +
  • + +

    Core.Settings#SETTINGS Settings : +Message formatting settings to use.

  • @@ -5141,7 +5170,8 @@ self

    diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html index e0276d335..177f34281 100644 --- a/docs/Documentation/Fsm.html +++ b/docs/Documentation/Fsm.html @@ -1598,7 +1598,7 @@ A string defining the start state.

    - + #string FSM._StartState @@ -1897,7 +1897,6 @@ A string defining the start state.

    - FSM.current diff --git a/docs/Documentation/Point.html b/docs/Documentation/Point.html index 864921e2a..f561df108 100644 --- a/docs/Documentation/Point.html +++ b/docs/Documentation/Point.html @@ -2829,6 +2829,7 @@ The y coordinate.

    + POINT_VEC2.z diff --git a/docs/Documentation/Settings.html b/docs/Documentation/Settings.html index 318968720..6836574d8 100644 --- a/docs/Documentation/Settings.html +++ b/docs/Documentation/Settings.html @@ -1142,7 +1142,7 @@ true if metric.

    - + #boolean SETTINGS.Metric diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index 1c949e94e..6168e3bad 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -2200,6 +2200,9 @@ The group that was spawned. You can use this group for further actions.

    + +

    Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.

    +
    @@ -2732,6 +2735,9 @@ when nothing was spawned.

    + +

    Overwrite unit names by default with group name.

    +
    @@ -3129,7 +3135,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
    - #boolean + SPAWN.SpawnUnControlled @@ -3153,7 +3159,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 ) -

    When the first Spawn executes, all the Groups need to be made visible before start.

    +

    Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.

    diff --git a/docs/Documentation/SpawnStatic.html b/docs/Documentation/SpawnStatic.html index bc91b9624..d8aa5e633 100644 --- a/docs/Documentation/SpawnStatic.html +++ b/docs/Documentation/SpawnStatic.html @@ -436,6 +436,7 @@ ptional) The name of the new static.

    + #number SPAWNSTATIC.SpawnIndex diff --git a/docs/Documentation/Spot.html b/docs/Documentation/Spot.html index 5fdc3b305..ead3792db 100644 --- a/docs/Documentation/Spot.html +++ b/docs/Documentation/Spot.html @@ -765,7 +765,6 @@ true if it is lasing

    - SPOT.ScheduleID @@ -779,7 +778,6 @@ true if it is lasing

    - SPOT.SpotIR @@ -793,7 +791,6 @@ true if it is lasing

    - SPOT.SpotLaser @@ -807,7 +804,6 @@ true if it is lasing

    - SPOT.Target diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html index a0ddfc083..bb3b9bca1 100644 --- a/docs/Documentation/Task_Cargo.html +++ b/docs/Documentation/Task_Cargo.html @@ -552,7 +552,7 @@ based on the tasking capabilities defined in Task#TA
    - Core.Cargo#CARGO_GROUP + Core.Cargo#CARGO FSM_PROCESS.Cargo @@ -631,7 +631,7 @@ based on the tasking capabilities defined in Task#TA
    - + #number TASK_CARGO.CargoLimit
    AI_A2A_DISPATCHER:CountDefendersToBeEngaged(DetectedItem, DefenderCount) +
    AI_A2A_DISPATCHER.DefenderDefault +
    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:SetBorderZone(BorderZone)

    Define a border area to simulate a cold war scenario.

    +
    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:SetSquadronGrouping(SquadronName, Grouping) - +

    Sets the grouping of new airplanes spawned.

    REPORT.ClassName +
    REPORT:GetCount() +

    Gets the amount of report items contained in the report.

    REPORT:SetIndent(Indent)

    Set indent of a REPORT.

    +
    REPORT:SetTitle(Title) +

    Sets the title of the report.

    DETECTION_AREAS:DetectedItemReportSummary(Index, AttackGroup)DETECTION_AREAS:DetectedItemReportSummary(Index, AttackGroup, Settings)

    Report summary of a detected item using a given numeric index.

    DETECTION_BASE:DetectedItemReportSummary(Index, AttackGroup)DETECTION_BASE:DetectedItemReportSummary(Index, AttackGroup, Settings)

    Report summary of a detected item using a given numeric index.

    DETECTION_TYPES:DetectedItemReportSummary(Index, DetectedTypeName, AttackGroup)DETECTION_TYPES:DetectedItemReportSummary(Index, AttackGroup, Settings, DetectedTypeName)

    Report summary of a DetectedItem using a given numeric index.

    DETECTION_UNITS:DetectedItemReportSummary(Index, AttackGroup)DETECTION_UNITS:DetectedItemReportSummary(Index, AttackGroup, Settings)

    Report summary of a DetectedItem using a given numeric index.