diff --git a/Moose Development/Moose/AI/AI_A2A.lua b/Moose Development/Moose/AI/AI_A2A.lua index ca31c31ec..8241c5f19 100644 --- a/Moose Development/Moose/AI/AI_A2A.lua +++ b/Moose Development/Moose/AI/AI_A2A.lua @@ -72,6 +72,7 @@ function AI_A2A:New( AIGroup ) self:SetFuelThreshold( .2, 60 ) self:SetDamageThreshold( 0.4 ) + self:SetDisengageRadius( 70000 ) self:SetStartState( "Stopped" ) @@ -295,6 +296,15 @@ function AI_A2A:SetHomeAirbase( HomeAirbase ) end +--- Sets the disengage range, that when engaging a target beyond the specified range, the engagement will be cancelled and the plane will RTB. +-- @param #AI_A2A self +-- @param #number DisengageRadius The disengage range. +-- @return #AI_A2A self +function AI_A2A:SetDisengageRadius( DisengageRadius ) + self:F2( { DisengageRadius } ) + + self.DisengageRadius = DisengageRadius +end --- Set the status checking off. -- @param #AI_A2A self @@ -378,6 +388,16 @@ function AI_A2A:onafterStatus() local RTB = false + local DistanceFromHomeBase = self.HomeAirbase:GetCoordinate():Get2DDistance( self.Controllable:GetCoordinate() ) + self:F({DistanceFromHomeBase=DistanceFromHomeBase}) + + if DistanceFromHomeBase > self.DisengageRadius then + self:E( self.Controllable:GetName() .. " is too far from home base, RTB!" ) + self:Home() + RTB = true + end + + local Fuel = self.Controllable:GetUnit(1):GetFuel() self:F({Fuel=Fuel}) if Fuel < self.PatrolFuelThresholdPercentage then diff --git a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua index d85c59508..da8a4b6ff 100644 --- a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua @@ -641,7 +641,9 @@ do -- AI_A2A_DISPATCHER -- -- Use the method @{#AI_A2A_DISPATCHER.SetDefaultDamageThreshold}() to set the **default damage treshold** of spawned airplanes for all squadrons. -- - -- ## 10.7. Default CAP Time Interval. + -- ## 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. @@ -649,7 +651,7 @@ do -- AI_A2A_DISPATCHER -- 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.8. Default CAP limit. + -- ### 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. @@ -659,6 +661,27 @@ do -- AI_A2A_DISPATCHER -- 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.8. Default settings for GCI. + -- + -- ## 10.8.1. Optimal intercept point. + -- + -- 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. + -- * The altitude of the intruders. + -- * An assumed time it takes to get planes operational at the airbase. + -- * The intercept speed, which is given as a parameter for each squadron or set by default for all squadrons. + -- + -- 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. + -- -- ## 11. Q & A: -- -- ### 11.1. Which countries will be selected for each coalition? @@ -751,6 +774,8 @@ do -- AI_A2A_DISPATCHER self:SetDefaultDamageThreshold( 0.4 ) -- When 40% of damage, go RTB. self:SetDefaultCapTimeInterval( 180, 600 ) -- Between 180 and 600 seconds. self:SetDefaultCapLimit( 1 ) -- Maximum one CAP per squadron. + self:SetIntercept( 300 ) -- A default intercept delay time of 300 seconds. + self:SetDisengageRadius( 100000 ) -- The default disengage radius is 100 km. self:AddTransition( "Started", "Assign", "Started" ) @@ -939,6 +964,26 @@ do -- AI_A2A_DISPATCHER return self end + + --- Define the radius to disengage any target when the distance to the home base is larger than the specified meters. + -- @param #AI_A2A_DISPATCHER self + -- @param #number DisengageRadius (Optional, Default = 100000) The radius to disengage a target when too far from the home base. + -- @return #AI_A2A_DISPATCHER + -- @usage + -- + -- -- Set 50km as the disengage radius. + -- Dispatcher:SetDisengageRadius( 50000 ) + -- + -- -- Set 100km as the disengage radius. + -- Dispatcher:SetDisngageRadius() -- 100000 is the default value. + -- + function AI_A2A_DISPATCHER:SetDisengageRadius( DisengageRadius ) + + self.DisengageRadius = DisengageRadius + + return self + end + --- Define the radius to check if a target can be engaged by an ground controlled intercept. -- So, if there is a target area detected and reported, @@ -1092,7 +1137,7 @@ do -- AI_A2A_DISPATCHER self.DefenderDefault.CapMaxSeconds = CapMaxSeconds return self - end + end --- 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. @@ -1116,13 +1161,24 @@ do -- AI_A2A_DISPATCHER end + function AI_A2A_DISPATCHER:SetIntercept( InterceptDelay ) + + self.DefenderDefault.InterceptDelay = InterceptDelay + + local Detection = self.Detection -- Functional.Detection#DETECTION_AREAS + Detection:SetIntercept( true, InterceptDelay ) + + return self + end + + --- Calculates which AI friendlies are nearby the area -- @param #AI_A2A_DISPATCHER self -- @param DetectedItem -- @return #number, Core.CommandCenter#REPORT function AI_A2A_DISPATCHER:GetAIFriendliesNearBy( DetectedItem ) - local FriendliesNearBy = self.Detection:GetFriendliesDistance( DetectedItem ) + local FriendliesNearBy = self.Detection:GetFriendliesNearBy( DetectedItem ) return FriendliesNearBy end @@ -2270,6 +2326,7 @@ do -- AI_A2A_DISPATCHER Fsm:SetHomeAirbase( DefenderSquadron.Airbase ) Fsm:SetFuelThreshold( self.DefenderDefault.FuelThreshold, 60 ) Fsm:SetDamageThreshold( self.DefenderDefault.DamageThreshold ) + Fsm:SetDisengageRadius( self.DisengageRadius ) Fsm:Start() Fsm:__Patrol( 2 ) @@ -2322,17 +2379,18 @@ do -- AI_A2A_DISPATCHER --- -- @param #AI_A2A_DISPATCHER self - function AI_A2A_DISPATCHER:onafterGCI( From, Event, To, Target, DefendersMissing, AIGroups ) + function AI_A2A_DISPATCHER:onafterGCI( From, Event, To, DetectedItem, DefendersMissing, Friendlies ) - local AttackerCount = Target.Set:Count() + local AttackerSet = DetectedItem.Set + local AttackerCount = AttackerSet:Count() local DefendersCount = 0 - for AIGroupID, AIGroup in pairs( AIGroups or {} ) do + for DefenderID, AIGroup in pairs( Friendlies or {} ) do local Fsm = self:GetDefenderTaskFsm( AIGroup ) - Fsm:__Engage( 1, Target.Set ) -- Engage on the TargetSetUnit + Fsm:__Engage( 1, AttackerSet ) -- Engage on the TargetSetUnit - self:SetDefenderTaskTarget( AIGroup, Target ) + self:SetDefenderTaskTarget( AIGroup, DetectedItem ) DefendersCount = DefendersCount + AIGroup:GetSize() end @@ -2349,9 +2407,11 @@ do -- AI_A2A_DISPATCHER self:E( { DefenderSquadron } ) local SpawnCoord = DefenderSquadron.Airbase:GetCoordinate() -- Core.Point#COORDINATE - local TargetCoord = Target.Set:GetFirst():GetCoordinate() + --local TargetCoord = AttackerSet:GetFirst():GetCoordinate() + local TargetCoord = DetectedItem.InterceptCoord if TargetCoord then local Distance = SpawnCoord:Get2DDistance( TargetCoord ) + self:F( { Distance = Distance, TargetCoord = TargetCoord } ) if ClosestDistance == 0 or Distance < ClosestDistance then @@ -2402,11 +2462,12 @@ do -- AI_A2A_DISPATCHER Fsm:SetHomeAirbase( DefenderSquadron.Airbase ) Fsm:SetFuelThreshold( self.DefenderDefault.FuelThreshold, 60 ) Fsm:SetDamageThreshold( self.DefenderDefault.DamageThreshold ) + Fsm:SetDisengageRadius( self.DisengageRadius ) Fsm:Start() - Fsm:__Engage( 2, Target.Set ) -- Engage on the TargetSetUnit + Fsm:__Engage( 2, DetectedItem.Set ) -- Engage on the TargetSetUnit - self:SetDefenderTask( DefenderGCI, "GCI", Fsm, Target ) + self:SetDefenderTask( DefenderGCI, "GCI", Fsm, DetectedItem ) function Fsm:onafterRTB( Defender, From, Event, To ) @@ -2475,20 +2536,20 @@ do -- AI_A2A_DISPATCHER -- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem -- @return Set#SET_UNIT TargetSetUnit: The target set of units. -- @return #nil If there are no targets to be set. - function AI_A2A_DISPATCHER:EvaluateGCI( Target ) - self:F( { Target.ItemID } ) + function AI_A2A_DISPATCHER:EvaluateGCI( DetectedItem ) + self:F( { DetectedItem.ItemID } ) - local AttackerSet = Target.Set + local AttackerSet = DetectedItem.Set local AttackerCount = AttackerSet:Count() -- First, count the active AIGroups Units, targetting the DetectedSet - local DefenderCount = self:CountDefendersEngaged( Target ) + local DefenderCount = self:CountDefendersEngaged( DetectedItem ) local DefendersMissing = AttackerCount - DefenderCount self:F( { AttackerCount = AttackerCount, DefenderCount = DefenderCount, DefendersMissing = DefendersMissing } ) - local Friendlies = self:CountDefendersToBeEngaged( Target, DefenderCount ) + local Friendlies = self:CountDefendersToBeEngaged( DetectedItem, DefenderCount ) - if Target.IsDetected == true then + if DetectedItem.IsDetected == true then return DefendersMissing, Friendlies end diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua index 841b676c3..de0c64258 100644 --- a/Moose Development/Moose/Functional/Detection.lua +++ b/Moose Development/Moose/Functional/Detection.lua @@ -940,6 +940,24 @@ do -- DETECTION_BASE end + do -- Intercept Point + + --- Set the parameters to calculate to optimal intercept point. + -- @param #DETECTION_BASE self + -- @param #boolean Intercept Intercept is true if an intercept point is calculated. Intercept is false if it is disabled. The default Intercept is false. + -- @param #number IntereptDelay If Intercept is true, then InterceptDelay is the average time it takes to get airplanes airborne. + -- @return #DETECTION_BASE self + function DETECTION_BASE:SetIntercept( Intercept, InterceptDelay ) + self:F2() + + self.Intercept = Intercept + self.InterceptDelay = InterceptDelay + + return self + end + + end + do -- Accept / Reject detected units --- Accept detections if within a range in meters. @@ -1130,9 +1148,9 @@ do -- DETECTION_BASE return DetectedItem.FriendliesNearBy end - --- Returns friendly units nearby the FAC units sorted per distance ... + --- Returns the distance used to identify friendlies near the deteted item ... -- @param #DETECTION_BASE self - -- @return #map<#number,Wrapper.Unit#UNIT> The map of Friendly UNITs. + -- @return #number The distance. function DETECTION_BASE:GetFriendliesDistance( DetectedItem ) return DetectedItem.FriendliesDistance @@ -1161,7 +1179,8 @@ do -- DETECTION_BASE local DetectedItem = ReportGroupData.DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem local DetectedSet = ReportGroupData.DetectedItem.Set - local DetectedUnit = DetectedSet:GetFirst() + local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT + local InterceptCoord = ReportGroupData.InterceptCoord or DetectedUnit:GetCoordinate() DetectedItem.FriendliesNearBy = nil @@ -1171,7 +1190,7 @@ do -- DETECTION_BASE local SphereSearch = { id = world.VolumeType.SPHERE, params = { - point = DetectedUnit:GetVec3(), + point = InterceptCoord:GetVec3(), radius = self.FriendliesRange, } @@ -1185,7 +1204,8 @@ do -- DETECTION_BASE local DetectedItem = ReportGroupData.DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem local DetectedSet = ReportGroupData.DetectedItem.Set local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT - local CenterCoord = DetectedUnit:GetCoordinate() + local InterceptCoord = ReportGroupData.InterceptCoord or DetectedUnit:GetCoordinate() + local DetectedUnitCoord = DetectedUnit:GetCoordinate() local ReportSetGroup = ReportGroupData.ReportSetGroup local EnemyCoalition = DetectedUnit:GetCoalition() @@ -1203,7 +1223,7 @@ do -- DETECTION_BASE local FriendlyUnit = UNIT:Find( FoundDCSUnit ) local FriendlyUnitName = FriendlyUnit:GetName() DetectedItem.FriendliesNearBy[FriendlyUnitName] = FriendlyUnit - local Distance = CenterCoord:Get2DDistance( FriendlyUnit:GetCoordinate() ) + local Distance = InterceptCoord:Get2DDistance( FriendlyUnit:GetCoordinate() ) DetectedItem.FriendliesDistance = DetectedItem.FriendliesDistance or {} DetectedItem.FriendliesDistance[Distance] = FriendlyUnit return true @@ -1233,8 +1253,8 @@ do -- DETECTION_BASE DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {} DetectedItem.FriendliesNearBy[PlayerUnitName] = PlayerUnit - local CenterCoord = DetectedUnit:GetCoordinate() - local Distance = CenterCoord:Get2DDistance( PlayerUnit:GetCoordinate() ) + --local CenterCoord = DetectedUnit:GetCoordinate() + local Distance = InterceptCoord:Get2DDistance( PlayerUnit:GetCoordinate() ) DetectedItem.FriendliesDistance = DetectedItem.FriendliesDistance or {} DetectedItem.FriendliesDistance[Distance] = PlayerUnit end @@ -2287,6 +2307,30 @@ do -- DETECTION_AREAS end + --- Calculate the optimal intercept point of the DetectedItem. + -- @param #DETECTION_AREAS self + -- @param #DETECTION_BASE.DetectedItem DetectedItem + function DETECTION_AREAS:CalculateIntercept( DetectedItem ) + + if self.Intercept then + local DetectedSet = DetectedItem.Set + local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT + local UnitSpeed = DetectedUnit:GetVelocityMPS() + local UnitHeading = DetectedUnit:GetHeading() + local UnitCoord = DetectedUnit:GetCoordinate() + + local TranslateDistance = UnitSpeed * self.InterceptDelay + + local InterceptCoord = UnitCoord:Translate( TranslateDistance, UnitHeading ) + + DetectedItem.InterceptCoord = InterceptCoord + else + DetectedItem.InterceptCoord = nil + end + + end + + --- Find the nearest FAC of the DetectedItem. -- @param #DETECTION_AREAS self -- @param #DETECTION_BASE.DetectedItem DetectedItem @@ -2605,6 +2649,8 @@ do -- DETECTION_AREAS local DetectedItem = DetectedItemData -- #DETECTION_BASE.DetectedItem local DetectedSet = DetectedItem.Set local DetectedZone = DetectedItem.Zone + + self:CalculateIntercept( DetectedItem ) self:ReportFriendliesNearBy( { DetectedItem = DetectedItem, ReportSetGroup = self.DetectionSetGroup } ) -- Fill the Friendlies table self:CalculateThreatLevelA2G( DetectedItem ) -- Calculate A2G threat level diff --git a/docs/Documentation/AI_A2A.html b/docs/Documentation/AI_A2A.html index 321285023..e6e283b73 100644 --- a/docs/Documentation/AI_A2A.html +++ b/docs/Documentation/AI_A2A.html @@ -146,6 +146,12 @@ AI_A2A:ClearTargetDistance() + + + + AI_A2A.DisengageRadius + + @@ -338,6 +344,12 @@ AI_A2A:SetDamageThreshold(PatrolDamageThreshold)

When the AI is damaged beyond a certain treshold, it is required that the AI returns to the home base.

+ + + + AI_A2A:SetDisengageRadius(DisengageRadius) + +

Sets the disengage range, that when engaging a target beyond the specified range, the engagement will be cancelled and the plane will RTB.

@@ -543,6 +555,20 @@ + + +
+
+ + + +AI_A2A.DisengageRadius + +
+
+ + +
@@ -575,6 +601,7 @@
+ #number AI_A2A.IdleCount @@ -1397,6 +1424,33 @@ self

+ +AI_A2A:SetDisengageRadius(DisengageRadius) + +
+
+ +

Sets the disengage range, that when engaging a target beyond the specified range, the engagement will be cancelled and the plane will RTB.

+ +

Parameter

+
    +
  • + +

    #number DisengageRadius : +The disengage range.

    + +
  • +
+

Return value

+ +

#AI_A2A: +self

+ +
+
+
+
+ AI_A2A:SetDispatcher(Dispatcher) diff --git a/docs/Documentation/AI_A2A_Dispatcher.html b/docs/Documentation/AI_A2A_Dispatcher.html index 88a752162..d8ce97b2a 100644 --- a/docs/Documentation/AI_A2A_Dispatcher.html +++ b/docs/Documentation/AI_A2A_Dispatcher.html @@ -386,6 +386,12 @@ Per one, two, three, four?

AI_A2A_DISPATCHER.Detection + + + + AI_A2A_DISPATCHER.DisengageRadius + + @@ -401,7 +407,7 @@ Per one, two, three, four?

- AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem, Target) + AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem)

Creates an GCI task when there are targets for it.

@@ -704,6 +710,12 @@ Per one, two, three, four?

AI_A2A_DISPATCHER:SetDefenderTaskTarget(AIGroup, Defender, 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.

@@ -716,6 +728,12 @@ Per one, two, three, four?

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) + + @@ -863,7 +881,7 @@ Per one, two, three, four?

- AI_A2A_DISPATCHER:onafterGCI(From, Event, To, Target, DefendersMissing, AIGroups) + AI_A2A_DISPATCHER:onafterGCI(From, Event, To, DetectedItem, DefendersMissing, Friendlies) @@ -1419,7 +1437,9 @@ For some default settings, a method is available that allows you to tweak the de

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

-

10.7. Default CAP Time Interval.

+

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.

@@ -1427,7 +1447,7 @@ The default CAP time interval is between 180 a

Use the method AIA2ADISPATCHER.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 AIA2ADISPATCHER.SetSquadronCapTimeInterval() method.

-

10.8. Default CAP limit.

+

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. @@ -1437,6 +1457,31 @@ So, ensure that you set the default CAP limit before you spawn

Use the method AIA2ADISPATCHER.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 AIA2ADISPATCHER.SetSquadronCapTimeInterval() method.

+

10.8. Default settings for GCI.

+ +

10.8.1. Optimal intercept point.

+ +

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.
  • +
  • The altitude of the intruders.
  • +
  • An assumed time it takes to get planes operational at the airbase.
  • +
  • The intercept speed, which is given as a parameter for each squadron or set by default for all squadrons.
  • +
+ +

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.
  • +
+

11. Q & A:

11.1. Which countries will be selected for each coalition?

@@ -2050,6 +2095,20 @@ DefenderSquadron

+ +
+
+
+ + + +AI_A2A_DISPATCHER.DisengageRadius + +
+
+ + +
@@ -2105,24 +2164,19 @@ If there are no targets to be set.

-AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem, Target) +AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem)

Creates an GCI task when there are targets for it.

-

Parameters

+

Parameter

Return values

@@ -3692,6 +3746,42 @@ From the airbase hot, from the airbase cold, in the air, from the runway.

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

+ +

Parameter

+
    +
  • + +

    #number DisengageRadius : +(Optional, Default = 100000) The radius to disengage a target when too far from the home base.

    + +
  • +
+

Return value

+ +

#AIA2ADISPATCHER:

+ + +

Usage:

+

+  -- Set 50km as the disengage radius.
+  Dispatcher:SetDisengageRadius( 50000 )
+  
+  -- Set 100km as the disengage radius.
+  Dispatcher:SetDisngageRadius() -- 100000 is the default value.
+  
+ +
+
+
+
+ AI_A2A_DISPATCHER:SetEngageRadius(EngageRadius) @@ -3787,6 +3877,27 @@ If too large, intercept missions may be triggered when the detected target is to
+ +AI_A2A_DISPATCHER:SetIntercept(InterceptDelay) + +
+
+ + + +

Parameter

+
    +
  • + +

    InterceptDelay :

    + +
  • +
+
+
+
+
+ AI_A2A_DISPATCHER:SetSquadron(SquadronName, AirbaseName, SpawnTemplates, Resources) @@ -4766,7 +4877,7 @@ Provide a value of true to display every 30 seconds a tactical
-AI_A2A_DISPATCHER:onafterGCI(From, Event, To, Target, DefendersMissing, AIGroups) +AI_A2A_DISPATCHER:onafterGCI(From, Event, To, DetectedItem, DefendersMissing, Friendlies)
@@ -4792,7 +4903,7 @@ Provide a value of true to display every 30 seconds a tactical
  • -

    Target :

    +

    DetectedItem :

  • @@ -4802,7 +4913,7 @@ Provide a value of true to display every 30 seconds a tactical
  • -

    AIGroups :

    +

    Friendlies :

  • diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html index 1e25ded90..fa84b7673 100644 --- a/docs/Documentation/AI_Patrol.html +++ b/docs/Documentation/AI_Patrol.html @@ -926,9 +926,6 @@ Use the method AIPATROLZONE.M - -

    This table contains the targets detected during patrol.

    -
    diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html index 35fbfb9ab..f6e167593 100644 --- a/docs/Documentation/Detection.html +++ b/docs/Documentation/Detection.html @@ -184,6 +184,12 @@ DETECTION uses the in-built detection capabilities of DCS World, but adds new fu DETECTION_AREAS:BoundDetectedZones()

    Bound the detected zones

    + + + + DETECTION_AREAS:CalculateIntercept(DetectedItem) + +

    Calculate the optimal intercept point of the DetectedItem.

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

    DETECTION_BASE:GetFriendliesDistance(DetectedItem) -

    Returns friendly units nearby the FAC units sorted per distance ...

    +

    Returns the distance used to identify friendlies near the deteted item ...

    @@ -667,6 +673,18 @@ The different values of Unit.Category can be:

    DETECTION_BASE:InitDetectVisual(DetectVisual)

    Detect Visual.

    + + + + DETECTION_BASE.Intercept + + + + + + DETECTION_BASE.InterceptDelay + + @@ -841,6 +859,12 @@ The different values of Unit.Category can be:

    DETECTION_BASE:SetFriendliesRange(FriendliesRange)

    Set the radius in meters to validate if friendlies are nearby.

    + + + + DETECTION_BASE:SetIntercept(Intercept, IntereptDelay, InterceptDelay) + +

    Set the parameters to calculate to optimal intercept point.

    @@ -959,6 +983,12 @@ The different values of Unit.Category can be:

    DETECTION_BASE.DetectedItem.ID

    -- The identifier of the detected area.

    + + + + DETECTION_BASE.DetectedItem.InterceptCoord + + @@ -1566,6 +1596,27 @@ self

    + +DETECTION_AREAS:CalculateIntercept(DetectedItem) + +
    +
    + +

    Calculate the optimal intercept point of the DetectedItem.

    + +

    Parameter

    + +
    +
    +
    +
    + DETECTION_AREAS:CalculateThreatLevelA2G(DetectedItem) @@ -2414,6 +2465,7 @@ The index of the DetectedItem.

    + #number DETECTION_BASE.DetectedItemMax @@ -2579,7 +2631,7 @@ The group to generate the report for.

    - + #number DETECTION_BASE.DetectionInterval @@ -3002,7 +3054,7 @@ DetectedSet

    -

    Returns friendly units nearby the FAC units sorted per distance ...

    +

    Returns the distance used to identify friendlies near the deteted item ...

    Parameter

      @@ -3014,8 +3066,8 @@ DetectedSet

    Return value

    -

    #map:

    -

    number,Wrapper.Unit#UNIT> The map of Friendly UNITs.

    +

    #number: +The distance.

    @@ -3246,6 +3298,34 @@ self

    #DETECTION_BASE: self

    +
    +
    +
    +
    + + + +DETECTION_BASE.Intercept + +
    +
    + + + +
    +
    +
    +
    + + + +DETECTION_BASE.InterceptDelay + +
    +
    + + +
    @@ -4117,6 +4197,44 @@ self

    + +DETECTION_BASE:SetIntercept(Intercept, IntereptDelay, InterceptDelay) + +
    +
    + +

    Set the parameters to calculate to optimal intercept point.

    + +

    Parameters

    +
      +
    • + +

      #boolean Intercept : +Intercept is true if an intercept point is calculated. Intercept is false if it is disabled. The default Intercept is false.

      + +
    • +
    • + +

      #number IntereptDelay : +If Intercept is true, then InterceptDelay is the average time it takes to get airplanes airborne.

      + +
    • +
    • + +

      InterceptDelay :

      + +
    • +
    +

    Return value

    + +

    #DETECTION_BASE: +self

    + +
    +
    +
    +
    + DETECTION_BASE:SetRejectZones(RejectZones) @@ -4540,6 +4658,20 @@ The To State string.

    -- The identifier of the detected area.

    + +
    +
    +
    + + + +DETECTION_BASE.DetectedItem.InterceptCoord + +
    +
    + + +
    diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html index 177f34281..e0276d335 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,6 +1897,7 @@ A string defining the start state.

    + FSM.current diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index d74870d0d..05a9cda85 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -2200,9 +2200,6 @@ 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.

    -
    @@ -2752,9 +2749,6 @@ when nothing was spawned.

    - -

    By default, no InitLimit

    -
    @@ -2790,7 +2784,7 @@ when nothing was spawned.

    - #number + SPAWN.SpawnMaxGroups @@ -2807,7 +2801,7 @@ when nothing was spawned.

    - #number + SPAWN.SpawnMaxUnitsAlive @@ -3135,7 +3129,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
    - #boolean + SPAWN.SpawnUnControlled diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html index a0ddfc083..743615651 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 + FSM_PROCESS.Cargo @@ -566,7 +566,6 @@ based on the tasking capabilities defined in Task#TA
    - FSM_PROCESS.DeployZone @@ -631,7 +630,7 @@ based on the tasking capabilities defined in Task#TA
    - + #number TASK_CARGO.CargoLimit