From fccf58cd6c768daab40bd53e1128ce751fa081c8 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Wed, 17 Feb 2021 14:02:37 +0100 Subject: [PATCH 01/15] Update Mantis.lua added code examples --- Moose Development/Moose/Functional/Mantis.lua | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index bc043506b..29b360e74 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -31,7 +31,7 @@ -- @field Core.Set#SET_GROUP SAM_Group The SAM #SET_GROUP -- @field #string EWR_Templates_Prefix Prefix to build the #SET_GROUP for EWR group -- @field Core.Set#SET_GROUP EWR_Group The EWR #SET_GROUP --- @field #Core.Set#SET_GROUP Adv_EWR_Group The EWR #SET_GROUP used for advanced mode +-- @field Core.Set#SET_GROUP Adv_EWR_Group The EWR #SET_GROUP used for advanced mode -- @field #string HQ_Template_CC The ME name of the HQ object -- @field Wrapper.Group#GROUP HQ_CC The #GROUP object of the HQ -- @field #table SAM_Table Table of SAM sites @@ -135,8 +135,26 @@ -- # 4. Advanced Mode -- -- Advanced mode will *decrease* reactivity of MANTIS, if HQ and/or EWR network dies. Awacs is counted as one EWR unit. It will set SAMs to RED state if both are dead. Requires usage of an **HQ** object and the **dynamic** option. --- E.g. `mymantis:SetAdvancedMode( true, 90 )` +-- +-- E.g. `mymantis:SetAdvancedMode( true, 90 )` +-- -- Use this option if you want to make use of or allow advanced SEAD tactics. +-- +-- # 5. Integrate SHORAD +-- +-- You can also choose to integrate Mantis with @{Functional.Shorad#SHORAD} for protection against HARMs and AGMs. When SHORAD detects a missile fired at one of MANTIS' SAM sites, it will activate SHORAD systems in +-- the given defense checkradius around that SAM site. Create a SHORAD object first, then integrate with MANTIS like so: +-- +-- `local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart()` +-- `myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue")` +-- `-- now set up MANTIS` +-- `mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs")` +-- `mymantis:AddShorad(myshorad,720)` +-- `mymantis:Start()` +-- +-- and (optionally) remove the link later on with +-- +-- `mymantis:RemoveShorad()` -- -- @field #MANTIS MANTIS = { From 95dc7ad2b43d90f83a612b474dcc383f5920f135 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Wed, 17 Feb 2021 14:04:59 +0100 Subject: [PATCH 02/15] Update Shorad.lua code example added --- Moose Development/Moose/Functional/Shorad.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Functional/Shorad.lua b/Moose Development/Moose/Functional/Shorad.lua index 7ed638f43..7ecf59d18 100644 --- a/Moose Development/Moose/Functional/Shorad.lua +++ b/Moose Development/Moose/Functional/Shorad.lua @@ -378,7 +378,14 @@ do -- @param #string TargetGroup Name of the target group used to build the #ZONE -- @param #number Radius Radius of the #ZONE -- @param #number ActiveTimer Number of seconds to stay active - -- @usage Use this function to integrate with other systems. + -- @usage Use this function to integrate with other systems, example + -- + -- local SamSet = SET_GROUP:New():FilterPrefixes("Blue SAM"):FilterCoalitions("blue"):FilterStart() + -- myshorad = SHORAD:New("BlueShorad", "Blue SHORAD", SamSet, 22000, 600, "blue") + -- myshorad:SwitchDebug(true) + -- mymantis = MANTIS:New("BlueMantis","Blue SAM","Blue EWR",nil,"blue",false,"Blue Awacs") + -- mymantis:AddShorad(myshorad,720) + -- mymantis:Start() function SHORAD:WakeUpShorad(TargetGroup, Radius, ActiveTimer) self:F({TargetGroup, Radius, ActiveTimer}) local targetgroup = GROUP:FindByName(TargetGroup) From cdb491bb5f3945636088a7c8a8f6cccb85ebe764 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Thu, 18 Feb 2021 17:05:36 +0100 Subject: [PATCH 03/15] Update AI_Cargo_Helicopter.lua Added docu on Pseudo Function, make Home() function clear and Height useful --- .../Moose/AI/AI_Cargo_Helicopter.lua | 75 +++++++++++++------ 1 file changed, 52 insertions(+), 23 deletions(-) diff --git a/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua b/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua index a9bae01c3..90a39bdb4 100644 --- a/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua +++ b/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua @@ -33,7 +33,7 @@ -- -- ## Infantry health. -- --- When infantry is unboarded from the APCs, the infantry is actually respawned into the battlefield. +-- When infantry is unboarded from the helicopters, the infantry is actually respawned into the battlefield. -- As a result, the unboarding infantry is very _healthy_ every time it unboards. -- This is due to the limitation of the DCS simulator, which is not able to specify the health of new spawned units as a parameter. -- However, infantry that was destroyed when unboarded, won't be respawned again. Destroyed is destroyed. @@ -67,18 +67,6 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) self:AddTransition( "Unloaded", "Pickup", "*" ) self:AddTransition( "Loaded", "Deploy", "*" ) - --[[ - self:AddTransition( { "Unloaded", "Loading" }, "Load", "Boarding" ) - self:AddTransition( "Boarding", "Board", "Boarding" ) - self:AddTransition( "Boarding", "Loaded", "Loaded" ) - self:AddTransition( "Boarding", "PickedUp", "Loaded" ) - self:AddTransition( "Boarding", "Deploy", "Loaded" ) - self:AddTransition( "Loaded", "Unload", "Unboarding" ) - self:AddTransition( "Unboarding", "Unboard", "Unboarding" ) - self:AddTransition( "Unboarding", "Unloaded", "Unboarding" ) - self:AddTransition( "Unboarding", "Deployed", "Unloaded" ) - self:AddTransition( "Unboarding", "Pickup", "Unloaded" ) - --]] self:AddTransition( "*", "Loaded", "Loaded" ) self:AddTransition( "Unboarding", "Pickup", "Unloaded" ) self:AddTransition( "Unloaded", "Unboard", "Unloaded" ) @@ -109,6 +97,24 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param Core.Point#COORDINATE Coordinate -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + --- PickedUp Handler OnAfter for AI_CARGO_HELICOPTER - Cargo set has been picked up, ready to deploy + -- @function [parent=#AI_CARGO_HELICOPTER] OnAfterPickedUp + -- @param #AI_CARGO_HELICOPTER self + -- @param Wrapper.Group#GROUP Helicopter The helicopter #GROUP object + -- @param #string From + -- @param #string Event + -- @param #string To + -- @param Wrapper.Unit#UNIT Unit The helicopter #UNIT object + + --- Unloaded Handler OnAfter for AI_CARGO_HELICOPTER - Cargo unloaded, carrier is empty + -- @function [parent=#AI_CARGO_HELICOPTER] OnAfterUnloaded + -- @param #AI_CARGO_HELICOPTER self + -- @param #string From + -- @param #string Event + -- @param #string To + -- @param #string Cargo.CargoGroup#CARGO_GROUP Cargo The #CARGO_GROUP object. + -- @param Wrapper.Unit#UNIT Unit The helicopter #UNIT object + --- Pickup Trigger for AI_CARGO_HELICOPTER -- @function [parent=#AI_CARGO_HELICOPTER] Pickup -- @param #AI_CARGO_HELICOPTER self @@ -141,6 +147,13 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param Core.Point#COORDINATE Coordinate -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + --- Deployed Handler OnAfter for AI_CARGO_HELICOPTER + -- @function [parent=#AI_CARGO_HELICOPTER] OnAfterDeployed + -- @param #AI_CARGO_HELICOPTER self + -- @param #string From + -- @param #string Event + -- @param #string To + --- Deploy Trigger for AI_CARGO_HELICOPTER -- @function [parent=#AI_CARGO_HELICOPTER] Deploy -- @param #AI_CARGO_HELICOPTER self @@ -154,6 +167,20 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param Core.Point#COORDINATE Coordinate Place at which the cargo is deployed. -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + --- Home Trigger for AI_CARGO_HELICOPTER + -- @function [parent=#AI_CARGO_HELICOPTER] Home + -- @param #AI_CARGO_HELICOPTER self + -- @param Core.Point#COORDINATE Coordinate Place to which the helicopter will go. + -- @param #number Speed (optional) Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Height (optional) Height the Helicopter should by flying at. + + --- Home Asynchronous Trigger for AI_CARGO_HELICOPTER + -- @function [parent=#AI_CARGO_HELICOPTER] __Home + -- @param #number Delay Delay in seconds. + -- @param #AI_CARGO_HELICOPTER self + -- @param Core.Point#COORDINATE Coordinate Place to which the helicopter will go. + -- @param #number Speed (optional) Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Height (optional) Height the Helicopter should by flying at. -- We need to capture the Crash events for the helicopters. -- The helicopter reference is used in the semaphore AI_CARGO_QUEUE. @@ -235,7 +262,7 @@ end -- @param Event -- @param To function AI_CARGO_HELICOPTER:onafterLanded( Helicopter, From, Event, To ) - + self:F({From, Event, To}) Helicopter:F( { Name = Helicopter:GetName() } ) if Helicopter and Helicopter:IsAlive() then @@ -276,7 +303,7 @@ end -- @param Core.Point#COORDINATE Coordinate -- @param #number Speed function AI_CARGO_HELICOPTER:onafterQueue( Helicopter, From, Event, To, Coordinate, Speed, DeployZone ) - + self:F({From, Event, To, Coordinate, Speed, DeployZone}) local HelicopterInZone = false if Helicopter and Helicopter:IsAlive() == true then @@ -359,7 +386,8 @@ end -- @param Core.Point#COORDINATE Coordinate -- @param #number Speed function AI_CARGO_HELICOPTER:onafterOrbit( Helicopter, From, Event, To, Coordinate ) - + self:F({From, Event, To, Coordinate}) + if Helicopter and Helicopter:IsAlive() then local Route = {} @@ -394,7 +422,7 @@ end -- @param #boolean Deployed Cargo is deployed. -- @return #boolean True if all cargo has been unloaded. function AI_CARGO_HELICOPTER:onafterDeployed( Helicopter, From, Event, To, DeployZone ) - self:F( { Helicopter, From, Event, To, DeployZone = DeployZone } ) + self:F( { From, Event, To, DeployZone = DeployZone } ) self:Orbit( Helicopter:GetCoordinate(), 50 ) @@ -488,7 +516,7 @@ end -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. -- @param #number Height Height in meters to move to the deploy coordinate. function AI_CARGO_HELICOPTER:onafterDeploy( Helicopter, From, Event, To, Coordinate, Speed, Height, DeployZone ) - + self:F({From, Event, To, Coordinate, Speed, Height, DeployZone}) if Helicopter and Helicopter:IsAlive() ~= nil then self.RouteDeploy = true @@ -554,7 +582,8 @@ end -- @param #number Height Height in meters to move to the home coordinate. -- @param Core.Zone#ZONE HomeZone The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. function AI_CARGO_HELICOPTER:onafterHome( Helicopter, From, Event, To, Coordinate, Speed, Height, HomeZone ) - + self:F({From, Event, To, Coordinate, Speed, Height}) + if Helicopter and Helicopter:IsAlive() ~= nil then self.RouteHome = true @@ -563,7 +592,8 @@ function AI_CARGO_HELICOPTER:onafterHome( Helicopter, From, Event, To, Coordinat --- Calculate the target route point. - Coordinate.y = Height + --Coordinate.y = Height + Height = Height or 50 Speed = Speed or Helicopter:GetSpeedMax()*0.5 @@ -576,7 +606,7 @@ function AI_CARGO_HELICOPTER:onafterHome( Helicopter, From, Event, To, Coordinat --- Create a route point of type air. local CoordinateTo = Coordinate local landheight = CoordinateTo:GetLandHeight() -- get target height - CoordinateTo.y = landheight + 50 -- flight height should be 50m above ground + CoordinateTo.y = landheight + Height -- flight height should be 50m above ground local WaypointTo = CoordinateTo:WaypointAir("RADIO", POINT_VEC3.RoutePointType.TurningPoint, POINT_VEC3.RoutePointAction.TurningPoint, Speed, true) @@ -589,12 +619,11 @@ function AI_CARGO_HELICOPTER:onafterHome( Helicopter, From, Event, To, Coordinat Tasks[#Tasks+1] = Helicopter:TaskLandAtVec2( CoordinateTo:GetVec2() ) Route[#Route].task = Helicopter:TaskCombo( Tasks ) - + Route[#Route+1] = WaypointTo -- Now route the helicopter Helicopter:Route(Route, 0) - end end From 4deca4f816b6081608aa3e4cf684526f35f5b9d5 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Fri, 19 Feb 2021 09:59:12 +0100 Subject: [PATCH 04/15] Update AI_Cargo_Helicopter.lua Helicopters don't drive, they fly... ;) --- .../Moose/AI/AI_Cargo_Helicopter.lua | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua b/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua index 90a39bdb4..8e33b4113 100644 --- a/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua +++ b/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua @@ -95,7 +95,7 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param #string Event -- @param #string To -- @param Core.Point#COORDINATE Coordinate - -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. --- PickedUp Handler OnAfter for AI_CARGO_HELICOPTER - Cargo set has been picked up, ready to deploy -- @function [parent=#AI_CARGO_HELICOPTER] OnAfterPickedUp @@ -112,14 +112,14 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param #string From -- @param #string Event -- @param #string To - -- @param #string Cargo.CargoGroup#CARGO_GROUP Cargo The #CARGO_GROUP object. + -- @param Cargo.CargoGroup#CARGO_GROUP Cargo The #CARGO_GROUP object. -- @param Wrapper.Unit#UNIT Unit The helicopter #UNIT object --- Pickup Trigger for AI_CARGO_HELICOPTER -- @function [parent=#AI_CARGO_HELICOPTER] Pickup -- @param #AI_CARGO_HELICOPTER self -- @param Core.Point#COORDINATE Coordinate - -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. --- Pickup Asynchronous Trigger for AI_CARGO_HELICOPTER -- @function [parent=#AI_CARGO_HELICOPTER] __Pickup @@ -135,7 +135,7 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param #string Event -- @param #string To -- @param Core.Point#COORDINATE Coordinate Place at which cargo is deployed. - -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. -- @return #boolean --- Deploy Handler OnAfter for AI_CARGO_HELICOPTER @@ -145,7 +145,7 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param #string Event -- @param #string To -- @param Core.Point#COORDINATE Coordinate - -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. --- Deployed Handler OnAfter for AI_CARGO_HELICOPTER -- @function [parent=#AI_CARGO_HELICOPTER] OnAfterDeployed @@ -158,20 +158,20 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @function [parent=#AI_CARGO_HELICOPTER] Deploy -- @param #AI_CARGO_HELICOPTER self -- @param Core.Point#COORDINATE Coordinate Place at which the cargo is deployed. - -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. --- Deploy Asynchronous Trigger for AI_CARGO_HELICOPTER -- @function [parent=#AI_CARGO_HELICOPTER] __Deploy -- @param #number Delay Delay in seconds. -- @param #AI_CARGO_HELICOPTER self -- @param Core.Point#COORDINATE Coordinate Place at which the cargo is deployed. - -- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. --- Home Trigger for AI_CARGO_HELICOPTER -- @function [parent=#AI_CARGO_HELICOPTER] Home -- @param #AI_CARGO_HELICOPTER self -- @param Core.Point#COORDINATE Coordinate Place to which the helicopter will go. - -- @param #number Speed (optional) Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Speed (optional) Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. -- @param #number Height (optional) Height the Helicopter should by flying at. --- Home Asynchronous Trigger for AI_CARGO_HELICOPTER @@ -179,7 +179,7 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param #number Delay Delay in seconds. -- @param #AI_CARGO_HELICOPTER self -- @param Core.Point#COORDINATE Coordinate Place to which the helicopter will go. - -- @param #number Speed (optional) Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. + -- @param #number Speed (optional) Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. -- @param #number Height (optional) Height the Helicopter should by flying at. -- We need to capture the Crash events for the helicopters. @@ -444,7 +444,7 @@ end -- @param Event -- @param To -- @param Core.Point#COORDINATE Coordinate Pickup place. --- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. +-- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. -- @param #number Height Height in meters to move to the pickup coordinate. This parameter is ignored for APCs. -- @param Core.Zone#ZONE PickupZone (optional) The zone where the cargo will be picked up. The PickupZone can be nil, if there wasn't any PickupZoneSet provided. function AI_CARGO_HELICOPTER:onafterPickup( Helicopter, From, Event, To, Coordinate, Speed, Height, PickupZone ) @@ -513,7 +513,7 @@ end -- @param Event -- @param To -- @param Core.Point#COORDINATE Coordinate Place at which the cargo is deployed. --- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. +-- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. -- @param #number Height Height in meters to move to the deploy coordinate. function AI_CARGO_HELICOPTER:onafterDeploy( Helicopter, From, Event, To, Coordinate, Speed, Height, DeployZone ) self:F({From, Event, To, Coordinate, Speed, Height, DeployZone}) @@ -578,7 +578,7 @@ end -- @param Event -- @param To -- @param Core.Point#COORDINATE Coordinate Home place. --- @param #number Speed Speed in km/h to drive to the pickup coordinate. Default is 50% of max possible speed the unit can go. +-- @param #number Speed Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. -- @param #number Height Height in meters to move to the home coordinate. -- @param Core.Zone#ZONE HomeZone The zone wherein the carrier will return when all cargo has been transported. This can be any zone type, like a ZONE, ZONE_GROUP, ZONE_AIRBASE. function AI_CARGO_HELICOPTER:onafterHome( Helicopter, From, Event, To, Coordinate, Speed, Height, HomeZone ) From f18c818b8e3d87a749f418770e1c8d389f199c43 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Fri, 19 Feb 2021 10:04:30 +0100 Subject: [PATCH 05/15] Update AI_Cargo_Helicopter.lua --- Moose Development/Moose/AI/AI_Cargo_Helicopter.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua b/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua index 8e33b4113..79f664a12 100644 --- a/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua +++ b/Moose Development/Moose/AI/AI_Cargo_Helicopter.lua @@ -172,7 +172,7 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param #AI_CARGO_HELICOPTER self -- @param Core.Point#COORDINATE Coordinate Place to which the helicopter will go. -- @param #number Speed (optional) Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. - -- @param #number Height (optional) Height the Helicopter should by flying at. + -- @param #number Height (optional) Height the Helicopter should be flying at. --- Home Asynchronous Trigger for AI_CARGO_HELICOPTER -- @function [parent=#AI_CARGO_HELICOPTER] __Home @@ -180,7 +180,7 @@ function AI_CARGO_HELICOPTER:New( Helicopter, CargoSet ) -- @param #AI_CARGO_HELICOPTER self -- @param Core.Point#COORDINATE Coordinate Place to which the helicopter will go. -- @param #number Speed (optional) Speed in km/h to fly to the pickup coordinate. Default is 50% of max possible speed the unit can go. - -- @param #number Height (optional) Height the Helicopter should by flying at. + -- @param #number Height (optional) Height the Helicopter should be flying at. -- We need to capture the Crash events for the helicopters. -- The helicopter reference is used in the semaphore AI_CARGO_QUEUE. From 11cdae098ba373ebfd469a5880a9abd9455e6f91 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Sun, 21 Feb 2021 19:55:48 +0100 Subject: [PATCH 06/15] Update Intelligence.lua Honor settings for clustermarkers --- Moose Development/Moose/Ops/Intelligence.lua | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Moose Development/Moose/Ops/Intelligence.lua b/Moose Development/Moose/Ops/Intelligence.lua index edff50801..fec438144 100644 --- a/Moose Development/Moose/Ops/Intelligence.lua +++ b/Moose Development/Moose/Ops/Intelligence.lua @@ -810,16 +810,17 @@ function INTEL:PaintPicture() -- Update F10 marker text if cluster has changed. - for _,_cluster in pairs(self.Clusters) do - local cluster=_cluster --#INTEL.Cluster - - local coordinate=self:GetClusterCoordinate(cluster) - - - -- Update F10 marker. - self:UpdateClusterMarker(cluster) - end + if self.clustermarkers then --honor markersettings + for _,_cluster in pairs(self.Clusters) do + local cluster=_cluster --#INTEL.Cluster + local coordinate=self:GetClusterCoordinate(cluster) + + + -- Update F10 marker. + self:UpdateClusterMarker(cluster) + end + end end --- Create a new cluster. From 832abd7860de118666e8d1fc4e44a12fe048b453 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Tue, 23 Feb 2021 10:34:55 +0100 Subject: [PATCH 07/15] Error in NewFromLLDD - altitude isn't set if given Thanks to tomekldc --- Moose Development/Moose/Core/Point.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua index 31669d146..0c722f9af 100644 --- a/Moose Development/Moose/Core/Point.lua +++ b/Moose Development/Moose/Core/Point.lua @@ -355,9 +355,9 @@ do -- COORDINATE -- Adjust height if altitude==nil then - _coord.y=altitude - else _coord.y=self:GetLandHeight() + else + _coord.y=altitude end return _coord From c72c3fd0917a9a764ca205c7a93bf7e8d41e9542 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Wed, 24 Feb 2021 12:55:54 +0100 Subject: [PATCH 08/15] Update Mantis.lua Added a smarter switch-on distance for SHORAD, added user function to set AWACS detection range, change default SAM firing range to 95% --- Moose Development/Moose/Functional/Mantis.lua | 47 ++++++++++++------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index 29b360e74..c4564fb94 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -20,7 +20,7 @@ -- @module Functional.Mantis -- @image Functional.Mantis.jpg --- Date: Jan 2021 +-- Date: Feb 2021 ------------------------------------------------------------------------- --- **MANTIS** class, extends #Core.Base#BASE @@ -54,6 +54,7 @@ -- @field Functional.Shorad#SHORAD Shorad SHORAD Object, if available -- @field #boolean ShoradLink If true, #MANTIS has #SHORAD enabled -- @field #number ShoradTime Timer in seconds, how long #SHORAD will be active after a detection inside of the defense range +-- @field #number ShoradActDistance Distance of an attacker in meters from a Mantis SAM site, on which Shorad will be switched on. Useful to not give away Shorad sites too early. Default 15km. Should be smaller than checkradius. -- @extends Core.Base#BASE @@ -127,7 +128,7 @@ -- * grouping = 5000 (meters) - Detection (EWR) will group enemy flights to areas of 5km for tracking - `MANTIS:SetEWRGrouping(radius)` -- * acceptrange = 80000 (meters) - Detection (EWR) will on consider flights inside a 80km radius - `MANTIS:SetEWRRange(radius)` -- * detectinterval = 30 (seconds) - MANTIS will decide every 30 seconds which SAM to activate - `MANTIS:SetDetectInterval(interval)` --- * engagerange = 75 (percent) - SAMs will only fire if flights are inside of a 75% radius of their max firerange - `MANTIS:SetSAMRange(range)` +-- * engagerange = 85 (percent) - SAMs will only fire if flights are inside of a 85% radius of their max firerange - `MANTIS:SetSAMRange(range)` -- * dynamic = false - Group filtering is set to once, i.e. newly added groups will not be part of the setup by default - `MANTIS:New(name,samprefix,ewrprefix,hq,coaltion,dynamic)` -- * autorelocate = false - HQ and (mobile) EWR system will not relocate in random intervals between 30mins and 1 hour - `MANTIS:SetAutoRelocate(hq, ewr)` -- * debug = false - Debugging reports on screen are set to off - `MANTIS:Debug(onoff)` @@ -187,7 +188,8 @@ MANTIS = { awacsrange = 250000, Shorad = nil, ShoradLink = false, - ShoradTime = 600, + ShoradTime = 600, + ShoradActDistance = 15000, } ----------------------------------------------------------------------- @@ -253,19 +255,20 @@ do self.verbose = false self.Adv_EWR_Group = nil self.AWACS_Prefix = awacs or nil - self.awacsrange = 250000 --TODO: 250km, User Function to change + self.awacsrange = 250000 --DONE: 250km, User Function to change self.Shorad = nil self.ShoradLink = false - self.ShoradTime = 600 + self.ShoradTime = 600 + self.ShoradActDistance = 15000 + if type(awacs) == "string" then self.advAwacs = true else self.advAwacs = false end - -- @field #string version - self.version="0.3.6" - env.info(string.format("***** Starting MANTIS Version %s *****", self.version)) + -- Inherit everything from BASE class. + local self = BASE:Inherit(self, BASE:New()) -- #MANTIS -- Set the string id for output to DCS.log file. self.lid=string.format("MANTIS %s | ", self.name) @@ -294,8 +297,10 @@ do if self.HQ_Template_CC then self.HQ_CC = GROUP:FindByName(self.HQ_Template_CC) end - -- Inherit everything from BASE class. - local self = BASE:Inherit(self, BASE:New()) -- #MANTIS + + -- @field #string version + self.version="0.3.7" + self:I(string.format("***** Starting MANTIS Version %s *****", self.version)) return self end @@ -397,6 +402,14 @@ do end end end + + --- Function to set AWACS detection range. Defaults to 250.000m (250km) - use **before** starting your Mantis! + -- @param #MANTIS self + -- @param #number range Detection range of the AWACS group + function MANTIS:SetAwacsRange(range) + local range = range or 250000 + self.awacsrange = range + end --- Function to set the HQ object for further use -- @param #MANTIS self @@ -587,6 +600,7 @@ do -- @param #table dectset Table of coordinates of detected items -- @param samcoordinate Core.Point#COORDINATE Coordinate object. -- @return #boolean True if in any zone, else false + -- @return #number Distance Target distance in meters or zero when no object is in zone function MANTIS:CheckObjectInZone(dectset, samcoordinate) self:F(self.lid.."CheckObjectInZone Called") -- check if non of the coordinate is in the given defense zone @@ -603,10 +617,10 @@ do if self.verbose then env.info(self.lid..text) end -- end output to cross-check if targetdistance <= radius then - return true + return true, targetdistance end end - return false + return false, 0 end --- (Internal) Function to start the detection via EWR groups @@ -676,7 +690,7 @@ do -- @param #MANTIS self -- @return #MANTIS self function MANTIS:SetSAMStartState() - -- TODO: if using dynamic filtering, update SAM_Table and the (active) SEAD groups, pull req #1405/#1406 + -- DONE: if using dynamic filtering, update SAM_Table and the (active) SEAD groups, pull req #1405/#1406 self:F(self.lid.."Setting SAM Start States") -- get SAM Group local SAM_SET = self.SAM_Group @@ -787,13 +801,14 @@ do local samcoordinate = _data[2] local name = _data[1] local samgroup = GROUP:FindByName(name) - if self:CheckObjectInZone(detset, samcoordinate) then --check any target in zone + local IsInZone, Distance = self:CheckObjectInZone(detset, samcoordinate) + if IsInZone then --check any target in zone if samgroup:IsAlive() then -- switch off SAM samgroup:OptionAlarmStateRed() -- link in to SHORAD if available - -- TODO Test integration fully - if self.ShoradLink then + -- DONE: Test integration fully + if self.ShoradLink and Distance < self.ShoradActDistance then -- don't give SHORAD position away too early local Shorad = self.Shorad local radius = self.checkradius local ontime = self.ShoradTime From cdd829e7bea070818abb57525675bc21041ed174 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Wed, 24 Feb 2021 16:16:28 +0100 Subject: [PATCH 09/15] Update AirWing.lua Ensure correct type of tanker is going on mission --- Moose Development/Moose/Ops/AirWing.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/AirWing.lua b/Moose Development/Moose/Ops/AirWing.lua index 8ffd7e6bf..2f3870403 100644 --- a/Moose Development/Moose/Ops/AirWing.lua +++ b/Moose Development/Moose/Ops/AirWing.lua @@ -966,7 +966,7 @@ function AIRWING:CheckTANKER() local altitude=patrol.altitude+1000*patrol.noccupied - local mission=AUFTRAG:NewTANKER(patrol.coord, altitude, patrol.speed, patrol.heading, patrol.leg, 0) + local mission=AUFTRAG:NewTANKER(patrol.coord, altitude, patrol.speed, patrol.heading, patrol.leg, 1) mission.patroldata=patrol @@ -984,7 +984,7 @@ function AIRWING:CheckTANKER() local altitude=patrol.altitude+1000*patrol.noccupied - local mission=AUFTRAG:NewTANKER(patrol.coord, altitude, patrol.speed, patrol.heading, patrol.leg, 1) + local mission=AUFTRAG:NewTANKER(patrol.coord, altitude, patrol.speed, patrol.heading, patrol.leg, 0) mission.patroldata=patrol From 7751d4ee8801115ad6ddcb6175e205582725a464 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Wed, 24 Feb 2021 16:22:13 +0100 Subject: [PATCH 10/15] Update Intelligence.lua Added function to set verbosity --- Moose Development/Moose/Ops/Intelligence.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Moose Development/Moose/Ops/Intelligence.lua b/Moose Development/Moose/Ops/Intelligence.lua index fec438144..3c6993761 100644 --- a/Moose Development/Moose/Ops/Intelligence.lua +++ b/Moose Development/Moose/Ops/Intelligence.lua @@ -351,6 +351,15 @@ function INTEL:SetClusterAnalysis(Switch, Markers) return self end +--- Set verbosity level for debugging. +-- @param #INTEL self +-- @param #number Verbosity The higher, the noisier, e.g. 0=off, 2=debug +-- @return #INTEL self +function INTEL:SetVerbosity(Verbosity) + self.verbose=Verbosity or 2 + return self +end + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Start & Status ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- From a6faadea488bde47cb51a6dc852b97411635688b Mon Sep 17 00:00:00 2001 From: madmoney99 Date: Thu, 25 Feb 2021 12:52:50 -0800 Subject: [PATCH 11/15] T-45C Goshawk Parameters Addition of parameters for the VNAO T-45C Goshawk. --- Moose Development/Moose/Ops/Airboss.lua | 41 ++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index 07ee32445..6748709ef 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -1271,6 +1271,7 @@ AIRBOSS.AircraftCarrier={ F14B="F-14B", F14A_AI="F-14A", FA18C="F/A-18C", + T45C="T-45", S3B="S-3B", S3BTANKER="S-3B Tanker", E2D="E-2C", @@ -5471,6 +5472,7 @@ function AIRBOSS:_GetAircraftAoA(playerData) -- Get AC type. local hornet=playerData.actype==AIRBOSS.AircraftCarrier.HORNET + local goshawk=playerData.actype==AIRBOSS.AircraftCarrier.T45C local skyhawk=playerData.actype==AIRBOSS.AircraftCarrier.A4EC local harrier=playerData.actype==AIRBOSS.AircraftCarrier.AV8B local tomcat=playerData.actype==AIRBOSS.AircraftCarrier.F14A or playerData.actype==AIRBOSS.AircraftCarrier.F14B @@ -5497,6 +5499,15 @@ function AIRBOSS:_GetAircraftAoA(playerData) aoa.OnSpeedMin = self:_AoAUnit2Deg(playerData, 14.5) --14.17 --14.5 units aoa.Fast = self:_AoAUnit2Deg(playerData, 14.0) --13.33 --14.0 units aoa.FAST = self:_AoAUnit2Deg(playerData, 13.0) --11.67 --13.0 units + elseif goshawk then + -- T-45C Goshawk parameters. + aoa.SLOW = 8.00 --19 + aoa.Slow = 7.75 --18 + aoa.OnSpeedMax = 7.25 --17.5 + aoa.OnSpeed = 7.00 --17 + aoa.OnSpeedMin = 6.75 --16.5 + aoa.Fast = 6.25 --16 + aoa.FAST = 6.00 --15 elseif skyhawk then -- A-4E-C Skyhawk parameters from https://forums.eagle.ru/showpost.php?p=3703467&postcount=390 -- Note that these are arbitrary UNITS and not degrees. We need a conversion formula! @@ -5681,6 +5692,9 @@ function AIRBOSS:_GetAircraftParameters(playerData, step) elseif skyhawk then alt=UTILS.FeetToMeters(600) speed=UTILS.KnotsToMps(250) + elseif goshawk then + alt=UTILS.FeetToMeters(800) + speed=UTILS.KnotsToMps(300) end elseif step==AIRBOSS.PatternStep.BREAKENTRY then @@ -5691,11 +5705,14 @@ function AIRBOSS:_GetAircraftParameters(playerData, step) elseif skyhawk then alt=UTILS.FeetToMeters(600) speed=UTILS.KnotsToMps(250) + elseif goshawk then + alt=UTILS.FeetToMeters(800) + speed=UTILS.KnotsToMps(300) end elseif step==AIRBOSS.PatternStep.EARLYBREAK then - if hornet or tomcat or harrier then + if hornet or tomcat or harrier or goshawk then alt=UTILS.FeetToMeters(800) elseif skyhawk then alt=UTILS.FeetToMeters(600) @@ -5703,7 +5720,7 @@ function AIRBOSS:_GetAircraftParameters(playerData, step) elseif step==AIRBOSS.PatternStep.LATEBREAK then - if hornet or tomcat or harrier then + if hornet or tomcat or harrier or goshawk then alt=UTILS.FeetToMeters(800) elseif skyhawk then alt=UTILS.FeetToMeters(600) @@ -5711,7 +5728,7 @@ function AIRBOSS:_GetAircraftParameters(playerData, step) elseif step==AIRBOSS.PatternStep.ABEAM then - if hornet or tomcat or harrier then + if hornet or tomcat or harrier or goshawk then alt=UTILS.FeetToMeters(600) elseif skyhawk then alt=UTILS.FeetToMeters(500) @@ -5725,11 +5742,20 @@ function AIRBOSS:_GetAircraftParameters(playerData, step) else dist=UTILS.NMToMeters(1.2) end + + if goshawk then + -- 0.9 to 1.1 NM per natops ch.4 page 48 + dist=UTILS.NMToMeters(0.9) + else + dist=UTILS.NMToMeters(1.1) + end elseif step==AIRBOSS.PatternStep.NINETY then if hornet or tomcat then alt=UTILS.FeetToMeters(500) + elseif goshawk then + alt=UTILS.FeetToMeters(450) elseif skyhawk then alt=UTILS.FeetToMeters(500) elseif harrier then @@ -5740,7 +5766,7 @@ function AIRBOSS:_GetAircraftParameters(playerData, step) elseif step==AIRBOSS.PatternStep.WAKE then - if hornet then + if hornet or goshawk then alt=UTILS.FeetToMeters(370) elseif tomcat then alt=UTILS.FeetToMeters(430) -- Tomcat should be a bit higher as it intercepts the GS a bit higher. @@ -5753,7 +5779,7 @@ function AIRBOSS:_GetAircraftParameters(playerData, step) elseif step==AIRBOSS.PatternStep.FINAL then - if hornet then + if hornet or goshawk then alt=UTILS.FeetToMeters(300) elseif tomcat then alt=UTILS.FeetToMeters(360) @@ -10491,6 +10517,9 @@ function AIRBOSS:_Trapped(playerData) elseif playerData.actype==AIRBOSS.AircraftCarrier.A4EC then -- A-4E gets slowed down much faster the the F/A-18C! dcorr=56 + elseif playerData.actype==AIRBOSS.AircraftCarrier.T45C then + -- T-45 also gets slowed down much faster the the F/A-18C. + dcorr=56 end -- Get wire. @@ -14080,6 +14109,8 @@ function AIRBOSS:_GetACNickname(actype) local nickname="unknown" if actype==AIRBOSS.AircraftCarrier.A4EC then nickname="Skyhawk" + elseif actype==AIRBOSS.AircraftCarrier.T45C then + nickname="Goshawk" elseif actype==AIRBOSS.AircraftCarrier.AV8B then nickname="Harrier" elseif actype==AIRBOSS.AircraftCarrier.E2D then From 884ea866e2d115f39d67670114d1b6ac76b92899 Mon Sep 17 00:00:00 2001 From: Frank Date: Sun, 28 Feb 2021 23:25:32 +0100 Subject: [PATCH 12/15] AIRBOSS v1.1.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adjusted and (hopefully improved) parameters. - Angled deck 9.0° --> 9.1359° (from DCS config file) USS Stennis: - Deck height 19.00 --> 19.06 meters (from DCS config file) Supercarriers: - Deck height 20.0 -->20.1394 meters (from DCS config file) - stern coordinate 1.0 meters more on starboard side (LUR calls). --- Moose Development/Moose/Ops/Airboss.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index 418962fc8..d8e631019 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -1705,7 +1705,7 @@ AIRBOSS.MenuF10Root=nil --- Airboss class version. -- @field #string version -AIRBOSS.version="1.1.5" +AIRBOSS.version="1.1.6" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -4160,7 +4160,7 @@ function AIRBOSS:_InitStennis() -- Carrier Parameters. self.carrierparam.sterndist =-153 - self.carrierparam.deckheight = 19 + self.carrierparam.deckheight = 19.06 -- Total size of the carrier (approx as rectangle). self.carrierparam.totlength=310 -- Wiki says 332.8 meters overall length. @@ -4168,7 +4168,7 @@ function AIRBOSS:_InitStennis() self.carrierparam.totwidthstarboard=30 -- Landing runway. - self.carrierparam.rwyangle = -9 + self.carrierparam.rwyangle = -9.1359 self.carrierparam.rwylength = 225 self.carrierparam.rwywidth = 20 @@ -4311,7 +4311,7 @@ function AIRBOSS:_InitNimitz() -- Carrier Parameters. self.carrierparam.sterndist =-164 - self.carrierparam.deckheight = 20 + self.carrierparam.deckheight = 20.1494 --DCS World OpenBeta\CoreMods\tech\USS_Nimitz\Database\USS_CVN_7X.lua -- Total size of the carrier (approx as rectangle). self.carrierparam.totlength=332.8 -- Wiki says 332.8 meters overall length. @@ -4319,7 +4319,7 @@ function AIRBOSS:_InitNimitz() self.carrierparam.totwidthstarboard=35 -- Landing runway. - self.carrierparam.rwyangle = -9 + self.carrierparam.rwyangle = -9.1359 --DCS World OpenBeta\CoreMods\tech\USS_Nimitz\scripts\USS_Nimitz_RunwaysAndRoutes.lua self.carrierparam.rwylength = 250 self.carrierparam.rwywidth = 25 @@ -10341,7 +10341,7 @@ function AIRBOSS:_GetSternCoord() stern=stern:Translate(self.carrierparam.sterndist, hdg):Translate(7, FB+90) else -- Nimitz SC: translate 8 meters starboard wrt Final bearing. - stern=stern:Translate(self.carrierparam.sterndist, hdg):Translate(8.5, FB+90) + stern=stern:Translate(self.carrierparam.sterndist, hdg):Translate(9.5, FB+90) end -- Set altitude. From 1df7a12587bfcfbbb3a61a29a6937fd0cfbeb712 Mon Sep 17 00:00:00 2001 From: Applevangelist <72444570+Applevangelist@users.noreply.github.com> Date: Tue, 2 Mar 2021 14:28:37 +0100 Subject: [PATCH 13/15] Update Intelligence.lua Finalized Cluster functions, added bits and bobs --- Moose Development/Moose/Ops/Intelligence.lua | 227 ++++++++++++++++--- 1 file changed, 191 insertions(+), 36 deletions(-) diff --git a/Moose Development/Moose/Ops/Intelligence.lua b/Moose Development/Moose/Ops/Intelligence.lua index 3c6993761..4080b6e32 100644 --- a/Moose Development/Moose/Ops/Intelligence.lua +++ b/Moose Development/Moose/Ops/Intelligence.lua @@ -31,6 +31,7 @@ -- @field #boolean clustermarkers If true, create cluster markers on F10 map. -- @field #number clustercounter Running number of clusters. -- @field #number dTforget Time interval in seconds before a known contact which is not detected any more is forgotten. +-- @field #number clusterradius Radius im kilometers in which groups/units are considered to belong to a cluster -- @extends Core.Fsm#FSM --- Top Secret! @@ -46,7 +47,7 @@ -- @field #INTEL INTEL = { ClassName = "INTEL", - verbose = 2, + verbose = 0, lid = nil, alias = nil, filterCategory = {}, @@ -56,6 +57,7 @@ INTEL = { ContactsUnknown = {}, Clusters = {}, clustercounter = 1, + clusterradius = 15, } --- Detected item info. @@ -74,6 +76,8 @@ INTEL = { -- @field #boolean isship -- @field #boolean ishelo -- @field #boolean isgrund +-- @field Ops.Auftrag#AUFTRAG mission The current Auftrag attached to this contact +-- @field #string recce The name of the recce unit that detected this contact --- Cluster info. -- @type INTEL.Cluster @@ -85,11 +89,12 @@ INTEL = { -- @field #number threatlevelAve Average of threat levels. -- @field Core.Point#COORDINATE coordinate Coordinate of the cluster. -- @field Wrapper.Marker#MARKER marker F10 marker. +-- @field Ops.Auftrag#AUFTRAG mission The current Auftrag attached to this cluster --- INTEL class version. -- @field #string version -INTEL.version="0.1.0" +INTEL.version="0.2.0" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- ToDo list @@ -175,6 +180,8 @@ function INTEL:New(DetectionSet, Coalition, Alias) self:AddTransition("*", "NewContact", "*") -- New contact has been detected. self:AddTransition("*", "LostContact", "*") -- Contact could not be detected any more. + self:AddTransition("*", "NewCluster", "*") -- New cluster has been detected. + self:AddTransition("*", "LostCluster", "*") -- Cluster could not be detected any more. -- Defaults self:SetForgetTime() @@ -210,10 +217,43 @@ function INTEL:New(DetectionSet, Coalition, Alias) -- @function [parent=#INTEL] __Status -- @param #INTEL self -- @param #number delay Delay in seconds. + + --- On After "NewContact" event. + -- @function [parent=#INTEL] OnAfterNewContact + -- @param #INTEL self + -- @param #string From From state. + -- @param #string Event Event. + -- @param #string To To state. + -- @param #INTEL.Contact Contact Detected contact. + + --- On After "LostContact" event. + -- @function [parent=#INTEL] OnAfterLostContact + -- @param #INTEL self + -- @param #string From From state. + -- @param #string Event Event. + -- @param #string To To state. + -- @param #INTEL.Contact Contact Lost contact. + + --- On After "NewCluster" event. + -- @function [parent=#INTEL] OnAfterNewCluster + -- @param #INTEL self + -- @param #string From From state. + -- @param #string Event Event. + -- @param #string To To state. + -- @param #INTEL.Contact Contact Detected contact. + -- @param #INTEL.Cluster Cluster Detected cluster + + --- On After "LostCluster" event. + -- @function [parent=#INTEL] OnAfterLostCluster + -- @param #INTEL self + -- @param #string From From state. + -- @param #string Event Event. + -- @param #string To To state. + -- @param #INTEL.Cluster Cluster Lost cluster + -- @param Ops.Auftrag#AUFTRAG Mission The Auftrag connected with this cluster or nil return self end - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- User functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -307,7 +347,7 @@ function INTEL:SetFilterCategory(Categories) for _,category in pairs(self.filterCategory) do text=text..string.format("%d,", category) end - self:I(self.lid..text) + self:T(self.lid..text) return self end @@ -334,7 +374,7 @@ function INTEL:FilterCategoryGroup(GroupCategories) for _,category in pairs(self.filterCategoryGroup) do text=text..string.format("%d,", category) end - self:I(self.lid..text) + self:T(self.lid..text) return self end @@ -360,6 +400,40 @@ function INTEL:SetVerbosity(Verbosity) return self end +--- Add a Mission (Auftrag) to a contact for tracking. +-- @param #INTEL self +-- @param #INTEL.Contact Contact The contact +-- @param Ops.Auftrag#AUFTRAG Mission The mission connected with this contact +-- @return #INTEL self +function INTEL:AddMissionToContact(Contact, Mission) + if Mission and Contact then + Contact.mission = Mission + end + return self +end + +--- Add a Mission (Auftrag) to a cluster for tracking. +-- @param #INTEL self +-- @param #INTEL.Cluster Cluster The cluster +-- @param Ops.Auftrag#AUFTRAG Mission The mission connected with this cluster +-- @return #INTEL self +function INTEL:AddMissionToCluster(Cluster, Mission) + if Mission and Cluster then + Cluster.mission = Mission + end + return self +end + +--- Change radius of the Clusters +-- @param #INTEL self +-- @param #number radius The radius of the clusters +-- @return #INTEL self +function INTEL:SetClusterRadius(radius) + local radius = radius or 15 + self.clusterradius = radius + return self +end + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Start & Status ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -398,10 +472,11 @@ function INTEL:onafterStatus(From, Event, To) -- Number of total contacts. local Ncontacts=#self.Contacts + local Nclusters=#self.Clusters -- Short info. if self.verbose>=1 then - local text=string.format("Status %s [Agents=%s]: Contacts=%d, New=%d, Lost=%d", fsmstate, self.detectionset:CountAlive(), Ncontacts, #self.ContactsUnknown, #self.ContactsLost) + local text=string.format("Status %s [Agents=%s]: Contacts=%d, Clusters=%d, New=%d, Lost=%d", fsmstate, self.detectionset:CountAlive(), Ncontacts, Nclusters, #self.ContactsUnknown, #self.ContactsLost) self:I(self.lid..text) end @@ -430,7 +505,8 @@ function INTEL:UpdateIntel() -- Set of all detected units. local DetectedUnits={} - + -- Set of which units was detected by which recce + local RecceDetecting = {} -- Loop over all units providing intel. for _,_group in pairs(self.detectionset.Set or {}) do local group=_group --Wrapper.Group#GROUP @@ -441,7 +517,7 @@ function INTEL:UpdateIntel() local recce=_recce --Wrapper.Unit#UNIT -- Get detected units. - self:GetDetectedUnits(recce, DetectedUnits) + self:GetDetectedUnits(recce, DetectedUnits, RecceDetecting) end @@ -498,7 +574,7 @@ function INTEL:UpdateIntel() end end if not keepit then - self:I(self.lid..string.format("Removing unit %s category=%d", unitname, unit:GetCategory())) + self:T(self.lid..string.format("Removing unit %s category=%d", unitname, unit:GetCategory())) table.insert(remove, unitname) end end @@ -511,17 +587,20 @@ function INTEL:UpdateIntel() end -- Create detected groups. - local DetectedGroups={} + local DetectedGroups={} + local RecceGroups={} for unitname,_unit in pairs(DetectedUnits) do local unit=_unit --Wrapper.Unit#UNIT local group=unit:GetGroup() if group then - DetectedGroups[group:GetName()]=group + local groupname = group:GetName() + DetectedGroups[groupname]=group + RecceGroups[groupname]=RecceDetecting[unitname] end end -- Create detected contacts. - self:CreateDetectedItems(DetectedGroups) + self:CreateDetectedItems(DetectedGroups, RecceGroups) -- Paint a picture of the battlefield. if self.clusteranalysis then @@ -537,8 +616,9 @@ end --- Create detected items. -- @param #INTEL self -- @param #table DetectedGroups Table of detected Groups -function INTEL:CreateDetectedItems(DetectedGroups) - +-- @param #table RecceDetecting Table of detecting recce names +function INTEL:CreateDetectedItems(DetectedGroups, RecceDetecting) + self:F({RecceDetecting=RecceDetecting}) -- Current time. local Tnow=timer.getAbsTime() @@ -578,7 +658,8 @@ function INTEL:CreateDetectedItems(DetectedGroups) item.position=group:GetCoordinate() item.velocity=group:GetVelocityVec3() item.speed=group:GetVelocityMPS() - + item.recce=RecceDetecting[groupname] + self:T(string.format("%s group detect by %s/%s", groupname, RecceDetecting[groupname] or "unknonw", item.recce or "unknown")) -- Add contact to table. self:AddContact(item) @@ -611,17 +692,20 @@ end -- If no detection method is given, the detection will use all the available methods by default. -- @param #INTEL self -- @param Wrapper.Unit#UNIT Unit The unit detecting. +-- @param #table DetectedUnits Table of detected units to be filled +-- @param #table RecceDetecting Table of recce per unit to be filled -- @param #boolean DetectVisual (Optional) If *false*, do not include visually detected targets. -- @param #boolean DetectOptical (Optional) If *false*, do not include optically detected targets. -- @param #boolean DetectRadar (Optional) If *false*, do not include targets detected by radar. -- @param #boolean DetectIRST (Optional) If *false*, do not include targets detected by IRST. -- @param #boolean DetectRWR (Optional) If *false*, do not include targets detected by RWR. -- @param #boolean DetectDLINK (Optional) If *false*, do not include targets detected by data link. -function INTEL:GetDetectedUnits(Unit, DetectedUnits, DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK) +function INTEL:GetDetectedUnits(Unit, DetectedUnits, RecceDetecting, DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK) -- Get detected DCS units. local detectedtargets=Unit:GetDetectedTargets(DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK) - + local reccename = Unit:GetName() + for DetectionObjectID, Detection in pairs(detectedtargets or {}) do local DetectedObject=Detection.object -- DCS#Object @@ -634,7 +718,8 @@ function INTEL:GetDetectedUnits(Unit, DetectedUnits, DetectVisual, DetectOptical local unitname=unit:GetName() DetectedUnits[unitname]=unit - + RecceDetecting[unitname]=reccename + self:T(string.format("Unit %s detect by %s", unitname, reccename)) end end end @@ -652,7 +737,7 @@ end -- @param #string To To state. -- @param #INTEL.Contact Contact Detected contact. function INTEL:onafterNewContact(From, Event, To, Contact) - self:I(self.lid..string.format("NEW contact %s", Contact.groupname)) + self:F(self.lid..string.format("NEW contact %s", Contact.groupname)) table.insert(self.ContactsUnknown, Contact) end @@ -663,10 +748,37 @@ end -- @param #string To To state. -- @param #INTEL.Contact Contact Detected contact. function INTEL:onafterLostContact(From, Event, To, Contact) - self:I(self.lid..string.format("LOST contact %s", Contact.groupname)) + self:F(self.lid..string.format("LOST contact %s", Contact.groupname)) table.insert(self.ContactsLost, Contact) end +--- On after "NewCluster" event. +-- @param #INTEL self +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param #INTEL.Contact Contact Detected contact. +-- @param #INTEL.Cluster Cluster Detected cluster +function INTEL:onafterNewCluster(From, Event, To, Contact, Cluster) + self:F(self.lid..string.format("NEW cluster %d size %d with contact %s", Cluster.index, Cluster.size, Contact.groupname)) +end + +--- On after "LostCluster" event. +-- @param #INTEL self +-- @param #string From From state. +-- @param #string Event Event. +-- @param #string To To state. +-- @param #INTEL.Cluster Cluster Lost cluster +-- @param Ops.Auftrag#AUFTRAG Mission The Auftrag connected with this cluster or nil +function INTEL:onafterLostCluster(From, Event, To, Cluster, Mission) + local text = self.lid..string.format("LOST cluster %d", Cluster.index) + if Mission then + local mission=Mission --Ops.Auftrag#AUFTRAG + text=text..string.format(" mission name=%s type=%s target=%s", mission.name, mission.type, mission:GetTargetName() or "unkown") + end + self:T(text) +end + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Misc Functions ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -761,11 +873,27 @@ function INTEL:PaintPicture() self:RemoveContactFromCluster(contact, cluster) end end - + -- clean up cluster table + local ClusterSet = {} + for _i,_cluster in pairs(self.Clusters) do + if (_cluster.size > 0) and (self:ClusterCountUnits(_cluster) > 0) then + table.insert(ClusterSet,_cluster) + else + local mission = _cluster.mission or nil + local marker = _cluster.marker + if marker then + marker:Remove() + end + self:LostCluster(_cluster, mission) + end + end + self.Clusters = ClusterSet + -- update positions + self:_UpdateClusterPositions() for _,_contact in pairs(self.Contacts) do local contact=_contact --#INTEL.Contact - + self:T(string.format("Paint Picture: checking for %s",contact.groupname)) -- Check if this contact is in any cluster. local isincluster=self:CheckContactInClusters(contact) @@ -773,7 +901,7 @@ function INTEL:PaintPicture() local currentcluster=self:GetClusterOfContact(contact) if currentcluster then - + --self:I(string.format("Paint Picture: %s has current cluster",contact.groupname)) --- -- Contact is currently part of a cluster. --- @@ -781,8 +909,8 @@ function INTEL:PaintPicture() -- Check if the contact is still connected to the cluster. local isconnected=self:IsContactConnectedToCluster(contact, currentcluster) - if not isconnected then - + if (not isconnected) and (currentcluster.size > 1) then + --self:I(string.format("Paint Picture: %s has LOST current cluster",contact.groupname)) local cluster=self:IsContactPartOfAnyClusters(contact) if cluster then @@ -791,6 +919,7 @@ function INTEL:PaintPicture() local newcluster=self:CreateCluster(contact.position) self:AddContactToCluster(contact, newcluster) + self:NewCluster(contact, newcluster) end end @@ -801,7 +930,7 @@ function INTEL:PaintPicture() --- -- Contact is not in any cluster yet. --- - + --self:I(string.format("Paint Picture: %s has NO current cluster",contact.groupname)) local cluster=self:IsContactPartOfAnyClusters(contact) if cluster then @@ -810,6 +939,7 @@ function INTEL:PaintPicture() local newcluster=self:CreateCluster(contact.position) self:AddContactToCluster(contact, newcluster) + self:NewCluster(contact, newcluster) end end @@ -819,13 +949,13 @@ function INTEL:PaintPicture() -- Update F10 marker text if cluster has changed. - if self.clustermarkers then --honor markersettings + if self.clustermarkers then for _,_cluster in pairs(self.Clusters) do local cluster=_cluster --#INTEL.Cluster - + local coordinate=self:GetClusterCoordinate(cluster) - - + + -- Update F10 marker. self:UpdateClusterMarker(cluster) end @@ -986,9 +1116,11 @@ function INTEL:IsContactConnectedToCluster(contact, cluster) if Contact.groupname~=contact.groupname then - local dist=Contact.position:Get2DDistance(contact.position) + --local dist=Contact.position:Get2DDistance(contact.position) + local dist=Contact.position:DistanceFromPointVec2(contact.position) - if dist<10*1000 then + local radius = self.clusterradius or 15 + if dist1000 then return true @@ -1083,6 +1216,27 @@ function INTEL:CheckClusterCoordinateChanged(cluster, coordinate) end +--- Update coordinates of the known clusters. +-- @param #INTEL self +function INTEL:_UpdateClusterPositions() + for _,_cluster in pairs (self.Clusters) do + local coord = self:GetClusterCoordinate(_cluster) + _cluster.coordinate = coord + self:T(self.lid..string.format("Cluster size: %s", _cluster.size)) + end +end + +--- Count number of units in cluster +-- @param #INTEL self +-- @param #INTEL.Cluster Cluster The cluster +-- @return #number unitcount +function INTEL:ClusterCountUnits(Cluster) + local unitcount = 0 + for _,_group in pairs (Cluster.Contacts) do -- get Wrapper.GROUP#GROUP _group + unitcount = unitcount + _group.group:CountAliveUnits() + end + return unitcount +end --- Update cluster F10 marker. -- @param #INTEL self @@ -1091,7 +1245,8 @@ end function INTEL:UpdateClusterMarker(cluster) -- Create a marker. - local text=string.format("Cluster #%d. Size %d, TLsum=%d", cluster.index, cluster.size, cluster.threatlevelSum) + local unitcount = self:ClusterCountUnits(cluster) + local text=string.format("Cluster #%d. Size %d, Units %d, TLsum=%d", cluster.index, cluster.size, unitcount, cluster.threatlevelSum) if not cluster.marker then cluster.marker=MARKER:New(cluster.coordinate, text):ToAll() From 3c6089884edfa7af0265d2ec7553e5a7a4d4d9ae Mon Sep 17 00:00:00 2001 From: Frank Date: Tue, 2 Mar 2021 21:19:30 +0100 Subject: [PATCH 14/15] Update Airboss.lua - Added MP wire correction function. --- Moose Development/Moose/Ops/Airboss.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index d8e631019..12370b7a7 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -2641,6 +2641,15 @@ function AIRBOSS:SetRecoveryTurnTime(interval) return self end +--- Set multiplayer environment wire correction. +-- @param #AIRBOSS self +-- @param #number Dcorr Correction distance in meters. Default 8.7 m. +-- @return #AIRBOSS self +function AIRBOSS:SetMPWireCorrection(Dcorr) + self.mpWireCorrection=Dcorr or 8.7 + return self +end + --- Set time interval for updating queues and other stuff. -- @param #AIRBOSS self -- @param #number interval Time interval in seconds. Default 30 sec. @@ -10371,6 +10380,11 @@ function AIRBOSS:_GetWire(Lcoord, dc) -- Corrected landing distance wrt to stern. Landing distance needs to be reduced due to delayed landing event for human players. local d=Ldist-dc + + -- Multiplayer wire correction. + if self.mpWireCorrection then + d=d-self.mpWireCorrection + end -- Shift wires from stern to their correct position. local w1=self.carrierparam.wire1 From 187643f6aeedc9faa0e4be61fa27fd613eeab17d Mon Sep 17 00:00:00 2001 From: madmoney99 Date: Tue, 2 Mar 2021 13:36:54 -0800 Subject: [PATCH 15/15] Groove time additions Changes on screen description of groove times to match NATOPs grading NESA LIG Changes unicorn groove time from 16-18secs to 15-18.99 seconds. No change to grading. Reference GitHub issues 1445 &1446. --- Moose Development/Moose/Ops/Airboss.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index 1ecc528dd..7cdf8a06d 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -39,6 +39,7 @@ -- * [F-14A/B Tomcat](https://forums.eagle.ru/forumdisplay.php?f=395) (Player & AI) -- * [A-4E Skyhawk Community Mod](https://forums.eagle.ru/showthread.php?t=224989) (Player & AI) -- * [AV-8B N/A Harrier](https://forums.eagle.ru/forumdisplay.php?f=555) (Player & AI) [**WIP**] +-- * [T-45C Goshawk (VNAO)(Player & AI)] -- * F/A-18C Hornet (AI) -- * F-14A Tomcat (AI) -- * E-2D Hawkeye (AI) @@ -12044,15 +12045,15 @@ function AIRBOSS:_EvalGrooveTime(playerData) local grade="" if t<9 then - grade="--" - elseif t<12 then - grade="(OK)" - elseif t<22 then - grade="OK" + grade="_NESA_" + elseif t<15 then + grade="NESA" + elseif t<19 then + grade="OK Groove" elseif t<=24 then - grade="(OK)" + grade="(LIG)" else - grade="--" + grade="LIG" end -- The unicorn! @@ -12093,7 +12094,7 @@ function AIRBOSS:_LSOgrade(playerData) -- Groove time 16-18 sec for a unicorn. local Tgroove=playerData.Tgroove - local TgrooveUnicorn=Tgroove and (Tgroove>=16.0 and Tgroove<=18.0) or false + local TgrooveUnicorn=Tgroove and (Tgroove>=15.0 and Tgroove<=18.99) or false local grade local points