From 501ab7099246020cf403ed010cc5f79a90d01dfb Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Wed, 27 Dec 2023 19:34:20 +0100 Subject: [PATCH 1/4] xxx --- Moose Development/Moose/Core/Set.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index 31a941c6b..d0670abd6 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -5394,7 +5394,7 @@ do -- SET_AIRBASE function SET_AIRBASE:GetRandomAirbase() local RandomAirbase = self:GetRandom() - self:F( { RandomAirbase = RandomAirbase:GetName() } ) + --self:F( { RandomAirbase = RandomAirbase:GetName() } ) return RandomAirbase end From 6ffe69484c43fcab55d3dda2873bd45dbfa8ef42 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 28 Dec 2023 13:32:53 +0100 Subject: [PATCH 2/4] Reduce noise --- Moose Development/Moose/Cargo/Cargo.lua | 62 +++++++++---------- Moose Development/Moose/Cargo/CargoGroup.lua | 42 ++++++------- Moose Development/Moose/Functional/Mantis.lua | 4 +- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/Moose Development/Moose/Cargo/Cargo.lua b/Moose Development/Moose/Cargo/Cargo.lua index c9297378a..8b7d6040e 100644 --- a/Moose Development/Moose/Cargo/Cargo.lua +++ b/Moose Development/Moose/Cargo/Cargo.lua @@ -370,7 +370,7 @@ CARGOS = {} do -- CARGO - --- @type CARGO + -- @type CARGO -- @extends Core.Fsm#FSM_PROCESS -- @field #string Type A string defining the type of the cargo. eg. Engineers, Equipment, Screwdrivers. -- @field #string Name A string defining the name of the cargo. The name is the unique identifier of the cargo. @@ -433,7 +433,7 @@ do -- CARGO Reported = {}, } - --- @type CARGO.CargoObjects + -- @type CARGO.CargoObjects -- @map < #string, Wrapper.Positionable#POSITIONABLE > The alive POSITIONABLE objects representing the the cargo. --- CARGO Constructor. This class is an abstract class and should not be instantiated. @@ -447,7 +447,7 @@ do -- CARGO function CARGO:New( Type, Name, Weight, LoadRadius, NearRadius ) --R2.1 local self = BASE:Inherit( self, FSM:New() ) -- #CARGO - self:F( { Type, Name, Weight, LoadRadius, NearRadius } ) + self:T( { Type, Name, Weight, LoadRadius, NearRadius } ) self:SetStartState( "UnLoaded" ) self:AddTransition( { "UnLoaded", "Boarding" }, "Board", "Boarding" ) @@ -711,7 +711,7 @@ do -- CARGO -- @param #CARGO self -- @return #CARGO function CARGO:Spawn( PointVec2 ) - self:F() + self:T() end @@ -812,7 +812,7 @@ do -- CARGO -- @param Core.Point#COORDINATE Coordinate -- @return #boolean true if the CargoGroup is within the loading radius. function CARGO:IsInLoadRadius( Coordinate ) - self:F( { Coordinate, LoadRadius = self.LoadRadius } ) + self:T( { Coordinate, LoadRadius = self.LoadRadius } ) local Distance = 0 if self:IsUnLoaded() then @@ -832,7 +832,7 @@ do -- CARGO -- @param Core.Point#COORDINATE Coordinate -- @return #boolean true if the Cargo can report itself. function CARGO:IsInReportRadius( Coordinate ) - self:F( { Coordinate } ) + self:T( { Coordinate } ) local Distance = 0 if self:IsUnLoaded() then @@ -853,23 +853,23 @@ do -- CARGO -- @param #number NearRadius The radius when the cargo will board the Carrier (to avoid collision). -- @return #boolean function CARGO:IsNear( Coordinate, NearRadius ) - --self:F( { PointVec2 = PointVec2, NearRadius = NearRadius } ) + --self:T( { PointVec2 = PointVec2, NearRadius = NearRadius } ) if self.CargoObject:IsAlive() then --local Distance = PointVec2:Get2DDistance( self.CargoObject:GetPointVec2() ) - --self:F( { CargoObjectName = self.CargoObject:GetName() } ) - --self:F( { CargoObjectVec2 = self.CargoObject:GetVec2() } ) - --self:F( { PointVec2 = PointVec2:GetVec2() } ) + --self:T( { CargoObjectName = self.CargoObject:GetName() } ) + --self:T( { CargoObjectVec2 = self.CargoObject:GetVec2() } ) + --self:T( { PointVec2 = PointVec2:GetVec2() } ) local Distance = Coordinate:Get2DDistance( self.CargoObject:GetCoordinate() ) - --self:F( { Distance = Distance, NearRadius = NearRadius or "nil" } ) + --self:T( { Distance = Distance, NearRadius = NearRadius or "nil" } ) if Distance <= NearRadius then - --self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = true } ) + --self:T( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = true } ) return true end end - --self:F( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = false } ) + --self:T( { PointVec2 = PointVec2, NearRadius = NearRadius, IsNear = false } ) return false end @@ -878,12 +878,12 @@ do -- CARGO -- @param Core.Zone#ZONE_BASE Zone -- @return #boolean **true** if cargo is in the Zone, **false** if cargo is not in the Zone. function CARGO:IsInZone( Zone ) - --self:F( { Zone } ) + --self:T( { Zone } ) if self:IsLoaded() then return Zone:IsPointVec2InZone( self.CargoCarrier:GetPointVec2() ) else - --self:F( { Size = self.CargoObject:GetSize(), Units = self.CargoObject:GetUnits() } ) + --self:T( { Size = self.CargoObject:GetSize(), Units = self.CargoObject:GetUnits() } ) if self.CargoObject:GetSize() ~= 0 then return Zone:IsPointVec2InZone( self.CargoObject:GetPointVec2() ) else @@ -1034,7 +1034,7 @@ end -- CARGO do -- CARGO_REPRESENTABLE - --- @type CARGO_REPRESENTABLE + -- @type CARGO_REPRESENTABLE -- @extends #CARGO -- @field test @@ -1056,7 +1056,7 @@ do -- CARGO_REPRESENTABLE -- Inherit CARGO. local self = BASE:Inherit( self, CARGO:New( Type, Name, 0, LoadRadius, NearRadius ) ) -- #CARGO_REPRESENTABLE - self:F( { Type, Name, LoadRadius, NearRadius } ) + self:T( { Type, Name, LoadRadius, NearRadius } ) -- Descriptors. local Desc=CargoObject:GetDesc() @@ -1086,7 +1086,7 @@ do -- CARGO_REPRESENTABLE function CARGO_REPRESENTABLE:Destroy() -- Cargo objects are deleted from the _DATABASE and SET_CARGO objects. - self:F( { CargoName = self:GetName() } ) + self:T( { CargoName = self:GetName() } ) --_EVENTDISPATCHER:CreateEventDeleteCargo( self ) return self @@ -1123,12 +1123,12 @@ do -- CARGO_REPRESENTABLE CoordinateZone:Scan( { Object.Category.UNIT } ) for _, DCSUnit in pairs( CoordinateZone:GetScannedUnits() ) do local NearUnit = UNIT:Find( DCSUnit ) - self:F({NearUnit=NearUnit}) + self:T({NearUnit=NearUnit}) local NearUnitCoalition = NearUnit:GetCoalition() local CargoCoalition = self:GetCoalition() if NearUnitCoalition == CargoCoalition then local Attributes = NearUnit:GetDesc() - self:F({Desc=Attributes}) + self:T({Desc=Attributes}) if NearUnit:HasAttribute( "Trucks" ) then MESSAGE:New( Message, 20, NearUnit:GetCallsign() .. " reporting - Cargo " .. self:GetName() ):ToGroup( TaskGroup ) break @@ -1142,7 +1142,7 @@ end -- CARGO_REPRESENTABLE do -- CARGO_REPORTABLE - --- @type CARGO_REPORTABLE + -- @type CARGO_REPORTABLE -- @extends #CARGO CARGO_REPORTABLE = { ClassName = "CARGO_REPORTABLE" @@ -1158,7 +1158,7 @@ do -- CARGO_REPORTABLE -- @return #CARGO_REPORTABLE function CARGO_REPORTABLE:New( Type, Name, Weight, LoadRadius, NearRadius ) local self = BASE:Inherit( self, CARGO:New( Type, Name, Weight, LoadRadius, NearRadius ) ) -- #CARGO_REPORTABLE - self:F( { Type, Name, Weight, LoadRadius, NearRadius } ) + self:T( { Type, Name, Weight, LoadRadius, NearRadius } ) return self end @@ -1178,7 +1178,7 @@ end do -- CARGO_PACKAGE - --- @type CARGO_PACKAGE + -- @type CARGO_PACKAGE -- @extends #CARGO_REPRESENTABLE CARGO_PACKAGE = { ClassName = "CARGO_PACKAGE" @@ -1195,7 +1195,7 @@ do -- CARGO_PACKAGE -- @return #CARGO_PACKAGE function CARGO_PACKAGE:New( CargoCarrier, Type, Name, Weight, LoadRadius, NearRadius ) local self = BASE:Inherit( self, CARGO_REPRESENTABLE:New( CargoCarrier, Type, Name, Weight, LoadRadius, NearRadius ) ) -- #CARGO_PACKAGE - self:F( { Type, Name, Weight, LoadRadius, NearRadius } ) + self:T( { Type, Name, Weight, LoadRadius, NearRadius } ) self:T( CargoCarrier ) self.CargoCarrier = CargoCarrier @@ -1213,7 +1213,7 @@ end -- @param #number BoardDistance -- @param #number Angle function CARGO_PACKAGE:onafterOnBoard( From, Event, To, CargoCarrier, Speed, BoardDistance, LoadDistance, Angle ) - self:F() + self:T() self.CargoInAir = self.CargoCarrier:InAir() @@ -1246,7 +1246,7 @@ end -- @param Wrapper.Unit#UNIT CargoCarrier -- @return #boolean function CARGO_PACKAGE:IsNear( CargoCarrier ) - self:F() + self:T() local CargoCarrierPoint = CargoCarrier:GetCoordinate() @@ -1271,7 +1271,7 @@ end -- @param #number LoadDistance -- @param #number Angle function CARGO_PACKAGE:onafterOnBoarded( From, Event, To, CargoCarrier, Speed, BoardDistance, LoadDistance, Angle ) - self:F() + self:T() if self:IsNear( CargoCarrier ) then self:__Load( 1, CargoCarrier, Speed, LoadDistance, Angle ) @@ -1292,7 +1292,7 @@ end -- @param #number Radius -- @param #number Angle function CARGO_PACKAGE:onafterUnBoard( From, Event, To, CargoCarrier, Speed, UnLoadDistance, UnBoardDistance, Radius, Angle ) - self:F() + self:T() self.CargoInAir = self.CargoCarrier:InAir() @@ -1331,7 +1331,7 @@ end -- @param Wrapper.Unit#UNIT CargoCarrier -- @param #number Speed function CARGO_PACKAGE:onafterUnBoarded( From, Event, To, CargoCarrier, Speed ) - self:F() + self:T() if self:IsNear( CargoCarrier ) then self:__UnLoad( 1, CargoCarrier, Speed ) @@ -1350,7 +1350,7 @@ end -- @param #number LoadDistance -- @param #number Angle function CARGO_PACKAGE:onafterLoad( From, Event, To, CargoCarrier, Speed, LoadDistance, Angle ) - self:F() + self:T() self.CargoCarrier = CargoCarrier @@ -1378,7 +1378,7 @@ end -- @param #number Distance -- @param #number Angle function CARGO_PACKAGE:onafterUnLoad( From, Event, To, CargoCarrier, Speed, Distance, Angle ) - self:F() + self:T() local StartPointVec2 = self.CargoCarrier:GetPointVec2() local CargoCarrierHeading = self.CargoCarrier:GetHeading() -- Get Heading of object in degrees. diff --git a/Moose Development/Moose/Cargo/CargoGroup.lua b/Moose Development/Moose/Cargo/CargoGroup.lua index 4f76aac4c..0cb2f1d5b 100644 --- a/Moose Development/Moose/Cargo/CargoGroup.lua +++ b/Moose Development/Moose/Cargo/CargoGroup.lua @@ -64,7 +64,7 @@ do -- CARGO_GROUP -- Inherit CAROG_REPORTABLE local self = BASE:Inherit( self, CARGO_REPORTABLE:New( Type, Name, 0, LoadRadius, NearRadius ) ) -- #CARGO_GROUP - self:F( { Type, Name, LoadRadius } ) + self:T( { Type, Name, LoadRadius } ) self.CargoSet = SET_CARGO:New() self.CargoGroup = CargoGroup @@ -146,7 +146,7 @@ do -- CARGO_GROUP -- @param #CARGO_GROUP self function CARGO_GROUP:Respawn() - self:F( { "Respawning" } ) + self:T( { "Respawning" } ) for CargoID, CargoData in pairs( self.CargoSet:GetSet() ) do local Cargo = CargoData -- Cargo.Cargo#CARGO @@ -227,7 +227,7 @@ do -- CARGO_GROUP -- @param #CARGO_GROUP self function CARGO_GROUP:Regroup() - self:F("Regroup") + self:T("Regroup") if self.Grouped == false then @@ -241,7 +241,7 @@ do -- CARGO_GROUP for CargoUnitName, CargoUnit in pairs( self.CargoSet:GetSet() ) do local CargoUnit = CargoUnit -- Cargo.CargoUnit#CARGO_UNIT - self:F( { CargoUnit:GetName(), UnLoaded = CargoUnit:IsUnLoaded() } ) + self:T( { CargoUnit:GetName(), UnLoaded = CargoUnit:IsUnLoaded() } ) if CargoUnit:IsUnLoaded() then @@ -258,7 +258,7 @@ do -- CARGO_GROUP -- Then we register the new group in the database self.CargoGroup = GROUP:NewTemplate( GroupTemplate, GroupTemplate.CoalitionID, GroupTemplate.CategoryID, GroupTemplate.CountryID ) - self:F( { "Regroup", GroupTemplate } ) + self:T( { "Regroup", GroupTemplate } ) -- Now we spawn the new group based on the template created. self.CargoObject = _DATABASE:Spawn( GroupTemplate ) @@ -309,14 +309,14 @@ do -- CARGO_GROUP -- @param Wrapper.Unit#UNIT CargoCarrier -- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier. function CARGO_GROUP:onafterBoard( From, Event, To, CargoCarrier, NearRadius, ... ) - self:F( { CargoCarrier.UnitName, From, Event, To, NearRadius = NearRadius } ) + self:T( { CargoCarrier.UnitName, From, Event, To, NearRadius = NearRadius } ) NearRadius = NearRadius or self.NearRadius -- For each Cargo object within the CARGO_GROUPED, route each object to the CargoLoadPointVec2 self.CargoSet:ForEach( function( Cargo, ... ) - self:F( { "Board Unit", Cargo:GetName( ), Cargo:IsDestroyed(), Cargo.CargoObject:IsAlive() } ) + self:T( { "Board Unit", Cargo:GetName( ), Cargo:IsDestroyed(), Cargo.CargoObject:IsAlive() } ) local CargoGroup = Cargo.CargoObject --Wrapper.Group#GROUP CargoGroup:OptionAlarmStateGreen() Cargo:__Board( 1, CargoCarrier, NearRadius, ... ) @@ -334,7 +334,7 @@ do -- CARGO_GROUP -- @param #string To -- @param Wrapper.Unit#UNIT CargoCarrier function CARGO_GROUP:onafterLoad( From, Event, To, CargoCarrier, ... ) - --self:F( { From, Event, To, CargoCarrier, ...} ) + --self:T( { From, Event, To, CargoCarrier, ...} ) if From == "UnLoaded" then -- For each Cargo object within the CARGO_GROUP, load each cargo to the CargoCarrier. @@ -359,7 +359,7 @@ do -- CARGO_GROUP -- @param Wrapper.Unit#UNIT CargoCarrier -- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier. function CARGO_GROUP:onafterBoarding( From, Event, To, CargoCarrier, NearRadius, ... ) - --self:F( { CargoCarrier.UnitName, From, Event, To } ) + --self:T( { CargoCarrier.UnitName, From, Event, To } ) local Boarded = true local Cancelled = false @@ -393,7 +393,7 @@ do -- CARGO_GROUP if not Boarded then self:__Boarding( -5, CargoCarrier, NearRadius, ... ) else - self:F("Group Cargo is loaded") + self:T("Group Cargo is loaded") self:__Load( 1, CargoCarrier, ... ) end else @@ -413,7 +413,7 @@ do -- CARGO_GROUP -- @param Core.Point#POINT_VEC2 ToPointVec2 -- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier. function CARGO_GROUP:onafterUnBoard( From, Event, To, ToPointVec2, NearRadius, ... ) - self:F( {From, Event, To, ToPointVec2, NearRadius } ) + self:T( {From, Event, To, ToPointVec2, NearRadius } ) NearRadius = NearRadius or 25 @@ -456,7 +456,7 @@ do -- CARGO_GROUP -- @param Core.Point#POINT_VEC2 ToPointVec2 -- @param #number NearRadius If distance is smaller than this number, cargo is loaded into the carrier. function CARGO_GROUP:onafterUnBoarding( From, Event, To, ToPointVec2, NearRadius, ... ) - --self:F( { From, Event, To, ToPointVec2, NearRadius } ) + --self:T( { From, Event, To, ToPointVec2, NearRadius } ) --local NearRadius = NearRadius or 25 @@ -493,7 +493,7 @@ do -- CARGO_GROUP -- @param #string To -- @param Core.Point#POINT_VEC2 ToPointVec2 function CARGO_GROUP:onafterUnLoad( From, Event, To, ToPointVec2, ... ) - --self:F( { From, Event, To, ToPointVec2 } ) + --self:T( { From, Event, To, ToPointVec2 } ) if From == "Loaded" then @@ -611,7 +611,7 @@ do -- CARGO_GROUP -- @param #CARGO_GROUP self -- @param Core.Point#COORDINATE Coordinate function CARGO_GROUP:RouteTo( Coordinate ) - --self:F( {Coordinate = Coordinate } ) + --self:T( {Coordinate = Coordinate } ) -- For each Cargo within the CargoSet, route each object to the Coordinate self.CargoSet:ForEach( @@ -629,13 +629,13 @@ do -- CARGO_GROUP -- @param #number NearRadius -- @return #boolean The Cargo is near to the Carrier or #nil if the Cargo is not near to the Carrier. function CARGO_GROUP:IsNear( CargoCarrier, NearRadius ) - self:F( {NearRadius = NearRadius } ) + self:T( {NearRadius = NearRadius } ) for _, Cargo in pairs( self.CargoSet:GetSet() ) do local Cargo = Cargo -- Cargo.Cargo#CARGO if Cargo:IsAlive() then if Cargo:IsNear( CargoCarrier:GetCoordinate(), NearRadius ) then - self:F( "Near" ) + self:T( "Near" ) return true end end @@ -649,7 +649,7 @@ do -- CARGO_GROUP -- @param Core.Point#COORDINATE Coordinate -- @return #boolean true if the Cargo Group is within the load radius. function CARGO_GROUP:IsInLoadRadius( Coordinate ) - --self:F( { Coordinate } ) + --self:T( { Coordinate } ) local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO @@ -669,7 +669,7 @@ do -- CARGO_GROUP return false end - self:F( { Distance = Distance, LoadRadius = self.LoadRadius } ) + self:T( { Distance = Distance, LoadRadius = self.LoadRadius } ) if Distance <= self.LoadRadius then return true else @@ -687,12 +687,12 @@ do -- CARGO_GROUP -- @param Core.Point#Coordinate Coordinate -- @return #boolean true if the Cargo Group is within the report radius. function CARGO_GROUP:IsInReportRadius( Coordinate ) - --self:F( { Coordinate } ) + --self:T( { Coordinate } ) local Cargo = self:GetFirstAlive() -- Cargo.Cargo#CARGO if Cargo then - self:F( { Cargo } ) + self:T( { Cargo } ) local Distance = 0 if Cargo:IsUnLoaded() then Distance = Coordinate:Get2DDistance( Cargo.CargoObject:GetCoordinate() ) @@ -738,7 +738,7 @@ do -- CARGO_GROUP -- @return #boolean **true** if the first element of the CargoGroup is in the Zone -- @return #boolean **false** if there is no element of the CargoGroup in the Zone. function CARGO_GROUP:IsInZone( Zone ) - --self:F( { Zone } ) + --self:T( { Zone } ) local Cargo = self.CargoSet:GetFirst() -- Cargo.Cargo#CARGO diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index ce95806b1..1ebe4124e 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -94,7 +94,7 @@ -- Known SAM types at the time of writing are: -- -- * Avenger --- * Chaparrel +-- * Chaparral -- * Hawk -- * Linebacker -- * NASAMS @@ -365,7 +365,7 @@ MANTIS.SamData = { ["SA-15"] = { Range=11, Blindspot=0, Height=6, Type="Short", Radar="Tor 9A331" }, ["SA-13"] = { Range=5, Blindspot=0, Height=3, Type="Short", Radar="Strela" }, ["Avenger"] = { Range=4, Blindspot=0, Height=3, Type="Short", Radar="Avenger" }, - ["Chaparrel"] = { Range=8, Blindspot=0, Height=3, Type="Short", Radar="Chaparral" }, + ["Chaparral"] = { Range=8, Blindspot=0, Height=3, Type="Short", Radar="Chaparral" }, ["Linebacker"] = { Range=4, Blindspot=0, Height=3, Type="Short", Radar="Linebacker" }, ["Silkworm"] = { Range=90, Blindspot=1, Height=0.2, Type="Long", Radar="Silkworm" }, -- units from HDS Mod, multi launcher options is tricky From 4fe1318e7c1c46842de54c9fd7b3d5ed256f849c Mon Sep 17 00:00:00 2001 From: kaltokri Date: Thu, 28 Dec 2023 16:38:26 +0100 Subject: [PATCH 3/4] Fixed a logic failure with external sound files in SoundOutput.lua --- Moose Development/Moose/Sound/SoundOutput.lua | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Moose Development/Moose/Sound/SoundOutput.lua b/Moose Development/Moose/Sound/SoundOutput.lua index e1c34916b..408be7b96 100644 --- a/Moose Development/Moose/Sound/SoundOutput.lua +++ b/Moose Development/Moose/Sound/SoundOutput.lua @@ -199,6 +199,8 @@ do -- Sound File else -- use internal path in miz file self.path="l10n/DEFAULT/" end + else + self.path = Path end -- Remove (back)slashes. From b052d993491064276fa37f5841734ff3e31dd879 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 29 Dec 2023 14:49:57 +0100 Subject: [PATCH 4/4] Fixes --- Moose Development/Moose/Functional/Mantis.lua | 8 +++---- Moose Development/Moose/Functional/Sead.lua | 8 +++---- .../Moose/Wrapper/Controllable.lua | 21 ++++++++++++++----- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index 1ebe4124e..a9c4ddd79 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -22,7 +22,7 @@ -- @module Functional.Mantis -- @image Functional.Mantis.jpg -- --- Last Update: Nov 2023 +-- Last Update: Dec 2023 ------------------------------------------------------------------------- --- **MANTIS** class, extends Core.Base#BASE @@ -631,7 +631,7 @@ do -- TODO Version -- @field #string version - self.version="0.8.15" + self.version="0.8.16" self:I(string.format("***** Starting MANTIS Version %s *****", self.version)) --- FSM Functions --- @@ -1149,7 +1149,7 @@ do --self:T(self.lid.." Relocating HQ") local text = self.lid.." Relocating HQ" --local m= MESSAGE:New(text,10,"MANTIS"):ToAll() - _hqgrp:RelocateGroundRandomInRadius(20,500,true,true) + _hqgrp:RelocateGroundRandomInRadius(20,500,true,true,nil,true) end --relocate EWR -- TODO: maybe dependent on AlarmState? Observed: SA11 SR only relocates if no objects in reach @@ -1163,7 +1163,7 @@ do local text = self.lid.." Relocating EWR ".._grp:GetName() local m= MESSAGE:New(text,10,"MANTIS"):ToAllIf(self.debug) if self.verbose then self:I(text) end - _grp:RelocateGroundRandomInRadius(20,500,true,true) + _grp:RelocateGroundRandomInRadius(20,500,true,true,nil,true) end end end diff --git a/Moose Development/Moose/Functional/Sead.lua b/Moose Development/Moose/Functional/Sead.lua index 07fb312c5..4c02b7b7f 100644 --- a/Moose Development/Moose/Functional/Sead.lua +++ b/Moose Development/Moose/Functional/Sead.lua @@ -17,9 +17,9 @@ -- -- === -- --- ### Authors: **FlightControl**, **applevangelist** +-- ### Authors: **applevangelist**, **FlightControl** -- --- Last Update: Oct 2023 +-- Last Update: Dec 2023 -- -- === -- @@ -144,7 +144,7 @@ function SEAD:New( SEADGroupPrefixes, Padding ) self:AddTransition("*", "ManageEvasion", "*") self:AddTransition("*", "CalculateHitZone", "*") - self:I("*** SEAD - Started Version 0.4.5") + self:I("*** SEAD - Started Version 0.4.6") return self end @@ -401,7 +401,7 @@ function SEAD:onafterManageEvasion(From,Event,To,_targetskill,_targetgroup,SEADP grp:EnableEmission(false) end grp:OptionAlarmStateGreen() -- needed else we cannot move around - grp:RelocateGroundRandomInRadius(20,300,false,false,"Diamond") + grp:RelocateGroundRandomInRadius(20,300,false,false,"Diamond",true) if self.UseCallBack then local object = self.CallBack object:SeadSuppressionStart(grp,name,attacker) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 0bed05a72..67a3cdcfe 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -2937,7 +2937,7 @@ function CONTROLLABLE:CopyRoute( Begin, End, Randomize, Radius ) end --- Return the detected targets of the controllable. --- The optional parametes specify the detection methods that can be applied. +-- The optional parameters specify the detection methods that can be applied. -- If no detection method is given, the detection will use all the available methods by default. -- @param #CONTROLLABLE self -- @param #boolean DetectVisual (optional) @@ -4025,14 +4025,22 @@ end -- @param #boolean onroad If true, route on road (less problems with AI way finding), default true -- @param #boolean shortcut If true and onroad is set, take a shorter route - if available - off road, default false -- @param #string formation Formation string as in the mission editor, e.g. "Vee", "Diamond", "Line abreast", etc. Defaults to "Off Road" +-- @param #boolean onland (optional) If true, try up to 50 times to get a coordinate on land.SurfaceType.LAND. Note - this descriptor value is not reliably implemented on all maps. -- @return #CONTROLLABLE self -function CONTROLLABLE:RelocateGroundRandomInRadius( speed, radius, onroad, shortcut, formation ) +function CONTROLLABLE:RelocateGroundRandomInRadius( speed, radius, onroad, shortcut, formation, onland ) self:F2( { self.ControllableName } ) local _coord = self:GetCoordinate() local _radius = radius or 500 local _speed = speed or 20 local _tocoord = _coord:GetRandomCoordinateInRadius( _radius, 100 ) + if onland then + for i=1,50 do + local island = _tocoord:GetSurfaceType() == land.SurfaceType.LAND and true or false + if island then break end + _tocoord = _coord:GetRandomCoordinateInRadius( _radius, 100 ) + end + end local _onroad = onroad or true local _grptsk = {} local _candoroad = false @@ -5349,9 +5357,10 @@ end -- @param #number Altitude (Optional) Altitude in meters. Defaults to the altitude of the coordinate. -- @param #number Speed (Optional) Speed in kph. Defaults to 500 kph. -- @param #number Formation (Optional) Formation to take, e.g. ENUMS.Formation.FixedWing.Trail.Close, also see [Hoggit Wiki](https://wiki.hoggitworld.com/view/DCS_option_formation). +-- @param #boolean AGL (Optional) If true, set altitude to above ground level (AGL), not above sea level (ASL). -- @param #number Delay (Optional) Set the task after delay seconds only. -- @return #CONTROLLABLE self -function CONTROLLABLE:PatrolRaceTrack(Point1, Point2, Altitude, Speed, Formation, Delay) +function CONTROLLABLE:PatrolRaceTrack(Point1, Point2, Altitude, Speed, Formation, AGL, Delay) local PatrolGroup = self -- Wrapper.Group#GROUP @@ -5373,8 +5382,10 @@ function CONTROLLABLE:PatrolRaceTrack(Point1, Point2, Altitude, Speed, Formation -- Calculate the new Route if Altitude then - FromCoord:SetAltitude(Altitude) - ToCoord:SetAltitude(Altitude) + local asl = true + if AGL then asl = false end + FromCoord:SetAltitude(Altitude, asl) + ToCoord:SetAltitude(Altitude, asl) end -- Create a "air waypoint", which is a "point" structure that can be given as a parameter to a Task