From 12b596a47f92e77ce1e11fec3cc4c4f8b55fe398 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sat, 22 Feb 2025 16:36:15 +0100 Subject: [PATCH 1/8] #MANTIS - if no EWR system is left over, MANTIS will switch on a random SR/TR each cycle to detect incoming enemies. --- Moose Development/Moose/Functional/Mantis.lua | 61 +++++++++++++++---- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/Moose Development/Moose/Functional/Mantis.lua b/Moose Development/Moose/Functional/Mantis.lua index 4ae7b68e3..fd6dea106 100644 --- a/Moose Development/Moose/Functional/Mantis.lua +++ b/Moose Development/Moose/Functional/Mantis.lua @@ -148,6 +148,7 @@ -- **Location** is of highest importance here. Whilst AWACS in DCS has almost the "all seeing eye", EWR don't have that. Choose your location wisely, against a mountain backdrop or inside a valley even the best EWR system -- doesn't work well. Prefer higher-up locations with a good view; use F7 in-game to check where you actually placed your EWR and have a look around. Apart from the obvious choice, do also consider other radar units -- for this role, most have "SR" (search radar) or "STR" (search and track radar) in their names, use the encyclopedia to see what they actually do. +-- **HINT** Set at least one EWR on invisible and immortal so MANTIS doesn't stop working. -- -- ## 1.2 SAM sites -- @@ -201,7 +202,7 @@ -- -- parameters are numbers. Defaults are 1,2,2,6,6 respectively -- mybluemantis:SetMaxActiveSAMs(Short,Mid,Long,Classic,Point) -- --- ### 2.1.3 SHORAD/Point defense will automatically be added from SAM sites of type "short-range" if the range is less than 5km or if the type is AAA. +-- ### 2.1.3 SHORAD/Point defense will automatically be added from SAM sites of type "point" or if the range is less than 5km or if the type is AAA. -- -- ### 2.1.4 Advanced features -- @@ -684,7 +685,7 @@ do -- TODO Version -- @field #string version - self.version="0.9.24" + self.version="0.9.25" self:I(string.format("***** Starting MANTIS Version %s *****", self.version)) --- FSM Functions --- @@ -1146,6 +1147,24 @@ do end return self end + + --- [Internal] Check if any EWR or AWACS is still alive + -- @param #MANTIS self + -- @return #boolean outcome + function MANTIS:_CheckAnyEWRAlive() + self:T(self.lid .. "_CheckAnyEWRAlive") + local alive = false + if self.EWR_Group:CountAlive() > 0 then + alive = true + end + if not alive and self.AWACS_Prefix then + local awacs = GROUP:FindByName(self.AWACS_Prefix) + if awacs and awacs:IsAlive() then + alive = true + end + end + return alive + end --- [Internal] Function to determine state of the advanced mode -- @param #MANTIS self @@ -1757,9 +1776,9 @@ do local radius = _data[3] local height = _data[4] local blind = _data[5] * 1.25 + 1 - local shortsam = _data[6] == MANTIS.SamType.SHORT and true or false + local shortsam = (_data[6] == MANTIS.SamType.SHORT) and true or false if not shortsam then - shortsam = _data[6] == MANTIS.SamType.POINT and true or false + shortsam = (_data[6] == MANTIS.SamType.POINT) and true or false end local samgroup = GROUP:FindByName(name) local IsInZone, Distance = self:_CheckObjectInZone(detset, samcoordinate, radius, height, dlink) @@ -2001,12 +2020,34 @@ do if not self.state2flag then self:_Check(self.Detection,self.DLink) end - - --[[ check Awacs - if self.advAwacs and not self.state2flag then - self:_Check(self.AWACS_Detection,false) + + local EWRAlive = self:_CheckAnyEWRAlive() + + local function FindSAMSRTR() + for i=1,1000 do + local randomsam = self.SAM_Group:GetRandom() + if randomsam and randomsam:IsAlive() then + if randomsam:IsSAM() then return randomsam end + end + end + end + + -- Switch on a random SR/TR if no EWR left over + if not EWRAlive then + local randomsam = FindSAMSRTR() -- Wrapper.Group#GROUP + if randomsam and randomsam:IsAlive() then + if self.UseEmOnOff then + randomsam:EnableEmission(true) + else + randomsam:OptionAlarmStateRed() + end + local name = randomsam:GetName() + if self.SamStateTracker[name] ~= "RED" then + self:__RedState(1,randomsam) + self.SamStateTracker[name] = "RED" + end + end end - --]] -- relocate HQ and EWR if self.autorelocate then @@ -2016,8 +2057,6 @@ do local halfintv = math.floor(timepassed / relointerval) - --self:T({timepassed=timepassed, halfintv=halfintv}) - if halfintv >= 1 then self.TimeStamp = timer.getAbsTime() self:_Relocate() From 2fc7a3b542b04ec115510f27463488ad554ce16d Mon Sep 17 00:00:00 2001 From: leka1986 <83298840+leka1986@users.noreply.github.com> Date: Sun, 23 Feb 2025 02:34:04 +0100 Subject: [PATCH 2/8] Update Controllable.lua Fixing this error Line 26056: attempt to index local '_coord' (a nil value) in this line, local _tocoord=_coord:GetRandomCoordinateInRadius(_radius,100) --- Moose Development/Moose/Wrapper/Controllable.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 362f6eb03..5dbd66ffd 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -4263,6 +4263,9 @@ function CONTROLLABLE:RelocateGroundRandomInRadius( speed, radius, onroad, short self:F2( { self.ControllableName } ) local _coord = self:GetCoordinate() + if not _coord then + return self + end local _radius = radius or 500 local _speed = speed or 20 local _tocoord = _coord:GetRandomCoordinateInRadius( _radius, 100 ) From 1c0a8d9380e65344a45005e1f887cabe100f46ee Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 23 Feb 2025 16:10:07 +0100 Subject: [PATCH 3/8] #SET_CLIENT - added option to handle CA slots #CONTROLLABLE - fix typos --- Moose Development/Moose/Core/Set.lua | 10 ++++++++++ Moose Development/Moose/Wrapper/Controllable.lua | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index 56ec9ecab..f2b6e6d3c 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -4611,6 +4611,16 @@ do -- SET_CLIENT end return self end + + --- Make the SET handle CA slots **only** (GROUND units used by any player). Needs active filtering with `FilterStart()` + -- @param #SET_CLIENT self + -- @return #SET_CLIENT self + function SET_CLIENT:HandleCASlots() + self:HandleEvent(EVENTS.PlayerEnterUnit,SET_CLIENT._EventPlayerEnterUnit) + self:HandleEvent(EVENTS.PlayerLeaveUnit,SET_CLIENT._EventPlayerLeaveUnit) + self:FilterFunction(function(client) if client and client:IsAlive() and client:IsGround() then return true else return false end end) + return self + end --- Handles the Database to check on an event (birth) that the Object was added in the Database. -- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event! diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index 5dbd66ffd..dd95b441e 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -973,7 +973,7 @@ end -- @param #number Frequency Radio frequency in MHz. -- @param #number Modulation Radio modulation. Default `radio.modulation.AM`. -- @param #number Power (Optional) Power of the Radio in Watts. Defaults to 10. --- @param #UnitID UnitID (Optional, if your object is a UNIT) The UNIT ID this is for. +-- @param #number UnitID (Optional, if your object is a UNIT) The UNIT ID this is for. -- @param #number Delay (Optional) Delay in seconds before the frequency is set. Default is immediately. -- @return #CONTROLLABLE self function CONTROLLABLE:CommandSetFrequencyForUnit(Frequency,Modulation,Power,UnitID,Delay) @@ -4315,7 +4315,7 @@ function CONTROLLABLE:OptionDisperseOnAttack( Seconds ) end --- Returns if the unit is a submarine. --- @param #POSITIONABLE self +-- @param #CONTROLLABLE self -- @return #boolean Submarines attributes result. function CONTROLLABLE:IsSubmarine() self:F2() From 41b867a4ca53a4ef1e285c63fb7ac11333e60372 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Sun, 2 Mar 2025 12:40:00 +0100 Subject: [PATCH 4/8] #GROUP - ensure GROUP:GetCoordinate() returns a group heading data field --- Moose Development/Moose/Wrapper/Group.lua | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index 17f23ed3c..75ece35ee 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -1227,11 +1227,14 @@ function GROUP:GetCoordinate() -- First try to get the 3D vector of the group. This uses local vec3=self:GetVec3() + local coord if vec3 then - local coord=COORDINATE:NewFromVec3(vec3) + coord=COORDINATE:NewFromVec3(vec3) + coord.Heading = self:GetHeading() or 0 return coord end + -- No luck try units and add Heading data local Units = self:GetUnits() or {} for _,_unit in pairs(Units) do @@ -1242,15 +1245,15 @@ function GROUP:GetCoordinate() local FirstUnitCoordinate = FirstUnit:GetCoordinate() if FirstUnitCoordinate then - local Heading = self:GetHeading() + local Heading = self:GetHeading() or 0 FirstUnitCoordinate.Heading = Heading return FirstUnitCoordinate end end end - -- no luck, try the API way + -- no luck, try the API way local DCSGroup = Group.getByName(self.GroupName) if DCSGroup then local DCSUnits = DCSGroup:getUnits() or {} @@ -1261,14 +1264,19 @@ function GROUP:GetCoordinate() if point then --self:I(point) local coord = COORDINATE:NewFromVec3(point) + coord.Heading = 0 + local munit = UNIT:Find(_unit) + if munit then + coord.Heading = munit:GetHeading() or 0 + end return coord end end end end - + BASE:E( { "Cannot GetCoordinate", Group = self, Alive = self:IsAlive() } ) - + end From 0b8810f8b38ab61795bc3b15a6146ec4df713958 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:16:47 +0100 Subject: [PATCH 5/8] Update ATIS.lua ATIS - Fix for Kola map when no sunset or sunrise arise and SRS is not used --- Moose Development/Moose/Ops/ATIS.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 32d43a1ca..548280fad 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -2049,12 +2049,14 @@ function ATIS:onafterBroadcast( From, Event, To ) local sunrise = coord:GetSunrise() --self:I(sunrise) local SUNRISE = "no time" + local NorthPolar = true if tostring(sunrise) ~= "N/S" and tostring(sunrise) ~= "N/R" then sunrise = UTILS.Split( sunrise, ":" ) SUNRISE = string.format( "%s%s", sunrise[1], sunrise[2] ) if self.useSRS then SUNRISE = string.format( "%s %s %s", sunrise[1], sunrise[2], hours ) end + NorthPolar = false end local sunset = coord:GetSunset() @@ -2066,6 +2068,7 @@ function ATIS:onafterBroadcast( From, Event, To ) if self.useSRS then SUNSET = string.format( "%s %s %s", sunset[1], sunset[2], hours ) end + NorthPolar = false end --------------------------------- @@ -2405,7 +2408,7 @@ function ATIS:onafterBroadcast( From, Event, To ) local sunrise = self.gettext:GetEntry("SUNRISEAT",self.locale) --subtitle = string.format( "Sunrise at %s local time", SUNRISE ) subtitle = string.format( sunrise, SUNRISE ) - if not self.useSRS then + if not self.useSRS and == false then self:Transmission( self.Sound.SunriseAt, 0.5, subtitle ) self.radioqueue:Number2Transmission( SUNRISE, nil, 0.2 ) self:Transmission( self.Sound.TimeLocal, 0.2 ) @@ -2416,7 +2419,7 @@ function ATIS:onafterBroadcast( From, Event, To ) local sunset = self.gettext:GetEntry("SUNSETAT",self.locale) --subtitle = string.format( "Sunset at %s local time", SUNSET ) subtitle = string.format( sunset, SUNSET ) - if not self.useSRS then + if not self.useSRS and == false then self:Transmission( self.Sound.SunsetAt, 0.5, subtitle ) self.radioqueue:Number2Transmission( SUNSET, nil, 0.5 ) self:Transmission( self.Sound.TimeLocal, 0.2 ) From 70e9d91bb5fd5e2eae8e3f1f63265f58dae36341 Mon Sep 17 00:00:00 2001 From: Thomas <72444570+Applevangelist@users.noreply.github.com> Date: Mon, 3 Mar 2025 14:19:11 +0100 Subject: [PATCH 6/8] Update ATIS.lua --- Moose Development/Moose/Ops/ATIS.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Moose Development/Moose/Ops/ATIS.lua b/Moose Development/Moose/Ops/ATIS.lua index 548280fad..2366ff09b 100644 --- a/Moose Development/Moose/Ops/ATIS.lua +++ b/Moose Development/Moose/Ops/ATIS.lua @@ -2408,7 +2408,7 @@ function ATIS:onafterBroadcast( From, Event, To ) local sunrise = self.gettext:GetEntry("SUNRISEAT",self.locale) --subtitle = string.format( "Sunrise at %s local time", SUNRISE ) subtitle = string.format( sunrise, SUNRISE ) - if not self.useSRS and == false then + if not self.useSRS and NorthPolar == false then self:Transmission( self.Sound.SunriseAt, 0.5, subtitle ) self.radioqueue:Number2Transmission( SUNRISE, nil, 0.2 ) self:Transmission( self.Sound.TimeLocal, 0.2 ) @@ -2419,7 +2419,7 @@ function ATIS:onafterBroadcast( From, Event, To ) local sunset = self.gettext:GetEntry("SUNSETAT",self.locale) --subtitle = string.format( "Sunset at %s local time", SUNSET ) subtitle = string.format( sunset, SUNSET ) - if not self.useSRS and == false then + if not self.useSRS and NorthPolar == false then self:Transmission( self.Sound.SunsetAt, 0.5, subtitle ) self.radioqueue:Number2Transmission( SUNSET, nil, 0.5 ) self:Transmission( self.Sound.TimeLocal, 0.2 ) From c808e4a4e21e554314198969517f0ab60818bf8f Mon Sep 17 00:00:00 2001 From: Frank Date: Wed, 5 Mar 2025 20:48:15 +0100 Subject: [PATCH 7/8] Update Airbase.lua - Added FighterAircraftSmall parking spot type --- Moose Development/Moose/Wrapper/Airbase.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Moose Development/Moose/Wrapper/Airbase.lua b/Moose Development/Moose/Wrapper/Airbase.lua index 1a1d6566e..93d672750 100644 --- a/Moose Development/Moose/Wrapper/Airbase.lua +++ b/Moose Development/Moose/Wrapper/Airbase.lua @@ -926,11 +926,12 @@ AIRBASE.Iraq = { -- @field #number HelicopterOnly 40: Special spots for Helicopers. -- @field #number Shelter 68: Hardened Air Shelter. Currently only on Caucaus map. -- @field #number OpenMed 72: Open/Shelter air airplane only. +-- @field #number SmallSizeFigher 100: Tight spots for smaller type fixed wing aircraft, like the F-16. Example of these spots: 04, 05, 06 on Muwaffaq_Salti. A Viper sized plane can spawn here, but an A-10 or Strike Eagle can't -- @field #number OpenBig 104: Open air spawn points. Generally larger but does not guarantee large aircraft are capable of spawning there. -- @field #number OpenMedOrBig 176: Combines OpenMed and OpenBig spots. -- @field #number HelicopterUsable 216: Combines HelicopterOnly, OpenMed and OpenBig. --- @field #number FighterAircraft 244: Combines Shelter. OpenMed and OpenBig spots. So effectively all spots usable by fixed wing aircraft. --- @field #number SmallSizeFigher 100: Tight spots for smaller type fixed wing aircraft, like the F-16. Example of these spots: 04, 05, 06 on Muwaffaq_Salti. A Viper sized plane can spawn here, but an A-10 or Strike Eagle can't +-- @field #number FighterAircraft 244: Combines Shelter, OpenMed and OpenBig spots. So effectively all spots usable by fixed wing aircraft. +-- @field #number FighterAircraftSmall 344: Combines Shelter, SmallsizeFighter, OpenMed and OpenBig spots. So effectively all spots usable by small fixed wing aircraft. AIRBASE.TerminalType = { Runway=16, HelicopterOnly=40, @@ -941,6 +942,7 @@ AIRBASE.TerminalType = { OpenMedOrBig=176, HelicopterUsable=216, FighterAircraft=244, + FighterAircraftSmall=344, } --- Status of a parking spot. @@ -2013,9 +2015,13 @@ function AIRBASE._CheckTerminalType(Term_Type, termtype) match=true end elseif termtype==AIRBASE.TerminalType.FighterAircraft then - if Term_Type==AIRBASE.TerminalType.OpenMed or Term_Type==AIRBASE.TerminalType.OpenBig or Term_Type==AIRBASE.TerminalType.Shelter or Term_Type==AIRBASE.TerminalType.SmallSizeFighter then + if Term_Type==AIRBASE.TerminalType.OpenMed or Term_Type==AIRBASE.TerminalType.OpenBig or Term_Type==AIRBASE.TerminalType.Shelter then match=true end + elseif termtype==AIRBASE.TerminalType.FighterAircraftSmall then + if Term_Type==AIRBASE.TerminalType.OpenMed or Term_Type==AIRBASE.TerminalType.OpenBig or Term_Type==AIRBASE.TerminalType.Shelter or Term_Type==AIRBASE.TerminalType.SmallSizeFighter then + match=true + end end return match From 45ebf9a3c7526769ee8183842e9850ae8f461978 Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Thu, 6 Mar 2025 12:25:53 +0100 Subject: [PATCH 8/8] #ZONE_ELASTIC - Fix zone filling --- Moose Development/Moose/Core/Zone.lua | 187 +++++++++++++------------- 1 file changed, 95 insertions(+), 92 deletions(-) diff --git a/Moose Development/Moose/Core/Zone.lua b/Moose Development/Moose/Core/Zone.lua index ceca5fb02..463629249 100644 --- a/Moose Development/Moose/Core/Zone.lua +++ b/Moose Development/Moose/Core/Zone.lua @@ -144,7 +144,7 @@ ZONE_BASE = { -- @return #ZONE_BASE self function ZONE_BASE:New( ZoneName ) local self = BASE:Inherit( self, FSM:New() ) - self:F( ZoneName ) + --self:F( ZoneName ) self.ZoneName = ZoneName @@ -157,7 +157,7 @@ end -- @param #ZONE_BASE self -- @return #string The name of the zone. function ZONE_BASE:GetName() - self:F2() + --self:F2() return self.ZoneName end @@ -167,7 +167,7 @@ end -- @param #string ZoneName The name of the zone. -- @return #ZONE_BASE function ZONE_BASE:SetName( ZoneName ) - self:F2() + --self:F2() self.ZoneName = ZoneName end @@ -177,7 +177,7 @@ end -- @param DCS#Vec2 Vec2 The Vec2 to test. -- @return #boolean true if the Vec2 is within the zone. function ZONE_BASE:IsVec2InZone( Vec2 ) - self:F2( Vec2 ) + --self:F2( Vec2 ) return false end @@ -232,13 +232,13 @@ end -- @param DCS#Distance Height The height to add to the land height where the center of the zone is located. -- @return Core.Point#POINT_VEC2 The PointVec2 of the zone. function ZONE_BASE:GetPointVec2() - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) local Vec2 = self:GetVec2() local PointVec2 = POINT_VEC2:NewFromVec2( Vec2 ) - self:T2( { PointVec2 } ) + --self:T2( { PointVec2 } ) return PointVec2 end @@ -248,7 +248,7 @@ end -- @param DCS#Distance Height The height to add to the land height where the center of the zone is located. -- @return DCS#Vec3 The Vec3 of the zone. function ZONE_BASE:GetVec3( Height ) - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) Height = Height or 0 @@ -256,7 +256,7 @@ function ZONE_BASE:GetVec3( Height ) local Vec3 = { x = Vec2.x, y = Height and Height or land.getHeight( self:GetVec2() ), z = Vec2.y } - self:T2( { Vec3 } ) + --self:T2( { Vec3 } ) return Vec3 end @@ -266,13 +266,13 @@ end -- @param DCS#Distance Height The height to add to the land height where the center of the zone is located. -- @return Core.Point#POINT_VEC3 The PointVec3 of the zone. function ZONE_BASE:GetPointVec3( Height ) - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) local Vec3 = self:GetVec3( Height ) local PointVec3 = POINT_VEC3:NewFromVec3( Vec3 ) - self:T2( { PointVec3 } ) + --self:T2( { PointVec3 } ) return PointVec3 end @@ -282,7 +282,7 @@ end -- @param DCS#Distance Height The height to add to the land height where the center of the zone is located. -- @return Core.Point#COORDINATE The Coordinate of the zone. function ZONE_BASE:GetCoordinate( Height ) --R2.1 - self:F2(self.ZoneName) + --self:F2(self.ZoneName) local Vec3 = self:GetVec3( Height ) @@ -363,7 +363,7 @@ end --- Bound the zone boundaries with a tires. -- @param #ZONE_BASE self function ZONE_BASE:BoundZone() - self:F2() + --self:F2() end --- Set draw coalition of zone. @@ -510,7 +510,7 @@ end -- @param #ZONE_BASE self -- @param Utilities.Utils#SMOKECOLOR SmokeColor The smoke color. function ZONE_BASE:SmokeZone( SmokeColor ) - self:F2( SmokeColor ) + --self:F2( SmokeColor ) end @@ -519,7 +519,7 @@ end -- @param #number ZoneProbability A value between 0 and 1. 0 = 0% and 1 = 100% probability. -- @return #ZONE_BASE self function ZONE_BASE:SetZoneProbability( ZoneProbability ) - self:F( { self:GetName(), ZoneProbability = ZoneProbability } ) + --self:F( { self:GetName(), ZoneProbability = ZoneProbability } ) self.ZoneProbability = ZoneProbability or 1 return self @@ -529,7 +529,7 @@ end -- @param #ZONE_BASE self -- @return #number A value between 0 and 1. 0 = 0% and 1 = 100% probability. function ZONE_BASE:GetZoneProbability() - self:F2() + --self:F2() return self.ZoneProbability end @@ -560,7 +560,7 @@ end -- -- The result should be that Zone1 would be more probable selected than Zone2. -- function ZONE_BASE:GetZoneMaybe() - self:F2() + --self:F2() local Randomization = math.random() if Randomization <= self.ZoneProbability then @@ -791,7 +791,7 @@ function ZONE_RADIUS:New( ZoneName, Vec2, Radius, DoNotRegisterZone ) -- Inherit ZONE_BASE. local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) ) -- #ZONE_RADIUS - self:F( { ZoneName, Vec2, Radius } ) + --self:F( { ZoneName, Vec2, Radius } ) self.Radius = Radius self.Vec2 = Vec2 @@ -947,7 +947,7 @@ end -- @param #number AddOffSet (optional) The angle to be added for the smoking start position. -- @return #ZONE_RADIUS self function ZONE_RADIUS:SmokeZone( SmokeColor, Points, AddHeight, AngleOffset ) - self:F2( SmokeColor ) + --self:F2( SmokeColor ) local Point = {} local Vec2 = self:GetVec2() @@ -978,7 +978,7 @@ end -- @param #number AddHeight (optional) The height to be added for the smoke. -- @return #ZONE_RADIUS self function ZONE_RADIUS:FlareZone( FlareColor, Points, Azimuth, AddHeight ) - self:F2( { FlareColor, Azimuth } ) + --self:F2( { FlareColor, Azimuth } ) local Point = {} local Vec2 = self:GetVec2() @@ -1004,9 +1004,9 @@ end -- @param #ZONE_RADIUS self -- @return DCS#Distance The radius of the zone. function ZONE_RADIUS:GetRadius() - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) - self:T2( { self.Radius } ) + --self:T2( { self.Radius } ) return self.Radius end @@ -1016,10 +1016,10 @@ end -- @param DCS#Distance Radius The radius of the zone. -- @return DCS#Distance The radius of the zone. function ZONE_RADIUS:SetRadius( Radius ) - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) self.Radius = Radius - self:T2( { self.Radius } ) + --self:T2( { self.Radius } ) return self.Radius end @@ -1028,9 +1028,9 @@ end -- @param #ZONE_RADIUS self -- @return DCS#Vec2 The location of the zone. function ZONE_RADIUS:GetVec2() - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) - self:T2( { self.Vec2 } ) + --self:T2( { self.Vec2 } ) return self.Vec2 end @@ -1040,11 +1040,11 @@ end -- @param DCS#Vec2 Vec2 The new location of the zone. -- @return DCS#Vec2 The new location of the zone. function ZONE_RADIUS:SetVec2( Vec2 ) - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) self.Vec2 = Vec2 - self:T2( { self.Vec2 } ) + --self:T2( { self.Vec2 } ) return self.Vec2 end @@ -1054,14 +1054,14 @@ end -- @param DCS#Distance Height The height to add to the land height where the center of the zone is located. -- @return DCS#Vec3 The point of the zone. function ZONE_RADIUS:GetVec3( Height ) - self:F2( { self.ZoneName, Height } ) + --self:F2( { self.ZoneName, Height } ) Height = Height or 0 local Vec2 = self:GetVec2() local Vec3 = { x = Vec2.x, y = land.getHeight( self:GetVec2() ) + Height, z = Vec2.y } - self:T2( { Vec3 } ) + --self:T2( { Vec3 } ) return Vec3 end @@ -1138,7 +1138,7 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories ) self.ScanData.Units[ZoneObject] = ZoneObject - self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } ) + --self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } ) end end @@ -1149,7 +1149,7 @@ function ZONE_RADIUS:Scan( ObjectCategories, UnitCategories ) self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {} self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( tostring(SceneryName), ZoneObject) table.insert(self.ScanData.SceneryTable,self.ScanData.Scenery[SceneryType][SceneryName] ) - self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } ) + --self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } ) end end @@ -1409,7 +1409,7 @@ function ZONE_RADIUS:SearchZone( EvaluateFunction, ObjectCategories ) local ZoneCoord = self:GetCoordinate() local ZoneRadius = self:GetRadius() - self:F({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()}) + --self:F({ZoneCoord = ZoneCoord, ZoneRadius = ZoneRadius, ZoneCoordLL = ZoneCoord:ToStringLLDMS()}) local SphereSearch = { id = world.VolumeType.SPHERE, @@ -1436,7 +1436,7 @@ end -- @param DCS#Vec2 Vec2 The location to test. -- @return #boolean true if the location is within the zone. function ZONE_RADIUS:IsVec2InZone( Vec2 ) - self:F2( Vec2 ) + --self:F2( Vec2 ) if not Vec2 then return false end @@ -1456,7 +1456,7 @@ end -- @param DCS#Vec3 Vec3 The point to test. -- @return #boolean true if the point is within the zone. function ZONE_RADIUS:IsVec3InZone( Vec3 ) - self:F2( Vec3 ) + --self:F2( Vec3 ) if not Vec3 then return false end local InZone = self:IsVec2InZone( { x = Vec3.x, y = Vec3.z } ) @@ -1521,11 +1521,11 @@ end -- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone. -- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone. function ZONE_RADIUS:GetRandomPointVec2( inner, outer ) - self:F( self.ZoneName, inner, outer ) + --self:F( self.ZoneName, inner, outer ) local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2( inner, outer ) ) - self:T3( { PointVec2 } ) + --self:T3( { PointVec2 } ) return PointVec2 end @@ -1536,11 +1536,11 @@ end -- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone. -- @return DCS#Vec3 The random location within the zone. function ZONE_RADIUS:GetRandomVec3( inner, outer ) - self:F( self.ZoneName, inner, outer ) + --self:F( self.ZoneName, inner, outer ) local Vec2 = self:GetRandomVec2( inner, outer ) - self:T3( { x = Vec2.x, y = self.y, z = Vec2.y } ) + --self:T3( { x = Vec2.x, y = self.y, z = Vec2.y } ) return { x = Vec2.x, y = self.y, z = Vec2.y } end @@ -1552,11 +1552,11 @@ end -- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone. -- @return Core.Point#POINT_VEC3 The @{Core.Point#POINT_VEC3} object reflecting the random 3D location within the zone. function ZONE_RADIUS:GetRandomPointVec3( inner, outer ) - self:F( self.ZoneName, inner, outer ) + --self:F( self.ZoneName, inner, outer ) local PointVec3 = POINT_VEC3:NewFromVec2( self:GetRandomVec2( inner, outer ) ) - self:T3( { PointVec3 } ) + --self:T3( { PointVec3 } ) return PointVec3 end @@ -1685,7 +1685,7 @@ function ZONE_RADIUS:GetRandomCoordinateWithoutBuildings(inner,outer,distance,ma T1=timer.getTime() - self:T(string.format("Found a coordinate: %s | Iterations: %d | Time: %.3f",tostring(found),iterations,T1-T0)) + --self:T(string.format("Found a coordinate: %s | Iterations: %d | Time: %.3f",tostring(found),iterations,T1-T0)) if found then return rcoord else return nil end @@ -1754,7 +1754,7 @@ function ZONE:New( ZoneName ) -- Create a new ZONE_RADIUS. local self=BASE:Inherit( self, ZONE_RADIUS:New(ZoneName, {x=Zone.point.x, y=Zone.point.z}, Zone.radius, true)) - self:F(ZoneName) + --self:F(ZoneName) -- Color of zone. self.Color={1, 0, 0, 0.15} @@ -1824,7 +1824,7 @@ function ZONE_UNIT:New( ZoneName, ZoneUNIT, Radius, Offset) self.relative_to_unit = Offset.relative_to_unit or false end - self:F( { ZoneName, ZoneUNIT:GetVec2(), Radius } ) + --self:F( { ZoneName, ZoneUNIT:GetVec2(), Radius } ) self.ZoneUNIT = ZoneUNIT self.LastVec2 = ZoneUNIT:GetVec2() @@ -1840,7 +1840,7 @@ end -- @param #ZONE_UNIT self -- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Unit#UNIT}location and the offset, if any. function ZONE_UNIT:GetVec2() - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) local ZoneVec2 = self.ZoneUNIT:GetVec2() if ZoneVec2 then @@ -1873,7 +1873,7 @@ function ZONE_UNIT:GetVec2() return self.LastVec2 end - self:T2( { ZoneVec2 } ) + --self:T2( { ZoneVec2 } ) return nil end @@ -1882,7 +1882,7 @@ end -- @param #ZONE_UNIT self -- @return DCS#Vec2 The random location within the zone. function ZONE_UNIT:GetRandomVec2() - self:F( self.ZoneName ) + --self:F( self.ZoneName ) local RandomVec2 = {} --local Vec2 = self.ZoneUNIT:GetVec2() -- FF: This does not take care of the new offset feature! @@ -1896,7 +1896,7 @@ function ZONE_UNIT:GetRandomVec2() RandomVec2.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius(); RandomVec2.y = Vec2.y + math.sin( angle ) * math.random() * self:GetRadius(); - self:T( { RandomVec2 } ) + --self:T( { RandomVec2 } ) return RandomVec2 end @@ -1906,7 +1906,7 @@ end -- @param DCS#Distance Height The height to add to the land height where the center of the zone is located. -- @return DCS#Vec3 The point of the zone. function ZONE_UNIT:GetVec3( Height ) - self:F2( self.ZoneName ) + --self:F2( self.ZoneName ) Height = Height or 0 @@ -1914,7 +1914,7 @@ function ZONE_UNIT:GetVec3( Height ) local Vec3 = { x = Vec2.x, y = land.getHeight( self:GetVec2() ) + Height, z = Vec2.y } - self:T2( { Vec3 } ) + --self:T2( { Vec3 } ) return Vec3 end @@ -1940,7 +1940,7 @@ ZONE_GROUP = { -- @return #ZONE_GROUP self function ZONE_GROUP:New( ZoneName, ZoneGROUP, Radius ) local self = BASE:Inherit( self, ZONE_RADIUS:New( ZoneName, ZoneGROUP:GetVec2(), Radius, true ) ) - self:F( { ZoneName, ZoneGROUP:GetVec2(), Radius } ) + --self:F( { ZoneName, ZoneGROUP:GetVec2(), Radius } ) self._.ZoneGROUP = ZoneGROUP self._.ZoneVec2Cache = self._.ZoneGROUP:GetVec2() @@ -1956,7 +1956,7 @@ end -- @param #ZONE_GROUP self -- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Group} location. function ZONE_GROUP:GetVec2() - self:F( self.ZoneName ) + --self:F( self.ZoneName ) local ZoneVec2 = nil @@ -1967,7 +1967,7 @@ function ZONE_GROUP:GetVec2() ZoneVec2 = self._.ZoneVec2Cache end - self:T( { ZoneVec2 } ) + --self:T( { ZoneVec2 } ) return ZoneVec2 end @@ -1976,7 +1976,7 @@ end -- @param #ZONE_GROUP self -- @return DCS#Vec2 The random location of the zone based on the @{Wrapper.Group} location. function ZONE_GROUP:GetRandomVec2() - self:F( self.ZoneName ) + --self:F( self.ZoneName ) local Point = {} local Vec2 = self._.ZoneGROUP:GetVec2() @@ -1985,7 +1985,7 @@ function ZONE_GROUP:GetRandomVec2() Point.x = Vec2.x + math.cos( angle ) * math.random() * self:GetRadius(); Point.y = Vec2.y + math.sin( angle ) * math.random() * self:GetRadius(); - self:T( { Point } ) + --self:T( { Point } ) return Point end @@ -1996,11 +1996,11 @@ end -- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone. -- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone. function ZONE_GROUP:GetRandomPointVec2( inner, outer ) - self:F( self.ZoneName, inner, outer ) + --self:F( self.ZoneName, inner, outer ) local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() ) - self:T3( { PointVec2 } ) + --self:T3( { PointVec2 } ) return PointVec2 end @@ -2046,7 +2046,7 @@ function _ZONE_TRIANGLE:New(p1, p2, p3) end self.SurfaceArea = math.abs((p2.x - p1.x) * (p3.y - p1.y) - (p3.x - p1.x) * (p2.y - p1.y)) * 0.5 - + return self end @@ -2183,7 +2183,7 @@ function ZONE_POLYGON_BASE:New( ZoneName, PointsArray ) -- Inherit ZONE_BASE. local self = BASE:Inherit( self, ZONE_BASE:New( ZoneName ) ) - self:F( { ZoneName, PointsArray } ) + --self:F( { ZoneName, PointsArray } ) if PointsArray then @@ -2351,7 +2351,7 @@ end -- @param #ZONE_POLYGON_BASE self -- @return DCS#Vec2 The location of the zone based on the @{Wrapper.Group} location. function ZONE_POLYGON_BASE:GetVec2() - self:F( self.ZoneName ) + --self:F( self.ZoneName ) local Bounds = self:GetBoundingSquare() @@ -2434,9 +2434,9 @@ end -- @param #ZONE_POLYGON_BASE self -- @return #ZONE_POLYGON_BASE self function ZONE_POLYGON_BASE:Flush() - self:F2() + --self:F2() - self:F( { Polygon = self.ZoneName, Coordinates = self._.Polygon } ) + --self:F( { Polygon = self.ZoneName, Coordinates = self._.Polygon } ) return self end @@ -2455,7 +2455,7 @@ function ZONE_POLYGON_BASE:BoundZone( UnBound ) j = #self._.Polygon while i <= #self._.Polygon do - self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } ) + --self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } ) local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y @@ -2563,7 +2563,7 @@ function ZONE_POLYGON_BASE:ReFill(Color,Alpha) self.FillTriangles = {} end -- refill - for _, triangle in pairs(self._Triangles) do + for _,triangle in pairs(self._Triangles) do local draw_ids = triangle:Fill(coalition,color,alpha,nil) self.FillTriangles = draw_ids table.combine(self.DrawID, draw_ids) @@ -2707,7 +2707,7 @@ end -- @param #number Segments (Optional) Number of segments within boundary line. Default 10. -- @return #ZONE_POLYGON_BASE self function ZONE_POLYGON_BASE:SmokeZone( SmokeColor, Segments ) - self:F2( SmokeColor ) + --self:F2( SmokeColor ) Segments=Segments or 10 @@ -2715,7 +2715,7 @@ function ZONE_POLYGON_BASE:SmokeZone( SmokeColor, Segments ) local j=#self._.Polygon while i <= #self._.Polygon do - self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } ) + --self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } ) local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y @@ -2740,7 +2740,7 @@ end -- @param #number AddHeight (optional) The height to be added for the smoke. -- @return #ZONE_POLYGON_BASE self function ZONE_POLYGON_BASE:FlareZone( FlareColor, Segments, Azimuth, AddHeight ) - self:F2(FlareColor) + --self:F2(FlareColor) Segments=Segments or 10 @@ -2750,7 +2750,7 @@ function ZONE_POLYGON_BASE:FlareZone( FlareColor, Segments, Azimuth, AddHeight ) local j=#self._.Polygon while i <= #self._.Polygon do - self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } ) + --self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } ) local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y @@ -2773,7 +2773,7 @@ end -- @param DCS#Vec2 Vec2 The location to test. -- @return #boolean true if the location is within the zone. function ZONE_POLYGON_BASE:IsVec2InZone( Vec2 ) - self:F2( Vec2 ) + --self:F2( Vec2 ) if not Vec2 then return false end local Next local Prev @@ -2783,18 +2783,18 @@ function ZONE_POLYGON_BASE:IsVec2InZone( Vec2 ) Prev = #self._.Polygon while Next <= #self._.Polygon do - self:T( { Next, Prev, self._.Polygon[Next], self._.Polygon[Prev] } ) + --self:T( { Next, Prev, self._.Polygon[Next], self._.Polygon[Prev] } ) if ( ( ( self._.Polygon[Next].y > Vec2.y ) ~= ( self._.Polygon[Prev].y > Vec2.y ) ) and ( Vec2.x < ( self._.Polygon[Prev].x - self._.Polygon[Next].x ) * ( Vec2.y - self._.Polygon[Next].y ) / ( self._.Polygon[Prev].y - self._.Polygon[Next].y ) + self._.Polygon[Next].x ) ) then InPolygon = not InPolygon end - self:T2( { InPolygon = InPolygon } ) + --self:T2( { InPolygon = InPolygon } ) Prev = Next Next = Next + 1 end - self:T( { InPolygon = InPolygon } ) + --self:T( { InPolygon = InPolygon } ) return InPolygon end @@ -2803,7 +2803,7 @@ end -- @param DCS#Vec3 Vec3 The point to test. -- @return #boolean true if the point is within the zone. function ZONE_POLYGON_BASE:IsVec3InZone( Vec3 ) - self:F2( Vec3 ) + --self:F2( Vec3 ) if not Vec3 then return false end @@ -2838,11 +2838,11 @@ end -- @param #ZONE_POLYGON_BASE self -- @return @{Core.Point#POINT_VEC2} function ZONE_POLYGON_BASE:GetRandomPointVec2() - self:F2() + --self:F2() local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() ) - self:T2( PointVec2 ) + --self:T2( PointVec2 ) return PointVec2 end @@ -2851,11 +2851,11 @@ end -- @param #ZONE_POLYGON_BASE self -- @return @{Core.Point#POINT_VEC3} function ZONE_POLYGON_BASE:GetRandomPointVec3() - self:F2() + --self:F2() local PointVec3 = POINT_VEC3:NewFromVec2( self:GetRandomVec2() ) - self:T2( PointVec3 ) + --self:T2( PointVec3 ) return PointVec3 end @@ -2865,11 +2865,11 @@ end -- @param #ZONE_POLYGON_BASE self -- @return Core.Point#COORDINATE function ZONE_POLYGON_BASE:GetRandomCoordinate() - self:F2() + --self:F2() local Coordinate = COORDINATE:NewFromVec2( self:GetRandomVec2() ) - self:T2( Coordinate ) + --self:T2( Coordinate ) return Coordinate end @@ -2886,7 +2886,7 @@ function ZONE_POLYGON_BASE:GetBoundingSquare() local y2 = self._.Polygon[1].y for i = 2, #self._.Polygon do - self:T2( { self._.Polygon[i], x1, y1, x2, y2 } ) + --self:T2( { self._.Polygon[i], x1, y1, x2, y2 } ) x1 = ( x1 > self._.Polygon[i].x ) and self._.Polygon[i].x or x1 x2 = ( x2 < self._.Polygon[i].x ) and self._.Polygon[i].x or x2 y1 = ( y1 > self._.Polygon[i].y ) and self._.Polygon[i].y or y1 @@ -2909,7 +2909,7 @@ function ZONE_POLYGON_BASE:GetBoundingVec2() local y2 = self._.Polygon[1].y for i = 2, #self._.Polygon do - self:T2( { self._.Polygon[i], x1, y1, x2, y2 } ) + --self:T2( { self._.Polygon[i], x1, y1, x2, y2 } ) x1 = ( x1 > self._.Polygon[i].x ) and self._.Polygon[i].x or x1 x2 = ( x2 < self._.Polygon[i].x ) and self._.Polygon[i].x or x2 y1 = ( y1 > self._.Polygon[i].y ) and self._.Polygon[i].y or y1 @@ -2948,7 +2948,7 @@ function ZONE_POLYGON_BASE:Boundary(Coalition, Color, Radius, Alpha, Segments, C Limit = #self._.Polygon end while i <= #self._.Polygon do - self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } ) + --self:T( { i, j, self._.Polygon[i], self._.Polygon[j] } ) if j ~= Limit then local DeltaX = self._.Polygon[j].x - self._.Polygon[i].x local DeltaY = self._.Polygon[j].y - self._.Polygon[i].y @@ -3019,7 +3019,7 @@ function ZONE_POLYGON:New( ZoneName, ZoneGroup ) local GroupPoints = ZoneGroup:GetTaskRoute() local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( ZoneName, GroupPoints ) ) - self:F( { ZoneName, ZoneGroup, self._.Polygon } ) + --self:F( { ZoneName, ZoneGroup, self._.Polygon } ) -- Zone objects are added to the _DATABASE and SET_ZONE objects. _EVENTDISPATCHER:CreateEventNewZone( self ) @@ -3035,7 +3035,7 @@ end function ZONE_POLYGON:NewFromPointsArray( ZoneName, PointsArray ) local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( ZoneName, PointsArray ) ) - self:F( { ZoneName, self._.Polygon } ) + --self:F( { ZoneName, self._.Polygon } ) -- Zone objects are added to the _DATABASE and SET_ZONE objects. _EVENTDISPATCHER:CreateEventNewZone( self ) @@ -3055,7 +3055,7 @@ function ZONE_POLYGON:NewFromGroupName( GroupName ) local GroupPoints = ZoneGroup:GetTaskRoute() local self = BASE:Inherit( self, ZONE_POLYGON_BASE:New( GroupName, GroupPoints ) ) - self:F( { GroupName, ZoneGroup, self._.Polygon } ) + --self:F( { GroupName, ZoneGroup, self._.Polygon } ) -- Zone objects are added to the _DATABASE and SET_ZONE objects. _EVENTDISPATCHER:CreateEventNewZone( self ) @@ -3221,7 +3221,7 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories ) self.ScanData.Units[ZoneObject] = ZoneObject - self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } ) + --self:F2( { Name = ZoneObject:getName(), Coalition = CoalitionDCSUnit } ) end end @@ -3232,7 +3232,7 @@ function ZONE_POLYGON:Scan( ObjectCategories, UnitCategories ) self.ScanData.Scenery[SceneryType] = self.ScanData.Scenery[SceneryType] or {} self.ScanData.Scenery[SceneryType][SceneryName] = SCENERY:Register( SceneryName, ZoneObject ) table.insert(self.ScanData.SceneryTable,self.ScanData.Scenery[SceneryType][SceneryName]) - self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } ) + --self:T( { SCENERY = self.ScanData.Scenery[SceneryType][SceneryName] } ) end end @@ -3573,8 +3573,8 @@ do -- ZONE_ELASTIC function ZONE_ELASTIC:Update(Delay, Draw) -- Debug info. - self:T(string.format("Updating ZONE_ELASTIC %s", tostring(self.ZoneName))) - + --self:T(string.format("Updating ZONE_ELASTIC %s", tostring(self.ZoneName))) + -- Copy all points. local points=UTILS.DeepCopy(self.points or {}) @@ -3592,6 +3592,9 @@ do -- ZONE_ELASTIC -- Update polygon verticies from points. self._.Polygon=self:_ConvexHull(points) + + self._Triangles = self:_Triangulate() + self.SurfaceArea = self:_CalculateSurfaceArea() if Draw~=false then if self.DrawID or Draw==true then @@ -3987,7 +3990,7 @@ do -- ZONE_AIRBASE -- @param #ZONE_AIRBASE self -- @return DCS#Vec2 The location of the zone based on the AIRBASE location. function ZONE_AIRBASE:GetVec2() - self:F( self.ZoneName ) + --self:F( self.ZoneName ) local ZoneVec2 = nil @@ -3998,7 +4001,7 @@ do -- ZONE_AIRBASE ZoneVec2 = self._.ZoneVec2Cache end - self:T( { ZoneVec2 } ) + --self:T( { ZoneVec2 } ) return ZoneVec2 end @@ -4009,11 +4012,11 @@ do -- ZONE_AIRBASE -- @param #number outer (optional) Maximal distance from the outer edge of the zone. Default is the radius of the zone. -- @return Core.Point#POINT_VEC2 The @{Core.Point#POINT_VEC2} object reflecting the random 3D location within the zone. function ZONE_AIRBASE:GetRandomPointVec2( inner, outer ) - self:F( self.ZoneName, inner, outer ) + --self:F( self.ZoneName, inner, outer ) local PointVec2 = POINT_VEC2:NewFromVec2( self:GetRandomVec2() ) - self:T3( { PointVec2 } ) + --self:T3( { PointVec2 } ) return PointVec2 end