diff --git a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua index 74c3b5746..dd1264b7a 100644 --- a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua @@ -1239,7 +1239,7 @@ do -- AI_A2A_DISPATCHER --- 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 time interval is 1 CAP. + -- The default CAP limit is 1 CAP, which means one CAP group being spawned. -- @param #AI_A2A_DISPATCHER self -- @param #number CapLimit The maximum amount of CAP that can be airborne at the same time for the squadron. -- @return #AI_A2A_DISPATCHER @@ -1497,7 +1497,7 @@ do -- AI_A2A_DISPATCHER end - --- + --- Set a CAP for a Squadron. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The squadron name. -- @param Core.Zone#ZONE_BASE Zone The @{Zone} object derived from @{Zone#ZONE_BASE} that defines the zone wherein the CAP will be executed. @@ -1549,9 +1549,13 @@ do -- AI_A2A_DISPATCHER return self end - --- + --- Set the squadron CAP parameters. -- @param #AI_A2A_DISPATCHER self -- @param #string SquadronName The squadron name. + -- @param #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. + -- @param #number LowInterval (optional) The minimum time boundary in seconds when a new CAP will be spawned. The default is 180 seconds. + -- @param #number HighInterval (optional) The maximum time boundary in seconds when a new CAP will be spawned. The default is 600 seconds. + -- @param #number Probability Is not in use, you can skip this parameter. -- @return #AI_A2A_DISPATCHER -- @usage -- @@ -1577,10 +1581,10 @@ do -- AI_A2A_DISPATCHER local Cap = self.DefenderSquadrons[SquadronName].Cap if Cap then - Cap.LowInterval = LowInterval or 300 + Cap.LowInterval = LowInterval or 180 Cap.HighInterval = HighInterval or 600 Cap.Probability = Probability or 1 - Cap.CapLimit = CapLimit + Cap.CapLimit = CapLimit or 1 Cap.Scheduler = Cap.Scheduler or SCHEDULER:New( self ) local Scheduler = Cap.Scheduler -- Core.Scheduler#SCHEDULER local ScheduleID = Cap.ScheduleID diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua index b2ce1538b..a09616279 100644 --- a/Moose Development/Moose/Functional/Detection.lua +++ b/Moose Development/Moose/Functional/Detection.lua @@ -1140,7 +1140,7 @@ do -- DETECTION_BASE end - do -- Threat + do -- NearBy calculations --- Returns if there are friendlies nearby the FAC units ... -- @param #DETECTION_BASE self @@ -1157,6 +1157,15 @@ do -- DETECTION_BASE return DetectedItem.FriendliesNearBy end + + --- Filters friendly units by unit category. + -- @param #DETECTION_BASE self + -- @param FriendliesCategory + -- @return #DETECTION_BASE + function DETECTION_BASE:FilterFriendliesCategory( FriendliesCategory ) + self.FriendliesCategory = FriendliesCategory + return self + end --- Returns if there are friendlies nearby the intercept ... -- @param #DETECTION_BASE self @@ -1245,15 +1254,18 @@ do -- DETECTION_BASE --self:F( { "Friendlies search:", FoundUnitName, FoundUnitCoalition, EnemyUnitName, EnemyCoalition, FoundUnitInReportSetGroup } ) if FoundUnitCoalition ~= EnemyCoalition and FoundUnitInReportSetGroup == false then - DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {} local FriendlyUnit = UNIT:Find( FoundDCSUnit ) local FriendlyUnitName = FriendlyUnit:GetName() - - DetectedItem.FriendliesNearBy[FriendlyUnitName] = FriendlyUnit + local FriendlyUnitCategory = FriendlyUnit:GetDesc().category + self:T( { FriendlyUnitCategory = FriendlyUnitCategory, FriendliesCategory = self.FriendliesCategory } ) - local Distance = DetectedUnitCoord:Get2DDistance( FriendlyUnit:GetCoordinate() ) - DetectedItem.FriendliesDistance = DetectedItem.FriendliesDistance or {} - DetectedItem.FriendliesDistance[Distance] = FriendlyUnit + if ( not self.FriendliesCategory ) or ( self.FriendliesCategory and ( self.FriendliesCategory == FriendlyUnitCategory ) ) then + DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {} + DetectedItem.FriendliesNearBy[FriendlyUnitName] = FriendlyUnit + local Distance = DetectedUnitCoord:Get2DDistance( FriendlyUnit:GetCoordinate() ) + DetectedItem.FriendliesDistance = DetectedItem.FriendliesDistance or {} + DetectedItem.FriendliesDistance[Distance] = FriendlyUnit + end return true end @@ -1269,23 +1281,28 @@ do -- DETECTION_BASE --- @param Wrapper.Unit#UNIT PlayerUnit function( PlayerUnitName ) local PlayerUnit = UNIT:FindByName( PlayerUnitName ) - + local PlayerUnitCategory = PlayerUnit:GetDesc().category + if PlayerUnit and PlayerUnit:IsInZone(DetectionZone) then - DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {} - local PlayerUnitName = PlayerUnit:GetName() - - DetectedItem.PlayersNearBy = DetectedItem.PlayersNearBy or {} - DetectedItem.PlayersNearBy[PlayerUnitName] = PlayerUnit - - DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {} - DetectedItem.FriendliesNearBy[PlayerUnitName] = PlayerUnit - - local CenterCoord = DetectedUnit:GetCoordinate() + if ( not self.FriendliesCategory ) or ( self.FriendliesCategory and ( self.FriendliesCategory == PlayerUnitCategory ) ) then - local Distance = CenterCoord:Get2DDistance( PlayerUnit:GetCoordinate() ) - DetectedItem.FriendliesDistance = DetectedItem.FriendliesDistance or {} - DetectedItem.FriendliesDistance[Distance] = PlayerUnit + DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {} + local PlayerUnitName = PlayerUnit:GetName() + + DetectedItem.PlayersNearBy = DetectedItem.PlayersNearBy or {} + DetectedItem.PlayersNearBy[PlayerUnitName] = PlayerUnit + + DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {} + DetectedItem.FriendliesNearBy[PlayerUnitName] = PlayerUnit + + local CenterCoord = DetectedUnit:GetCoordinate() + + local Distance = CenterCoord:Get2DDistance( PlayerUnit:GetCoordinate() ) + DetectedItem.FriendliesDistance = DetectedItem.FriendliesDistance or {} + DetectedItem.FriendliesDistance[Distance] = PlayerUnit + + end end end ) diff --git a/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua b/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua index 9de721ff4..8857bb4ce 100644 --- a/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua +++ b/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua @@ -59,6 +59,7 @@ do -- TASK_A2G_DISPATCHER self.Mission = Mission self.Detection:FilterCategories( Unit.Category.GROUND_UNIT, Unit.Category.SHIP ) + self.Detection:FilterFriendliesCategory( Unit.Category.GROUND_UNIT ) self:AddTransition( "Started", "Assign", "Started" ) diff --git a/docs/Documentation/AI_A2A_Dispatcher.html b/docs/Documentation/AI_A2A_Dispatcher.html index a44b0d577..6cc0cf345 100644 --- a/docs/Documentation/AI_A2A_Dispatcher.html +++ b/docs/Documentation/AI_A2A_Dispatcher.html @@ -757,13 +757,13 @@ Per one, two, three, four?
Set a CAP for a Squadron.
Set the squadron CAP parameters.
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 time interval is 1 CAP.
+The default CAP limit is 1 CAP, which means one CAP group being spawned.
-
-
+
Set a CAP for a Squadron.
Parameters
@@ -4342,7 +4342,10 @@ The altitude type, which is a string "BARO" defining Barometric or "RADIO" defin
-
+
Set the squadron CAP parameters.
+
+
Parameters
@@ -4354,22 +4357,26 @@ The squadron name.
-
-
CapLimit :
+#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.
-
-
LowInterval :
+#number LowInterval :
+(optional) The minimum time boundary in seconds when a new CAP will be spawned. The default is 180 seconds.
-
-
HighInterval :
+#number HighInterval :
+(optional) The maximum time boundary in seconds when a new CAP will be spawned. The default is 600 seconds.
-
-
Probability :
+#number Probability :
+Is not in use, you can skip this parameter.
diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html
index fe4a4263b..9f6098452 100644
--- a/docs/Documentation/Cargo.html
+++ b/docs/Documentation/Cargo.html
@@ -3542,7 +3542,6 @@ The range till cargo will board.
-
- #number
CARGO_UNIT.RunCount
diff --git a/docs/Documentation/Designate.html b/docs/Documentation/Designate.html
index 31210aea8..c18932686 100644
--- a/docs/Documentation/Designate.html
+++ b/docs/Documentation/Designate.html
@@ -1130,6 +1130,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 00b524902..15a67b87c 100644
--- a/docs/Documentation/Detection.html
+++ b/docs/Documentation/Detection.html
@@ -2619,7 +2619,7 @@ The group to generate the report for.
-
-
+ #number
DETECTION_BASE.DetectionInterval
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/Movement.html b/docs/Documentation/Movement.html
index be5ce073c..4307c3aaa 100644
--- a/docs/Documentation/Movement.html
+++ b/docs/Documentation/Movement.html
@@ -227,7 +227,6 @@ on defined intervals (currently every minute).
-
- #number
MOVEMENT.AliveUnits
@@ -236,9 +235,6 @@ on defined intervals (currently every minute).
-
-
Contains the counter how many units are currently alive
-
diff --git a/docs/Documentation/Point.html b/docs/Documentation/Point.html
index 22a8976b5..4c79fc8f9 100644
--- a/docs/Documentation/Point.html
+++ b/docs/Documentation/Point.html
@@ -2862,6 +2862,7 @@ The y coordinate.
-
+
POINT_VEC2.z
diff --git a/docs/Documentation/Positionable.html b/docs/Documentation/Positionable.html
index f5b1c4a9e..573b1fc66 100644
--- a/docs/Documentation/Positionable.html
+++ b/docs/Documentation/Positionable.html
@@ -1836,7 +1836,6 @@ The height in meters to add to the altitude of the positionable.
-
- Core.Spot#SPOT
POSITIONABLE.Spot
diff --git a/docs/Documentation/Settings.html b/docs/Documentation/Settings.html
index 992d1808d..85d72ad06 100644
--- a/docs/Documentation/Settings.html
+++ b/docs/Documentation/Settings.html
@@ -1093,7 +1093,7 @@ true if metric.
-
- #boolean
+
SETTINGS.Metric
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index 65835348c..c9dc9dd3f 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -3150,7 +3150,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
+ When the first Spawn executes, all the Groups need to be made visible before start.
diff --git a/docs/Documentation/Spot.html b/docs/Documentation/Spot.html
index ead3792db..5fdc3b305 100644
--- a/docs/Documentation/Spot.html
+++ b/docs/Documentation/Spot.html
@@ -765,6 +765,7 @@ true if it is lasing
-
+
SPOT.ScheduleID
@@ -778,6 +779,7 @@ true if it is lasing
-
+
SPOT.SpotIR
@@ -791,6 +793,7 @@ true if it is lasing
-
+
SPOT.SpotLaser
@@ -804,6 +807,7 @@ true if it is lasing
-
+
SPOT.Target
diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html
index 349f0de89..5ccba6643 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