diff --git a/Moose Development/Moose/Base.lua b/Moose Development/Moose/Base.lua index c96e27047..e2196c8ba 100644 --- a/Moose Development/Moose/Base.lua +++ b/Moose Development/Moose/Base.lua @@ -116,7 +116,6 @@ FORMATION = { -- return self -- end -- @todo need to investigate if the deepCopy is really needed... Don't think so. - function BASE:New() local Child = routines.utils.deepCopy( self ) local Parent = {} diff --git a/Moose Development/Moose/Client.lua b/Moose Development/Moose/Client.lua index 672a9c2c3..75e1ebd16 100644 --- a/Moose Development/Moose/Client.lua +++ b/Moose Development/Moose/Client.lua @@ -159,7 +159,7 @@ function CLIENT:AddBriefing( ClientBriefing ) return self end ---- Show the briefing of the MISSION to the CLIENT. +--- Show the briefing of a CLIENT. -- @param #CLIENT self -- @return #CLIENT self function CLIENT:ShowBriefing() @@ -168,14 +168,25 @@ function CLIENT:ShowBriefing() if not self.ClientBriefingShown then self.ClientBriefingShown = true local Briefing = "" - if self.MissionBriefing then - Briefing = Briefing .. self.MissionBriefing - end if self.ClientBriefing then - Briefing = Briefing .. "\n" .. self.ClientBriefing + Briefing = Briefing .. self.ClientBriefing end - Briefing = Briefing .. "\nPress [LEFT ALT]+[B] to view the complete mission briefing." - self:Message( Briefing, 30, self.ClientName .. '/MissionBriefing', "Briefing" ) + Briefing = Briefing .. " Press [LEFT ALT]+[B] to view the complete mission briefing." + self:Message( Briefing, 60, self.ClientName .. '/ClientBriefing', "Briefing" ) + end + + return self +end + +--- Show the mission briefing of a MISSION to the CLIENT. +-- @param #CLIENT self +-- @param #string MissionBriefing +-- @return #CLIENT self +function CLIENT:ShowMissionBriefing( MissionBriefing ) + self:F( { self.ClientName } ) + + if MissionBriefing then + self:Message( MissionBriefing, 60, self.ClientName .. '/MissionBriefing', "Mission Briefing" ) end return self diff --git a/Moose Development/Moose/Mission.lua b/Moose Development/Moose/Mission.lua index 0093ad9ce..764f26425 100644 --- a/Moose Development/Moose/Mission.lua +++ b/Moose Development/Moose/Mission.lua @@ -1,6 +1,6 @@ --- A MISSION is the main owner of a Mission orchestration within MOOSE . The Mission framework orchestrates @{CLIENT}s, @{TASK}s, @{STAGE}s etc. -- A @{CLIENT} needs to be registered within the @{MISSION} through the function @{AddClient}. A @{TASK} needs to be registered within the @{MISSION} through the function @{AddTask}. --- @module MISSION +-- @module Mission Include.File( "Routines" ) Include.File( "Base" ) @@ -8,7 +8,10 @@ Include.File( "Client" ) Include.File( "Task" ) --- The MISSION class --- @type +-- @type MISSION +-- @extends Base#BASE +-- @field #MISSION.Clients _Clients +-- @field #string MissionBriefing MISSION = { ClassName = "MISSION", Name = "", @@ -29,6 +32,8 @@ MISSION = { _GoalTasks = {} } +--- @type MISSION.Clients +-- @list function MISSION:Meta() @@ -236,10 +241,10 @@ end -- @return CLIENT -- @usage -- Add a number of Client objects to the Mission. --- Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) function MISSION:AddClient( Client ) self:F( { Client } ) @@ -355,6 +360,7 @@ _TransportExecuteStage = { --- The MISSIONSCHEDULER is an OBJECT and is the main scheduler of ALL active MISSIONs registered within this scheduler. It's workings are considered internal and is automatically created when the Mission.lua file is included. -- @type MISSIONSCHEDULER +-- @field #MISSIONSCHEDULER.MISSIONS Missions MISSIONSCHEDULER = { Missions = {}, MissionCount = 0, @@ -364,20 +370,28 @@ MISSIONSCHEDULER = { TimeShow = 5 } +--- @type MISSIONSCHEDULER.MISSIONS +-- @list <#MISSION> Mission + --- This is the main MISSIONSCHEDULER Scheduler function. It is considered internal and is automatically created when the Mission.lua file is included. function MISSIONSCHEDULER.Scheduler() + -- loop through the missions in the TransportTasks - for MissionName, Mission in pairs( MISSIONSCHEDULER.Missions ) do - + for MissionName, MissionData in pairs( MISSIONSCHEDULER.Missions ) do + + local Mission = MissionData -- #MISSION + if not Mission:IsCompleted() then -- This flag will monitor if for this mission, there are clients alive. If this flag is still false at the end of the loop, the mission status will be set to Pending (if not Failed or Completed). local ClientsAlive = false - for ClientID, Client in pairs( Mission._Clients ) do + for ClientID, ClientData in pairs( Mission._Clients ) do + + local Client = ClientData -- Client#CLIENT - if Client:GetDCSGroup() then + if Client:IsAlive() then -- There is at least one Client that is alive... So the Mission status is set to Ongoing. ClientsAlive = true @@ -405,7 +419,7 @@ function MISSIONSCHEDULER.Scheduler() -- For each Client, check for each Task the state and evolve the mission. -- This flag will indicate if the Task of the Client is Complete. - TaskComplete = false + local TaskComplete = false for TaskNumber, Task in pairs( Client._Tasks ) do @@ -554,7 +568,7 @@ function MISSIONSCHEDULER.AddMission( Mission ) MISSIONSCHEDULER.Missions[Mission.Name] = Mission MISSIONSCHEDULER.MissionCount = MISSIONSCHEDULER.MissionCount + 1 -- Add an overall AI Client for the AI tasks... This AI Client will facilitate the Events in the background for each Task. - --MissionAdd:AddClient( CLIENT:New( 'AI' ) ) + --MissionAdd:AddClient( CLIENT:Register( 'AI' ) ) return Mission end diff --git a/Moose Development/Moose/Stage.lua b/Moose Development/Moose/Stage.lua index 5dae9ae6a..d28c22c7d 100644 --- a/Moose Development/Moose/Stage.lua +++ b/Moose Development/Moose/Stage.lua @@ -66,10 +66,16 @@ function STAGEBRIEF:New() return self end +--- Execute +-- @param #STAGEBRIEF self +-- @param Mission#MISSION Mission +-- @param Client#CLIENT Client +-- @param Task#TASK Task +-- @return #boolean function STAGEBRIEF:Execute( Mission, Client, Task ) local Valid = BASE:Inherited(self):Execute( Mission, Client, Task ) self:F() - Client:ShowBriefing() + Client:ShowMissionBriefing( Mission.MissionBriefing ) self.StageBriefingTime = timer.getTime() return Valid end diff --git a/Moose Development/Moose/Test.lua b/Moose Development/Moose/Test.lua new file mode 100644 index 000000000..e69de29bb 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 142198273..8f1d04ce8 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: 20160525_1659' ) +env.info( 'Moose Generation Timestamp: 20160526_1413' ) local base = _G env.info("Loading MOOSE " .. base.timer.getAbsTime() ) @@ -2666,7 +2666,6 @@ FORMATION = { -- return self -- end -- @todo need to investigate if the deepCopy is really needed... Don't think so. - function BASE:New() local Child = routines.utils.deepCopy( self ) local Parent = {} @@ -6959,7 +6958,7 @@ function CLIENT:AddBriefing( ClientBriefing ) return self end ---- Show the briefing of the MISSION to the CLIENT. +--- Show the briefing of a CLIENT. -- @param #CLIENT self -- @return #CLIENT self function CLIENT:ShowBriefing() @@ -6968,14 +6967,25 @@ function CLIENT:ShowBriefing() if not self.ClientBriefingShown then self.ClientBriefingShown = true local Briefing = "" - if self.MissionBriefing then - Briefing = Briefing .. self.MissionBriefing - end if self.ClientBriefing then - Briefing = Briefing .. "\n" .. self.ClientBriefing + Briefing = Briefing .. self.ClientBriefing end - Briefing = Briefing .. "\nPress [LEFT ALT]+[B] to view the complete mission briefing." - self:Message( Briefing, 30, self.ClientName .. '/MissionBriefing', "Briefing" ) + Briefing = Briefing .. " Press [LEFT ALT]+[B] to view the complete mission briefing." + self:Message( Briefing, 60, self.ClientName .. '/ClientBriefing', "Briefing" ) + end + + return self +end + +--- Show the mission briefing of a MISSION to the CLIENT. +-- @param #CLIENT self +-- @param #string MissionBriefing +-- @return #CLIENT self +function CLIENT:ShowMissionBriefing( MissionBriefing ) + self:F( { self.ClientName } ) + + if MissionBriefing then + self:Message( MissionBriefing, 60, self.ClientName .. '/MissionBriefing', "Mission Briefing" ) end return self @@ -10203,10 +10213,16 @@ function STAGEBRIEF:New() return self end +--- Execute +-- @param #STAGEBRIEF self +-- @param Mission#MISSION Mission +-- @param Client#CLIENT Client +-- @param Task#TASK Task +-- @return #boolean function STAGEBRIEF:Execute( Mission, Client, Task ) local Valid = BASE:Inherited(self):Execute( Mission, Client, Task ) self:F() - Client:ShowBriefing() + Client:ShowMissionBriefing( Mission.MissionBriefing ) self.StageBriefingTime = timer.getTime() return Valid end @@ -12211,7 +12227,7 @@ end --- A MISSION is the main owner of a Mission orchestration within MOOSE . The Mission framework orchestrates @{CLIENT}s, @{TASK}s, @{STAGE}s etc. -- A @{CLIENT} needs to be registered within the @{MISSION} through the function @{AddClient}. A @{TASK} needs to be registered within the @{MISSION} through the function @{AddTask}. --- @module MISSION +-- @module Mission Include.File( "Routines" ) Include.File( "Base" ) @@ -12219,7 +12235,10 @@ Include.File( "Client" ) Include.File( "Task" ) --- The MISSION class --- @type +-- @type MISSION +-- @extends Base#BASE +-- @field #MISSION.Clients _Clients +-- @field #string MissionBriefing MISSION = { ClassName = "MISSION", Name = "", @@ -12240,6 +12259,8 @@ MISSION = { _GoalTasks = {} } +--- @type MISSION.Clients +-- @list function MISSION:Meta() @@ -12447,10 +12468,10 @@ end -- @return CLIENT -- @usage -- Add a number of Client objects to the Mission. --- Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) function MISSION:AddClient( Client ) self:F( { Client } ) @@ -12566,6 +12587,7 @@ _TransportExecuteStage = { --- The MISSIONSCHEDULER is an OBJECT and is the main scheduler of ALL active MISSIONs registered within this scheduler. It's workings are considered internal and is automatically created when the Mission.lua file is included. -- @type MISSIONSCHEDULER +-- @field #MISSIONSCHEDULER.MISSIONS Missions MISSIONSCHEDULER = { Missions = {}, MissionCount = 0, @@ -12575,20 +12597,28 @@ MISSIONSCHEDULER = { TimeShow = 5 } +--- @type MISSIONSCHEDULER.MISSIONS +-- @list <#MISSION> Mission + --- This is the main MISSIONSCHEDULER Scheduler function. It is considered internal and is automatically created when the Mission.lua file is included. function MISSIONSCHEDULER.Scheduler() + -- loop through the missions in the TransportTasks - for MissionName, Mission in pairs( MISSIONSCHEDULER.Missions ) do - + for MissionName, MissionData in pairs( MISSIONSCHEDULER.Missions ) do + + local Mission = MissionData -- #MISSION + if not Mission:IsCompleted() then -- This flag will monitor if for this mission, there are clients alive. If this flag is still false at the end of the loop, the mission status will be set to Pending (if not Failed or Completed). local ClientsAlive = false - for ClientID, Client in pairs( Mission._Clients ) do + for ClientID, ClientData in pairs( Mission._Clients ) do + + local Client = ClientData -- Client#CLIENT - if Client:GetDCSGroup() then + if Client:IsAlive() then -- There is at least one Client that is alive... So the Mission status is set to Ongoing. ClientsAlive = true @@ -12616,7 +12646,7 @@ function MISSIONSCHEDULER.Scheduler() -- For each Client, check for each Task the state and evolve the mission. -- This flag will indicate if the Task of the Client is Complete. - TaskComplete = false + local TaskComplete = false for TaskNumber, Task in pairs( Client._Tasks ) do @@ -12765,7 +12795,7 @@ function MISSIONSCHEDULER.AddMission( Mission ) MISSIONSCHEDULER.Missions[Mission.Name] = Mission MISSIONSCHEDULER.MissionCount = MISSIONSCHEDULER.MissionCount + 1 -- Add an overall AI Client for the AI tasks... This AI Client will facilitate the Events in the background for each Task. - --MissionAdd:AddClient( CLIENT:New( 'AI' ) ) + --MissionAdd:AddClient( CLIENT:Register( 'AI' ) ) return Mission end diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 142198273..8f1d04ce8 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: 20160525_1659' ) +env.info( 'Moose Generation Timestamp: 20160526_1413' ) local base = _G env.info("Loading MOOSE " .. base.timer.getAbsTime() ) @@ -2666,7 +2666,6 @@ FORMATION = { -- return self -- end -- @todo need to investigate if the deepCopy is really needed... Don't think so. - function BASE:New() local Child = routines.utils.deepCopy( self ) local Parent = {} @@ -6959,7 +6958,7 @@ function CLIENT:AddBriefing( ClientBriefing ) return self end ---- Show the briefing of the MISSION to the CLIENT. +--- Show the briefing of a CLIENT. -- @param #CLIENT self -- @return #CLIENT self function CLIENT:ShowBriefing() @@ -6968,14 +6967,25 @@ function CLIENT:ShowBriefing() if not self.ClientBriefingShown then self.ClientBriefingShown = true local Briefing = "" - if self.MissionBriefing then - Briefing = Briefing .. self.MissionBriefing - end if self.ClientBriefing then - Briefing = Briefing .. "\n" .. self.ClientBriefing + Briefing = Briefing .. self.ClientBriefing end - Briefing = Briefing .. "\nPress [LEFT ALT]+[B] to view the complete mission briefing." - self:Message( Briefing, 30, self.ClientName .. '/MissionBriefing', "Briefing" ) + Briefing = Briefing .. " Press [LEFT ALT]+[B] to view the complete mission briefing." + self:Message( Briefing, 60, self.ClientName .. '/ClientBriefing', "Briefing" ) + end + + return self +end + +--- Show the mission briefing of a MISSION to the CLIENT. +-- @param #CLIENT self +-- @param #string MissionBriefing +-- @return #CLIENT self +function CLIENT:ShowMissionBriefing( MissionBriefing ) + self:F( { self.ClientName } ) + + if MissionBriefing then + self:Message( MissionBriefing, 60, self.ClientName .. '/MissionBriefing', "Mission Briefing" ) end return self @@ -10203,10 +10213,16 @@ function STAGEBRIEF:New() return self end +--- Execute +-- @param #STAGEBRIEF self +-- @param Mission#MISSION Mission +-- @param Client#CLIENT Client +-- @param Task#TASK Task +-- @return #boolean function STAGEBRIEF:Execute( Mission, Client, Task ) local Valid = BASE:Inherited(self):Execute( Mission, Client, Task ) self:F() - Client:ShowBriefing() + Client:ShowMissionBriefing( Mission.MissionBriefing ) self.StageBriefingTime = timer.getTime() return Valid end @@ -12211,7 +12227,7 @@ end --- A MISSION is the main owner of a Mission orchestration within MOOSE . The Mission framework orchestrates @{CLIENT}s, @{TASK}s, @{STAGE}s etc. -- A @{CLIENT} needs to be registered within the @{MISSION} through the function @{AddClient}. A @{TASK} needs to be registered within the @{MISSION} through the function @{AddTask}. --- @module MISSION +-- @module Mission Include.File( "Routines" ) Include.File( "Base" ) @@ -12219,7 +12235,10 @@ Include.File( "Client" ) Include.File( "Task" ) --- The MISSION class --- @type +-- @type MISSION +-- @extends Base#BASE +-- @field #MISSION.Clients _Clients +-- @field #string MissionBriefing MISSION = { ClassName = "MISSION", Name = "", @@ -12240,6 +12259,8 @@ MISSION = { _GoalTasks = {} } +--- @type MISSION.Clients +-- @list function MISSION:Meta() @@ -12447,10 +12468,10 @@ end -- @return CLIENT -- @usage -- Add a number of Client objects to the Mission. --- Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) --- Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) +-- Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() ) function MISSION:AddClient( Client ) self:F( { Client } ) @@ -12566,6 +12587,7 @@ _TransportExecuteStage = { --- The MISSIONSCHEDULER is an OBJECT and is the main scheduler of ALL active MISSIONs registered within this scheduler. It's workings are considered internal and is automatically created when the Mission.lua file is included. -- @type MISSIONSCHEDULER +-- @field #MISSIONSCHEDULER.MISSIONS Missions MISSIONSCHEDULER = { Missions = {}, MissionCount = 0, @@ -12575,20 +12597,28 @@ MISSIONSCHEDULER = { TimeShow = 5 } +--- @type MISSIONSCHEDULER.MISSIONS +-- @list <#MISSION> Mission + --- This is the main MISSIONSCHEDULER Scheduler function. It is considered internal and is automatically created when the Mission.lua file is included. function MISSIONSCHEDULER.Scheduler() + -- loop through the missions in the TransportTasks - for MissionName, Mission in pairs( MISSIONSCHEDULER.Missions ) do - + for MissionName, MissionData in pairs( MISSIONSCHEDULER.Missions ) do + + local Mission = MissionData -- #MISSION + if not Mission:IsCompleted() then -- This flag will monitor if for this mission, there are clients alive. If this flag is still false at the end of the loop, the mission status will be set to Pending (if not Failed or Completed). local ClientsAlive = false - for ClientID, Client in pairs( Mission._Clients ) do + for ClientID, ClientData in pairs( Mission._Clients ) do + + local Client = ClientData -- Client#CLIENT - if Client:GetDCSGroup() then + if Client:IsAlive() then -- There is at least one Client that is alive... So the Mission status is set to Ongoing. ClientsAlive = true @@ -12616,7 +12646,7 @@ function MISSIONSCHEDULER.Scheduler() -- For each Client, check for each Task the state and evolve the mission. -- This flag will indicate if the Task of the Client is Complete. - TaskComplete = false + local TaskComplete = false for TaskNumber, Task in pairs( Client._Tasks ) do @@ -12765,7 +12795,7 @@ function MISSIONSCHEDULER.AddMission( Mission ) MISSIONSCHEDULER.Missions[Mission.Name] = Mission MISSIONSCHEDULER.MissionCount = MISSIONSCHEDULER.MissionCount + 1 -- Add an overall AI Client for the AI tasks... This AI Client will facilitate the Events in the background for each Task. - --MissionAdd:AddClient( CLIENT:New( 'AI' ) ) + --MissionAdd:AddClient( CLIENT:Register( 'AI' ) ) return Mission end 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 6604a6119..928c05242 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_DATABASE/Moose_Test_DATABASE.miz b/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.miz index fcc10299c..0bdbd3f05 100644 Binary files a/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.miz and b/Moose Test Missions/Moose_Test_DATABASE/Moose_Test_DATABASE.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 c09ab7628..670f8d468 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_ESCORT/MOOSE_Test_ESCORT.miz b/Moose Test Missions/Moose_Test_ESCORT/MOOSE_Test_ESCORT.miz index 2551c476f..912b3d1cf 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_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz b/Moose Test Missions/Moose_Test_MISSILETRAINER/Moose_Test_MISSILETRAINER.miz index 4c7dabda2..69faae2df 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_SEAD/MOOSE_Test_SEAD.miz b/Moose Test Missions/Moose_Test_SEAD/MOOSE_Test_SEAD.miz index 561b272f9..dbe71769b 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_SPAWN/MOOSE_Test_SPAWN.lua b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua index 293d8faf8..c2f784faa 100644 --- a/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua +++ b/Moose Test Missions/Moose_Test_SPAWN/MOOSE_Test_SPAWN.lua @@ -127,7 +127,7 @@ Spawn_Vehicle_SpawnToZone = SPAWN:New( "Spawn Vehicle SpawnToZone" ) -- and the vehicle will drive to a random location within the defined zone. -- For this, the following code is activated within the mission on waypoint 3: -- --- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:New( ... ):GetUnit(1) ) +-- local InfantryDropGroup = Spawn_Vehicle_SpawnToZone:SpawnFromUnit( GROUP:Find( ... ):GetUnit(1) ) -- local InfantryDropRoute = InfantryDropGroup:CopyRoute( 1, 0 ) -- InfantryDropGroup:RouteToZone( ZONE:New( "Target Zone" ), true, 80 ) -- 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 4517f1c82..3a6bcd9e6 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 e9346aaa2..63198ee5a 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 68443e275..c909c341b 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 48c7a6b1b..d2fa72778 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