diff --git a/Moose Development/Moose/Base.lua b/Moose Development/Moose/Base.lua index 1737ebdfd..0c7361e41 100644 --- a/Moose Development/Moose/Base.lua +++ b/Moose Development/Moose/Base.lua @@ -440,7 +440,7 @@ end -- @param Arguments A #table or any field. function BASE:_F( Arguments, DebugInfoCurrentParam, DebugInfoFromParam ) - if ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then + if debug and ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then local DebugInfoCurrent = DebugInfoCurrentParam and DebugInfoCurrentParam or debug.getinfo( 2, "nl" ) local DebugInfoFrom = DebugInfoFromParam and DebugInfoFromParam or debug.getinfo( 3, "l" ) @@ -469,7 +469,7 @@ end -- @param Arguments A #table or any field. function BASE:F( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -485,7 +485,7 @@ end -- @param Arguments A #table or any field. function BASE:F2( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -500,7 +500,7 @@ end -- @param Arguments A #table or any field. function BASE:F3( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -515,7 +515,7 @@ end -- @param Arguments A #table or any field. function BASE:_T( Arguments, DebugInfoCurrentParam, DebugInfoFromParam ) - if ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then + if debug and ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then local DebugInfoCurrent = DebugInfoCurrentParam and DebugInfoCurrentParam or debug.getinfo( 2, "nl" ) local DebugInfoFrom = DebugInfoFromParam and DebugInfoFromParam or debug.getinfo( 3, "l" ) @@ -544,7 +544,7 @@ end -- @param Arguments A #table or any field. function BASE:T( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -560,7 +560,7 @@ end -- @param Arguments A #table or any field. function BASE:T2( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -575,7 +575,7 @@ end -- @param Arguments A #table or any field. function BASE:T3( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -590,21 +590,24 @@ end -- @param Arguments A #table or any field. function BASE:E( Arguments ) - local DebugInfoCurrent = debug.getinfo( 2, "nl" ) - local DebugInfoFrom = debug.getinfo( 3, "l" ) - - local Function = "function" - if DebugInfoCurrent.name then - Function = DebugInfoCurrent.name - end - - local LineCurrent = DebugInfoCurrent.currentline - local LineFrom = -1 - if DebugInfoFrom then - LineFrom = DebugInfoFrom.currentline - end - - env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) ) + if debug then + local DebugInfoCurrent = debug.getinfo( 2, "nl" ) + local DebugInfoFrom = debug.getinfo( 3, "l" ) + + local Function = "function" + if DebugInfoCurrent.name then + Function = DebugInfoCurrent.name + end + + local LineCurrent = DebugInfoCurrent.currentline + local LineFrom = -1 + if DebugInfoFrom then + LineFrom = DebugInfoFrom.currentline + end + + env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) ) + end + end diff --git a/Moose Development/Moose/Cargo.lua b/Moose Development/Moose/Cargo.lua index 5a8913910..f4372934e 100644 --- a/Moose Development/Moose/Cargo.lua +++ b/Moose Development/Moose/Cargo.lua @@ -887,7 +887,6 @@ function CARGO_PACKAGE:OnBoard( Client, LandingZone, OnBoardSide ) end self:T( "Routing " .. CargoHostName ) - --routines.scheduleFunction( routines.goRoute, { CargoHostName, Points}, timer.getTime() + 4 ) SCHEDULER:New( self, routines.goRoute, { CargoHostName, Points }, 4 ) return Valid diff --git a/Moose Development/Moose/CleanUp.lua b/Moose Development/Moose/CleanUp.lua index 71554252b..b8525ebce 100644 --- a/Moose Development/Moose/CleanUp.lua +++ b/Moose Development/Moose/CleanUp.lua @@ -43,7 +43,6 @@ function CLEANUP:New( ZoneNames, TimeInterval ) local self = BASE:Inherit( self, _EVENTDISPATCHER:OnBirth( self._OnEventBirth, self ) - --self.CleanUpScheduler = routines.scheduleFunction( self._CleanUpScheduler, { self }, timer.getTime() + 1, TimeInterval ) self.CleanUpScheduler = SCHEDULER:New( self, self._CleanUpScheduler, {}, 1, TimeInterval ) return self @@ -168,7 +167,6 @@ function CLEANUP:_EventShot( Event ) if ( CurrentLandingZoneID ) then -- Okay, the missile was fired within the CLEANUP.ZoneNames, destroy the fired weapon. --_SEADmissile:destroy() - --routines.scheduleFunction( CLEANUP._DestroyMissile, { self, Event.Weapon }, timer.getTime() + 0.1) SCHEDULER:New( self, CLEANUP._DestroyMissile, { Event.Weapon }, 0.1 ) end end @@ -185,7 +183,6 @@ function CLEANUP:_EventHitCleanUp( Event ) self:T( { "Life: ", Event.IniDCSUnitName, ' = ', Event.IniDCSUnit:getLife(), "/", Event.IniDCSUnit:getLife0() } ) if Event.IniDCSUnit:getLife() < Event.IniDCSUnit:getLife0() then self:T( "CleanUp: Destroy: " .. Event.IniDCSUnitName ) - --routines.scheduleFunction( CLEANUP._DestroyUnit, { self, Event.IniDCSUnit }, timer.getTime() + 0.1) SCHEDULER:New( self, CLEANUP._DestroyUnit, { Event.IniDCSUnit }, 0.1 ) end end @@ -196,7 +193,6 @@ function CLEANUP:_EventHitCleanUp( Event ) self:T( { "Life: ", Event.TgtDCSUnitName, ' = ', Event.TgtDCSUnit:getLife(), "/", Event.TgtDCSUnit:getLife0() } ) if Event.TgtDCSUnit:getLife() < Event.TgtDCSUnit:getLife0() then self:T( "CleanUp: Destroy: " .. Event.TgtDCSUnitName ) - --routines.scheduleFunction( CLEANUP._DestroyUnit, { self, Event.TgtDCSUnit }, timer.getTime() + 0.1 ) SCHEDULER:New( self, CLEANUP._DestroyUnit, { Event.TgtDCSUnit }, 0.1 ) end end diff --git a/Moose Development/Moose/Controllable.lua b/Moose Development/Moose/Controllable.lua index bbab284be..c1c899bd5 100644 --- a/Moose Development/Moose/Controllable.lua +++ b/Moose Development/Moose/Controllable.lua @@ -202,7 +202,6 @@ function CONTROLLABLE:PushTask( DCSTask, WaitTime ) -- Controller:pushTask( DCSTask ) if WaitTime then - --routines.scheduleFunction( Controller.pushTask, { Controller, DCSTask }, timer.getTime() + WaitTime ) SCHEDULER:New( Controller, Controller.pushTask, { DCSTask }, WaitTime ) else Controller:pushTask( DCSTask ) @@ -233,7 +232,6 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime ) if not WaitTime then WaitTime = 1 end - --routines.scheduleFunction( Controller.setTask, { Controller, DCSTask }, timer.getTime() + WaitTime ) SCHEDULER:New( Controller, Controller.setTask, { DCSTask }, WaitTime ) return self @@ -1481,7 +1479,6 @@ function CONTROLLABLE:Route( GoPoints ) local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, } local Controller = self:_GetController() --Controller.setTask( Controller, MissionTask ) - --routines.scheduleFunction( Controller.setTask, { Controller, MissionTask}, timer.getTime() + 1 ) SCHEDULER:New( Controller, Controller.setTask, { MissionTask }, 1 ) return self end diff --git a/Moose Development/Moose/Detection.lua b/Moose Development/Moose/Detection.lua index b4b9a4ba3..b4a26d88d 100644 --- a/Moose Development/Moose/Detection.lua +++ b/Moose Development/Moose/Detection.lua @@ -8,7 +8,7 @@ -- -- 1.1) DETECTION_BASE constructor -- ------------------------------- --- Construct a new DETECTION_BASE instance using the @{Detection#DETECTION.New}() method. +-- Construct a new DETECTION_BASE instance using the @{Detection#DETECTION_BASE.New}() method. -- -- 1.2) DETECTION_BASE initialization -- ---------------------------------- @@ -394,15 +394,17 @@ function DETECTION_UNITGROUPS:SmokeDetectedUnits() self:F2() self._SmokeDetectedUnits = true + return self end --- Flare the detected units -- @param #DETECTION_UNITGROUPS self -- @return #DETECTION_UNITGROUPS self -function DETECTION_UNITGROUPS:SmokeDetectedUnits() +function DETECTION_UNITGROUPS:FlareDetectedUnits() self:F2() self._FlareDetectedUnits = true + return self end --- Smoke the detected zones @@ -412,6 +414,7 @@ function DETECTION_UNITGROUPS:SmokeDetectedZones() self:F2() self._SmokeDetectedZones = true + return self end --- Flare the detected zones @@ -421,6 +424,7 @@ function DETECTION_UNITGROUPS:FlareDetectedZones() self:F2() self._FlareDetectedZones = true + return self end @@ -445,7 +449,6 @@ function DETECTION_UNITGROUPS:CreateDetectionSets() for DetectedZoneIndex = 1, #self.DetectedZones do self:T( "Detected Unit Set #" .. DetectedZoneIndex ) local DetectedUnitSet = self.DetectedSets[DetectedZoneIndex] -- Set#SET_BASE - DetectedUnitSet:Flush() local DetectedZone = self.DetectedZones[DetectedZoneIndex] -- Zone#ZONE_UNIT if DetectedUnit:IsInZone( DetectedZone ) then self:T( "Adding to Unit Set #" .. DetectedZoneIndex ) diff --git a/Moose Development/Moose/Escort.lua b/Moose Development/Moose/Escort.lua index 2a543e7c5..e03c871c9 100644 --- a/Moose Development/Moose/Escort.lua +++ b/Moose Development/Moose/Escort.lua @@ -557,7 +557,6 @@ function ESCORT:MenuReportTargets( Seconds ) self.EscortMenuAttackNearbyTargets = MENU_CLIENT:New( self.EscortClient, "Attack targets", self.EscortMenu ) - --self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, Seconds ) self.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, Seconds ) return self @@ -779,7 +778,6 @@ function ESCORT._SwitchReportNearbyTargets( MenuParam ) if self.ReportTargets then if not self.ReportTargetsScheduler then - --self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, 30 ) self.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, 30 ) end else @@ -856,16 +854,6 @@ function ESCORT._AttackTarget( MenuParam ) EscortGroup:OptionROEOpenFire() EscortGroup:OptionROTPassiveDefense() EscortGroup:SetState( EscortGroup, "Escort", self ) --- routines.scheduleFunction( --- EscortGroup.PushTask, --- { EscortGroup, --- EscortGroup:TaskCombo( --- { EscortGroup:TaskAttackUnit( AttackUnit ), --- EscortGroup:TaskFunction( 1, 2, "_Resume", {"''"} ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroup, EscortGroup.PushTask, { EscortGroup:TaskCombo( @@ -876,15 +864,6 @@ function ESCORT._AttackTarget( MenuParam ) }, 10 ) else --- routines.scheduleFunction( --- EscortGroup.PushTask, --- { EscortGroup, --- EscortGroup:TaskCombo( --- { EscortGroup:TaskFireAtPoint( AttackUnit:GetPointVec2(), 50 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroup, EscortGroup.PushTask, { EscortGroup:TaskCombo( @@ -915,16 +894,6 @@ function ESCORT._AssistTarget( MenuParam ) if EscortGroupAttack:IsAir() then EscortGroupAttack:OptionROEOpenFire() EscortGroupAttack:OptionROTVertical() --- routines.scheduleFunction( --- EscortGroupAttack.PushTask, --- { EscortGroupAttack, --- EscortGroupAttack:TaskCombo( --- { EscortGroupAttack:TaskAttackUnit( AttackUnit ), --- EscortGroupAttack:TaskOrbitCircle( 500, 350 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHDULER:New( EscortGroupAttack, EscortGroupAttack.PushTask, { EscortGroupAttack:TaskCombo( @@ -935,15 +904,6 @@ function ESCORT._AssistTarget( MenuParam ) }, 10 ) else --- routines.scheduleFunction( --- EscortGroupAttack.PushTask, --- { EscortGroupAttack, --- EscortGroupAttack:TaskCombo( --- { EscortGroupAttack:TaskFireAtPoint( AttackUnit:GetPointVec2(), 50 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroupAttack, EscortGroupAttack.PushTask, { EscortGroupAttack:TaskCombo( @@ -1003,7 +963,6 @@ function ESCORT._ResumeMission( MenuParam ) table.remove( WayPoints, 1 ) end - --routines.scheduleFunction( EscortGroup.SetTask, {EscortGroup, EscortGroup:TaskRoute( WayPoints ) }, timer.getTime() + 1 ) SCHEDULER:New( EscortGroup, EscortGroup.SetTask, { EscortGroup:TaskRoute( WayPoints ) }, 1 ) EscortGroup:MessageToClient( "Resuming mission from waypoint " .. WayPoint .. ".", 10, EscortClient ) diff --git a/Moose Development/Moose/Event.lua b/Moose Development/Moose/Event.lua index 88f16e783..bcad4497f 100644 --- a/Moose Development/Moose/Event.lua +++ b/Moose Development/Moose/Event.lua @@ -465,7 +465,8 @@ function EVENT:OnPlayerLeaveUnit( EventFunction, EventSelf ) end - +--- @param #EVENT self +-- @param #EVENTDATA Event function EVENT:onEvent( Event ) self:F2( { _EVENTCODES[Event.id], Event } ) @@ -499,7 +500,7 @@ function EVENT:onEvent( Event ) Event.WeaponName = Event.Weapon:getTypeName() --Event.WeaponTgtDCSUnit = Event.Weapon:getTarget() end - self:E( { _EVENTCODES[Event.id], Event } ) + self:E( { _EVENTCODES[Event.id], Event.IniUnitName, Event.TgtUnitName, Event.WeaponName } ) for ClassName, EventData in pairs( self.Events[Event.id] ) do if Event.IniDCSUnitName and EventData.IniUnit and EventData.IniUnit[Event.IniDCSUnitName] then self:E( { "Calling event function for class ", ClassName, " unit ", Event.IniDCSUnitName } ) diff --git a/Moose Development/Moose/Routines.lua b/Moose Development/Moose/Routines.lua index 5235f218b..f5f42d146 100644 --- a/Moose Development/Moose/Routines.lua +++ b/Moose Development/Moose/Routines.lua @@ -441,22 +441,6 @@ routines.getNorthCorrection = function(point) --gets the correction needed for end --- the main area -do - -- THE MAIN FUNCTION -- Accessed 100 times/sec. - routines.main = function() - timer.scheduleFunction(routines.main, {}, timer.getTime() + 2) --reschedule first in case of Lua error - ---------------------------------------------------------------------------------------------------------- - --area to add new stuff in - - routines.do_scheduled_functions() - end -- end of routines.main - - timer.scheduleFunction(routines.main, {}, timer.getTime() + 2) - -end - - do local idNum = 0 diff --git a/Moose Development/Moose/Scheduler.lua b/Moose Development/Moose/Scheduler.lua index d3d75fd95..9d6b66295 100644 --- a/Moose Development/Moose/Scheduler.lua +++ b/Moose Development/Moose/Scheduler.lua @@ -111,8 +111,10 @@ function SCHEDULER:_Scheduler() local ErrorHandler = function( errmsg ) env.info( "Error in SCHEDULER function:" .. errmsg ) - env.info( debug.traceback() ) - + if debug ~= nil then + env.info( debug.traceback() ) + end + return errmsg end diff --git a/Moose Development/Moose/Sead.lua b/Moose Development/Moose/Sead.lua index 489c1ecf9..25e9ceff2 100644 --- a/Moose Development/Moose/Sead.lua +++ b/Moose Development/Moose/Sead.lua @@ -50,7 +50,6 @@ function SEAD:EventShot( Event ) local SEADUnitName = Event.IniDCSUnitName local SEADWeapon = Event.Weapon -- Identify the weapon fired local SEADWeaponName = Event.WeaponName -- return weapon type - --trigger.action.outText( string.format("Alerte, depart missile " ..string.format(SEADWeaponName)), 20) --debug message -- Start of the 2nd loop self:T( "Missile Launched = " .. SEADWeaponName ) if SEADWeaponName == "KH-58" or SEADWeaponName == "KH-25MPU" or SEADWeaponName == "AGM-88" or SEADWeaponName == "KH-31A" or SEADWeaponName == "KH-31P" then -- Check if the missile is a SEAD @@ -76,10 +75,10 @@ function SEAD:EventShot( Event ) local Skills = { "Average", "Good", "High", "Excellent" } _targetskill = Skills[ math.random(1,4) ] end - self:T( _targetskill ) -- debug message for skill check + self:T( _targetskill ) if self.TargetSkill[_targetskill] then if (_evade > self.TargetSkill[_targetskill].Evade) then - self:T( string.format("Evading, target skill " ..string.format(_targetskill)) ) --debug message + self:T( string.format("Evading, target skill " ..string.format(_targetskill)) ) local _targetMim = Weapon.getTarget(SEADWeapon) local _targetMimname = Unit.getName(_targetMim) local _targetMimgroup = Unit.getGroup(Weapon.getTarget(SEADWeapon)) diff --git a/Moose Development/Moose/Set.lua b/Moose Development/Moose/Set.lua index c3194e0dc..628d57b75 100644 --- a/Moose Development/Moose/Set.lua +++ b/Moose Development/Moose/Set.lua @@ -399,7 +399,7 @@ end -- @param #SET_BASE self -- @param Event#EVENTDATA Event function SET_BASE:_EventOnDeadOrCrash( Event ) - self:F2( { Event } ) + self:F3( { Event } ) if Event.IniDCSUnit then local ObjectName, Object = self:FindInDatabase( Event ) @@ -455,7 +455,7 @@ function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArgumen local function CoRoutine() local Count = 0 for ObjectID, Object in pairs( Set ) do - self:T2( Object ) + self:T3( Object ) if Function then if Function( unpack( FunctionArguments ), Object ) == true then IteratorFunction( Object, unpack( arg ) ) @@ -544,7 +544,7 @@ function SET_BASE:IsIncludeObject( Object ) return true end ---- Flushes the current SET_BASE contents in the log ... (for debug reasons). +--- Flushes the current SET_BASE contents in the log ... (for debugging reasons). -- @param #SET_BASE self -- @return #string A string with the names of the objects. function SET_BASE:Flush() @@ -1165,7 +1165,6 @@ end function SET_UNIT:FindInDatabase( Event ) self:F3( { Event } ) - self:E( { Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName] } ) return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName] end diff --git a/Moose Development/Moose/Zone.lua b/Moose Development/Moose/Zone.lua index 5deecb865..9bb906a90 100644 --- a/Moose Development/Moose/Zone.lua +++ b/Moose Development/Moose/Zone.lua @@ -490,33 +490,34 @@ end --- Returns if a location is within the zone. +-- Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html -- @param #ZONE_POLYGON_BASE self -- @param DCSTypes#Vec2 PointVec2 The location to test. -- @return #boolean true if the location is within the zone. function ZONE_POLYGON_BASE:IsPointVec2InZone( PointVec2 ) self:F2( PointVec2 ) - local i - local j - local c = false + local Next + local Prev + local InPolygon = false - i = 1 - j = #self.Polygon + Next = 1 + Prev = #self.Polygon - while i < #self.Polygon do - j = i - i = i + 1 - self:T( { i, j, self.Polygon[i], self.Polygon[j] } ) - if ( ( ( self.Polygon[i].y > PointVec2.y ) ~= ( self.Polygon[j].y > PointVec2.y ) ) and - ( PointVec2.x < ( self.Polygon[j].x - self.Polygon[i].x ) * ( PointVec2.y - self.Polygon[i].y ) / ( self.Polygon[j].y - self.Polygon[i].y ) + self.Polygon[i].x ) + while Next <= #self.Polygon do + self:T( { Next, Prev, self.Polygon[Next], self.Polygon[Prev] } ) + if ( ( ( self.Polygon[Next].y > PointVec2.y ) ~= ( self.Polygon[Prev].y > PointVec2.y ) ) and + ( PointVec2.x < ( self.Polygon[Prev].x - self.Polygon[Next].x ) * ( PointVec2.y - self.Polygon[Next].y ) / ( self.Polygon[Prev].y - self.Polygon[Next].y ) + self.Polygon[Next].x ) ) then - c = not c + InPolygon = not InPolygon end - self:T2( { "c = ", c } ) + self:T2( { InPolygon = InPolygon } ) + Prev = Next + Next = Next + 1 end - self:T( { "c = ", c } ) - return c + self:T( { InPolygon = InPolygon } ) + return InPolygon end --- Define a random @{DCSTypes#Vec2} within the zone. diff --git a/Moose Mission Setup/Moose Create Dynamic/Moose_Dynamic_Loader.lua b/Moose Mission Setup/Moose Create Dynamic/Moose_Dynamic_Loader.lua index 8c3b6bdf7..f0bd89564 100644 --- a/Moose Mission Setup/Moose Create Dynamic/Moose_Dynamic_Loader.lua +++ b/Moose Mission Setup/Moose Create Dynamic/Moose_Dynamic_Loader.lua @@ -3,25 +3,13 @@ local base = _G Include = {} -Include.Path = function() - local str = debug.getinfo(2, "S").source - return str:match("(.*/)"):sub(1,-2):gsub("\\","/") -end - Include.File = function( IncludeFile ) if not Include.Files[ IncludeFile ] then Include.Files[IncludeFile] = IncludeFile env.info( "Include:" .. IncludeFile .. " from " .. Include.ProgramPath ) local f = assert( base.loadfile( Include.ProgramPath .. IncludeFile .. ".lua" ) ) if f == nil then - env.info( "Include:" .. IncludeFile .. " from " .. Include.MissionPath ) - local f = assert( base.loadfile( Include.MissionPath .. IncludeFile .. ".lua" ) ) - if f == nil then - error ("Could not load MOOSE file " .. IncludeFile .. ".lua" ) - else - env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.MissionPath ) - return f() - end + error ("Could not load MOOSE file " .. IncludeFile .. ".lua" ) else env.info( "Include:" .. IncludeFile .. " loaded from " .. Include.ProgramPath ) return f() @@ -30,10 +18,8 @@ Include.File = function( IncludeFile ) end Include.ProgramPath = "Scripts/Moose/" -Include.MissionPath = Include.Path() env.info( "Include.ProgramPath = " .. Include.ProgramPath) -env.info( "Include.MissionPath = " .. Include.MissionPath) Include.Files = {} diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua index 0a431f203..7f30d885d 100644 --- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua +++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20160625_0851' ) +env.info( 'Moose Generation Timestamp: 20160626_0740' ) local base = _G Include = {} @@ -450,22 +450,6 @@ routines.getNorthCorrection = function(point) --gets the correction needed for end --- the main area -do - -- THE MAIN FUNCTION -- Accessed 100 times/sec. - routines.main = function() - timer.scheduleFunction(routines.main, {}, timer.getTime() + 2) --reschedule first in case of Lua error - ---------------------------------------------------------------------------------------------------------- - --area to add new stuff in - - routines.do_scheduled_functions() - end -- end of routines.main - - timer.scheduleFunction(routines.main, {}, timer.getTime() + 2) - -end - - do local idNum = 0 @@ -2969,7 +2953,7 @@ end -- @param Arguments A #table or any field. function BASE:_F( Arguments, DebugInfoCurrentParam, DebugInfoFromParam ) - if ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then + if debug and ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then local DebugInfoCurrent = DebugInfoCurrentParam and DebugInfoCurrentParam or debug.getinfo( 2, "nl" ) local DebugInfoFrom = DebugInfoFromParam and DebugInfoFromParam or debug.getinfo( 3, "l" ) @@ -2998,7 +2982,7 @@ end -- @param Arguments A #table or any field. function BASE:F( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3014,7 +2998,7 @@ end -- @param Arguments A #table or any field. function BASE:F2( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3029,7 +3013,7 @@ end -- @param Arguments A #table or any field. function BASE:F3( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3044,7 +3028,7 @@ end -- @param Arguments A #table or any field. function BASE:_T( Arguments, DebugInfoCurrentParam, DebugInfoFromParam ) - if ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then + if debug and ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then local DebugInfoCurrent = DebugInfoCurrentParam and DebugInfoCurrentParam or debug.getinfo( 2, "nl" ) local DebugInfoFrom = DebugInfoFromParam and DebugInfoFromParam or debug.getinfo( 3, "l" ) @@ -3073,7 +3057,7 @@ end -- @param Arguments A #table or any field. function BASE:T( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3089,7 +3073,7 @@ end -- @param Arguments A #table or any field. function BASE:T2( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3104,7 +3088,7 @@ end -- @param Arguments A #table or any field. function BASE:T3( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3119,21 +3103,24 @@ end -- @param Arguments A #table or any field. function BASE:E( Arguments ) - local DebugInfoCurrent = debug.getinfo( 2, "nl" ) - local DebugInfoFrom = debug.getinfo( 3, "l" ) - - local Function = "function" - if DebugInfoCurrent.name then - Function = DebugInfoCurrent.name - end - - local LineCurrent = DebugInfoCurrent.currentline - local LineFrom = -1 - if DebugInfoFrom then - LineFrom = DebugInfoFrom.currentline - end - - env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) ) + if debug then + local DebugInfoCurrent = debug.getinfo( 2, "nl" ) + local DebugInfoFrom = debug.getinfo( 3, "l" ) + + local Function = "function" + if DebugInfoCurrent.name then + Function = DebugInfoCurrent.name + end + + local LineCurrent = DebugInfoCurrent.currentline + local LineFrom = -1 + if DebugInfoFrom then + LineFrom = DebugInfoFrom.currentline + end + + env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) ) + end + end @@ -3973,7 +3960,6 @@ function CONTROLLABLE:PushTask( DCSTask, WaitTime ) -- Controller:pushTask( DCSTask ) if WaitTime then - --routines.scheduleFunction( Controller.pushTask, { Controller, DCSTask }, timer.getTime() + WaitTime ) SCHEDULER:New( Controller, Controller.pushTask, { DCSTask }, WaitTime ) else Controller:pushTask( DCSTask ) @@ -4004,7 +3990,6 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime ) if not WaitTime then WaitTime = 1 end - --routines.scheduleFunction( Controller.setTask, { Controller, DCSTask }, timer.getTime() + WaitTime ) SCHEDULER:New( Controller, Controller.setTask, { DCSTask }, WaitTime ) return self @@ -5252,7 +5237,6 @@ function CONTROLLABLE:Route( GoPoints ) local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, } local Controller = self:_GetController() --Controller.setTask( Controller, MissionTask ) - --routines.scheduleFunction( Controller.setTask, { Controller, MissionTask}, timer.getTime() + 1 ) SCHEDULER:New( Controller, Controller.setTask, { MissionTask }, 1 ) return self end @@ -6072,8 +6056,10 @@ function SCHEDULER:_Scheduler() local ErrorHandler = function( errmsg ) env.info( "Error in SCHEDULER function:" .. errmsg ) - env.info( debug.traceback() ) - + if debug ~= nil then + env.info( debug.traceback() ) + end + return errmsg end @@ -6592,7 +6578,8 @@ function EVENT:OnPlayerLeaveUnit( EventFunction, EventSelf ) end - +--- @param #EVENT self +-- @param #EVENTDATA Event function EVENT:onEvent( Event ) self:F2( { _EVENTCODES[Event.id], Event } ) @@ -6626,7 +6613,7 @@ function EVENT:onEvent( Event ) Event.WeaponName = Event.Weapon:getTypeName() --Event.WeaponTgtDCSUnit = Event.Weapon:getTarget() end - self:E( { _EVENTCODES[Event.id], Event } ) + self:E( { _EVENTCODES[Event.id], Event.IniUnitName, Event.TgtUnitName, Event.WeaponName } ) for ClassName, EventData in pairs( self.Events[Event.id] ) do if Event.IniDCSUnitName and EventData.IniUnit and EventData.IniUnit[Event.IniDCSUnitName] then self:E( { "Calling event function for class ", ClassName, " unit ", Event.IniDCSUnitName } ) @@ -8951,33 +8938,34 @@ end --- Returns if a location is within the zone. +-- Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html -- @param #ZONE_POLYGON_BASE self -- @param DCSTypes#Vec2 PointVec2 The location to test. -- @return #boolean true if the location is within the zone. function ZONE_POLYGON_BASE:IsPointVec2InZone( PointVec2 ) self:F2( PointVec2 ) - local i - local j - local c = false + local Next + local Prev + local InPolygon = false - i = 1 - j = #self.Polygon + Next = 1 + Prev = #self.Polygon - while i < #self.Polygon do - j = i - i = i + 1 - self:T( { i, j, self.Polygon[i], self.Polygon[j] } ) - if ( ( ( self.Polygon[i].y > PointVec2.y ) ~= ( self.Polygon[j].y > PointVec2.y ) ) and - ( PointVec2.x < ( self.Polygon[j].x - self.Polygon[i].x ) * ( PointVec2.y - self.Polygon[i].y ) / ( self.Polygon[j].y - self.Polygon[i].y ) + self.Polygon[i].x ) + while Next <= #self.Polygon do + self:T( { Next, Prev, self.Polygon[Next], self.Polygon[Prev] } ) + if ( ( ( self.Polygon[Next].y > PointVec2.y ) ~= ( self.Polygon[Prev].y > PointVec2.y ) ) and + ( PointVec2.x < ( self.Polygon[Prev].x - self.Polygon[Next].x ) * ( PointVec2.y - self.Polygon[Next].y ) / ( self.Polygon[Prev].y - self.Polygon[Next].y ) + self.Polygon[Next].x ) ) then - c = not c + InPolygon = not InPolygon end - self:T2( { "c = ", c } ) + self:T2( { InPolygon = InPolygon } ) + Prev = Next + Next = Next + 1 end - self:T( { "c = ", c } ) - return c + self:T( { InPolygon = InPolygon } ) + return InPolygon end --- Define a random @{DCSTypes#Vec2} within the zone. @@ -11078,7 +11066,7 @@ end -- @param #SET_BASE self -- @param Event#EVENTDATA Event function SET_BASE:_EventOnDeadOrCrash( Event ) - self:F2( { Event } ) + self:F3( { Event } ) if Event.IniDCSUnit then local ObjectName, Object = self:FindInDatabase( Event ) @@ -11134,7 +11122,7 @@ function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArgumen local function CoRoutine() local Count = 0 for ObjectID, Object in pairs( Set ) do - self:T2( Object ) + self:T3( Object ) if Function then if Function( unpack( FunctionArguments ), Object ) == true then IteratorFunction( Object, unpack( arg ) ) @@ -11223,7 +11211,7 @@ function SET_BASE:IsIncludeObject( Object ) return true end ---- Flushes the current SET_BASE contents in the log ... (for debug reasons). +--- Flushes the current SET_BASE contents in the log ... (for debugging reasons). -- @param #SET_BASE self -- @return #string A string with the names of the objects. function SET_BASE:Flush() @@ -11844,7 +11832,6 @@ end function SET_UNIT:FindInDatabase( Event ) self:F3( { Event } ) - self:E( { Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName] } ) return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName] end @@ -14627,7 +14614,6 @@ function CARGO_PACKAGE:OnBoard( Client, LandingZone, OnBoardSide ) end self:T( "Routing " .. CargoHostName ) - --routines.scheduleFunction( routines.goRoute, { CargoHostName, Points}, timer.getTime() + 4 ) SCHEDULER:New( self, routines.goRoute, { CargoHostName, Points }, 4 ) return Valid @@ -17863,7 +17849,6 @@ function CLEANUP:New( ZoneNames, TimeInterval ) local self = BASE:Inherit( self, _EVENTDISPATCHER:OnBirth( self._OnEventBirth, self ) - --self.CleanUpScheduler = routines.scheduleFunction( self._CleanUpScheduler, { self }, timer.getTime() + 1, TimeInterval ) self.CleanUpScheduler = SCHEDULER:New( self, self._CleanUpScheduler, {}, 1, TimeInterval ) return self @@ -17988,7 +17973,6 @@ function CLEANUP:_EventShot( Event ) if ( CurrentLandingZoneID ) then -- Okay, the missile was fired within the CLEANUP.ZoneNames, destroy the fired weapon. --_SEADmissile:destroy() - --routines.scheduleFunction( CLEANUP._DestroyMissile, { self, Event.Weapon }, timer.getTime() + 0.1) SCHEDULER:New( self, CLEANUP._DestroyMissile, { Event.Weapon }, 0.1 ) end end @@ -18005,7 +17989,6 @@ function CLEANUP:_EventHitCleanUp( Event ) self:T( { "Life: ", Event.IniDCSUnitName, ' = ', Event.IniDCSUnit:getLife(), "/", Event.IniDCSUnit:getLife0() } ) if Event.IniDCSUnit:getLife() < Event.IniDCSUnit:getLife0() then self:T( "CleanUp: Destroy: " .. Event.IniDCSUnitName ) - --routines.scheduleFunction( CLEANUP._DestroyUnit, { self, Event.IniDCSUnit }, timer.getTime() + 0.1) SCHEDULER:New( self, CLEANUP._DestroyUnit, { Event.IniDCSUnit }, 0.1 ) end end @@ -18016,7 +17999,6 @@ function CLEANUP:_EventHitCleanUp( Event ) self:T( { "Life: ", Event.TgtDCSUnitName, ' = ', Event.TgtDCSUnit:getLife(), "/", Event.TgtDCSUnit:getLife0() } ) if Event.TgtDCSUnit:getLife() < Event.TgtDCSUnit:getLife0() then self:T( "CleanUp: Destroy: " .. Event.TgtDCSUnitName ) - --routines.scheduleFunction( CLEANUP._DestroyUnit, { self, Event.TgtDCSUnit }, timer.getTime() + 0.1 ) SCHEDULER:New( self, CLEANUP._DestroyUnit, { Event.TgtDCSUnit }, 0.1 ) end end @@ -19578,7 +19560,6 @@ function SEAD:EventShot( Event ) local SEADUnitName = Event.IniDCSUnitName local SEADWeapon = Event.Weapon -- Identify the weapon fired local SEADWeaponName = Event.WeaponName -- return weapon type - --trigger.action.outText( string.format("Alerte, depart missile " ..string.format(SEADWeaponName)), 20) --debug message -- Start of the 2nd loop self:T( "Missile Launched = " .. SEADWeaponName ) if SEADWeaponName == "KH-58" or SEADWeaponName == "KH-25MPU" or SEADWeaponName == "AGM-88" or SEADWeaponName == "KH-31A" or SEADWeaponName == "KH-31P" then -- Check if the missile is a SEAD @@ -19604,10 +19585,10 @@ function SEAD:EventShot( Event ) local Skills = { "Average", "Good", "High", "Excellent" } _targetskill = Skills[ math.random(1,4) ] end - self:T( _targetskill ) -- debug message for skill check + self:T( _targetskill ) if self.TargetSkill[_targetskill] then if (_evade > self.TargetSkill[_targetskill].Evade) then - self:T( string.format("Evading, target skill " ..string.format(_targetskill)) ) --debug message + self:T( string.format("Evading, target skill " ..string.format(_targetskill)) ) local _targetMim = Weapon.getTarget(SEADWeapon) local _targetMimname = Unit.getName(_targetMim) local _targetMimgroup = Unit.getGroup(Weapon.getTarget(SEADWeapon)) @@ -20215,7 +20196,6 @@ function ESCORT:MenuReportTargets( Seconds ) self.EscortMenuAttackNearbyTargets = MENU_CLIENT:New( self.EscortClient, "Attack targets", self.EscortMenu ) - --self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, Seconds ) self.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, Seconds ) return self @@ -20437,7 +20417,6 @@ function ESCORT._SwitchReportNearbyTargets( MenuParam ) if self.ReportTargets then if not self.ReportTargetsScheduler then - --self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, 30 ) self.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, 30 ) end else @@ -20514,16 +20493,6 @@ function ESCORT._AttackTarget( MenuParam ) EscortGroup:OptionROEOpenFire() EscortGroup:OptionROTPassiveDefense() EscortGroup:SetState( EscortGroup, "Escort", self ) --- routines.scheduleFunction( --- EscortGroup.PushTask, --- { EscortGroup, --- EscortGroup:TaskCombo( --- { EscortGroup:TaskAttackUnit( AttackUnit ), --- EscortGroup:TaskFunction( 1, 2, "_Resume", {"''"} ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroup, EscortGroup.PushTask, { EscortGroup:TaskCombo( @@ -20534,15 +20503,6 @@ function ESCORT._AttackTarget( MenuParam ) }, 10 ) else --- routines.scheduleFunction( --- EscortGroup.PushTask, --- { EscortGroup, --- EscortGroup:TaskCombo( --- { EscortGroup:TaskFireAtPoint( AttackUnit:GetPointVec2(), 50 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroup, EscortGroup.PushTask, { EscortGroup:TaskCombo( @@ -20573,16 +20533,6 @@ function ESCORT._AssistTarget( MenuParam ) if EscortGroupAttack:IsAir() then EscortGroupAttack:OptionROEOpenFire() EscortGroupAttack:OptionROTVertical() --- routines.scheduleFunction( --- EscortGroupAttack.PushTask, --- { EscortGroupAttack, --- EscortGroupAttack:TaskCombo( --- { EscortGroupAttack:TaskAttackUnit( AttackUnit ), --- EscortGroupAttack:TaskOrbitCircle( 500, 350 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHDULER:New( EscortGroupAttack, EscortGroupAttack.PushTask, { EscortGroupAttack:TaskCombo( @@ -20593,15 +20543,6 @@ function ESCORT._AssistTarget( MenuParam ) }, 10 ) else --- routines.scheduleFunction( --- EscortGroupAttack.PushTask, --- { EscortGroupAttack, --- EscortGroupAttack:TaskCombo( --- { EscortGroupAttack:TaskFireAtPoint( AttackUnit:GetPointVec2(), 50 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroupAttack, EscortGroupAttack.PushTask, { EscortGroupAttack:TaskCombo( @@ -20661,7 +20602,6 @@ function ESCORT._ResumeMission( MenuParam ) table.remove( WayPoints, 1 ) end - --routines.scheduleFunction( EscortGroup.SetTask, {EscortGroup, EscortGroup:TaskRoute( WayPoints ) }, timer.getTime() + 1 ) SCHEDULER:New( EscortGroup, EscortGroup.SetTask, { EscortGroup:TaskRoute( WayPoints ) }, 1 ) EscortGroup:MessageToClient( "Resuming mission from waypoint " .. WayPoint .. ".", 10, EscortClient ) @@ -23109,7 +23049,7 @@ end -- -- 1.1) DETECTION_BASE constructor -- ------------------------------- --- Construct a new DETECTION_BASE instance using the @{Detection#DETECTION.New}() method. +-- Construct a new DETECTION_BASE instance using the @{Detection#DETECTION_BASE.New}() method. -- -- 1.2) DETECTION_BASE initialization -- ---------------------------------- @@ -23495,15 +23435,17 @@ function DETECTION_UNITGROUPS:SmokeDetectedUnits() self:F2() self._SmokeDetectedUnits = true + return self end --- Flare the detected units -- @param #DETECTION_UNITGROUPS self -- @return #DETECTION_UNITGROUPS self -function DETECTION_UNITGROUPS:SmokeDetectedUnits() +function DETECTION_UNITGROUPS:FlareDetectedUnits() self:F2() self._FlareDetectedUnits = true + return self end --- Smoke the detected zones @@ -23513,6 +23455,7 @@ function DETECTION_UNITGROUPS:SmokeDetectedZones() self:F2() self._SmokeDetectedZones = true + return self end --- Flare the detected zones @@ -23522,6 +23465,7 @@ function DETECTION_UNITGROUPS:FlareDetectedZones() self:F2() self._FlareDetectedZones = true + return self end @@ -23546,7 +23490,6 @@ function DETECTION_UNITGROUPS:CreateDetectionSets() for DetectedZoneIndex = 1, #self.DetectedZones do self:T( "Detected Unit Set #" .. DetectedZoneIndex ) local DetectedUnitSet = self.DetectedSets[DetectedZoneIndex] -- Set#SET_BASE - DetectedUnitSet:Flush() local DetectedZone = self.DetectedZones[DetectedZoneIndex] -- Zone#ZONE_UNIT if DetectedUnit:IsInZone( DetectedZone ) then self:T( "Adding to Unit Set #" .. DetectedZoneIndex ) diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 0a431f203..7f30d885d 100644 --- a/Moose Mission Setup/Moose.lua +++ b/Moose Mission Setup/Moose.lua @@ -1,5 +1,5 @@ env.info( '*** MOOSE STATIC INCLUDE START *** ' ) -env.info( 'Moose Generation Timestamp: 20160625_0851' ) +env.info( 'Moose Generation Timestamp: 20160626_0740' ) local base = _G Include = {} @@ -450,22 +450,6 @@ routines.getNorthCorrection = function(point) --gets the correction needed for end --- the main area -do - -- THE MAIN FUNCTION -- Accessed 100 times/sec. - routines.main = function() - timer.scheduleFunction(routines.main, {}, timer.getTime() + 2) --reschedule first in case of Lua error - ---------------------------------------------------------------------------------------------------------- - --area to add new stuff in - - routines.do_scheduled_functions() - end -- end of routines.main - - timer.scheduleFunction(routines.main, {}, timer.getTime() + 2) - -end - - do local idNum = 0 @@ -2969,7 +2953,7 @@ end -- @param Arguments A #table or any field. function BASE:_F( Arguments, DebugInfoCurrentParam, DebugInfoFromParam ) - if ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then + if debug and ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then local DebugInfoCurrent = DebugInfoCurrentParam and DebugInfoCurrentParam or debug.getinfo( 2, "nl" ) local DebugInfoFrom = DebugInfoFromParam and DebugInfoFromParam or debug.getinfo( 3, "l" ) @@ -2998,7 +2982,7 @@ end -- @param Arguments A #table or any field. function BASE:F( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3014,7 +2998,7 @@ end -- @param Arguments A #table or any field. function BASE:F2( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3029,7 +3013,7 @@ end -- @param Arguments A #table or any field. function BASE:F3( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3044,7 +3028,7 @@ end -- @param Arguments A #table or any field. function BASE:_T( Arguments, DebugInfoCurrentParam, DebugInfoFromParam ) - if ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then + if debug and ( _TraceAll == true ) or ( _TraceClass[self.ClassName] or _TraceClassMethod[self.ClassName] ) then local DebugInfoCurrent = DebugInfoCurrentParam and DebugInfoCurrentParam or debug.getinfo( 2, "nl" ) local DebugInfoFrom = DebugInfoFromParam and DebugInfoFromParam or debug.getinfo( 3, "l" ) @@ -3073,7 +3057,7 @@ end -- @param Arguments A #table or any field. function BASE:T( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3089,7 +3073,7 @@ end -- @param Arguments A #table or any field. function BASE:T2( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3104,7 +3088,7 @@ end -- @param Arguments A #table or any field. function BASE:T3( Arguments ) - if _TraceOnOff then + if debug and _TraceOnOff then local DebugInfoCurrent = debug.getinfo( 2, "nl" ) local DebugInfoFrom = debug.getinfo( 3, "l" ) @@ -3119,21 +3103,24 @@ end -- @param Arguments A #table or any field. function BASE:E( Arguments ) - local DebugInfoCurrent = debug.getinfo( 2, "nl" ) - local DebugInfoFrom = debug.getinfo( 3, "l" ) - - local Function = "function" - if DebugInfoCurrent.name then - Function = DebugInfoCurrent.name - end - - local LineCurrent = DebugInfoCurrent.currentline - local LineFrom = -1 - if DebugInfoFrom then - LineFrom = DebugInfoFrom.currentline - end - - env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) ) + if debug then + local DebugInfoCurrent = debug.getinfo( 2, "nl" ) + local DebugInfoFrom = debug.getinfo( 3, "l" ) + + local Function = "function" + if DebugInfoCurrent.name then + Function = DebugInfoCurrent.name + end + + local LineCurrent = DebugInfoCurrent.currentline + local LineFrom = -1 + if DebugInfoFrom then + LineFrom = DebugInfoFrom.currentline + end + + env.info( string.format( "%6d(%6d)/%1s:%20s%05d.%s(%s)" , LineCurrent, LineFrom, "E", self.ClassName, self.ClassID, Function, routines.utils.oneLineSerialize( Arguments ) ) ) + end + end @@ -3973,7 +3960,6 @@ function CONTROLLABLE:PushTask( DCSTask, WaitTime ) -- Controller:pushTask( DCSTask ) if WaitTime then - --routines.scheduleFunction( Controller.pushTask, { Controller, DCSTask }, timer.getTime() + WaitTime ) SCHEDULER:New( Controller, Controller.pushTask, { DCSTask }, WaitTime ) else Controller:pushTask( DCSTask ) @@ -4004,7 +3990,6 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime ) if not WaitTime then WaitTime = 1 end - --routines.scheduleFunction( Controller.setTask, { Controller, DCSTask }, timer.getTime() + WaitTime ) SCHEDULER:New( Controller, Controller.setTask, { DCSTask }, WaitTime ) return self @@ -5252,7 +5237,6 @@ function CONTROLLABLE:Route( GoPoints ) local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, } local Controller = self:_GetController() --Controller.setTask( Controller, MissionTask ) - --routines.scheduleFunction( Controller.setTask, { Controller, MissionTask}, timer.getTime() + 1 ) SCHEDULER:New( Controller, Controller.setTask, { MissionTask }, 1 ) return self end @@ -6072,8 +6056,10 @@ function SCHEDULER:_Scheduler() local ErrorHandler = function( errmsg ) env.info( "Error in SCHEDULER function:" .. errmsg ) - env.info( debug.traceback() ) - + if debug ~= nil then + env.info( debug.traceback() ) + end + return errmsg end @@ -6592,7 +6578,8 @@ function EVENT:OnPlayerLeaveUnit( EventFunction, EventSelf ) end - +--- @param #EVENT self +-- @param #EVENTDATA Event function EVENT:onEvent( Event ) self:F2( { _EVENTCODES[Event.id], Event } ) @@ -6626,7 +6613,7 @@ function EVENT:onEvent( Event ) Event.WeaponName = Event.Weapon:getTypeName() --Event.WeaponTgtDCSUnit = Event.Weapon:getTarget() end - self:E( { _EVENTCODES[Event.id], Event } ) + self:E( { _EVENTCODES[Event.id], Event.IniUnitName, Event.TgtUnitName, Event.WeaponName } ) for ClassName, EventData in pairs( self.Events[Event.id] ) do if Event.IniDCSUnitName and EventData.IniUnit and EventData.IniUnit[Event.IniDCSUnitName] then self:E( { "Calling event function for class ", ClassName, " unit ", Event.IniDCSUnitName } ) @@ -8951,33 +8938,34 @@ end --- Returns if a location is within the zone. +-- Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html -- @param #ZONE_POLYGON_BASE self -- @param DCSTypes#Vec2 PointVec2 The location to test. -- @return #boolean true if the location is within the zone. function ZONE_POLYGON_BASE:IsPointVec2InZone( PointVec2 ) self:F2( PointVec2 ) - local i - local j - local c = false + local Next + local Prev + local InPolygon = false - i = 1 - j = #self.Polygon + Next = 1 + Prev = #self.Polygon - while i < #self.Polygon do - j = i - i = i + 1 - self:T( { i, j, self.Polygon[i], self.Polygon[j] } ) - if ( ( ( self.Polygon[i].y > PointVec2.y ) ~= ( self.Polygon[j].y > PointVec2.y ) ) and - ( PointVec2.x < ( self.Polygon[j].x - self.Polygon[i].x ) * ( PointVec2.y - self.Polygon[i].y ) / ( self.Polygon[j].y - self.Polygon[i].y ) + self.Polygon[i].x ) + while Next <= #self.Polygon do + self:T( { Next, Prev, self.Polygon[Next], self.Polygon[Prev] } ) + if ( ( ( self.Polygon[Next].y > PointVec2.y ) ~= ( self.Polygon[Prev].y > PointVec2.y ) ) and + ( PointVec2.x < ( self.Polygon[Prev].x - self.Polygon[Next].x ) * ( PointVec2.y - self.Polygon[Next].y ) / ( self.Polygon[Prev].y - self.Polygon[Next].y ) + self.Polygon[Next].x ) ) then - c = not c + InPolygon = not InPolygon end - self:T2( { "c = ", c } ) + self:T2( { InPolygon = InPolygon } ) + Prev = Next + Next = Next + 1 end - self:T( { "c = ", c } ) - return c + self:T( { InPolygon = InPolygon } ) + return InPolygon end --- Define a random @{DCSTypes#Vec2} within the zone. @@ -11078,7 +11066,7 @@ end -- @param #SET_BASE self -- @param Event#EVENTDATA Event function SET_BASE:_EventOnDeadOrCrash( Event ) - self:F2( { Event } ) + self:F3( { Event } ) if Event.IniDCSUnit then local ObjectName, Object = self:FindInDatabase( Event ) @@ -11134,7 +11122,7 @@ function SET_BASE:ForEach( IteratorFunction, arg, Set, Function, FunctionArgumen local function CoRoutine() local Count = 0 for ObjectID, Object in pairs( Set ) do - self:T2( Object ) + self:T3( Object ) if Function then if Function( unpack( FunctionArguments ), Object ) == true then IteratorFunction( Object, unpack( arg ) ) @@ -11223,7 +11211,7 @@ function SET_BASE:IsIncludeObject( Object ) return true end ---- Flushes the current SET_BASE contents in the log ... (for debug reasons). +--- Flushes the current SET_BASE contents in the log ... (for debugging reasons). -- @param #SET_BASE self -- @return #string A string with the names of the objects. function SET_BASE:Flush() @@ -11844,7 +11832,6 @@ end function SET_UNIT:FindInDatabase( Event ) self:F3( { Event } ) - self:E( { Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName] } ) return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName] end @@ -14627,7 +14614,6 @@ function CARGO_PACKAGE:OnBoard( Client, LandingZone, OnBoardSide ) end self:T( "Routing " .. CargoHostName ) - --routines.scheduleFunction( routines.goRoute, { CargoHostName, Points}, timer.getTime() + 4 ) SCHEDULER:New( self, routines.goRoute, { CargoHostName, Points }, 4 ) return Valid @@ -17863,7 +17849,6 @@ function CLEANUP:New( ZoneNames, TimeInterval ) local self = BASE:Inherit( self, _EVENTDISPATCHER:OnBirth( self._OnEventBirth, self ) - --self.CleanUpScheduler = routines.scheduleFunction( self._CleanUpScheduler, { self }, timer.getTime() + 1, TimeInterval ) self.CleanUpScheduler = SCHEDULER:New( self, self._CleanUpScheduler, {}, 1, TimeInterval ) return self @@ -17988,7 +17973,6 @@ function CLEANUP:_EventShot( Event ) if ( CurrentLandingZoneID ) then -- Okay, the missile was fired within the CLEANUP.ZoneNames, destroy the fired weapon. --_SEADmissile:destroy() - --routines.scheduleFunction( CLEANUP._DestroyMissile, { self, Event.Weapon }, timer.getTime() + 0.1) SCHEDULER:New( self, CLEANUP._DestroyMissile, { Event.Weapon }, 0.1 ) end end @@ -18005,7 +17989,6 @@ function CLEANUP:_EventHitCleanUp( Event ) self:T( { "Life: ", Event.IniDCSUnitName, ' = ', Event.IniDCSUnit:getLife(), "/", Event.IniDCSUnit:getLife0() } ) if Event.IniDCSUnit:getLife() < Event.IniDCSUnit:getLife0() then self:T( "CleanUp: Destroy: " .. Event.IniDCSUnitName ) - --routines.scheduleFunction( CLEANUP._DestroyUnit, { self, Event.IniDCSUnit }, timer.getTime() + 0.1) SCHEDULER:New( self, CLEANUP._DestroyUnit, { Event.IniDCSUnit }, 0.1 ) end end @@ -18016,7 +17999,6 @@ function CLEANUP:_EventHitCleanUp( Event ) self:T( { "Life: ", Event.TgtDCSUnitName, ' = ', Event.TgtDCSUnit:getLife(), "/", Event.TgtDCSUnit:getLife0() } ) if Event.TgtDCSUnit:getLife() < Event.TgtDCSUnit:getLife0() then self:T( "CleanUp: Destroy: " .. Event.TgtDCSUnitName ) - --routines.scheduleFunction( CLEANUP._DestroyUnit, { self, Event.TgtDCSUnit }, timer.getTime() + 0.1 ) SCHEDULER:New( self, CLEANUP._DestroyUnit, { Event.TgtDCSUnit }, 0.1 ) end end @@ -19578,7 +19560,6 @@ function SEAD:EventShot( Event ) local SEADUnitName = Event.IniDCSUnitName local SEADWeapon = Event.Weapon -- Identify the weapon fired local SEADWeaponName = Event.WeaponName -- return weapon type - --trigger.action.outText( string.format("Alerte, depart missile " ..string.format(SEADWeaponName)), 20) --debug message -- Start of the 2nd loop self:T( "Missile Launched = " .. SEADWeaponName ) if SEADWeaponName == "KH-58" or SEADWeaponName == "KH-25MPU" or SEADWeaponName == "AGM-88" or SEADWeaponName == "KH-31A" or SEADWeaponName == "KH-31P" then -- Check if the missile is a SEAD @@ -19604,10 +19585,10 @@ function SEAD:EventShot( Event ) local Skills = { "Average", "Good", "High", "Excellent" } _targetskill = Skills[ math.random(1,4) ] end - self:T( _targetskill ) -- debug message for skill check + self:T( _targetskill ) if self.TargetSkill[_targetskill] then if (_evade > self.TargetSkill[_targetskill].Evade) then - self:T( string.format("Evading, target skill " ..string.format(_targetskill)) ) --debug message + self:T( string.format("Evading, target skill " ..string.format(_targetskill)) ) local _targetMim = Weapon.getTarget(SEADWeapon) local _targetMimname = Unit.getName(_targetMim) local _targetMimgroup = Unit.getGroup(Weapon.getTarget(SEADWeapon)) @@ -20215,7 +20196,6 @@ function ESCORT:MenuReportTargets( Seconds ) self.EscortMenuAttackNearbyTargets = MENU_CLIENT:New( self.EscortClient, "Attack targets", self.EscortMenu ) - --self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, Seconds ) self.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, Seconds ) return self @@ -20437,7 +20417,6 @@ function ESCORT._SwitchReportNearbyTargets( MenuParam ) if self.ReportTargets then if not self.ReportTargetsScheduler then - --self.ReportTargetsScheduler = routines.scheduleFunction( self._ReportTargetsScheduler, { self }, timer.getTime() + 1, 30 ) self.ReportTargetsScheduler = SCHEDULER:New( self, self._ReportTargetsScheduler, {}, 1, 30 ) end else @@ -20514,16 +20493,6 @@ function ESCORT._AttackTarget( MenuParam ) EscortGroup:OptionROEOpenFire() EscortGroup:OptionROTPassiveDefense() EscortGroup:SetState( EscortGroup, "Escort", self ) --- routines.scheduleFunction( --- EscortGroup.PushTask, --- { EscortGroup, --- EscortGroup:TaskCombo( --- { EscortGroup:TaskAttackUnit( AttackUnit ), --- EscortGroup:TaskFunction( 1, 2, "_Resume", {"''"} ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroup, EscortGroup.PushTask, { EscortGroup:TaskCombo( @@ -20534,15 +20503,6 @@ function ESCORT._AttackTarget( MenuParam ) }, 10 ) else --- routines.scheduleFunction( --- EscortGroup.PushTask, --- { EscortGroup, --- EscortGroup:TaskCombo( --- { EscortGroup:TaskFireAtPoint( AttackUnit:GetPointVec2(), 50 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroup, EscortGroup.PushTask, { EscortGroup:TaskCombo( @@ -20573,16 +20533,6 @@ function ESCORT._AssistTarget( MenuParam ) if EscortGroupAttack:IsAir() then EscortGroupAttack:OptionROEOpenFire() EscortGroupAttack:OptionROTVertical() --- routines.scheduleFunction( --- EscortGroupAttack.PushTask, --- { EscortGroupAttack, --- EscortGroupAttack:TaskCombo( --- { EscortGroupAttack:TaskAttackUnit( AttackUnit ), --- EscortGroupAttack:TaskOrbitCircle( 500, 350 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHDULER:New( EscortGroupAttack, EscortGroupAttack.PushTask, { EscortGroupAttack:TaskCombo( @@ -20593,15 +20543,6 @@ function ESCORT._AssistTarget( MenuParam ) }, 10 ) else --- routines.scheduleFunction( --- EscortGroupAttack.PushTask, --- { EscortGroupAttack, --- EscortGroupAttack:TaskCombo( --- { EscortGroupAttack:TaskFireAtPoint( AttackUnit:GetPointVec2(), 50 ) --- } --- ) --- }, timer.getTime() + 10 --- ) SCHEDULER:New( EscortGroupAttack, EscortGroupAttack.PushTask, { EscortGroupAttack:TaskCombo( @@ -20661,7 +20602,6 @@ function ESCORT._ResumeMission( MenuParam ) table.remove( WayPoints, 1 ) end - --routines.scheduleFunction( EscortGroup.SetTask, {EscortGroup, EscortGroup:TaskRoute( WayPoints ) }, timer.getTime() + 1 ) SCHEDULER:New( EscortGroup, EscortGroup.SetTask, { EscortGroup:TaskRoute( WayPoints ) }, 1 ) EscortGroup:MessageToClient( "Resuming mission from waypoint " .. WayPoint .. ".", 10, EscortClient ) @@ -23109,7 +23049,7 @@ end -- -- 1.1) DETECTION_BASE constructor -- ------------------------------- --- Construct a new DETECTION_BASE instance using the @{Detection#DETECTION.New}() method. +-- Construct a new DETECTION_BASE instance using the @{Detection#DETECTION_BASE.New}() method. -- -- 1.2) DETECTION_BASE initialization -- ---------------------------------- @@ -23495,15 +23435,17 @@ function DETECTION_UNITGROUPS:SmokeDetectedUnits() self:F2() self._SmokeDetectedUnits = true + return self end --- Flare the detected units -- @param #DETECTION_UNITGROUPS self -- @return #DETECTION_UNITGROUPS self -function DETECTION_UNITGROUPS:SmokeDetectedUnits() +function DETECTION_UNITGROUPS:FlareDetectedUnits() self:F2() self._FlareDetectedUnits = true + return self end --- Smoke the detected zones @@ -23513,6 +23455,7 @@ function DETECTION_UNITGROUPS:SmokeDetectedZones() self:F2() self._SmokeDetectedZones = true + return self end --- Flare the detected zones @@ -23522,6 +23465,7 @@ function DETECTION_UNITGROUPS:FlareDetectedZones() self:F2() self._FlareDetectedZones = true + return self end @@ -23546,7 +23490,6 @@ function DETECTION_UNITGROUPS:CreateDetectionSets() for DetectedZoneIndex = 1, #self.DetectedZones do self:T( "Detected Unit Set #" .. DetectedZoneIndex ) local DetectedUnitSet = self.DetectedSets[DetectedZoneIndex] -- Set#SET_BASE - DetectedUnitSet:Flush() local DetectedZone = self.DetectedZones[DetectedZoneIndex] -- Zone#ZONE_UNIT if DetectedUnit:IsInZone( DetectedZone ) then self:T( "Adding to Unit Set #" .. DetectedZoneIndex ) diff --git a/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz b/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz index 94e4c4089..f5743e2d5 100644 Binary files a/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz and b/Moose Test Missions/Moose_Test_AIBALANCER/Moose_Test_AIBALANCER.miz differ diff --git a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz b/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz index f22c23be2..a40541339 100644 Binary files a/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz and b/Moose Test Missions/Moose_Test_AIRBASEPOLICE/Moose_Test_AIRBASEPOLICE.miz differ diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz index 1d19f356a..8939a96e8 100644 Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz and b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_with_Moose.miz differ diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz index 4d06d7f0f..89ee9770c 100644 Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz and b/Moose Test Missions/Moose_Test_BASE/Moose_Test_AIRBLANCER_without_Moose.miz differ diff --git a/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz b/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz index 3b9c57ad8..190fd65f9 100644 Binary files a/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz and b/Moose Test Missions/Moose_Test_BASE/Moose_Test_BASE.miz differ diff --git a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz index 68b9d0b7b..7b0bb991e 100644 Binary files a/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz and b/Moose Test Missions/Moose_Test_CLEANUP/Moose_Test_CLEANUP.miz differ diff --git a/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz b/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz index 58349ca2f..c9ae54b5f 100644 Binary files a/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz and b/Moose Test Missions/Moose_Test_DESTROY/MOOSE_Test_DESTROY.miz differ diff --git a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz index 366bf2c74..d8636d2bd 100644 Binary files a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz and b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION.miz differ diff --git a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz index 5c8138b82..1d5a774d0 100644 Binary files a/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz and b/Moose Test Missions/Moose_Test_DETECTION/Moose_Test_DETECTION_Laser.miz differ diff --git a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz index c36c14757..5f4ee1984 100644 Binary files a/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz and b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz differ diff --git a/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz b/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz index f8e039058..02ea77fa3 100644 Binary files a/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz and b/Moose Test Missions/Moose_Test_FAC/Moose_Test_FAC.miz differ diff --git a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz index c9e9d4835..d91ec66b1 100644 Binary files a/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz and b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz differ diff --git a/Moose Test Missions/Moose_Test_PATROLZONE/MOOSE_Test_PATROLZONE.miz b/Moose Test Missions/Moose_Test_PATROLZONE/MOOSE_Test_PATROLZONE.miz index 2ccdc62a5..db3b2171d 100644 Binary files a/Moose Test Missions/Moose_Test_PATROLZONE/MOOSE_Test_PATROLZONE.miz and b/Moose Test Missions/Moose_Test_PATROLZONE/MOOSE_Test_PATROLZONE.miz differ diff --git a/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz b/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz index fa00cc356..8942ee416 100644 Binary files a/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz and b/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz differ diff --git a/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz b/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz index 9a3617477..b18755943 100644 Binary files a/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz and b/Moose Test Missions/Moose_Test_SET_AIRBASE/Moose_Test_SET_AIRBASE.miz differ diff --git a/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz b/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz index 2d750e3f7..5bd652aeb 100644 Binary files a/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz and b/Moose Test Missions/Moose_Test_SET_CLIENT/Moose_Test_SET_CLIENT.miz differ diff --git a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz b/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz index 9791487ad..80907c6e5 100644 Binary files a/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz and b/Moose Test Missions/Moose_Test_SET_GROUP/Moose_Test_SET_GROUP.miz differ diff --git a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz index 0bc001417..e52fe5d86 100644 Binary files a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz and b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.miz differ diff --git a/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz b/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz index 5ef153478..be33534cb 100644 Binary files a/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz and b/Moose Test Missions/Moose_Test_SPAWN_Repeat/MOOSE_Test_SPAWN_Repeat.miz differ diff --git a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz b/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz index 43cbe10c0..ccb22ec8b 100644 Binary files a/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz and b/Moose Test Missions/Moose_Test_TASK_Pickup_and_Deploy/MOOSE_Test_TASK_Pickup_and_Deploy.miz differ diff --git a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz index 81729afd8..e2b82e9ab 100644 Binary files a/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz and b/Moose Test Missions/Moose_Test_WRAPPER/Moose_Test_WRAPPER.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz b/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz index 08536ea49..ac6114ce0 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz and b/Moose Test Missions/Moose_Test_ZONE/Moose_Test_ZONE.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz b/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz index 3fe74fccf..8964c9fd2 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz and b/Moose Test Missions/Moose_Test_ZONE_POLYGON/Moose_Test_ZONE_POLYGON.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz b/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz index 8d593e3c6..c81572b99 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz and b/Moose Test Missions/Moose_Test_ZONE_RADIUS/Moose_Test_ZONE_RADIUS.miz differ diff --git a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz b/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz index f98754531..17c016fea 100644 Binary files a/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz and b/Moose Test Missions/Moose_Test_ZONE_UNIT/Moose_Test_ZONE_UNIT.miz differ