From 7ed0d7eec3acfd2e55576362e56048c77a408fba Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Tue, 9 May 2023 09:44:41 +0200 Subject: [PATCH] #AI_A2X... * Fixes --- .../Moose/AI/AI_A2A_Dispatcher.lua | 14 +++++++ .../Moose/AI/AI_A2G_Dispatcher.lua | 19 +++++++-- .../Moose/AI/AI_Air_Dispatcher.lua | 2 +- Moose Development/Moose/AI/AI_Escort.lua | 42 +++++++++---------- 4 files changed, 52 insertions(+), 25 deletions(-) diff --git a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua index d0d1a940a..504d39985 100644 --- a/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2A_Dispatcher.lua @@ -1687,6 +1687,20 @@ do -- AI_A2A_DISPATCHER return DefenderSquadron end + + --- Get a resource count from a specific squadron + -- @param #AI_A2A_DISPATCHER self + -- @param #string Squadron Name of the squadron. + -- @return #number Number of airframes available or nil if the squadron does not exist + function AI_A2A_DISPATCHER:QuerySquadron(Squadron) + local Squadron = self:GetSquadron(Squadron) + if Squadron.ResourceCount then + self:T2(string.format("%s = %s",Squadron.Name,Squadron.ResourceCount)) + return Squadron.ResourceCount + end + self:F({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount}) + return nil + end --- [DEPRECATED - Might create problems launching planes] Set the Squadron visible before startup of the dispatcher. -- All planes will be spawned as uncontrolled on the parking spot. diff --git a/Moose Development/Moose/AI/AI_A2G_Dispatcher.lua b/Moose Development/Moose/AI/AI_A2G_Dispatcher.lua index 25ebaf022..cccbdbddc 100644 --- a/Moose Development/Moose/AI/AI_A2G_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_A2G_Dispatcher.lua @@ -1,4 +1,4 @@ ---- **AI** - Create an automated A2G defense system based on a detection network of reconnaissance vehicles and air units, coordinating SEAD, BAI and CAS operations. +--- **AI** - Create an automated A2G defense system with reconnaissance units, coordinating SEAD, BAI and CAS operations. -- -- === -- @@ -951,7 +951,7 @@ do -- AI_A2G_DISPATCHER AI_A2G_DISPATCHER.DefenseQueue = {} --- Defense approach types. - -- @type #AI_A2G_DISPATCHER.DefenseApproach + -- @type AI_A2G_DISPATCHER.DefenseApproach AI_A2G_DISPATCHER.DefenseApproach = { Random = 1, Distance = 2, @@ -1806,6 +1806,19 @@ do -- AI_A2G_DISPATCHER return DefenderSquadron end + --- Get a resource count from a specific squadron + -- @param #AI_A2G_DISPATCHER self + -- @param #string Squadron Name of the squadron. + -- @return #number Number of airframes available or nil if the squadron does not exist + function AI_A2G_DISPATCHER:QuerySquadron(Squadron) + local Squadron = self:GetSquadron(Squadron) + if Squadron.ResourceCount then + self:T2(string.format("%s = %s",Squadron.Name,Squadron.ResourceCount)) + return Squadron.ResourceCount + end + self:F({Squadron = Squadron.Name,SquadronResourceCount = Squadron.ResourceCount}) + return nil + end --- Set the Squadron visible before startup of the dispatcher. -- All planes will be spawned as uncontrolled on the parking spot. @@ -1839,7 +1852,7 @@ do -- AI_A2G_DISPATCHER --- Check if the Squadron is visible before startup of the dispatcher. -- @param #AI_A2G_DISPATCHER self -- @param #string SquadronName The squadron name. - -- @return #bool true if visible. + -- @return #boolean true if visible. -- @usage -- -- -- Set the Squadron visible before startup of dispatcher. diff --git a/Moose Development/Moose/AI/AI_Air_Dispatcher.lua b/Moose Development/Moose/AI/AI_Air_Dispatcher.lua index c63e007d7..d88416696 100644 --- a/Moose Development/Moose/AI/AI_Air_Dispatcher.lua +++ b/Moose Development/Moose/AI/AI_Air_Dispatcher.lua @@ -1852,7 +1852,7 @@ do -- AI_AIR_DISPATCHER --- Check if the Squadron is visible before startup of the dispatcher. -- @param #AI_AIR_DISPATCHER self -- @param #string SquadronName The squadron name. - -- @return #bool true if visible. + -- @return #boolean true if visible. -- @usage -- -- -- Set the Squadron visible before startup of dispatcher. diff --git a/Moose Development/Moose/AI/AI_Escort.lua b/Moose Development/Moose/AI/AI_Escort.lua index 0ca7a05eb..e18948790 100644 --- a/Moose Development/Moose/AI/AI_Escort.lua +++ b/Moose Development/Moose/AI/AI_Escort.lua @@ -443,9 +443,9 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. -- @param #number YSpace The space between groups on the Y-axis in meters for each sequent group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @param #number ZLevels The amount of levels on the Z-axis. -- @return #AI_ESCORT @@ -493,9 +493,9 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. -- @param #number YSpace The space between groups on the Y-axis in meters for each sequent group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @param #number ZLevels The amount of levels on the Z-axis. -- @return #AI_ESCORT @@ -580,7 +580,7 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. -- @return #AI_ESCORT function AI_ESCORT:MenuFormationTrail( XStart, XSpace, YStart ) @@ -594,7 +594,7 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. -- @param #number YSpace The space between groups on the Y-axis in meters for each sequent group. -- @return #AI_ESCORT function AI_ESCORT:MenuFormationStack( XStart, XSpace, YStart, YSpace ) @@ -609,8 +609,8 @@ end -- This menu will appear under **Formation**. -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @return #AI_ESCORT function AI_ESCORT:MenuFormationLeftLine( XStart, YStart, ZStart, ZSpace ) @@ -625,8 +625,8 @@ end -- This menu will appear under **Formation**. -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @return #AI_ESCORT function AI_ESCORT:MenuFormationRightLine( XStart, YStart, ZStart, ZSpace ) @@ -642,8 +642,8 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @return #AI_ESCORT function AI_ESCORT:MenuFormationLeftWing( XStart, XSpace, YStart, ZStart, ZSpace ) @@ -659,8 +659,8 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @return #AI_ESCORT function AI_ESCORT:MenuFormationRightWing( XStart, XSpace, YStart, ZStart, ZSpace ) @@ -676,9 +676,9 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. -- @param #number YSpace The space between groups on the Y-axis in meters for each sequent group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @return #AI_ESCORT function AI_ESCORT:MenuFormationCenterWing( XStart, XSpace, YStart, YSpace, ZStart, ZSpace ) @@ -694,9 +694,9 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. -- @param #number YSpace The space between groups on the Y-axis in meters for each sequent group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @return #AI_ESCORT function AI_ESCORT:MenuFormationVic( XStart, XSpace, YStart, YSpace, ZStart, ZSpace ) @@ -712,9 +712,9 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. -- @param #number YSpace The space between groups on the Y-axis in meters for each sequent group. --- @param #nubmer ZStart The start position on the Z-axis in meters for the first group. +-- @param #number ZStart The start position on the Z-axis in meters for the first group. -- @param #number ZSpace The space between groups on the Z-axis in meters for each sequent group. -- @param #number ZLevels The amount of levels on the Z-axis. -- @return #AI_ESCORT @@ -1471,7 +1471,7 @@ end -- @param #AI_ESCORT self -- @param #number XStart The start position on the X-axis in meters for the first group. -- @param #number XSpace The space between groups on the X-axis in meters for each sequent group. --- @param #nubmer YStart The start position on the Y-axis in meters for the first group. +-- @param #number YStart The start position on the Y-axis in meters for the first group. -- @return #AI_ESCORT function AI_ESCORT:_EscortFormationTrail( EscortGroup, XStart, XSpace, YStart )