From cc7685161461e3e4430a83633e904897c72d4f30 Mon Sep 17 00:00:00 2001 From: smiki Date: Mon, 25 Aug 2025 23:08:25 +0200 Subject: [PATCH 01/30] [ADDED] `ValidateAndRepositionGroundUnits` to UNIT and GROUP respawns --- Moose Development/Moose/Wrapper/Group.lua | 14 ++++++++++++++ Moose Development/Moose/Wrapper/Unit.lua | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 89ff5f7c3..dc6cf3af1 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -2231,6 +2231,10 @@ function GROUP:Respawn( Template, Reset ) --UTILS.PrintTableToLog(Template) + if self.ValidateAndRepositionGroundUnits then + UTILS.ValidateAndRepositionGroundUnits(Template.units) + end + -- Spawn new group. self:ScheduleOnce(0.1,_DATABASE.Spawn,_DATABASE,Template) --_DATABASE:Spawn(Template) @@ -3192,3 +3196,13 @@ function GROUP:IsAAA() end return isAAA end + +--- This function uses Disposition and other fallback logic to find better ground positions for ground units. +--- NOTE: This is not a spawn randomizer. +--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table. +--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. +--- Uses UTILS.ValidateAndRepositionGroundUnits. +-- @param #boolean Enabled Enable/disable the feature. +function GROUP:SetValidateAndRepositionGroundUnits(Enabled) + self.ValidateAndRepositionGroundUnits = Enabled +end diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index d005ebca2..9fd6963a1 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -377,6 +377,10 @@ function UNIT:ReSpawnAt(Coordinate, Heading) --self:T( SpawnGroupTemplate ) + if self.ValidateAndRepositionGroundUnits then + UTILS.ValidateAndRepositionGroundUnits(SpawnGroupTemplate.units) + end + _DATABASE:Spawn(SpawnGroupTemplate) end @@ -1938,3 +1942,13 @@ end function UNIT:SetCarrierIlluminationMode(Mode) UTILS.SetCarrierIlluminationMode(self:GetID(), Mode) end + +--- This function uses Disposition and other fallback logic to find better ground positions for ground units. +--- NOTE: This is not a spawn randomizer. +--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table. +--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. +--- Uses UTILS.ValidateAndRepositionGroundUnits. +-- @param #boolean Enabled Enable/disable the feature. +function UNIT:SetValidateAndRepositionGroundUnits(Enabled) + self.ValidateAndRepositionGroundUnits = Enabled +end From b6d725920a5dfb1c2a55fc3f13128dcd10bdd390 Mon Sep 17 00:00:00 2001 From: smiki Date: Mon, 25 Aug 2025 23:22:00 +0200 Subject: [PATCH 02/30] [ADDED] `ValidateAndRepositionGroundUnits` to OPSGROUP --- Moose Development/Moose/Ops/Legion.lua | 1 + Moose Development/Moose/Ops/OpsGroup.lua | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Moose Development/Moose/Ops/Legion.lua b/Moose Development/Moose/Ops/Legion.lua index b3c00592f..71b1c0f55 100644 --- a/Moose Development/Moose/Ops/Legion.lua +++ b/Moose Development/Moose/Ops/Legion.lua @@ -1823,6 +1823,7 @@ function LEGION:_CreateFlightGroup(asset) --- opsgroup=ARMYGROUP:New(asset.spawngroupname) + opsgroup:SetValidateAndRepositionGroundUnits(self.ValidateAndRepositionGroundUnits) elseif self:IsFleet() then diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index 40dccb84e..02ea215f4 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -7847,6 +7847,10 @@ function OPSGROUP:_Spawn(Delay, Template) -- Debug output. self:T2({Template=Template}) + if self:IsArmygroup() and self.ValidateAndRepositionGroundUnits then + UTILS.ValidateAndRepositionGroundUnits(Template.units) + end + -- Spawn new group. self.group=_DATABASE:Spawn(Template) --local countryID=self.group:GetCountry() @@ -13955,6 +13959,15 @@ function OPSGROUP:_GetDetectedTarget() return targetgroup, targetdist end +--- This function uses Disposition and other fallback logic to find better ground positions for ground units. +--- NOTE: This is not a spawn randomizer. +--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table. +--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. +--- Uses UTILS.ValidateAndRepositionGroundUnits. +-- @param #boolean Enabled Enable/disable the feature. +function OPSGROUP:SetValidateAndRepositionGroundUnits(Enabled) + self.ValidateAndRepositionGroundUnits = Enabled +end ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- From 2479147fd9948ef8bea9dd6e13edd4449261aa75 Mon Sep 17 00:00:00 2001 From: smiki Date: Tue, 26 Aug 2025 13:15:12 +0200 Subject: [PATCH 03/30] [ADDED] `ValidateAndRepositionGroundUnits` to OPSGROUP --- Moose Development/Moose/Ops/OpsGroup.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Moose Development/Moose/Ops/OpsGroup.lua b/Moose Development/Moose/Ops/OpsGroup.lua index 02ea215f4..f23053a18 100644 --- a/Moose Development/Moose/Ops/OpsGroup.lua +++ b/Moose Development/Moose/Ops/OpsGroup.lua @@ -7853,6 +7853,7 @@ function OPSGROUP:_Spawn(Delay, Template) -- Spawn new group. self.group=_DATABASE:Spawn(Template) + self.group:SetValidateAndRepositionGroundUnits(self.ValidateAndRepositionGroundUnits) --local countryID=self.group:GetCountry() --local categoryID=self.group:GetCategory() --local dcsgroup=coalition.addGroup(countryID, categoryID, Template) From db053398d233f37e221bc20bc5d136871e60073c Mon Sep 17 00:00:00 2001 From: TeTeT Nimitz Date: Wed, 27 Aug 2025 13:12:50 +0200 Subject: [PATCH 04/30] Add support for Vietnam War Vessels carriers to Airboss: - CVA-31 Bon Homme Richard - Generic Essex with SCB-125 upgrade (angled Deck) - CVAN-65 Enterprise 1966 - CVN-65 Enterprise modern --- Moose Development/Moose/Ops/Airboss.lua | 65 +++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index c24f6720c..89f6f5b37 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -1317,6 +1317,10 @@ AIRBOSS.AircraftCarrier={ -- @field #string FORRESTAL USS Forrestal (CV-59) [Heatblur Carrier Module] -- @field #string VINSON USS Carl Vinson (CVN-70) [Deprecated!] -- @field #string ESSEX Essex class carrier (e.g. USS Yorktown (CV-10)) [Magnitude 3 Carrier Module] +-- @field #string BONHOMMERICHARD USS Bon Homme Richard carrier [VWV Mod] +-- @field #string ESSEXSCB125 Generic Essex class carrier with angled deck (SCB-125 upgrade) [VWV Mod] +-- @field #string ENTERPRISE66 USS Enterprise in the 1966 configuration [VWV Mod] +-- @field #string ENTERPRISEMODERN USS Enterprise in a modern configuration [Derived VWV Mod] -- @field #string HERMES HMS Hermes (R12) [V/STOL Carrier] -- @field #string INVINCIBLE HMS Invincible (R05) [V/STOL Carrier] -- @field #string TARAWA USS Tarawa (LHA-1) [V/STOL Carrier] @@ -1331,8 +1335,12 @@ AIRBOSS.CarrierType = { TRUMAN = "CVN_75", STENNIS = "Stennis", FORRESTAL = "Forrestal", + ENTERPRISE66 = "USS Enterprise 1966", + ENTERPRISEMODERN = "cvn-65", VINSON = "VINSON", ESSEX = "Essex", + BONHOMMERICHARD = "USS Bon Homme Richard", + ESSEXSCB125 = "essex_scb125", HERMES = "HERMES81", INVINCIBLE = "hms_invincible", TARAWA = "LHA_Tarawa", @@ -2019,11 +2027,19 @@ function AIRBOSS:New( carriername, alias ) self:_InitNimitz() elseif self.carriertype == AIRBOSS.CarrierType.FORRESTAL then self:_InitForrestal() + elseif self.carriertype == AIRBOSS.CarrierType.ENTERPRISE66 then + self:_InitEnterprise() + elseif self.carriertype == AIRBOSS.CarrierType.ENTERPRISEMODERN then + self:_InitEnterprise() elseif self.carriertype == AIRBOSS.CarrierType.VINSON then -- Carl Vinson is legacy now. self:_InitStennis() elseif self.carriertype == AIRBOSS.CarrierType.ESSEX then self:_InitEssex() + elseif self.carriertype == AIRBOSS.CarrierType.BONHOMMERICHARD then + self:_InitBonHommeRichard() + elseif self.carriertype == AIRBOSS.CarrierType.ESSEXSCB125 then + self:_InitEssexSCB125() elseif self.carriertype == AIRBOSS.CarrierType.HERMES then -- Hermes parameters. self:_InitHermes() @@ -4653,6 +4669,26 @@ function AIRBOSS:_InitForrestal() end +--- Init parameters for Enterprise carrier. +-- @param #AIRBOSS self +function AIRBOSS:_InitEnterprise() + -- Using Forrestal as template + self:_InitForrestal() + + self.carrierparam.sterndist = -164.30 + self.carrierparam.deckheight = 19.52 + + self.carrierparam.totlength = 335 + self.carrierparam.rwylength = 223 + + -- Wires. + self.carrierparam.wire1 = 57.7 + self.carrierparam.wire2 = 69.6 + self.carrierparam.wire3 = 79.5 + self.carrierparam.wire4 = 90.0 + +end + --- Init parameters for Essec class carriers. -- @param #AIRBOSS self function AIRBOSS:_InitEssex() @@ -4698,6 +4734,35 @@ function AIRBOSS:_InitEssex() end +--- Init parameters for CVA-31 Bon Homme Richard carriers. +-- @param #AIRBOSS self +function AIRBOSS:_InitBonHommeRichard() + -- Init Essex as default + self:_InitEssex() + + self.carrierparam.deckheight = 16.95 + + -- Landing runway. + -- from BHR EssexRunwayAndRoutes.lua + self.carrierparam.rwyangle = -11.4 + self.carrierparam.rwylength = 97 + self.carrierparam.rwywidth = 20 + + -- Wires. + self.carrierparam.wire1 = 40.4 -- Distance from stern to first wire. Original from Frank - 42 + self.carrierparam.wire2 = 45 + self.carrierparam.wire3 = 51 + self.carrierparam.wire4 = 58.1 +end + +--- Init parameters for Generic Essex SC125 class carriers. +-- @param #AIRBOSS self +function AIRBOSS:_InitEssexSCB125() + -- Init Bon Homme Richard as default + self:_InitBonHommeRichard() + +end + --- Init parameters for R12 HMS Hermes carrier. -- @param #AIRBOSS self function AIRBOSS:_InitHermes() From e590701c01e331d9d972434a304bc59a5ab5be5b Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 28 Aug 2025 11:13:50 +0200 Subject: [PATCH 05/30] xx --- Moose Development/Moose/Ops/Auftrag.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Ops/Auftrag.lua b/Moose Development/Moose/Ops/Auftrag.lua index b4e6128a1..41bac80e0 100644 --- a/Moose Development/Moose/Ops/Auftrag.lua +++ b/Moose Development/Moose/Ops/Auftrag.lua @@ -1321,13 +1321,19 @@ end -- @param #number Altitude Orbit altitude in feet. Default is y component of `Coordinate`. -- @param #number Speed Orbit indicated airspeed in knots at the set altitude ASL. Default 350 KIAS. -- @param #number Heading Heading of race-track pattern in degrees. Default 270 (East to West). --- @param #number Leg Length of race-track in NM. Default 10 NM. +-- @param #number Leg Length of race-track in NM. Default 10 NM. Set to 0 for a simple circular orbit. -- @param #number RefuelSystem Refueling system (0=boom, 1=probe). This info is *only* for AIRWINGs so they launch the right tanker type. -- @return #AUFTRAG self function AUFTRAG:NewTANKER(Coordinate, Altitude, Speed, Heading, Leg, RefuelSystem) - + + local mission + if Leg == 0 then + mission=AUFTRAG:NewORBIT_CIRCLE(Coordinate,Altitude,Speed) + else + mission=AUFTRAG:NewORBIT_RACETRACK(Coordinate,Altitude,Speed,Heading,Leg) + end -- Create ORBIT first. - local mission=AUFTRAG:NewORBIT_RACETRACK(Coordinate, Altitude, Speed, Heading, Leg) + --local mission=AUFTRAG:NewORBIT_RACETRACK(Coordinate, Altitude, Speed, Heading, Leg) -- Mission type TANKER. mission.type=AUFTRAG.Type.TANKER From efb1d79e7739c15898d4ce4bf7cd6088b85540e3 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 28 Aug 2025 13:17:57 +0200 Subject: [PATCH 06/30] #COHORT - Fix Callsign Setting --- Moose Development/Moose/Ops/Cohort.lua | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Ops/Cohort.lua b/Moose Development/Moose/Ops/Cohort.lua index 26f54e66d..c18d838d6 100644 --- a/Moose Development/Moose/Ops/Cohort.lua +++ b/Moose Development/Moose/Ops/Cohort.lua @@ -88,7 +88,7 @@ COHORT = { --- COHORT class version. -- @field #string version -COHORT.version="0.3.6" +COHORT.version="0.3.7" --- Global variable to store the unique(!) cohort names _COHORTNAMES={} @@ -100,6 +100,7 @@ _COHORTNAMES={} -- DONE: Create FLOTILLA class. -- DONE: Added check for properties. -- DONE: Make general so that PLATOON and SQUADRON can inherit this class. +-- DONE: Better setting of call signs. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- Constructor @@ -515,10 +516,12 @@ end -- @param #COHORT self -- @param #number Callsign Callsign from CALLSIGN.Aircraft, e.g. "Chevy" for CALLSIGN.Aircraft.CHEVY. -- @param #number Index Callsign index, Chevy-**1**. +-- @param #string CallsignString (optional) Set this for tasks like TANKER, AWACS or KIOWA and the like, which have special names. E.g. "Darkstar" or "Roughneck". -- @return #COHORT self -function COHORT:SetCallsign(Callsign, Index) +function COHORT:SetCallsign(Callsign, Index, CallsignString) self.callsignName=Callsign self.callsignIndex=Index + self.callsignClearName=CallsignString self.callsign={} self.callsign.NumberSquad=Callsign self.callsign.NumberGroup=Index @@ -679,7 +682,16 @@ end function COHORT:GetCallsign(Asset) if self.callsignName then - + --[[ + ["callsign"] = + { + [2] = 1, + ["name"] = "Darkstar11", + [3] = 1, + [1] = 5, + [4] = "Darkstar11", + }, -- end of ["callsign"] + ]] Asset.callsign={} for i=1,Asset.nunits do @@ -695,12 +707,16 @@ function COHORT:GetCallsign(Asset) else self.callsigncounter=self.callsigncounter+1 end + callsign["name"] = self.callsignClearName or UTILS.GetCallsignName(self.callsignName) or "None" + callsign["name"] = string.format("%s%d%d",callsign["name"],callsign[2],callsign[3]) + callsign[4] = callsign["name"] Asset.callsign[i]=callsign self:T3({callsign=callsign}) - --TODO: there is also a table entry .name, which is a string. + --DONE: there is also a table entry .name, which is a string. + --UTILS.PrintTableToLog(callsign) end From e003b91bbe0b3edf22da430b577d5950f71dc852 Mon Sep 17 00:00:00 2001 From: smiki Date: Thu, 28 Aug 2025 19:36:22 +0200 Subject: [PATCH 07/30] [ADDED] `SPAWNSTATIC:InitValidateAndRepositionStatic(OnOff, MaxRadius)` --- Moose Development/Moose/Core/Spawn.lua | 1 + Moose Development/Moose/Core/SpawnStatic.lua | 22 +++++++++ Moose Development/Moose/Utilities/Utils.lua | 48 ++++++++++++++++++++ Moose Development/Moose/Wrapper/Group.lua | 1 + Moose Development/Moose/Wrapper/Unit.lua | 1 + 5 files changed, 73 insertions(+) diff --git a/Moose Development/Moose/Core/Spawn.lua b/Moose Development/Moose/Core/Spawn.lua index 0d58567a4..f58937439 100644 --- a/Moose Development/Moose/Core/Spawn.lua +++ b/Moose Development/Moose/Core/Spawn.lua @@ -1054,6 +1054,7 @@ end --- NOTE: This is not a spawn randomizer. --- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area. --- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. +-- @param #SPAWN self -- @param #boolean OnOff Enable/disable the feature. -- @param #number MaxRadius (Optional) Max radius to search for valid ground locations in meters. Default is double the max radius of the units. -- @param #number Spacing (Optional) Minimum spacing between units in meters. Default is 5% of the search radius or 5 meters, whichever is larger. diff --git a/Moose Development/Moose/Core/SpawnStatic.lua b/Moose Development/Moose/Core/SpawnStatic.lua index 344d1a5d7..c67d6ed7c 100644 --- a/Moose Development/Moose/Core/SpawnStatic.lua +++ b/Moose Development/Moose/Core/SpawnStatic.lua @@ -378,6 +378,20 @@ function SPAWNSTATIC:InitLinkToUnit(Unit, OffsetX, OffsetY, OffsetAngle) return self end +--- Uses Disposition and other fallback logic to find a better and valid ground spawn position. +--- NOTE: This is not a spawn randomizer. +--- It will try to a find clear ground location avoiding trees, water, roads, runways, map scenery, other statics and other units in the area. +--- Uses the initial position if it's a valid location. +-- @param #SPAWNSTATIC self +-- @param #boolean OnOff Enable/disable the feature. +-- @param #number MaxRadius (Optional) Max radius to search for a valid ground location in meters. Default is 10 times the max radius of the static. +-- @return #SPAWNSTATIC self +function SPAWNSTATIC:InitValidateAndRepositionStatic(OnOff, MaxRadius) + self.SpawnValidateAndRepositionStatic = OnOff + self.ValidateAndRepositionStaticMaxRadius = MaxRadius + return self +end + --- Allows to place a CallFunction hook when a new static spawns. -- The provided method will be called when a new group is spawned, including its given parameters. -- The first parameter of the SpawnFunction is the @{Wrapper.Static#STATIC} that was spawned. @@ -544,6 +558,14 @@ function SPAWNSTATIC:_SpawnStatic(Template, CountryID) -- Add static to the game. local Static=nil --DCS#StaticObject + if self.ValidateAndRepositionStatic then + local validPos = UTILS.ValidateAndRepositionStatic(CountryID, Template.category, Template.type, Template, Template.shape_name, self.ValidateAndRepositionStaticMaxRadius) + if validPos then + Template.x = validPos.x + Template.y = validPos.y + end + end + if self.InitFarp then local TemplateGroup={} diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index cd94f71b2..1a2809b24 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -4981,3 +4981,51 @@ function UTILS.ValidateAndRepositionGroundUnits(Positions, Anchor, MaxRadius, Sp end end end + +--- This function uses Disposition and other fallback logic to find better ground positions for ground units. +--- NOTE: This is not a spawn randomizer. +--- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table. +--- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. +-- @param #table Positions A table of DCS#Vec2 or DCS#Vec3, can be a units table from the group template. +-- @param DCS#Vec2 Position DCS#Vec2 or DCS#Vec3 initial spawn location. +-- @param #number MaxRadius (Optional) Max radius to search for valid ground locations in meters. Default is double the max radius of the static. +-- @return DCS#Vec2 Initial Position if it's valid, else a valid spawn position. nil if no valid position found. +function UTILS.ValidateAndRepositionStatic(Country, Category, Type, Position, ShapeName, MaxRadius) + local coord = COORDINATE:NewFromVec2(Position) + local st = SPAWNSTATIC:NewFromType(Type, Category, Country) + if ShapeName then + st:InitShape(ShapeName) + end + local sName = "s-"..timer.getTime().."-"..math.random(1,10000) + local tempStatic = st:SpawnFromCoordinate(coord, 0, sName) + if tempStatic then + local sRadius = tempStatic:GetBoundingRadius(2) or 3 + tempStatic:Destroy() + sRadius = sRadius * 0.5 + MaxRadius = MaxRadius or math.max(sRadius * 10, 100) + local positions = UTILS.GetSimpleZones(coord:GetVec3(), MaxRadius, sRadius, 20) + if positions and #positions > 0 then + local closestSpot + local closestDist = math.huge + for _, spot in pairs(positions) do -- Disposition sometimes returns points on roads, hence this filter. + if land.getSurfaceType(spot) == land.SurfaceType.LAND then + local dist = UTILS.VecDist2D(Position, spot) + if dist < closestDist then + closestDist = dist + closestSpot = spot + end + end + end + + if closestSpot then + if closestDist >= sRadius then + return closestSpot + else + return Position + end + end + end + end + + return nil +end diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index dc6cf3af1..77380fb7b 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -3202,6 +3202,7 @@ end --- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table. --- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. --- Uses UTILS.ValidateAndRepositionGroundUnits. +-- @param #UNIT self -- @param #boolean Enabled Enable/disable the feature. function GROUP:SetValidateAndRepositionGroundUnits(Enabled) self.ValidateAndRepositionGroundUnits = Enabled diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua index 9fd6963a1..9d2ab5cfd 100644 --- a/Moose Development/Moose/Wrapper/Unit.lua +++ b/Moose Development/Moose/Wrapper/Unit.lua @@ -1948,6 +1948,7 @@ end --- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table. --- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. --- Uses UTILS.ValidateAndRepositionGroundUnits. +-- @param #UNIT self -- @param #boolean Enabled Enable/disable the feature. function UNIT:SetValidateAndRepositionGroundUnits(Enabled) self.ValidateAndRepositionGroundUnits = Enabled From 323f09b06c85df89956b7d3766c0bf5213619ed1 Mon Sep 17 00:00:00 2001 From: smiki Date: Thu, 28 Aug 2025 19:38:05 +0200 Subject: [PATCH 08/30] [ADDED] `SPAWNSTATIC:InitValidateAndRepositionStatic(OnOff, MaxRadius)` --- Moose Development/Moose/Core/SpawnStatic.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Core/SpawnStatic.lua b/Moose Development/Moose/Core/SpawnStatic.lua index c67d6ed7c..332e7e464 100644 --- a/Moose Development/Moose/Core/SpawnStatic.lua +++ b/Moose Development/Moose/Core/SpawnStatic.lua @@ -387,7 +387,7 @@ end -- @param #number MaxRadius (Optional) Max radius to search for a valid ground location in meters. Default is 10 times the max radius of the static. -- @return #SPAWNSTATIC self function SPAWNSTATIC:InitValidateAndRepositionStatic(OnOff, MaxRadius) - self.SpawnValidateAndRepositionStatic = OnOff + self.ValidateAndRepositionStatic = OnOff self.ValidateAndRepositionStaticMaxRadius = MaxRadius return self end From 42ecdd3b1468d43e08be6c53acebc672d9b8a6ea Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 31 Aug 2025 13:24:31 +0200 Subject: [PATCH 09/30] #AIRBASE - Add Sinai Damascus Intl Airbase in the enumerator --- Moose Development/Moose/Wrapper/Airbase.lua | 100 ++++++++++---------- 1 file changed, 51 insertions(+), 49 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index cf96d6064..58b1fea1e 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -703,55 +703,56 @@ AIRBASE.SouthAtlantic={ --- Airbases of the Sinai map: -- --- * AIRBASE.Sinai.Abu_Rudeis --- * AIRBASE.Sinai.Abu_Suwayr --- * AIRBASE.Sinai.Al_Bahr_al_Ahmar --- * AIRBASE.Sinai.Al_Ismailiyah --- * AIRBASE.Sinai.Al_Khatatbah --- * AIRBASE.Sinai.Al_Mansurah --- * AIRBASE.Sinai.Al_Rahmaniyah_Air_Base --- * AIRBASE.Sinai.As_Salihiyah --- * AIRBASE.Sinai.AzZaqaziq --- * AIRBASE.Sinai.Baluza --- * AIRBASE.Sinai.Ben_Gurion --- * AIRBASE.Sinai.Beni_Suef --- * AIRBASE.Sinai.Bilbeis_Air_Base --- * AIRBASE.Sinai.Bir_Hasanah --- * AIRBASE.Sinai.Birma_Air_Base --- * AIRBASE.Sinai.Borg_El_Arab_International_Airport --- * AIRBASE.Sinai.Cairo_International_Airport --- * AIRBASE.Sinai.Cairo_West --- * AIRBASE.Sinai.Difarsuwar_Airfield --- * AIRBASE.Sinai.El_Arish --- * AIRBASE.Sinai.El_Gora --- * AIRBASE.Sinai.El_Minya --- * AIRBASE.Sinai.Fayed --- * AIRBASE.Sinai.Gebel_El_Basur_Air_Base --- * AIRBASE.Sinai.Hatzerim --- * AIRBASE.Sinai.Hatzor --- * AIRBASE.Sinai.Hurghada_International_Airport --- * AIRBASE.Sinai.Inshas_Airbase --- * AIRBASE.Sinai.Jiyanklis_Air_Base --- * AIRBASE.Sinai.Kedem --- * AIRBASE.Sinai.Kibrit_Air_Base --- * AIRBASE.Sinai.Kom_Awshim --- * AIRBASE.Sinai.Melez --- * AIRBASE.Sinai.Mezzeh_Air_Base --- * AIRBASE.Sinai.Nevatim --- * AIRBASE.Sinai.Ovda --- * AIRBASE.Sinai.Palmachim --- * AIRBASE.Sinai.Quwaysina --- * AIRBASE.Sinai.Rafic_Hariri_Intl --- * AIRBASE.Sinai.Ramat_David --- * AIRBASE.Sinai.Ramon_Airbase --- * AIRBASE.Sinai.Ramon_International_Airport --- * AIRBASE.Sinai.Sde_Dov --- * AIRBASE.Sinai.Sharm_El_Sheikh_International_Airport --- * AIRBASE.Sinai.St_Catherine --- * AIRBASE.Sinai.Tabuk --- * AIRBASE.Sinai.Tel_Nof --- * AIRBASE.Sinai.Wadi_Abu_Rish --- * AIRBASE.Sinai.Wadi_al_Jandali +-- * AIRBASE.SinaiMap.Abu_Rudeis +-- * AIRBASE.SinaiMap.Abu_Suwayr +-- * AIRBASE.SinaiMap.Al_Bahr_al_Ahmar +-- * AIRBASE.SinaiMap.Al_Ismailiyah +-- * AIRBASE.SinaiMap.Al_Khatatbah +-- * AIRBASE.SinaiMap.Al_Mansurah +-- * AIRBASE.SinaiMap.Al_Rahmaniyah_Air_Base +-- * AIRBASE.SinaiMap.As_Salihiyah +-- * AIRBASE.SinaiMap.AzZaqaziq +-- * AIRBASE.SinaiMap.Baluza +-- * AIRBASE.SinaiMap.Ben_Gurion +-- * AIRBASE.SinaiMap.Beni_Suef +-- * AIRBASE.SinaiMap.Bilbeis_Air_Base +-- * AIRBASE.SinaiMap.Bir_Hasanah +-- * AIRBASE.SinaiMap.Birma_Air_Base +-- * AIRBASE.SinaiMap.Borg_El_Arab_International_Airport +-- * AIRBASE.SinaiMap.Cairo_International_Airport +-- * AIRBASE.SinaiMap.Cairo_West +-- * AIRBASE.SinaiMap.Damascus_Intl +-- * AIRBASE.SinaiMap.Difarsuwar_Airfield +-- * AIRBASE.SinaiMap.El_Arish +-- * AIRBASE.SinaiMap.El_Gora +-- * AIRBASE.SinaiMap.El_Minya +-- * AIRBASE.SinaiMap.Fayed +-- * AIRBASE.SinaiMap.Gebel_El_Basur_Air_Base +-- * AIRBASE.SinaiMap.Hatzerim +-- * AIRBASE.SinaiMap.Hatzor +-- * AIRBASE.SinaiMap.Hurghada_International_Airport +-- * AIRBASE.SinaiMap.Inshas_Airbase +-- * AIRBASE.SinaiMap.Jiyanklis_Air_Base +-- * AIRBASE.SinaiMap.Kedem +-- * AIRBASE.SinaiMap.Kibrit_Air_Base +-- * AIRBASE.SinaiMap.Kom_Awshim +-- * AIRBASE.SinaiMap.Melez +-- * AIRBASE.SinaiMap.Mezzeh_Air_Base +-- * AIRBASE.SinaiMap.Nevatim +-- * AIRBASE.SinaiMap.Ovda +-- * AIRBASE.SinaiMap.Palmachim +-- * AIRBASE.SinaiMap.Quwaysina +-- * AIRBASE.SinaiMap.Rafic_Hariri_Intl +-- * AIRBASE.SinaiMap.Ramat_David +-- * AIRBASE.SinaiMap.Ramon_Airbase +-- * AIRBASE.SinaiMap.Ramon_International_Airport +-- * AIRBASE.SinaiMap.Sde_Dov +-- * AIRBASE.SinaiMap.Sharm_El_Sheikh_International_Airport +-- * AIRBASE.SinaiMap.St_Catherine +-- * AIRBASE.SinaiMap.Tabuk +-- * AIRBASE.SinaiMap.Tel_Nof +-- * AIRBASE.SinaiMap.Wadi_Abu_Rish +-- * AIRBASE.SinaiMap.Wadi_al_Jandali -- -- @field Sinai AIRBASE.Sinai = { @@ -773,6 +774,7 @@ AIRBASE.Sinai = { ["Borg_El_Arab_International_Airport"] = "Borg El Arab International Airport", ["Cairo_International_Airport"] = "Cairo International Airport", ["Cairo_West"] = "Cairo West", + ["Damascus_Intl"] = "Damascus Intl", ["Difarsuwar_Airfield"] = "Difarsuwar Airfield", ["El_Arish"] = "El Arish", ["El_Gora"] = "El Gora", From 6c1907f7e0f14497e08c2ca08281de5119b655f4 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 31 Aug 2025 13:27:24 +0200 Subject: [PATCH 10/30] GROUO correction in class self line 3205 --- Moose Development/Moose/Wrapper/Group.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 77380fb7b..6ff787553 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -3202,7 +3202,7 @@ end --- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table. --- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. --- Uses UTILS.ValidateAndRepositionGroundUnits. --- @param #UNIT self +-- @param #GROUP self -- @param #boolean Enabled Enable/disable the feature. function GROUP:SetValidateAndRepositionGroundUnits(Enabled) self.ValidateAndRepositionGroundUnits = Enabled From 873879ff794237212fe6f76f723a8d47506a00a3 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 31 Aug 2025 18:22:17 +0200 Subject: [PATCH 11/30] #AIRBOSS - Slight tweak to EnableSRS() when no parameters are handed in. --- Moose Development/Moose/Ops/Airboss.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Moose Development/Moose/Ops/Airboss.lua b/Moose Development/Moose/Ops/Airboss.lua index 89f6f5b37..70535cd0e 100644 --- a/Moose Development/Moose/Ops/Airboss.lua +++ b/Moose Development/Moose/Ops/Airboss.lua @@ -39,6 +39,8 @@ -- * [USS America](https://en.wikipedia.org/wiki/USS_America_\(LHA-6\)) (LHA-6) -- * [Juan Carlos I](https://en.wikipedia.org/wiki/Spanish_amphibious_assault_ship_Juan_Carlos_I) (L61) -- * [HMAS Canberra](https://en.wikipedia.org/wiki/HMAS_Canberra_\(L02\)) (L02) +-- * BONHOMMERICHARD [VWV Mod] +-- * ENTERPRISE66 [VWV Mod] -- -- **Supported Aircraft:** -- @@ -1764,7 +1766,7 @@ AIRBOSS.MenuF10Root = nil --- Airboss class version. -- @field #string version -AIRBOSS.version = "1.4.1" +AIRBOSS.version = "1.4.2" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -3126,8 +3128,8 @@ function AIRBOSS:EnableSRS(PathToSRS,Port,Culture,Gender,Voice,GoogleCreds,Volum self.SRS:SetCulture(Culture or "en-US") --self.SRS:SetFrequencies(Frequencies) self.SRS:SetGender(Gender or "male") - self.SRS:SetPath(PathToSRS) - self.SRS:SetPort(Port or 5002) + --self.SRS:SetPath(PathToSRS) + self.SRS:SetPort(Port or MSRS.port or 5002) self.SRS:SetLabel(self.AirbossRadio.alias or "AIRBOSS") self.SRS:SetCoordinate(self.carrier:GetCoordinate()) self.SRS:SetVolume(Volume or 1) @@ -3138,7 +3140,10 @@ function AIRBOSS:EnableSRS(PathToSRS,Port,Culture,Gender,Voice,GoogleCreds,Volum if Voice then self.SRS:SetVoice(Voice) end - self.SRS:SetVolume(Volume or 1.0) + if (not Voice) and self.SRS and self.SRS:GetProvider() == MSRS.Provider.GOOGLE then + self.SRS.voice = MSRS.poptions["gcloud"].voice or MSRS.Voices.Google.Standard.en_US_Standard_B + end + --self.SRS:SetVolume(Volume or 1.0) -- SRSQUEUE self.SRSQ = MSRSQUEUE:New("AIRBOSS") self.SRSQ:SetTransmitOnlyWithPlayers(true) From 44f3c776eb0bad395b2520a89b2630a8345ef74b Mon Sep 17 00:00:00 2001 From: smiki Date: Mon, 1 Sep 2025 09:30:05 +0200 Subject: [PATCH 12/30] [FIXED] `UTILS.HdgTo to accept both Vec2 or Vec3` --- Moose Development/Moose/Utilities/Utils.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index 1a2809b24..e4d85fbff 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -1586,12 +1586,12 @@ function UTILS.HdgDiff(h1, h2) return math.abs(delta) end ---- Returns the heading from one vec3 to another vec3. --- @param DCS#Vec3 a From vec3. --- @param DCS#Vec3 b To vec3. +--- Returns the heading from one vec2/vec3 to another vec2/vec3. +-- @param DCS#Vec3 a From Vec2 or Vec3. +-- @param DCS#Vec3 b To Vec2 or Vec3. -- @return #number Heading in degrees. function UTILS.HdgTo(a, b) - local dz=b.z-a.z + local dz=(b.z or b.y) - (a.z or a.y) local dx=b.x-a.x local heading=math.deg(math.atan2(dz, dx)) if heading < 0 then @@ -4982,7 +4982,7 @@ function UTILS.ValidateAndRepositionGroundUnits(Positions, Anchor, MaxRadius, Sp end end ---- This function uses Disposition and other fallback logic to find better ground positions for ground units. +--- This function uses Disposition and other fallback logic to find better ground positions for statics. --- NOTE: This is not a spawn randomizer. --- It will try to find clear ground locations avoiding trees, water, roads, runways, map scenery, statics and other units in the area and modifies the provided positions table. --- Maintains the original layout and unit positions as close as possible by searching for the next closest valid position to each unit. From 7df90b2d302887cb052840688587b9d98ca5ff38 Mon Sep 17 00:00:00 2001 From: smiki Date: Wed, 3 Sep 2025 09:12:20 +0200 Subject: [PATCH 13/30] [ADDED] `GROUP:GetBoundingBox()` since `POSITIONABLE:GetBoundingBox()` is only for units --- Moose Development/Moose/Wrapper/Group.lua | 46 +++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 6ff787553..cdc76a54d 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -3207,3 +3207,49 @@ end function GROUP:SetValidateAndRepositionGroundUnits(Enabled) self.ValidateAndRepositionGroundUnits = Enabled end + + +--- Get the bounding box of the group combining UNIT:GetBoundingBox() units. +-- @param #GROUP self +-- @return DCS#Box3 The bounding box of the GROUP. +-- @return #nil The GROUP does not have any alive units. +function GROUP:GetBoundingBox() + local bbox = { min = { x = math.huge, y = math.huge, z = math.huge }, + max = { x = -math.huge, y = -math.huge, z = -math.huge } + } + + local Units = self:GetUnits() or {} + if #Units == 0 then + return nil + end + + for _, unit in pairs(Units) do + if unit and unit:IsAlive() then + local ubox = unit:GetBoundingBox() + + if ubox then + if ubox.min.x < bbox.min.x then + bbox.min.x = ubox.min.x + end + if ubox.min.y < bbox.min.y then + bbox.min.y = ubox.min.y + end + if ubox.min.z < bbox.min.z then + bbox.min.z = ubox.min.z + end + + if ubox.max.x > bbox.max.x then + bbox.max.x = ubox.max.x + end + if ubox.max.y > bbox.max.y then + bbox.max.y = ubox.max.y + end + if ubox.max.z > bbox.max.z then + bbox.max.z = ubox.max.z + end + end + end + end + + return bbox +end From 03275938e787eb0b9cdf08402cab1d67c716c8ed Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 7 Sep 2025 18:58:41 +0200 Subject: [PATCH 14/30] #CLIENTMENU - add missing func from documentation --- Moose Development/Moose/Core/ClientMenu.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Core/ClientMenu.lua b/Moose Development/Moose/Core/ClientMenu.lua index 5e7219add..fea72914d 100644 --- a/Moose Development/Moose/Core/ClientMenu.lua +++ b/Moose Development/Moose/Core/ClientMenu.lua @@ -20,7 +20,7 @@ -- -- @module Core.ClientMenu -- @image Core_Menu.JPG --- last change: Jan 2025 +-- last change: Sept 2025 -- TODO ---------------------------------------------------------------------------------------------------------------- @@ -417,7 +417,7 @@ end CLIENTMENUMANAGER = { ClassName = "CLIENTMENUMANAGER", lid = "", - version = "0.1.6", + version = "0.1.7", name = nil, clientset = nil, menutree = {}, @@ -806,6 +806,16 @@ function CLIENTMENUMANAGER:ResetMenuComplete() return self end +--- Remove the entry and all entries below the given entry from the client's F10 menus. +-- @param #CLIENTMENUMANAGER self +-- @param #CLIENTMENU Entry The entry to remove +-- @param Wrapper.Client#CLIENT Client (optional) If given, make this change only for this client. +-- @return #CLIENTMENUMANAGER self +function CLIENTMENUMANAGER:DeleteEntry(Entry,Client) + self:T(self.lid.."DeleteEntry") + return self:DeleteF10Entry(Entry,Client) +end + --- Remove the entry and all entries below the given entry from the client's F10 menus. -- @param #CLIENTMENUMANAGER self -- @param #CLIENTMENU Entry The entry to remove From 09e5fca1a57c91b93cb8987f7d07a93bcddb4734 Mon Sep 17 00:00:00 2001 From: smiki Date: Thu, 11 Sep 2025 00:38:20 +0200 Subject: [PATCH 15/30] [FIXED] CTLD. Injected spawns not using `InitValidateAndRepositionGroundUnits` --- Moose Development/Moose/Ops/CTLD.lua | 3 +++ Moose Development/Moose/Wrapper/Group.lua | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 6b1bb8d60..556b03038 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -6930,6 +6930,7 @@ end local alias = string.format("%s-%d", _template, math.random(1,100000)) self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias) :InitRandomizeUnits(randompositions,20,2) + :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits) :InitDelayOff() :OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp) :SpawnFromVec2(randomcoord) @@ -7083,12 +7084,14 @@ end if canmove then self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias) :InitRandomizeUnits(true,20,2) + :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits) :InitDelayOff() :OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp) :SpawnFromVec2(randomcoord) else -- don't random position of e.g. SAM units build as FOB self.DroppedTroops[self.TroopCounter] = SPAWN:NewWithAlias(_template,alias) :InitDelayOff() + :InitValidateAndRepositionGroundUnits(self.validateAndRepositionUnits) :OnSpawnGroup(function(grp,TimeStamp) grp.spawntime = TimeStamp or timer.getTime() end,TimeStamp) :SpawnFromVec2(randomcoord) end diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index cdc76a54d..1c38db672 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -231,6 +231,7 @@ GROUP.Attribute = { GROUND_AAA="Ground_AAA", GROUND_SAM="Ground_SAM", GROUND_SHORAD="Ground_SHORAD", + GROUND_BALLISTICMISSILE="Ground_BallisticMissile", GROUND_OTHER="Ground_OtherGround", NAVAL_AIRCRAFTCARRIER="Naval_AircraftCarrier", NAVAL_WARSHIP="Naval_WarShip", @@ -2643,6 +2644,8 @@ function GROUP:GetAttribute() local artillery=self:HasAttribute("Artillery") local tank=self:HasAttribute("Old Tanks") or self:HasAttribute("Modern Tanks") or self:HasAttribute("Tanks") local aaa=self:HasAttribute("AAA") and (not self:HasAttribute("SAM elements")) + local ballisticMissile=artillery and self:HasAttribute("SS_missile") + local shorad=self:HasAttribute("SR SAM") local ewr=self:HasAttribute("EWR") local ifv=self:HasAttribute("IFV") local sam=self:HasAttribute("SAM elements") or self:HasAttribute("Optical Tracker") @@ -2684,6 +2687,8 @@ function GROUP:GetAttribute() attribute=GROUP.Attribute.GROUND_SAM elseif aaa then attribute=GROUP.Attribute.GROUND_AAA + elseif artillery and ballisticMissile then + attribute=GROUP.Attribute.GROUND_BALLISTICMISSILE elseif artillery then attribute=GROUP.Attribute.GROUND_ARTILLERY elseif tank then From 3f8954d21da7a050ea33fb29d81b44f1640fb359 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Mon, 15 Sep 2025 09:28:35 +0200 Subject: [PATCH 16/30] #EASYGCICAP - Fixed - for Tanker Squadrons the TACAN channel could not be nil. --- Moose Development/Moose/Ops/EasyGCICAP.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/EasyGCICAP.lua b/Moose Development/Moose/Ops/EasyGCICAP.lua index f0700332d..5c789141f 100644 --- a/Moose Development/Moose/Ops/EasyGCICAP.lua +++ b/Moose Development/Moose/Ops/EasyGCICAP.lua @@ -273,7 +273,7 @@ EASYGCICAP = { --- EASYGCICAP class version. -- @field #string version -EASYGCICAP.version="0.1.27" +EASYGCICAP.version="0.1.28" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -1209,7 +1209,9 @@ function EASYGCICAP:_AddTankerSquadron(TemplateName, SquadName, AirbaseName, Air Squadron_One:SetSkill(Skill or AI.Skill.AVERAGE) Squadron_One:SetMissionRange(self.missionrange) Squadron_One:SetRadio(Frequency,Modulation) - Squadron_One:AddTacanChannel(TACAN,TACAN) + if TACAN then + Squadron_One:AddTacanChannel(TACAN,TACAN) + end local wing = self.wings[AirbaseName][1] -- Ops.Airwing#AIRWING From f73dc6c3be6e77b6fc5497e531dd9adbe3905836 Mon Sep 17 00:00:00 2001 From: smiki Date: Tue, 16 Sep 2025 15:14:28 +0200 Subject: [PATCH 17/30] [Added] `PLAYERTASKCONTROLLER:CanJoinTask` Override function in order to implement custom logic if a player can join a task or not. --- Moose Development/Moose/Ops/PlayerTask.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 7ce6d57c2..77516f752 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -3530,6 +3530,16 @@ function PLAYERTASKCONTROLLER:AddPlayerTaskToQueue(PlayerTask,Silent,TaskFilter) return self end +--- [User] Override this function in order to implement custom logic if a player can join a task or not. +-- @param #PLAYERTASKCONTROLLER self +-- @param Ops.PlayerTask#PLAYERTASK Task +-- @param Wrapper.Group#GROUP Group +-- @param Wrapper.Client#CLIENT Client +-- @return #boolean Outcome True if player can join the task, false if not +function PLAYERTASKCONTROLLER:CanJoinTask(Task, Group, Client) + return true +end + --- [Internal] Join a player to a task -- @param #PLAYERTASKCONTROLLER self -- @param Ops.PlayerTask#PLAYERTASK Task @@ -3540,6 +3550,11 @@ end function PLAYERTASKCONTROLLER:_JoinTask(Task, Force, Group, Client) self:T({Force, Group, Client}) self:T(self.lid.."_JoinTask") + + if not self:CanJoinTask(Task, Group, Client) then + return self + end + local force = false if type(Force) == "boolean" then force = Force From 5414adc8d850b96da29f7fd00f9fd7ee177b8174 Mon Sep 17 00:00:00 2001 From: smiki Date: Wed, 17 Sep 2025 09:26:34 +0200 Subject: [PATCH 18/30] [Added] `PLAYERTASK:CanJoinTask` Override function in order to implement custom logic if a player can join a task or not. --- Moose Development/Moose/Ops/PlayerTask.lua | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 77516f752..9a7679936 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -387,6 +387,14 @@ function PLAYERTASK:_CheckCaptureOpsZoneSuccess(OpsZone, CaptureSquadGroupNamePr return OpsZone:GetOwner() == Coalition and isClientInZone and isCaptureGroupInZone end +--- [User] Override this function in order to implement custom logic if a player can join a task or not. +-- @param #PLAYERTASK self +-- @param Wrapper.Group#GROUP Group +-- @param Wrapper.Client#CLIENT Client +-- @return #boolean Outcome True if player can join the task, false if not +function PLAYERTASK:CanJoinTask(Group, Client) + return true +end --- [Internal] Add a PLAYERTASKCONTROLLER for this task -- @param #PLAYERTASK self @@ -3555,6 +3563,10 @@ function PLAYERTASKCONTROLLER:_JoinTask(Task, Force, Group, Client) return self end + if not Task:CanJoinTask(Group, Client) then + return self + end + local force = false if type(Force) == "boolean" then force = Force From 04fcb985fe27bb9f5a065f7588aef8b5b9671e99 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 17 Sep 2025 12:04:34 +0200 Subject: [PATCH 19/30] #PLAYERTASK - Ensure call task failed on the controller --- Moose Development/Moose/Ops/PlayerTask.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/PlayerTask.lua b/Moose Development/Moose/Ops/PlayerTask.lua index 7ce6d57c2..95a98fcfd 100644 --- a/Moose Development/Moose/Ops/PlayerTask.lua +++ b/Moose Development/Moose/Ops/PlayerTask.lua @@ -98,7 +98,7 @@ PLAYERTASK = { --- PLAYERTASK class version. -- @field #string version -PLAYERTASK.version="0.1.27" +PLAYERTASK.version="0.1.28" --- Generic task condition. -- @type PLAYERTASK.Condition @@ -1227,7 +1227,10 @@ function PLAYERTASK:onafterFailed(From, Event, To) self.TargetMarker:Remove() end self.FinalState = "Failed" - self:__Done(-1) + if self.TaskController then + self.TaskController:__TaskFailed(-1,self) + end + self:__Done(-1.5) end if self.TaskController.Scoring then local clients,count = self:GetClientObjects() From 65d1c4187eff15d34465f37647c3e5dce5b0dbb5 Mon Sep 17 00:00:00 2001 From: smiki Date: Wed, 17 Sep 2025 20:19:17 +0200 Subject: [PATCH 20/30] [Fixed] attempt to index field 'Place' (a nil value) in LandingAfterEjection --- Moose Development/Moose/Core/Event.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Core/Event.lua b/Moose Development/Moose/Core/Event.lua index c5893325b..7cdec63ac 100644 --- a/Moose Development/Moose/Core/Event.lua +++ b/Moose Development/Moose/Core/Event.lua @@ -1508,7 +1508,9 @@ function EVENT:onEvent( Event ) else if Event.place:isExist() and Object.getCategory(Event.place) ~= Object.Category.SCENERY then Event.Place=AIRBASE:Find(Event.place) - Event.PlaceName=Event.Place:GetName() + if Event.Place then + Event.PlaceName=Event.Place:GetName() + end end end end From b320ba597a09bc40062f48c3c7dc11f5c6bede3b Mon Sep 17 00:00:00 2001 From: m1nd Date: Thu, 18 Sep 2025 00:32:48 +0200 Subject: [PATCH 21/30] fix: Add conditional checks for AWACS markers based on `AllowMarkers` property --- Moose Development/Moose/Ops/Awacs.lua | 64 ++++++++++++++++++++------- 1 file changed, 48 insertions(+), 16 deletions(-) diff --git a/Moose Development/Moose/Ops/Awacs.lua b/Moose Development/Moose/Ops/Awacs.lua index c4d4632fa..a2dff4db3 100644 --- a/Moose Development/Moose/Ops/Awacs.lua +++ b/Moose Development/Moose/Ops/Awacs.lua @@ -2021,7 +2021,9 @@ function AWACS:SetAdditionalZone(Zone, Draw) self.BorderZone = Zone if self.debug then Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true) - MARKER:New(Zone:GetCoordinate(),"Defensive Zone"):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(Zone:GetCoordinate(),"Defensive Zone"):ToCoalition(self.coalition) + end elseif Draw then Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true) end @@ -2041,7 +2043,9 @@ function AWACS:SetRejectionZone(Zone,Draw) --MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToAll() elseif self.debug then Zone:DrawZone(self.coalition,{1,0.64,0},1,{1,0.64,0},0.2,1,true) - MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(Zone:GetCoordinate(),"Rejection Zone"):ToCoalition(self.coalition) + end end return self end @@ -4094,10 +4098,14 @@ function AWACS:_CreateAnchorStackFromMarker(Name,Coord) if self.debug then AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end else local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end self.AnchorStacks:Push(AnchorStackOne,newname) @@ -4140,10 +4148,14 @@ function AWACS:_CreateAnchorStack() --self.AnchorStacks:Flush() AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end else local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end self.AnchorStacks:Push(AnchorStackOne,newname) else @@ -4167,10 +4179,14 @@ function AWACS:_CreateAnchorStack() if self.debug then AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end else local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end self.AnchorStacks:Push(AnchorStackOne,newname) end @@ -5102,10 +5118,14 @@ function AWACS:AddCAPAirWing(AirWing,Zone) if self.debug then AnchorStackOne.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end else local stationtag = string.format("Station: %s\nCoordinate: %s",newname,self.StationZone:GetCoordinate():ToStringLLDDM()) - AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + AnchorStackOne.AnchorMarker=MARKER:New(AnchorStackOne.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end self.AnchorStacks:Push(AnchorStackOne,newname) AirWing.HasOwnStation = true @@ -5948,23 +5968,35 @@ function AWACS:onafterStart(From, Event, To) self.OpsZone:DrawZone(self.coalition,{1,0,0},1,{1,0,0},0.2,5,true) local AOCoordString = self.AOCoordinate:ToStringLLDDM() local Rocktag = string.format("FEZ: %s\nBulls Coordinate: %s",self.AOName,AOCoordString) - MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition) + end self.StationZone:DrawZone(self.coalition,{0,0,1},1,{0,0,1},0.2,5,true) local stationtag = string.format("Station: %s\nCoordinate: %s",self.StationZoneName,self.StationZone:GetCoordinate():ToStringLLDDM()) if not self.GCI then - MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end self.OrbitZone:DrawZone(self.coalition,{0,1,0},1,{0,1,0},0.2,5,true) - MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition) + end end else local AOCoordString = self.AOCoordinate:ToStringLLDDM() local Rocktag = string.format("FEZ: %s\nBulls Coordinate: %s",self.AOName,AOCoordString) - MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.AOCoordinate,Rocktag):ToCoalition(self.coalition) + end if not self.GCI then - MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.OrbitZone:GetCoordinate(),"AIC Orbit Zone"):ToCoalition(self.coalition) + end end local stationtag = string.format("Station: %s\nCoordinate: %s",self.StationZoneName,self.StationZone:GetCoordinate():ToStringLLDDM()) - MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + if self.AllowMarkers then + MARKER:New(self.StationZone:GetCoordinate(),stationtag):ToCoalition(self.coalition) + end end if not self.GCI then From c5b0be5d21944fa5f9f2da18a013cdca1e19dd91 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:08:15 +0200 Subject: [PATCH 22/30] Update Airbase.lua Iraq Airbases --- Moose Development/Moose/Wrapper/Airbase.lua | 51 +++++++++++++-------- 1 file changed, 33 insertions(+), 18 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index 58b1fea1e..23874b387 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -933,37 +933,52 @@ AIRBASE.Afghanistan = { --- Airbases of the Iraq map -- --- * AIRBASE.Iraq.Baghdad_International_Airport --- * AIRBASE.Iraq.Sulaimaniyah_International_Airport --- * AIRBASE.Iraq.Al_Sahra_Airport --- * AIRBASE.Iraq.Erbil_International_Airpor --- * AIRBASE.Iraq.Al_Taji_Airport -- * AIRBASE.Iraq.Al_Asad_Airbase +-- * AIRBASE.Iraq.Al_Kut_Airbase +-- * AIRBASE.Iraq.Al_Sahra_Airport -- * AIRBASE.Iraq.Al_Salam_Airbase --- * AIRBASE.Iraq.Balad_Airbase --- * AIRBASE.Iraq.Kirkuk_International_Airport --- * AIRBASE.Iraq.Bashur_Airport +-- * AIRBASE.Iraq.Al_Taji_Airport -- * AIRBASE.Iraq.Al_Taquddum_Airport --- * AIRBASE.Iraq.Qayyarah_Airfield_West +-- * AIRBASE.Iraq.Baghdad_International_Airport +-- * AIRBASE.Iraq.Balad_Airbase +-- * AIRBASE.Iraq.Bashur_Airport +-- * AIRBASE.Iraq.Erbil_International_Airport +-- * AIRBASE.Iraq.Sulaimaniyah_International_Airport +-- * AIRBASE.Iraq.H2_Airbase +-- * AIRBASE.Iraq.H3_Main_Airbase +-- * AIRBASE.Iraq.H3_Northwest_Airbase +-- * AIRBASE.Iraq.H3_Southwest_Airbase -- * AIRBASE.Iraq.K1_Base +-- * AIRBASE.Iraq.Kirkuk_International_Airport +-- * AIRBASE.Iraq.Mosul_International_Airport +-- * AIRBASE.Iraq.Qayyarah_Airfield_West +-- * AIRBASE.Iraq.Sulaimaniyah_International_Airport -- -- @field Iraq AIRBASE.Iraq = { - ["Baghdad_International_Airport"] = "Baghdad International Airport", - ["Sulaimaniyah_International_Airport"] = "Sulaimaniyah International Airport", - ["Al_Sahra_Airport"] = "Al-Sahra Airport", - ["Erbil_International_Airport"] = "Erbil International Airport", - ["Al_Taji_Airport"] = "Al-Taji Airport", +{ ["Al_Asad_Airbase"] = "Al-Asad Airbase", + ["Al_Kut_Airport"] = "Al-Kut Airport", + ["Al_Sahra_Airport"] = "Al-Sahra Airport", ["Al_Salam_Airbase"] = "Al-Salam Airbase", - ["Balad_Airbase"] = "Balad Airbase", - ["Kirkuk_International_Airport"] = "Kirkuk International Airport", - ["Bashur_Airport"] = "Bashur Airport", + ["Al_Taji_Airport"] = "Al-Taji Airport", ["Al_Taquddum_Airport"] = "Al-Taquddum Airport", - ["Qayyarah_Airfield_West"] = "Qayyarah Airfield West", + ["Baghdad_International_Airport"] = "Baghdad International Airport", + ["Balad_Airbase"] = "Balad Airbase", + ["Bashur_Airport"] = "Bashur Airport", + ["Erbil_International_Airport"] = "Erbil International Airport", + ["H2_Airbase"] = "H-2 Airbase", + ["H3_Main_Airbase"] = "H-3 Main Airbase", + ["H3_Northwest_Airbase"] = "H-3 Northwest Airbase", + ["H3_Southwest_Airbase"] = "H-3 Southwest Airbase", ["K1_Base"] = "K1 Base", + ["Kirkuk_International_Airport"] = "Kirkuk International Airport", + ["Mosul_International_Airport"] = "Mosul International Airport", + ["Qayyarah_Airfield_West"] = "Qayyarah Airfield West", + ["Sulaimaniyah_International_Airport"] = "Sulaimaniyah International Airport", } + --- Airbases of the Germany Cold War map -- * AIRBASE.GermanyCW.Airracing_Frankfurt -- * AIRBASE.GermanyCW.Airracing_Frankfurt From c2f0ce0fa2de38b0abfaa37ed73327da9307105e Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:13:44 +0200 Subject: [PATCH 23/30] Update Airbase.lua --- Moose Development/Moose/Wrapper/Airbase.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index 23874b387..7b56f195b 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -956,7 +956,6 @@ AIRBASE.Afghanistan = { -- -- @field Iraq AIRBASE.Iraq = { -{ ["Al_Asad_Airbase"] = "Al-Asad Airbase", ["Al_Kut_Airport"] = "Al-Kut Airport", ["Al_Sahra_Airport"] = "Al-Sahra Airport", From 6fdf3957bdb88a7477410f6e63d9c9a1b621a720 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Tue, 23 Sep 2025 15:19:10 +0200 Subject: [PATCH 24/30] Fix for #Storage.lua some missing string concats --- Moose Development/Moose/Wrapper/Storage.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Storage.lua b/Moose Development/Moose/Wrapper/Storage.lua index 4b445613c..4e6fbad2b 100644 --- a/Moose Development/Moose/Wrapper/Storage.lua +++ b/Moose Development/Moose/Wrapper/Storage.lua @@ -753,7 +753,7 @@ function STORAGE:LoadFromFile(Path,Filename) end end else - self:E("File for Liquids could not be found: "..tostring(Path).."\\"..tostring(Filename"_Liquids.csv")) + self:E("File for Liquids could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Liquids.csv")) end end @@ -773,7 +773,7 @@ function STORAGE:LoadFromFile(Path,Filename) end end else - self:E("File for Aircraft could not be found: "..tostring(Path).."\\"..tostring(Filename"_Aircraft.csv")) + self:E("File for Aircraft could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Aircraft.csv")) end end @@ -805,7 +805,7 @@ function STORAGE:LoadFromFile(Path,Filename) end end else - self:E("File for Weapons could not be found: "..tostring(Path).."\\"..tostring(Filename"_Weapons.csv")) + self:E("File for Weapons could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Weapons.csv")) end end From 3beb98a5e9dbae24d9439e80c24e34c1e0bae0eb Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Tue, 23 Sep 2025 15:26:38 +0200 Subject: [PATCH 25/30] Update Storage.lua --- Moose Development/Moose/Wrapper/Storage.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Storage.lua b/Moose Development/Moose/Wrapper/Storage.lua index 4e6fbad2b..5b5c23b3d 100644 --- a/Moose Development/Moose/Wrapper/Storage.lua +++ b/Moose Development/Moose/Wrapper/Storage.lua @@ -753,7 +753,7 @@ function STORAGE:LoadFromFile(Path,Filename) end end else - self:E("File for Liquids could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Liquids.csv")) + self:E("File for Liquids could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Liquids.csv") end end @@ -773,7 +773,7 @@ function STORAGE:LoadFromFile(Path,Filename) end end else - self:E("File for Aircraft could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Aircraft.csv")) + self:E("File for Aircraft could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Aircraft.csv") end end @@ -805,7 +805,7 @@ function STORAGE:LoadFromFile(Path,Filename) end end else - self:E("File for Weapons could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Weapons.csv")) + self:E("File for Weapons could not be found: "..tostring(Path).."\\"..tostring(Filename).."_Weapons.csv") end end From ec0ff7afcd687e49d8ad2b17fd2e93342b727cd9 Mon Sep 17 00:00:00 2001 From: smiki Date: Wed, 24 Sep 2025 15:14:21 +0200 Subject: [PATCH 26/30] [Fixed] Zone Scans returns objects outside the zone --- Moose Development/Moose/Core/Zone.lua | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/Moose Development/Moose/Core/Zone.lua b/Moose Development/Moose/Core/Zone.lua index 104362abb..c2deb6823 100644 --- a/Moose Development/Moose/Core/Zone.lua +++ b/Moose Development/Moose/Core/Zone.lua @@ -1180,15 +1180,13 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories ) local function EvaluateZone( ZoneObject ) --if ZoneObject:isExist() then --FF: isExist always returns false for SCENERY objects since DCS 2.2 and still in DCS 2.5 - if ZoneObject then + if ZoneObject and self:IsVec3InZone(ZoneObject:getPoint()) then -- Get object category. local ObjectCategory = Object.getCategory(ZoneObject) if ( ObjectCategory == Object.Category.UNIT and ZoneObject:isExist() and ZoneObject:isActive() ) or (ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then - local CoalitionDCSUnit = ZoneObject:getCoalition() - local Include = false if not UnitCategories then -- Anything found is included. @@ -3308,14 +3306,12 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories ) local function EvaluateZone( ZoneObject ) - if ZoneObject then + if ZoneObject and self:IsVec3InZone(ZoneObject:getPoint()) then local ObjectCategory = Object.getCategory(ZoneObject) if ( ObjectCategory == Object.Category.UNIT and ZoneObject:isExist() and ZoneObject:isActive() ) or (ObjectCategory == Object.Category.STATIC and ZoneObject:isExist()) then - local CoalitionDCSUnit = ZoneObject:getCoalition() - local Include = false if not UnitCategories then -- Anything found is included. @@ -3347,7 +3343,7 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories ) end -- trying with box search - if ObjectCategory == Object.Category.SCENERY and self:IsVec3InZone(ZoneObject:getPoint()) then + if ObjectCategory == Object.Category.SCENERY then local SceneryType = ZoneObject:getTypeName() local SceneryName = ZoneObject:getName() self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {} From 8fb4d4c7c634d8602bdd14e4b9cb8804333b6b56 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 25 Sep 2025 12:13:29 +0200 Subject: [PATCH 27/30] #CTLD - add CratesPickedUp at one more point --- Moose Development/Moose/Ops/CTLD.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 556b03038..9dff3ecec 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -1417,7 +1417,7 @@ CTLD.FixedWingTypes = { --- CTLD class version. -- @field #string version -CTLD.version="1.3.37" +CTLD.version="1.3.38" --- Instantiate a new CTLD. -- @param #CTLD self @@ -3328,6 +3328,7 @@ function CTLD:_LoadCratesNearby(Group, Unit) self:_RefreshLoadCratesMenu(Group, Unit) -- clean up real world crates self:_CleanupTrackedCrates(crateidsloaded) + self:__CratesPickedUp(1, Group, Unit, loaded.Cargo) end end return self From 47ddc642394164c0b5df0998840d34a7ba01b471 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 25 Sep 2025 15:17:03 +0200 Subject: [PATCH 28/30] #EASYGCICAP added `EASYGCICAP:SetCAPEngageTargetTypes(types)` --- Moose Development/Moose/Ops/EasyGCICAP.lua | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/EasyGCICAP.lua b/Moose Development/Moose/Ops/EasyGCICAP.lua index 5c789141f..8a902cad5 100644 --- a/Moose Development/Moose/Ops/EasyGCICAP.lua +++ b/Moose Development/Moose/Ops/EasyGCICAP.lua @@ -79,6 +79,7 @@ -- @field #number FuelLowThreshold -- @field #number FuelCriticalThreshold -- @field #boolean showpatrolpointmarks +-- @field #table EngageTargetTypes -- @extends Core.Fsm#FSM --- *“Airspeed, altitude, and brains. Two are always needed to successfully complete the flight.”* -- Unknown. @@ -237,6 +238,7 @@ EASYGCICAP = { FuelLowThreshold = 25, FuelCriticalThreshold = 10, showpatrolpointmarks = false, + EngageTargetTypes = {"Air"}, } --- Internal Squadron data type @@ -273,7 +275,7 @@ EASYGCICAP = { --- EASYGCICAP class version. -- @field #string version -EASYGCICAP.version="0.1.28" +EASYGCICAP.version="0.1.30" ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -- TODO list @@ -330,6 +332,7 @@ function EASYGCICAP:New(Alias, AirbaseName, Coalition, EWRName) self.FuelLowThreshold = 25 self.FuelCriticalThreshold = 10 self.showpatrolpointmarks = false + self.EngageTargetTypes = {"Air"} -- Set some string id for output to DCS.log file. self.lid=string.format("EASYGCICAP %s | ", self.alias) @@ -608,6 +611,17 @@ function EASYGCICAP:SetCapStartTimeVariation(Start, End) return self end + +--- Set which target types CAP flights will prefer to engage, defaults to {"Air"} +-- @param #EASYGCICAP self +-- @param #table types Table of comma separated #string entries, defaults to {"Air"} (everything that flies and is not a weapon). Useful other options are e.g. {"Bombers"}, {"Fighters"}, +-- or {"Helicopters"} or combinations like {"Bombers", "Fighters", "UAVs"}. See [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_enum_attributes). +-- @return #EASYGCICAP self +function EASYGCICAP:SetCAPEngageTargetTypes(types) + self.EngageTargetTypes = types or {"Air"} + return self +end + --- Add an AirWing to the manager -- @param #EASYGCICAP self -- @param #string Airbasename @@ -706,6 +720,7 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias) local NoGoZoneSet = self.NoGoZoneSet local FuelLow = self.FuelLowThreshold or 25 local FuelCritical = self.FuelCriticalThreshold or 10 + local EngageTypes = self.EngageTargetTypes or {"Air"} function CAP_Wing:onbeforeFlightOnMission(From, Event, To, Flightgroup, Mission) local flightgroup = Flightgroup -- Ops.FlightGroup#FLIGHTGROUP @@ -720,7 +735,7 @@ function EASYGCICAP:_AddAirwing(Airbasename, Alias) flightgroup:GetGroup():SetOptionLandingOverheadBreak() if Mission.type ~= AUFTRAG.Type.TANKER and Mission.type ~= AUFTRAG.Type.AWACS and Mission.type ~= AUFTRAG.Type.RECON then flightgroup:SetDetection(true) - flightgroup:SetEngageDetectedOn(engagerange,{"Air"},GoZoneSet,NoGoZoneSet) + flightgroup:SetEngageDetectedOn(engagerange,EngageTypes,GoZoneSet,NoGoZoneSet) flightgroup:SetOutOfAAMRTB() flightgroup:SetFuelLowRTB(true) flightgroup:SetFuelLowThreshold(FuelLow) From aec69884dc2ca86b306ef4e14fd9fe649e90ccdf Mon Sep 17 00:00:00 2001 From: smiki Date: Fri, 26 Sep 2025 15:13:03 +0200 Subject: [PATCH 29/30] [ADDED] CTLD. UH-60L DAP default unit capability --- Moose Development/Moose/Ops/CTLD.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Moose Development/Moose/Ops/CTLD.lua b/Moose Development/Moose/Ops/CTLD.lua index 9dff3ecec..0c354709c 100644 --- a/Moose Development/Moose/Ops/CTLD.lua +++ b/Moose Development/Moose/Ops/CTLD.lua @@ -1396,6 +1396,7 @@ CTLD.UnitTypeCapabilities = { ["Hercules"] = {type="Hercules", crates=true, troops=true, cratelimit = 7, trooplimit = 64, length = 25, cargoweightlimit = 19000}, -- 19t cargo, 64 paratroopers. --Actually it's longer, but the center coord is off-center of the model. ["UH-60L"] = {type="UH-60L", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats + ["UH-60L_DAP"] = {type="UH-60L_DAP", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 16, cargoweightlimit = 500}, -- UH-60L DAP is an attack helo but can do limited CSAR and CTLD ["MH-60R"] = {type="MH-60R", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats ["SH-60B"] = {type="SH-60B", crates=true, troops=true, cratelimit = 2, trooplimit = 20, length = 16, cargoweightlimit = 3500}, -- 4t cargo, 20 (unsec) seats ["AH-64D_BLK_II"] = {type="AH-64D_BLK_II", crates=false, troops=true, cratelimit = 0, trooplimit = 2, length = 17, cargoweightlimit = 200}, -- 2 ppl **outside** the helo From 362652ac6cdf9afef3e0ec80c73b67a0c04ba822 Mon Sep 17 00:00:00 2001 From: smiki Date: Fri, 26 Sep 2025 15:14:12 +0200 Subject: [PATCH 30/30] [ADDED] CSAR. UH-60L DAP aircraft type --- Moose Development/Moose/Ops/CSAR.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/Moose Development/Moose/Ops/CSAR.lua b/Moose Development/Moose/Ops/CSAR.lua index 56ec21ef5..d9d743d95 100644 --- a/Moose Development/Moose/Ops/CSAR.lua +++ b/Moose Development/Moose/Ops/CSAR.lua @@ -305,6 +305,7 @@ CSAR.AircraftType["Mi-24P"] = 8 CSAR.AircraftType["Mi-24V"] = 8 CSAR.AircraftType["Bell-47"] = 2 CSAR.AircraftType["UH-60L"] = 10 +CSAR.AircraftType["UH-60L_DAP"] = 2 CSAR.AircraftType["AH-64D_BLK_II"] = 2 CSAR.AircraftType["Bronco-OV-10A"] = 2 CSAR.AircraftType["MH-60R"] = 10