diff --git a/Moose Development/Moose/AI/AI_Patrol.lua b/Moose Development/Moose/AI/AI_Patrol.lua index 6781fe964..cd517e450 100644 --- a/Moose Development/Moose/AI/AI_Patrol.lua +++ b/Moose Development/Moose/AI/AI_Patrol.lua @@ -345,8 +345,8 @@ function AI_PATROLZONE:onenterRoute() self.Controllable:SetState( self.Controllable, "PatrolZone", self ) self.Controllable:WayPointFunction( #PatrolRoute, 1, "_NewPatrolRoute" ) - --- NOW ACT_ROUTE THE GROUP! - self.Controllable:WayPointExecute( 1 ) + --- NOW ROUTE THE GROUP! + self.Controllable:WayPointExecute( 1, 5 ) self:__Patrol( 30 ) end diff --git a/Moose Development/Moose/Core/ScheduleDispatcher.lua b/Moose Development/Moose/Core/ScheduleDispatcher.lua index 18ac50a5a..fc2933cde 100644 --- a/Moose Development/Moose/Core/ScheduleDispatcher.lua +++ b/Moose Development/Moose/Core/ScheduleDispatcher.lua @@ -66,9 +66,9 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr -- If the object used as the key is nil, then the garbage collector will remove the item from the Functions array. self.ObjectSchedulers = self.ObjectSchedulers or setmetatable( {}, { __mode = "v" } ) - if Scheduler.SchedulerObject then + if Scheduler.MasterObject then self.ObjectSchedulers[self.CallID] = Scheduler - self:E( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), SchedulerObject = tostring(Scheduler.SchedulerObject) } ) + self:E( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), MasterObject = tostring(Scheduler.MasterObject) } ) else self.PersistentSchedulers[self.CallID] = Scheduler self:E( { CallID = self.CallID, PersistentScheduler = self.PersistentSchedulers[self.CallID] } ) @@ -80,7 +80,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr self.Schedule[Scheduler][self.CallID].Function = ScheduleFunction self.Schedule[Scheduler][self.CallID].Arguments = ScheduleArguments self.Schedule[Scheduler][self.CallID].StartTime = timer.getTime() + ( Start or 0 ) - self.Schedule[Scheduler][self.CallID].Start = Start + .001 + self.Schedule[Scheduler][self.CallID].Start = Start + .1 self.Schedule[Scheduler][self.CallID].Repeat = Repeat self.Schedule[Scheduler][self.CallID].Randomize = Randomize self.Schedule[Scheduler][self.CallID].Stop = Stop @@ -156,7 +156,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr self:Stop( Scheduler, CallID ) end else - --self:E( "Scheduled obscolete call for CallID: " .. CallID ) + self:E( "Scheduled obscolete call for CallID: " .. CallID ) end return nil diff --git a/Moose Development/Moose/Core/Scheduler.lua b/Moose Development/Moose/Core/Scheduler.lua index 14b596a5b..39604c2b7 100644 --- a/Moose Development/Moose/Core/Scheduler.lua +++ b/Moose Development/Moose/Core/Scheduler.lua @@ -69,6 +69,8 @@ function SCHEDULER:New( SchedulerObject, SchedulerFunction, SchedulerArguments, local ScheduleID = nil + self.MasterObject = SchedulerObject + if SchedulerFunction then ScheduleID = self:Schedule( SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop ) end diff --git a/Moose Development/Moose/Functional/Spawn.lua b/Moose Development/Moose/Functional/Spawn.lua index 843b12f0e..0f4a09686 100644 --- a/Moose Development/Moose/Functional/Spawn.lua +++ b/Moose Development/Moose/Functional/Spawn.lua @@ -591,6 +591,7 @@ function SPAWN:ReSpawn( SpawnIndex ) -- TODO: This logic makes DCS crash and i don't know why (yet). local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) + local WayPoints = SpawnGroup and SpawnGroup.WayPoints or nil if SpawnGroup then local SpawnDCSGroup = SpawnGroup:GetDCSObject() if SpawnDCSGroup then @@ -598,7 +599,15 @@ function SPAWN:ReSpawn( SpawnIndex ) end end - return self:SpawnWithIndex( SpawnIndex ) + local SpawnGroup = self:SpawnWithIndex( SpawnIndex ) + if SpawnGroup and WayPoints then + -- If there were WayPoints set, then Re-Execute those WayPoints! + self:E( WayPoints ) + SpawnGroup:WayPointInitialize( WayPoints ) + SpawnGroup:WayPointExecute( 1, 5 ) + end + + return SpawnGroup end --- Will spawn a group with a specified index number. diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index af21429ba..bf94e2e05 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -144,6 +144,8 @@ function CONTROLLABLE:New( ControllableName ) local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) ) self:F2( ControllableName ) self.ControllableName = ControllableName + + self.TaskScheduler = SCHEDULER:New( self ) return self end @@ -202,7 +204,7 @@ function CONTROLLABLE:PushTask( DCSTask, WaitTime ) -- Controller:pushTask( DCSTask ) if WaitTime then - SCHEDULER:New( Controller, Controller.pushTask, { DCSTask }, WaitTime ) + self.TaskScheduler:Schedule( Controller, Controller.pushTask, { DCSTask }, WaitTime ) else Controller:pushTask( DCSTask ) end @@ -233,7 +235,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime ) if not WaitTime then Controller:setTask( DCSTask ) else - SCHEDULER:New( Controller, Controller.setTask, { DCSTask }, WaitTime ) + self.TaskScheduler:Schedule( Controller, Controller.setTask, { DCSTask }, WaitTime ) end return self @@ -1494,7 +1496,7 @@ function CONTROLLABLE:Route( GoPoints ) local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, } local Controller = self:_GetController() --Controller.setTask( Controller, MissionTask ) - SCHEDULER:New( Controller, Controller.setTask, { MissionTask }, 1 ) + self.TaskScheduler:Schedule( Controller, Controller.setTask, { MissionTask }, 1 ) return self end @@ -2122,7 +2124,7 @@ end -- @param #table WayPoints If WayPoints is given, then use the route. -- @return #CONTROLLABLE function CONTROLLABLE:WayPointInitialize( WayPoints ) - self:F( { WayPoint, WayPointIndex, WayPointFunction } ) + self:F( { WayPoints } ) if WayPoints then self.WayPoints = WayPoints @@ -2133,6 +2135,18 @@ function CONTROLLABLE:WayPointInitialize( WayPoints ) return self end +--- Get the current WayPoints set with the WayPoint functions( Note that the WayPoints can be nil, although there ARE waypoints). +-- @param #CONTROLLABLE self +-- @return #table WayPoints If WayPoints is given, then return the WayPoints structure. +function CONTROLLABLE:GetWayPoints() + self:F( ) + + if self.WayPoints then + return self.WayPoints + end + + return nil +end --- Registers a waypoint function that will be executed when the controllable moves over the WayPoint. -- @param #CONTROLLABLE self 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 1d9b665ac..544390cf6 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: 20170110_1254' ) +env.info( 'Moose Generation Timestamp: 20170112_1201' ) local base = _G Include = {} @@ -3857,6 +3857,8 @@ function SCHEDULER:New( SchedulerObject, SchedulerFunction, SchedulerArguments, local ScheduleID = nil + self.MasterObject = SchedulerObject + if SchedulerFunction then ScheduleID = self:Schedule( SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop ) end @@ -4015,9 +4017,9 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr -- If the object used as the key is nil, then the garbage collector will remove the item from the Functions array. self.ObjectSchedulers = self.ObjectSchedulers or setmetatable( {}, { __mode = "v" } ) - if Scheduler.SchedulerObject then + if Scheduler.MasterObject then self.ObjectSchedulers[self.CallID] = Scheduler - self:E( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), SchedulerObject = tostring(Scheduler.SchedulerObject) } ) + self:E( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), MasterObject = tostring(Scheduler.MasterObject) } ) else self.PersistentSchedulers[self.CallID] = Scheduler self:E( { CallID = self.CallID, PersistentScheduler = self.PersistentSchedulers[self.CallID] } ) @@ -4029,7 +4031,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr self.Schedule[Scheduler][self.CallID].Function = ScheduleFunction self.Schedule[Scheduler][self.CallID].Arguments = ScheduleArguments self.Schedule[Scheduler][self.CallID].StartTime = timer.getTime() + ( Start or 0 ) - self.Schedule[Scheduler][self.CallID].Start = Start + .001 + self.Schedule[Scheduler][self.CallID].Start = Start + .1 self.Schedule[Scheduler][self.CallID].Repeat = Repeat self.Schedule[Scheduler][self.CallID].Randomize = Randomize self.Schedule[Scheduler][self.CallID].Stop = Stop @@ -4105,7 +4107,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr self:Stop( Scheduler, CallID ) end else - --self:E( "Scheduled obscolete call for CallID: " .. CallID ) + self:E( "Scheduled obscolete call for CallID: " .. CallID ) end return nil @@ -12627,6 +12629,8 @@ function CONTROLLABLE:New( ControllableName ) local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) ) self:F2( ControllableName ) self.ControllableName = ControllableName + + self.TaskScheduler = SCHEDULER:New( self ) return self end @@ -12685,7 +12689,7 @@ function CONTROLLABLE:PushTask( DCSTask, WaitTime ) -- Controller:pushTask( DCSTask ) if WaitTime then - SCHEDULER:New( Controller, Controller.pushTask, { DCSTask }, WaitTime ) + self.TaskScheduler:Schedule( Controller, Controller.pushTask, { DCSTask }, WaitTime ) else Controller:pushTask( DCSTask ) end @@ -12716,7 +12720,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime ) if not WaitTime then Controller:setTask( DCSTask ) else - SCHEDULER:New( Controller, Controller.setTask, { DCSTask }, WaitTime ) + self.TaskScheduler:Schedule( Controller, Controller.setTask, { DCSTask }, WaitTime ) end return self @@ -13977,7 +13981,7 @@ function CONTROLLABLE:Route( GoPoints ) local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, } local Controller = self:_GetController() --Controller.setTask( Controller, MissionTask ) - SCHEDULER:New( Controller, Controller.setTask, { MissionTask }, 1 ) + self.TaskScheduler:Schedule( Controller, Controller.setTask, { MissionTask }, 1 ) return self end @@ -14605,7 +14609,7 @@ end -- @param #table WayPoints If WayPoints is given, then use the route. -- @return #CONTROLLABLE function CONTROLLABLE:WayPointInitialize( WayPoints ) - self:F( { WayPoint, WayPointIndex, WayPointFunction } ) + self:F( { WayPoints } ) if WayPoints then self.WayPoints = WayPoints @@ -14616,6 +14620,18 @@ function CONTROLLABLE:WayPointInitialize( WayPoints ) return self end +--- Get the current WayPoints set with the WayPoint functions( Note that the WayPoints can be nil, although there ARE waypoints). +-- @param #CONTROLLABLE self +-- @return #table WayPoints If WayPoints is given, then return the WayPoints structure. +function CONTROLLABLE:GetWayPoints() + self:F( ) + + if self.WayPoints then + return self.WayPoints + end + + return nil +end --- Registers a waypoint function that will be executed when the controllable moves over the WayPoint. -- @param #CONTROLLABLE self @@ -18775,6 +18791,7 @@ function SPAWN:ReSpawn( SpawnIndex ) -- TODO: This logic makes DCS crash and i don't know why (yet). local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) + local WayPoints = SpawnGroup and SpawnGroup.WayPoints or nil if SpawnGroup then local SpawnDCSGroup = SpawnGroup:GetDCSObject() if SpawnDCSGroup then @@ -18782,7 +18799,15 @@ function SPAWN:ReSpawn( SpawnIndex ) end end - return self:SpawnWithIndex( SpawnIndex ) + local SpawnGroup = self:SpawnWithIndex( SpawnIndex ) + if SpawnGroup and WayPoints then + -- If there were WayPoints set, then Re-Execute those WayPoints! + self:E( WayPoints ) + SpawnGroup:WayPointInitialize( WayPoints ) + SpawnGroup:WayPointExecute( 1, 5 ) + end + + return SpawnGroup end --- Will spawn a group with a specified index number. @@ -24834,8 +24859,8 @@ function AI_PATROLZONE:onenterRoute() self.Controllable:SetState( self.Controllable, "PatrolZone", self ) self.Controllable:WayPointFunction( #PatrolRoute, 1, "_NewPatrolRoute" ) - --- NOW ACT_ROUTE THE GROUP! - self.Controllable:WayPointExecute( 1 ) + --- NOW ROUTE THE GROUP! + self.Controllable:WayPointExecute( 1, 5 ) self:__Patrol( 30 ) end diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 1d9b665ac..544390cf6 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: 20170110_1254' ) +env.info( 'Moose Generation Timestamp: 20170112_1201' ) local base = _G Include = {} @@ -3857,6 +3857,8 @@ function SCHEDULER:New( SchedulerObject, SchedulerFunction, SchedulerArguments, local ScheduleID = nil + self.MasterObject = SchedulerObject + if SchedulerFunction then ScheduleID = self:Schedule( SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop ) end @@ -4015,9 +4017,9 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr -- If the object used as the key is nil, then the garbage collector will remove the item from the Functions array. self.ObjectSchedulers = self.ObjectSchedulers or setmetatable( {}, { __mode = "v" } ) - if Scheduler.SchedulerObject then + if Scheduler.MasterObject then self.ObjectSchedulers[self.CallID] = Scheduler - self:E( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), SchedulerObject = tostring(Scheduler.SchedulerObject) } ) + self:E( { CallID = self.CallID, ObjectScheduler = tostring(self.ObjectSchedulers[self.CallID]), MasterObject = tostring(Scheduler.MasterObject) } ) else self.PersistentSchedulers[self.CallID] = Scheduler self:E( { CallID = self.CallID, PersistentScheduler = self.PersistentSchedulers[self.CallID] } ) @@ -4029,7 +4031,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr self.Schedule[Scheduler][self.CallID].Function = ScheduleFunction self.Schedule[Scheduler][self.CallID].Arguments = ScheduleArguments self.Schedule[Scheduler][self.CallID].StartTime = timer.getTime() + ( Start or 0 ) - self.Schedule[Scheduler][self.CallID].Start = Start + .001 + self.Schedule[Scheduler][self.CallID].Start = Start + .1 self.Schedule[Scheduler][self.CallID].Repeat = Repeat self.Schedule[Scheduler][self.CallID].Randomize = Randomize self.Schedule[Scheduler][self.CallID].Stop = Stop @@ -4105,7 +4107,7 @@ function SCHEDULEDISPATCHER:AddSchedule( Scheduler, ScheduleFunction, ScheduleAr self:Stop( Scheduler, CallID ) end else - --self:E( "Scheduled obscolete call for CallID: " .. CallID ) + self:E( "Scheduled obscolete call for CallID: " .. CallID ) end return nil @@ -12627,6 +12629,8 @@ function CONTROLLABLE:New( ControllableName ) local self = BASE:Inherit( self, POSITIONABLE:New( ControllableName ) ) self:F2( ControllableName ) self.ControllableName = ControllableName + + self.TaskScheduler = SCHEDULER:New( self ) return self end @@ -12685,7 +12689,7 @@ function CONTROLLABLE:PushTask( DCSTask, WaitTime ) -- Controller:pushTask( DCSTask ) if WaitTime then - SCHEDULER:New( Controller, Controller.pushTask, { DCSTask }, WaitTime ) + self.TaskScheduler:Schedule( Controller, Controller.pushTask, { DCSTask }, WaitTime ) else Controller:pushTask( DCSTask ) end @@ -12716,7 +12720,7 @@ function CONTROLLABLE:SetTask( DCSTask, WaitTime ) if not WaitTime then Controller:setTask( DCSTask ) else - SCHEDULER:New( Controller, Controller.setTask, { DCSTask }, WaitTime ) + self.TaskScheduler:Schedule( Controller, Controller.setTask, { DCSTask }, WaitTime ) end return self @@ -13977,7 +13981,7 @@ function CONTROLLABLE:Route( GoPoints ) local MissionTask = { id = 'Mission', params = { route = { points = Points, }, }, } local Controller = self:_GetController() --Controller.setTask( Controller, MissionTask ) - SCHEDULER:New( Controller, Controller.setTask, { MissionTask }, 1 ) + self.TaskScheduler:Schedule( Controller, Controller.setTask, { MissionTask }, 1 ) return self end @@ -14605,7 +14609,7 @@ end -- @param #table WayPoints If WayPoints is given, then use the route. -- @return #CONTROLLABLE function CONTROLLABLE:WayPointInitialize( WayPoints ) - self:F( { WayPoint, WayPointIndex, WayPointFunction } ) + self:F( { WayPoints } ) if WayPoints then self.WayPoints = WayPoints @@ -14616,6 +14620,18 @@ function CONTROLLABLE:WayPointInitialize( WayPoints ) return self end +--- Get the current WayPoints set with the WayPoint functions( Note that the WayPoints can be nil, although there ARE waypoints). +-- @param #CONTROLLABLE self +-- @return #table WayPoints If WayPoints is given, then return the WayPoints structure. +function CONTROLLABLE:GetWayPoints() + self:F( ) + + if self.WayPoints then + return self.WayPoints + end + + return nil +end --- Registers a waypoint function that will be executed when the controllable moves over the WayPoint. -- @param #CONTROLLABLE self @@ -18775,6 +18791,7 @@ function SPAWN:ReSpawn( SpawnIndex ) -- TODO: This logic makes DCS crash and i don't know why (yet). local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) + local WayPoints = SpawnGroup and SpawnGroup.WayPoints or nil if SpawnGroup then local SpawnDCSGroup = SpawnGroup:GetDCSObject() if SpawnDCSGroup then @@ -18782,7 +18799,15 @@ function SPAWN:ReSpawn( SpawnIndex ) end end - return self:SpawnWithIndex( SpawnIndex ) + local SpawnGroup = self:SpawnWithIndex( SpawnIndex ) + if SpawnGroup and WayPoints then + -- If there were WayPoints set, then Re-Execute those WayPoints! + self:E( WayPoints ) + SpawnGroup:WayPointInitialize( WayPoints ) + SpawnGroup:WayPointExecute( 1, 5 ) + end + + return SpawnGroup end --- Will spawn a group with a specified index number. @@ -24834,8 +24859,8 @@ function AI_PATROLZONE:onenterRoute() self.Controllable:SetState( self.Controllable, "PatrolZone", self ) self.Controllable:WayPointFunction( #PatrolRoute, 1, "_NewPatrolRoute" ) - --- NOW ACT_ROUTE THE GROUP! - self.Controllable:WayPointExecute( 1 ) + --- NOW ROUTE THE GROUP! + self.Controllable:WayPointExecute( 1, 5 ) self:__Patrol( 30 ) end diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua b/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua index 78f9a6946..4e708331a 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.lua @@ -31,15 +31,17 @@ local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) -- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) +local PatrolZones = {} + function RU_AI_Balancer:OnAfterSpawned( SetGroup, From, Event, To, AIGroup ) local PatrolZoneGroup = GROUP:FindByName( "PatrolZone" ) local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup ) - local Patrol = AI_PATROLZONE:New( PatrolZone, 3000, 6000, 400, 600 ) - Patrol:ManageFuel( 0.2, 60 ) - Patrol:SetControllable( AIGroup ) - Patrol:__Start( 5 ) + PatrolZones[AIGroup] = AI_PATROLZONE:New( PatrolZone, 3000, 6000, 400, 600 ) + PatrolZones[AIGroup]:ManageFuel( 0.2, 60 ) + PatrolZones[AIGroup]:SetControllable( AIGroup ) + PatrolZones[AIGroup]:__Start( 5 ) end diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.miz b/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.miz index 62e5dd39f..e46b66d08 100644 Binary files a/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.miz and b/Moose Test Missions/AIB - AI Balancing/AIB-002 - Patrol AI/AIB-002 - Patrol AI.miz differ diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua b/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua index 59722ccda..f7501afd4 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-005 - Patrol AI and Randomize Zones/AIB-005 - Patrol AI and Randomize Zones.lua @@ -25,7 +25,7 @@ local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCa -- Define the SPAWN object for the red AI plane template. -- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. -- If a blocked plane exists, this red plane will be ReSpawned. -local RU_PlanesSpawn = SPAWN:New( "AI RU" ) +local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 60 ) -- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn ) diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua b/Moose Test Missions/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua index 650aca254..c04dc441f 100644 --- a/Moose Test Missions/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua +++ b/Moose Test Missions/AIB - AI Balancing/AIB-006 - Declutter AI at Airbases/AIB-006 - Declutter AI at Airbases.lua @@ -24,7 +24,7 @@ local RU_PlanesClientSet = SET_CLIENT:New():FilterCountries( "RUSSIA" ):FilterCa -- Define the SPAWN object for the red AI plane template. -- We use InitCleanUp to check every 20 seconds, if there are no planes blocked at the airbase, waithing for take-off. -- If a blocked plane exists, this red plane will be ReSpawned. -local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 20 ) +local RU_PlanesSpawn = SPAWN:New( "AI RU" ):InitCleanUp( 60 ) -- Start the AI_BALANCER, using the SET of red CLIENTs, and the SPAWN object as a parameter. local RU_AI_Balancer = AI_BALANCER:New( RU_PlanesClientSet, RU_PlanesSpawn )