diff --git a/Moose Development/Moose/AI/AI_A2A.lua b/Moose Development/Moose/AI/AI_A2A.lua index 02755c943..d38c7c05c 100644 --- a/Moose Development/Moose/AI/AI_A2A.lua +++ b/Moose Development/Moose/AI/AI_A2A.lua @@ -220,6 +220,33 @@ function AI_A2A:New( AIGroup ) -- @param #string Event The Event string. -- @param #string To The To State string. + self:AddTransition( "Patrolling", "Refuel", "Refuelling" ) + + --- Refuel Handler OnBefore for AI_A2A + -- @function [parent=#AI_A2A] OnBeforeRefuel + -- @param #AI_A2A self + -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. + -- @param #string From + -- @param #string Event + -- @param #string To + -- @return #boolean + + --- Refuel Handler OnAfter for AI_A2A + -- @function [parent=#AI_A2A] OnAfterRefuel + -- @param #AI_A2A self + -- @param Wrapper.Controllable#CONTROLLABLE Controllable The Controllable Object managed by the FSM. + -- @param #string From + -- @param #string Event + -- @param #string To + + --- Refuel Trigger for AI_A2A + -- @function [parent=#AI_A2A] Refuel + -- @param #AI_A2A self + + --- Refuel Asynchronous Trigger for AI_A2A + -- @function [parent=#AI_A2A] __Refuel + -- @param #AI_A2A self + -- @param #number Delay self:AddTransition( "*", "Return", "Returning" ) self:AddTransition( "*", "Hold", "Holding" ) @@ -296,6 +323,16 @@ function AI_A2A:SetHomeAirbase( HomeAirbase ) self.HomeAirbase = HomeAirbase end +--- Sets to refuel at the given tanker. +-- @param #AI_A2A self +-- @param Wrapper.Group#GROUP TankerName The group name of the tanker as defined within the Mission Editor or spawned. +-- @return #AI_A2A self +function AI_A2A:SetTanker( TankerName ) + self:F2( { TankerName } ) + + self.TankerName = TankerName +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 @@ -415,16 +452,21 @@ function AI_A2A:onafterStatus() local Fuel = self.Controllable:GetUnit(1):GetFuel() self:F({Fuel=Fuel}) if Fuel < self.PatrolFuelThresholdPercentage then - self:E( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... RTB!" ) - local OldAIControllable = self.Controllable - local AIControllableTemplate = self.Controllable:GetTemplate() - - local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed ) - local TimedOrbitTask = OldAIControllable:TaskControlled( OrbitTask, OldAIControllable:TaskCondition(nil,nil,nil,nil,self.PatrolOutOfFuelOrbitTime,nil ) ) - OldAIControllable:SetTask( TimedOrbitTask, 10 ) - - self:Fuel() - RTB = true + if self.TankerName then + self:E( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... Refuelling at Tanker!" ) + self:Refuel() + else + self:E( self.Controllable:GetName() .. " is out of fuel: " .. Fuel .. " ... RTB!" ) + local OldAIControllable = self.Controllable + local AIControllableTemplate = self.Controllable:GetTemplate() + + local OrbitTask = OldAIControllable:TaskOrbitCircle( math.random( self.PatrolFloorAltitude, self.PatrolCeilingAltitude ), self.PatrolMinSpeed ) + local TimedOrbitTask = OldAIControllable:TaskControlled( OrbitTask, OldAIControllable:TaskCondition(nil,nil,nil,nil,self.PatrolOutOfFuelOrbitTime,nil ) ) + OldAIControllable:SetTask( TimedOrbitTask, 10 ) + + self:Fuel() + RTB = true + end else end @@ -573,6 +615,8 @@ function AI_A2A:onafterHome( AIGroup, From, Event, To ) end + + --- @param #AI_A2A self -- @param Wrapper.Group#GROUP AIGroup function AI_A2A:onafterHold( AIGroup, From, Event, To, HoldTime ) @@ -595,7 +639,69 @@ function AI_A2A:onafterHold( AIGroup, From, Event, To, HoldTime ) end +--- @param Wrapper.Group#GROUP AIGroup +function AI_A2A.Resume( AIGroup ) + AIGroup:E( { "AI_A2A.Resume:", AIGroup:GetName() } ) + if AIGroup:IsAlive() then + local _AI_A2A = AIGroup:GetState( AIGroup, "AI_A2A" ) -- #AI_A2A + _AI_A2A:__RTB( 0.5 ) + --_AI_A2A:Retur() + end + +end + +--- @param #AI_A2A self +-- @param Wrapper.Group#GROUP AIGroup +function AI_A2A:onafterRefuel( AIGroup, From, Event, To ) + self:F( { AIGroup, From, Event, To } ) + + self:E( "Group " .. self.Controllable:GetName() .. " ... Refuelling! ( " .. self:GetState() .. " )" ) + + if AIGroup and AIGroup:IsAlive() then + local Tanker = GROUP:FindByName( self.TankerName ) + if Tanker:IsAlive() and Tanker:IsAirPlane() then + + local RefuelRoute = {} + + --- Calculate the target route point. + + local CurrentCoord = AIGroup:GetCoordinate() + local ToRefuelCoord = Tanker:GetCoordinate() + local ToRefuelSpeed = math.random( self.PatrolMinSpeed, self.PatrolMaxSpeed ) + + --- Create a route point of type air. + local ToRefuelRoutePoint = ToRefuelCoord:RoutePointAir( + self.PatrolAltType, + POINT_VEC3.RoutePointType.TurningPoint, + POINT_VEC3.RoutePointAction.TurningPoint, + ToRefuelSpeed, + true + ) + + self:F( { ToRefuelSpeed = ToRefuelSpeed } ) + + RefuelRoute[#RefuelRoute+1] = ToRefuelRoutePoint + RefuelRoute[#RefuelRoute+1] = ToRefuelRoutePoint + + AIGroup:OptionROEHoldFire() + AIGroup:OptionROTEvadeFire() + + local Tasks = {} + Tasks[#Tasks+1] = AIGroup:TaskRefueling() + Tasks[#Tasks+1] = AIGroup:TaskFunction( 1, 1, self:GetClassName() .. ".Resume" ) + RefuelRoute[#RefuelRoute].task = AIGroup:TaskCombo( Tasks ) + AIGroup:SetState( AIGroup, "AI_A2A", self ) + + --- NOW ROUTE THE GROUP! + AIGroup:SetTask( AIGroup:TaskRoute( RefuelRoute ), 1 ) + + else + self:RTB() + end + end + +end diff --git a/Moose Development/Moose/AI/AI_A2A_Cap.lua b/Moose Development/Moose/AI/AI_A2A_Cap.lua index bd38bd29a..5377ced12 100644 --- a/Moose Development/Moose/AI/AI_A2A_Cap.lua +++ b/Moose Development/Moose/AI/AI_A2A_Cap.lua @@ -493,3 +493,15 @@ function AI_A2A_CAP:OnEventDead( EventData ) end end end + +--- @param Wrapper.Group#GROUP AIGroup +function AI_A2A_CAP.Resume( AIGroup ) + + AIGroup:E( { "AI_A2A_CAP.Resume:", AIGroup:GetName() } ) + if AIGroup:IsAlive() then + local _AI_A2A = AIGroup:GetState( AIGroup, "AI_A2A" ) -- #AI_A2A + _AI_A2A:__Reset( 1 ) + _AI_A2A:__Route( 5 ) + end + +end diff --git a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua index 0be824d76..7519ff960 100644 --- a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua @@ -464,7 +464,7 @@ do -- AI_A2A_DISPATCHER -- -- The **grouping value is set for a Squadron**, and can be **dynamically adjusted** during mission execution, so to adjust the defense flights grouping when the tactical situation changes. -- - -- ### 6.4. Overhead and Balance the effectiveness of the air defenses in case of GCI + -- ### 6.4. Overhead and Balance the effectiveness of the air defenses in case of GCI. -- -- The effectiveness can be set with the **overhead parameter**. This is a number that is used to calculate the amount of Units that dispatching command will allocate to GCI in surplus of detected amount of units. -- The **default value** of the overhead parameter is 1.0, which means **equal balance**. @@ -490,6 +490,14 @@ do -- AI_A2A_DISPATCHER -- -- The **overhead value is set for a Squadron**, and can be **dynamically adjusted** during mission execution, so to adjust the defense overhead when the tactical situation changes. -- + -- ## 6.5. Squadron fuel treshold. + -- + -- When an airplane gets **out of fuel** to a certain %-tage, which is by default **15% (0.15)**, there are two possible actions that can be taken: + -- - The defender will go RTB, and will be replaced with a new defender if possible. + -- - The defender will refuel at a tanker, if a tanker has been specified for the squadron. + -- + -- Use the method @{#AI_A2A_DISPATCHER.SetSquadronFuelThreshold}() to set the **squadron fuel treshold** of spawned airplanes for all squadrons. + -- -- ## 7. Setup a squadron for CAP -- -- ### 7.1. Set the CAP zones @@ -564,6 +572,31 @@ do -- AI_A2A_DISPATCHER -- A2ADispatcher:SetSquadronCap( "Sochi", CAPZoneWest, 4000, 8000, 600, 800, 800, 1200, "BARO" ) -- A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) -- + -- ## 7.3. Squadron tanker to refuel when executing CAP and defender is out of fuel. + -- + -- Instead of sending CAP to RTB when out of fuel, you can let CAP refuel in mid air using a tanker. + -- This greatly increases the efficiency of your CAP operations. + -- + -- In the mission editor, setup a group with task Refuelling. A tanker unit of the correct coalition will be automatically selected. + -- Then, use the method @{#AI_A2A_DISPATCHER.SetDefaultTanker}() to set the default tanker for the refuelling. + -- You can also specify a specific tanker for refuelling for a squadron by using the method @{#AI_A2A_DISPATCHER.SetSquadronTanker}(). + -- + -- When the tanker specified is alive and in the air, the tanker will be used for refuelling. + -- + -- For example, the following setup will create a CAP for squadron "Gelend" with a refuel task for the squadron: + -- + -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\AI_A2A_DISPATCHER-ME_10.JPG) + -- + -- -- Define the CAP + -- A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-30" }, 20 ) + -- A2ADispatcher:SetSquadronCap( "Gelend", ZONE:New( "PatrolZoneGelend" ), 4000, 8000, 600, 800, 1000, 1300 ) + -- A2ADispatcher:SetSquadronCapInterval( "Gelend", 2, 30, 600, 1 ) + -- A2ADispatcher:SetSquadronGci( "Gelend", 900, 1200 ) + -- + -- -- Setup the Refuelling for squadron "Gelend", at tanker (group) "TankerGelend" when the fuel in the tank of the CAP defenders is less than 80%. + -- A2ADispatcher:SetSquadronFuelThreshold( "Gelend", 0.8 ) + -- A2ADispatcher:SetSquadronTanker( "Gelend", "TankerGelend" ) + -- -- ## 8. Setup a squadron for GCI: -- -- The method @{#AI_A2A_DISPATCHER.SetSquadronGci}() defines a GCI execution for a squadron. @@ -665,6 +698,31 @@ 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.7.3. Default tanker for refuelling when executing CAP. + -- + -- Instead of sending CAP to RTB when out of fuel, you can let CAP refuel in mid air using a tanker. + -- This greatly increases the efficiency of your CAP operations. + -- + -- In the mission editor, setup a group with task Refuelling. A tanker unit of the correct coalition will be automatically selected. + -- Then, use the method @{#AI_A2A_DISPATCHER.SetDefaultTanker}() to set the tanker for the dispatcher. + -- Use the method @{#AI_A2A_DISPATCHER.SetDefaultFuelTreshold}() to set the %-tage left in the defender airplane tanks when a refuel action is needed. + -- + -- When the tanker specified is alive and in the air, the tanker will be used for refuelling. + -- + -- For example, the following setup will set the default refuel tanker to "Tanker": + -- + -- ![Banner Image](..\Presentations\AI_A2A_DISPATCHER\AI_A2A_DISPATCHER-ME_11.JPG) + -- + -- -- Define the CAP + -- A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-34" }, 20 ) + -- A2ADispatcher:SetSquadronCap( "Sochi", ZONE:New( "PatrolZone" ), 4000, 8000, 600, 800, 1000, 1300 ) + -- A2ADispatcher:SetSquadronCapInterval("Sochi", 2, 30, 600, 1 ) + -- A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 ) + -- + -- -- Set the default tanker for refuelling to "Tanker", when the default fuel treshold has reached 90% fuel left. + -- A2ADispatcher:SetDefaultFuelThreshold( 0.9 ) + -- A2ADispatcher:SetDefaultTanker( "Tanker" ) + -- -- ## 10.8. Default settings for GCI. -- -- ## 10.8.1. Optimal intercept point calculation. @@ -689,10 +747,11 @@ do -- AI_A2A_DISPATCHER -- ## 10.8.2. Default disengage radius. -- -- The radius to **disengage any target** when the **distance** of the defender to the **home base** is larger than the specified meters. - -- The default disengage radius is **100km** (100000 meters). Note that the disengage radius is applicable to ALL squadrons! + -- The default disengage radius is **300km** (300000 meters). Note that the disengage radius is applicable to ALL squadrons! -- -- Use the method @{#AI_A2A_DISPATCHER.SetDisengageRadius}() to modify the default disengage radius to another distance setting. -- + -- -- ## 11. Q & A: -- -- ### 11.1. Which countries will be selected for each coalition? @@ -777,7 +836,7 @@ do -- AI_A2A_DISPATCHER self:SetEngageRadius() self:SetGciRadius() self:SetIntercept( 300 ) -- A default intercept delay time of 300 seconds. - self:SetDisengageRadius( 100000 ) -- The default disengage radius is 100 km. + self:SetDisengageRadius( 300000 ) -- The default disengage radius is 300 km. self:SetDefaultTakeoff( AI_A2A_DISPATCHER.Takeoff.Air ) self:SetDefaultLanding( AI_A2A_DISPATCHER.Landing.NearAirbase ) @@ -978,7 +1037,7 @@ do -- AI_A2A_DISPATCHER --- 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. + -- @param #number DisengageRadius (Optional, Default = 300000) The radius to disengage a target when too far from the home base. -- @return #AI_A2A_DISPATCHER -- @usage -- @@ -986,11 +1045,11 @@ do -- AI_A2A_DISPATCHER -- Dispatcher:SetDisengageRadius( 50000 ) -- -- -- Set 100km as the disengage radius. - -- Dispatcher:SetDisngageRadius() -- 100000 is the default value. + -- Dispatcher:SetDisngageRadius() -- 300000 is the default value. -- function AI_A2A_DISPATCHER:SetDisengageRadius( DisengageRadius ) - self.DisengageRadius = DisengageRadius + self.DisengageRadius = DisengageRadius or 300000 return self end @@ -1086,27 +1145,6 @@ do -- AI_A2A_DISPATCHER end - --- Set the default fuel treshold when defenders will RTB or Refuel in the air. - -- The fuel treshold is by default set to 15%, which means that an airplane will stay in the air until 15% of its fuel has been consumed. - -- @param #AI_A2A_DISPATCHER self - -- @param #number FuelThreshold A decimal number between 0 and 1, that expresses the %-tage of the treshold of fuel remaining in the tank when the plane will go RTB or Refuel. - -- @return #AI_A2A_DISPATCHER - -- @usage - -- - -- -- Now Setup the A2A dispatcher, and initialize it using the Detection object. - -- A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) - -- - -- -- Now Setup the default fuel treshold. - -- A2ADispatcher:SetDefaultRefuelThreshold( 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank. - -- - function AI_A2A_DISPATCHER:SetDefaultFuelThreshold( FuelThreshold ) - - self.DefenderDefault.FuelThreshold = FuelThreshold - - return self - end - - --- Set the default damage treshold when defenders will RTB. -- The default damage treshold is by default set to 40%, which means that when the airplane is 40% damaged, it will go RTB. -- @param #AI_A2A_DISPATCHER self @@ -2171,6 +2209,96 @@ do -- AI_A2A_DISPATCHER return self end + --- Set the default fuel treshold when defenders will RTB or Refuel in the air. + -- The fuel treshold is by default set to 15%, which means that an airplane will stay in the air until 15% of its fuel has been consumed. + -- @param #AI_A2A_DISPATCHER self + -- @param #number FuelThreshold A decimal number between 0 and 1, that expresses the %-tage of the treshold of fuel remaining in the tank when the plane will go RTB or Refuel. + -- @return #AI_A2A_DISPATCHER + -- @usage + -- + -- -- Now Setup the A2A dispatcher, and initialize it using the Detection object. + -- A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + -- + -- -- Now Setup the default fuel treshold. + -- A2ADispatcher:SetDefaultRefuelThreshold( 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank. + -- + function AI_A2A_DISPATCHER:SetDefaultFuelThreshold( FuelThreshold ) + + self.DefenderDefault.FuelThreshold = FuelThreshold + + return self + end + + + --- Set the fuel treshold for the squadron when defenders will RTB or Refuel in the air. + -- The fuel treshold is by default set to 15%, which means that an airplane will stay in the air until 15% of its fuel has been consumed. + -- @param #AI_A2A_DISPATCHER self + -- @param #string SquadronName The name of the squadron. + -- @param #number FuelThreshold A decimal number between 0 and 1, that expresses the %-tage of the treshold of fuel remaining in the tank when the plane will go RTB or Refuel. + -- @return #AI_A2A_DISPATCHER + -- @usage + -- + -- -- Now Setup the A2A dispatcher, and initialize it using the Detection object. + -- A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + -- + -- -- Now Setup the default fuel treshold. + -- A2ADispatcher:SetSquadronRefuelThreshold( "SquadronName", 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank. + -- + function AI_A2A_DISPATCHER:SetSquadronFuelThreshold( SquadronName, FuelThreshold ) + + local DefenderSquadron = self:GetSquadron( SquadronName ) + DefenderSquadron.FuelThreshold = FuelThreshold + + return self + end + + --- Set the default tanker where defenders will Refuel in the air. + -- @param #AI_A2A_DISPATCHER self + -- @param #strig TankerName A string defining the group name of the Tanker as defined within the Mission Editor. + -- @return #AI_A2A_DISPATCHER + -- @usage + -- + -- -- Now Setup the A2A dispatcher, and initialize it using the Detection object. + -- A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + -- + -- -- Now Setup the default fuel treshold. + -- A2ADispatcher:SetDefaultRefuelThreshold( 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank. + -- + -- -- Now Setup the default tanker. + -- A2ADispatcher:SetDefaultTanker( "Tanker" ) -- The group name of the tanker is "Tanker" in the Mission Editor. + function AI_A2A_DISPATCHER:SetDefaultTanker( TankerName ) + + self.DefenderDefault.TankerName = TankerName + + return self + end + + + --- Set the squadron tanker where defenders will Refuel in the air. + -- @param #AI_A2A_DISPATCHER self + -- @param #string SquadronName The name of the squadron. + -- @param #strig TankerName A string defining the group name of the Tanker as defined within the Mission Editor. + -- @return #AI_A2A_DISPATCHER + -- @usage + -- + -- -- Now Setup the A2A dispatcher, and initialize it using the Detection object. + -- A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) + -- + -- -- Now Setup the squadron fuel treshold. + -- A2ADispatcher:SetSquadronRefuelThreshold( "SquadronName", 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank. + -- + -- -- Now Setup the squadron tanker. + -- A2ADispatcher:SetSquadronTanker( "SquadronName", "Tanker" ) -- The group name of the tanker is "Tanker" in the Mission Editor. + function AI_A2A_DISPATCHER:SetSquadronTanker( SquadronName, TankerName ) + + local DefenderSquadron = self:GetSquadron( SquadronName ) + DefenderSquadron.TankerName = TankerName + + return self + end + + + --- @param #AI_A2A_DISPATCHER self function AI_A2A_DISPATCHER:AddDefenderToSquadron( Squadron, Defender, Size ) @@ -2236,7 +2364,7 @@ do -- AI_A2A_DISPATCHER if AIGroup:IsAlive() then -- Check if the CAP is patrolling or engaging. If not, this is not a valid CAP, even if it is alive! -- The CAP could be damaged, lost control, or out of fuel! - if DefenderTask.Fsm:Is( "Patrolling" ) or DefenderTask.Fsm:Is( "Engaging" ) then + if DefenderTask.Fsm:Is( "Patrolling" ) or DefenderTask.Fsm:Is( "Engaging" ) or DefenderTask.Fsm:Is( "Refuelling" )then CapCount = CapCount + 1 end end @@ -2341,9 +2469,10 @@ do -- AI_A2A_DISPATCHER local Fsm = AI_A2A_CAP:New( DefenderCAP, Cap.Zone, Cap.FloorAltitude, Cap.CeilingAltitude, Cap.PatrolMinSpeed, Cap.PatrolMaxSpeed, Cap.EngageMinSpeed, Cap.EngageMaxSpeed, Cap.AltType ) Fsm:SetDispatcher( self ) Fsm:SetHomeAirbase( DefenderSquadron.Airbase ) - Fsm:SetFuelThreshold( self.DefenderDefault.FuelThreshold, 60 ) + Fsm:SetFuelThreshold( DefenderSquadron.FuelThreshold or self.DefenderDefault.FuelThreshold, 60 ) Fsm:SetDamageThreshold( self.DefenderDefault.DamageThreshold ) Fsm:SetDisengageRadius( self.DisengageRadius ) + Fsm:SetTanker( DefenderSquadron.TankerName or self.DefenderDefault.TankerName ) Fsm:Start() Fsm:__Patrol( 2 ) @@ -2493,7 +2622,7 @@ do -- AI_A2A_DISPATCHER local Fsm = AI_A2A_GCI:New( DefenderGCI, Gci.EngageMinSpeed, Gci.EngageMaxSpeed ) Fsm:SetDispatcher( self ) Fsm:SetHomeAirbase( DefenderSquadron.Airbase ) - Fsm:SetFuelThreshold( self.DefenderDefault.FuelThreshold, 60 ) + Fsm:SetFuelThreshold( DefenderSquadron.FuelThreshold or self.DefenderDefault.FuelThreshold, 60 ) Fsm:SetDamageThreshold( self.DefenderDefault.DamageThreshold ) Fsm:SetDisengageRadius( self.DisengageRadius ) Fsm:Start() diff --git a/Moose Development/Moose/AI/AI_A2A_Patrol.lua b/Moose Development/Moose/AI/AI_A2A_Patrol.lua index 60d0aee64..5bd1e7dbc 100644 --- a/Moose Development/Moose/AI/AI_A2A_Patrol.lua +++ b/Moose Development/Moose/AI/AI_A2A_Patrol.lua @@ -179,7 +179,7 @@ function AI_A2A_PATROL:New( AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeil -- defafult PatrolAltType to "RADIO" if not specified self.PatrolAltType = PatrolAltType or "RADIO" - self:AddTransition( "Started", "Patrol", "Patrolling" ) + self:AddTransition( { "Started", "Refuelling" }, "Patrol", "Patrolling" ) --- OnBefore Transition Handler for Event Patrol. -- @function [parent=#AI_A2A_PATROL] OnBeforePatrol @@ -252,6 +252,8 @@ function AI_A2A_PATROL:New( AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeil -- @param #AI_A2A_PATROL self -- @param #number Delay The delay in seconds. + + self:AddTransition( "*", "Reset", "Patrolling" ) -- FSM_CONTROLLABLE Transition for type #AI_A2A_PATROL. return self @@ -386,3 +388,14 @@ function AI_A2A_PATROL:onafterRoute( AIGroup, From, Event, To ) end +--- @param Wrapper.Group#GROUP AIGroup +function AI_A2A_PATROL.Resume( AIGroup ) + + AIGroup:E( { "AI_A2A_PATROL.Resume:", AIGroup:GetName() } ) + if AIGroup:IsAlive() then + local _AI_A2A = AIGroup:GetState( AIGroup, "AI_A2A" ) -- #AI_A2A + _AI_A2A:__Reset( 1 ) + _AI_A2A:__Route( 5 ) + end + +end diff --git a/docs/Documentation/AI_A2A.html b/docs/Documentation/AI_A2A.html index e6e283b73..a806e13d7 100644 --- a/docs/Documentation/AI_A2A.html +++ b/docs/Documentation/AI_A2A.html @@ -182,6 +182,12 @@ AI_A2A:OnAfterRTB(Controllable, From, Event, To)

OnAfter Transition Handler for Event RTB.

+ + + + AI_A2A:OnAfterRefuel(Controllable, From, Event, To) + +

Refuel Handler OnAfter for AI_A2A

@@ -206,6 +212,12 @@ AI_A2A:OnBeforeRTB(Controllable, From, Event, To)

OnBefore Transition Handler for Event RTB.

+ + + + AI_A2A:OnBeforeRefuel(Controllable, From, Event, To) + +

Refuel Handler OnBefore for AI_A2A

@@ -326,12 +338,30 @@ AI_A2A:RTB()

Synchronous Event Trigger for Event RTB.

+ + + + AI_A2A.RTBHold(AIGroup) + + AI_A2A.RTBRoute(AIGroup) + + + + AI_A2A:Refuel() + +

Refuel Trigger for AI_A2A

+ + + + AI_A2A.Resume(AIGroup) + + @@ -380,6 +410,12 @@ AI_A2A:SetStatusOff()

Set the status checking off.

+ + + + AI_A2A:SetTanker(TankerName) + +

Sets to refuel at the given tanker.

@@ -404,12 +440,24 @@ AI_A2A:Stop()

Synchronous Event Trigger for Event Stop.

+ + + + AI_A2A.TankerName + + AI_A2A:__RTB(Delay)

Asynchronous Event Trigger for Event RTB.

+ + + + AI_A2A:__Refuel(Delay) + +

Refuel Asynchronous Trigger for AI_A2A

@@ -434,6 +482,12 @@ AI_A2A:onafterDead() + + + + AI_A2A:onafterHold(AIGroup, From, Event, To, HoldTime) + + @@ -446,6 +500,12 @@ AI_A2A:onafterRTB(AIGroup, From, Event, To) + + + + AI_A2A:onafterRefuel(AIGroup, From, Event, To) + + @@ -682,6 +742,43 @@ The To State string.

+ +AI_A2A:OnAfterRefuel(Controllable, From, Event, To) + +
+
+ +

Refuel Handler OnAfter for AI_A2A

+ +

Parameters

+ +
+
+
+
+ AI_A2A:OnAfterStart(From, Event, To) @@ -833,6 +930,48 @@ The To State string.

#boolean: Return false to cancel Transition.

+ +
+
+
+ + +AI_A2A:OnBeforeRefuel(Controllable, From, Event, To) + +
+
+ +

Refuel Handler OnBefore for AI_A2A

+ +

Parameters

+ +

Return value

+ +

#boolean:

+ +
@@ -1336,6 +1475,27 @@ Return false to cancel Transition.

+ +AI_A2A.RTBHold(AIGroup) + +
+
+ + + +

Parameter

+ +
+
+
+
+ AI_A2A.RTBRoute(AIGroup) @@ -1344,6 +1504,40 @@ Return false to cancel Transition.

+

Parameter

+ + +
+
+
+ + +AI_A2A:Refuel() + +
+
+ +

Refuel Trigger for AI_A2A

+ +
+
+
+
+ + +AI_A2A.Resume(AIGroup) + +
+
+ + +

Parameter

+
+
+
+ + + +AI_A2A.TankerName + +
+
+ + +
@@ -1669,6 +1904,27 @@ The delay in seconds.

+ +AI_A2A:__Refuel(Delay) + +
+
+ +

Refuel Asynchronous Trigger for AI_A2A

+ +

Parameter

+
    +
  • + +

    #number Delay :

    + +
  • +
+
+
+
+
+ AI_A2A:__Start(Delay) @@ -1742,6 +1998,47 @@ The delay in seconds.

+ +
+
+
+ + +AI_A2A:onafterHold(AIGroup, From, Event, To, HoldTime) + +
+
+ + + +

Parameters

+
    +
  • + +

    Wrapper.Group#GROUP AIGroup :

    + +
  • +
  • + +

    From :

    + +
  • +
  • + +

    Event :

    + +
  • +
  • + +

    To :

    + +
  • +
  • + +

    HoldTime :

    + +
  • +
@@ -1791,6 +2088,42 @@ The delay in seconds.

+

Parameters

+ + +
+
+
+ + +AI_A2A:onafterRefuel(AIGroup, From, Event, To) + +
+
+ + +

Parameters

  • diff --git a/docs/Documentation/AI_A2A_Cap.html b/docs/Documentation/AI_A2A_Cap.html index e16f6b1ec..09d0a09c5 100644 --- a/docs/Documentation/AI_A2A_Cap.html +++ b/docs/Documentation/AI_A2A_Cap.html @@ -312,6 +312,12 @@ and automatically engage any airborne enemies that are within a certain range or AI_A2A_CAP:OnLeaveEngaging(Controllable, From, Event, To)

    OnLeave Transition Handler for State Engaging.

    + + + + AI_A2A_CAP.Resume(AIGroup) + + @@ -499,6 +505,8 @@ Use the method AICap#AI

    Type AI_A2A_Cap

    +

    Type AI_A2A

    +

    Type AI_A2A_CAP

    Field(s)

    @@ -1293,6 +1301,27 @@ Return false to cancel Transition.

    + +AI_A2A_CAP.Resume(AIGroup) + +
    +
    + + + +

    Parameter

    + +
    +
    +
    +
    + AI_A2A_CAP:SetEngageRange(EngageRange) diff --git a/docs/Documentation/AI_A2A_Dispatcher.html b/docs/Documentation/AI_A2A_Dispatcher.html index 96c4b44c2..2fde0002b 100644 --- a/docs/Documentation/AI_A2A_Dispatcher.html +++ b/docs/Documentation/AI_A2A_Dispatcher.html @@ -299,7 +299,7 @@ Per one, two, three, four?

    Type AI_A2A_DISPATCHER

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

    + + + + @@ -752,6 +758,12 @@ Per one, two, three, four?

    + + + + @@ -824,6 +836,12 @@ Per one, two, three, four?

    + + + + @@ -1244,9 +1262,11 @@ targets to be engaged. Depending on the grouping parameter, the spawned flights For example with a group setting of 2, if 3 targets are detected and cannot be engaged by CAP or any airborne flight, a GCI needs to be started, the GCI flights will be grouped as follows: Group 1 of 2 flights and Group 2 of one flight!

    +

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

    +

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

    -

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

    +

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

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

    @@ -1270,8 +1290,18 @@ The overhead must be given as a decimal value with 1 as the neutral value, which

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

    +

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

    +

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

    +

    6.5. Squadron fuel treshold.

    + +

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

    + +

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

    +

    7. Setup a squadron for CAP

    7.1. Set the CAP zones

    @@ -1349,6 +1379,32 @@ Zones can be circles, can be setup in the mission editor using trigger zones, bu A2ADispatcher:SetSquadronCapInterval( "Sochi", 2, 30, 120, 1 ) +

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

    + +

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

    + +

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

    + +

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

    + +

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

    + +

    Banner Image

    + +
     -- Define the CAP
    + A2ADispatcher:SetSquadron( "Gelend", AIRBASE.Caucasus.Gelendzhik, { "SQ CCCP SU-30" }, 20 )
    + A2ADispatcher:SetSquadronCap( "Gelend", ZONE:New( "PatrolZoneGelend" ), 4000, 8000, 600, 800, 1000, 1300 )
    + A2ADispatcher:SetSquadronCapInterval( "Gelend", 2, 30, 600, 1 ) 
    + A2ADispatcher:SetSquadronGci( "Gelend", 900, 1200 )
    +
    + -- Setup the Refuelling for squadron "Gelend", at tanker (group) "TankerGelend" when the fuel in the tank of the CAP defenders is less than 80%.
    + A2ADispatcher:SetSquadronFuelThreshold( "Gelend", 0.8 )
    + A2ADispatcher:SetSquadronTanker( "Gelend", "TankerGelend" )
    +
    +

    8. Setup a squadron for GCI:

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

    @@ -1457,6 +1513,32 @@ 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.7.3. Default tanker for refuelling when executing CAP.

    + +

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

    + +

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

    + +

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

    + +

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

    + +

    Banner Image

    + +
     -- Define the CAP
    + A2ADispatcher:SetSquadron( "Sochi", AIRBASE.Caucasus.Sochi_Adler, { "SQ CCCP SU-34" }, 20 )
    + A2ADispatcher:SetSquadronCap( "Sochi", ZONE:New( "PatrolZone" ), 4000, 8000, 600, 800, 1000, 1300 )
    + A2ADispatcher:SetSquadronCapInterval("Sochi", 2, 30, 600, 1 ) 
    + A2ADispatcher:SetSquadronGci( "Sochi", 900, 1200 )
    +
    + -- Set the default tanker for refuelling to "Tanker", when the default fuel treshold has reached 90% fuel left.
    + A2ADispatcher:SetDefaultFuelThreshold( 0.9 )
    + A2ADispatcher:SetDefaultTanker( "Tanker" )
    +
    +

    10.8. Default settings for GCI.

    10.8.1. Optimal intercept point calculation.

    @@ -1485,10 +1567,11 @@ This time can easily take 2 to 3 minutes, and even then the defenders still need

    10.8.2. Default disengage radius.

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

    +The default disengage radius is 300km (300000 meters). Note that the disengage radius is applicable to ALL squadrons!

    Use the method AIA2ADISPATCHER.SetDisengageRadius() to modify the default disengage radius to another distance setting.

    +

    11. Q & A:

    11.1. Which countries will be selected for each coalition?

    @@ -1813,7 +1896,7 @@ The following parameters were given to the :New method of AIA2AGCICAP,
    -AI_A2A_DISPATCHER:AddDefenderToSquadron(Squadron, Defender) +AI_A2A_DISPATCHER:AddDefenderToSquadron(Squadron, Defender, Size)
    @@ -1831,6 +1914,11 @@ The following parameters were given to the :New method of AIA2AGCICAP,

    Defender :

    + +
  • + +

    Size :

    +
  • @@ -2107,7 +2195,6 @@ DefenderSquadron

    - AI_A2A_DISPATCHER.DisengageRadius @@ -3686,6 +3773,44 @@ From the airbase hot, from the airbase cold, in the air, from the runway.

    + +AI_A2A_DISPATCHER:SetDefaultTanker(TankerName) + +
    +
    + +

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

    + +

    Parameter

    +
      +
    • + +

      #strig TankerName : +A string defining the group name of the Tanker as defined within the Mission Editor.

      + +
    • +
    +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
    +  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )  
    +  
    +  -- Now Setup the default fuel treshold.
    +  A2ADispatcher:SetDefaultRefuelThreshold( 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank.
    +  
    +  -- Now Setup the default tanker.
    +  A2ADispatcher:SetDefaultTanker( "Tanker" ) -- The group name of the tanker is "Tanker" in the Mission Editor.
    + +
    +
    +
    +
    + AI_A2A_DISPATCHER:SetDefenderTask(Defender, Type, Fsm, Target) @@ -3766,7 +3891,7 @@ From the airbase hot, from the airbase cold, in the air, from the runway.

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

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

  • @@ -3781,7 +3906,7 @@ From the airbase hot, from the airbase cold, in the air, from the runway.

    Dispatcher:SetDisengageRadius( 50000 ) -- Set 100km as the disengage radius. - Dispatcher:SetDisngageRadius() -- 100000 is the default value. + Dispatcher:SetDisngageRadius() -- 300000 is the default value. @@ -4164,6 +4289,51 @@ The squadron name.

    + +AI_A2A_DISPATCHER:SetSquadronFuelThreshold(SquadronName, FuelThreshold) + +
    +
    + +

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

    + + +

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

    + +

    Parameters

    +
      +
    • + +

      #string SquadronName : +The name of the squadron.

      + +
    • +
    • + +

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

      + +
    • +
    +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
    +  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )  
    +  
    +  -- Now Setup the default fuel treshold.
    +  A2ADispatcher:SetSquadronRefuelThreshold( "SquadronName", 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank.
    +  
    + +
    +
    +
    +
    + AI_A2A_DISPATCHER:SetSquadronGci(SquadronName, EngageMinSpeed, EngageMaxSpeed) @@ -4673,6 +4843,50 @@ The name of the squadron.

    + +AI_A2A_DISPATCHER:SetSquadronTanker(SquadronName, TankerName) + +
    +
    + +

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

    + +

    Parameters

    +
      +
    • + +

      #string SquadronName : +The name of the squadron.

      + +
    • +
    • + +

      #strig TankerName : +A string defining the group name of the Tanker as defined within the Mission Editor.

      + +
    • +
    +

    Return value

    + +

    #AIA2ADISPATCHER:

    + + +

    Usage:

    +
    
    +  -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
    +  A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )  
    +  
    +  -- Now Setup the squadron fuel treshold.
    +  A2ADispatcher:SetSquadronRefuelThreshold( "SquadronName", 0.30 ) -- Go RTB when only 30% of fuel remaining in the tank.
    +  
    +  -- Now Setup the squadron tanker.
    +  A2ADispatcher:SetSquadronTanker( "SquadronName", "Tanker" ) -- The group name of the tanker is "Tanker" in the Mission Editor.
    + +
    +
    +
    +
    + AI_A2A_DISPATCHER:SetTacticalDisplay(TacticalDisplay) @@ -5115,6 +5329,8 @@ The radius in meters wherein detected airplanes will GCI.

    Type list

    +

    Type strig

    + diff --git a/docs/Documentation/AI_A2A_GCI.html b/docs/Documentation/AI_A2A_GCI.html index c6d4b3b60..e3a59b407 100644 --- a/docs/Documentation/AI_A2A_GCI.html +++ b/docs/Documentation/AI_A2A_GCI.html @@ -204,7 +204,7 @@
    - + @@ -617,19 +617,24 @@ Use the method AICap#AI -AI_A2A_GCI.InterceptRoute(AIControllable) +AI_A2A_GCI.InterceptRoute(AIControllable, AIGroup)
    -

    Parameter

    +

    Parameters

    diff --git a/docs/Documentation/AI_A2A_Patrol.html b/docs/Documentation/AI_A2A_Patrol.html index a386ed968..f05d91c1a 100644 --- a/docs/Documentation/AI_A2A_Patrol.html +++ b/docs/Documentation/AI_A2A_Patrol.html @@ -251,6 +251,12 @@
    + + + + @@ -430,6 +436,8 @@ Use the method AIA2APATROL.Man

    Type AI_A2A_Patrol

    +

    Type AI_A2A

    +

    Type AI_A2A_PATROL

    Field(s)

    @@ -875,6 +883,27 @@ Note that this method is required, as triggers the next route when patrolling fo + +
    +
    +
    + + +AI_A2A_PATROL.Resume(AIGroup) + +
    +
    + + + +

    Parameter

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

    + CARGO_UNIT.CargoCarrier diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html index f59a1a84a..c9238637b 100644 --- a/docs/Documentation/Detection.html +++ b/docs/Documentation/Detection.html @@ -625,6 +625,12 @@ The different values of Unit.Category can be:

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

    + + + + @@ -2630,7 +2642,7 @@ The group to generate the report for.

    - + #number DETECTION_BASE.DetectionInterval @@ -3099,6 +3111,32 @@ The distance.

    + +DETECTION_BASE:GetFriendliesNearIntercept(DetectedItem) + +
    +
    + +

    Returns friendly units nearby the intercept point ...

    + +

    Parameter

    +
      +
    • + +

      DetectedItem :

      + +
    • +
    +

    Return value

    + +

    #map:

    +

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

    + +
    +
    +
    +
    + DETECTION_BASE:GetPlayersNearBy(DetectedItem) @@ -3408,6 +3446,32 @@ trhe if there are friendlies nearby

    + +DETECTION_BASE:IsFriendliesNearIntercept(DetectedItem) + +
    +
    + +

    Returns if there are friendlies nearby the intercept ...

    + +

    Parameter

    +
      +
    • + +

      DetectedItem :

      + +
    • +
    +

    Return value

    + +

    #boolean: +trhe if there are friendlies near the intercept.

    + +
    +
    +
    +
    + DETECTION_BASE:IsPlayersNearBy(DetectedItem) 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 4307c3aaa..be5ce073c 100644 --- a/docs/Documentation/Movement.html +++ b/docs/Documentation/Movement.html @@ -227,6 +227,7 @@ on defined intervals (currently every minute).

    + #number MOVEMENT.AliveUnits @@ -235,6 +236,9 @@ 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 864921e2a..f561df108 100644 --- a/docs/Documentation/Point.html +++ b/docs/Documentation/Point.html @@ -2829,6 +2829,7 @@ The y coordinate.

    + POINT_VEC2.z diff --git a/docs/Documentation/Positionable.html b/docs/Documentation/Positionable.html index 78befb2bf..82d94f58f 100644 --- a/docs/Documentation/Positionable.html +++ b/docs/Documentation/Positionable.html @@ -1838,6 +1838,7 @@ self

    + Core.Spot#SPOT POSITIONABLE.Spot diff --git a/docs/Documentation/Settings.html b/docs/Documentation/Settings.html index 318968720..6836574d8 100644 --- a/docs/Documentation/Settings.html +++ b/docs/Documentation/Settings.html @@ -1142,7 +1142,7 @@ true if metric.

    - + #boolean SETTINGS.Metric diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index 0f27003d1..32fc7e73f 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -822,6 +822,12 @@ and any spaces before and after the resulting name are removed.

    + + + +
    AI_A2A_DISPATCHER:AddDefenderToSquadron(Squadron, Defender)AI_A2A_DISPATCHER:AddDefenderToSquadron(Squadron, Defender, Size) AI_A2A_DISPATCHER:SetDefaultTakeoffInAir()

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

    +
    AI_A2A_DISPATCHER:SetDefaultTanker(TankerName) +

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

    AI_A2A_DISPATCHER:SetSquadronCapInterval(SquadronName, CapLimit, LowInterval, HighInterval, Probability) +
    AI_A2A_DISPATCHER:SetSquadronFuelThreshold(SquadronName, FuelThreshold) +

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

    AI_A2A_DISPATCHER:SetSquadronTakeoffInAir(SquadronName)

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

    +
    AI_A2A_DISPATCHER:SetSquadronTanker(SquadronName, TankerName) +

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

    AI_A2A_GCI.InterceptRoute(AIControllable)AI_A2A_GCI.InterceptRoute(AIControllable, AIGroup) AI_A2A_PATROL.PatrolZone +
    AI_A2A_PATROL.Resume(AIGroup) +
    DETECTION_BASE:GetFriendliesNearBy(DetectedItem)

    Returns friendly units nearby the FAC units ...

    +
    DETECTION_BASE:GetFriendliesNearIntercept(DetectedItem) +

    Returns friendly units nearby the intercept point ...

    DETECTION_BASE:IsFriendliesNearBy(DetectedItem)

    Returns if there are friendlies nearby the FAC units ...

    +
    DETECTION_BASE:IsFriendliesNearIntercept(DetectedItem) +

    Returns if there are friendlies nearby the intercept ...

    SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) +
    SPAWN.uncontrolled +
    @@ -2194,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.

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

- -

Overwrite unit names by default with group name.

-
@@ -2746,9 +2746,6 @@ when nothing was spawned.

- -

By default, no InitLimit

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

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

- #number + SPAWN.SpawnMaxUnitsAlive @@ -3129,7 +3126,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
- #boolean + SPAWN.SpawnUnControlled @@ -3153,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.

@@ -3733,6 +3730,20 @@ True = Continue Scheduler

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

+ #number SPAWNSTATIC.SpawnIndex diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html index cf19dab00..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 @@ -566,6 +566,7 @@ based on the tasking capabilities defined in Task#TA
+ FSM_PROCESS.DeployZone @@ -630,7 +631,7 @@ based on the tasking capabilities defined in Task#TA
- #number + TASK_CARGO.CargoLimit diff --git a/docs/Presentations/AI_A2A_DISPATCHER/AI_A2A_DISPATCHER-ME_10.jpg b/docs/Presentations/AI_A2A_DISPATCHER/AI_A2A_DISPATCHER-ME_10.jpg new file mode 100644 index 000000000..31aaf520d Binary files /dev/null and b/docs/Presentations/AI_A2A_DISPATCHER/AI_A2A_DISPATCHER-ME_10.jpg differ diff --git a/docs/Presentations/AI_A2A_DISPATCHER/AI_A2A_DISPATCHER-ME_11.jpg b/docs/Presentations/AI_A2A_DISPATCHER/AI_A2A_DISPATCHER-ME_11.jpg new file mode 100644 index 000000000..b27640e76 Binary files /dev/null and b/docs/Presentations/AI_A2A_DISPATCHER/AI_A2A_DISPATCHER-ME_11.jpg differ