diff --git a/Moose Development/Moose/Actions/Act_Route.lua b/Moose Development/Moose/Actions/Act_Route.lua index d2598b6c2..1ca28ca2c 100644 --- a/Moose Development/Moose/Actions/Act_Route.lua +++ b/Moose Development/Moose/Actions/Act_Route.lua @@ -144,13 +144,15 @@ do -- ACT_ROUTE -- @param #string From -- @param #string To function ACT_ROUTE:onbeforeRoute( ProcessUnit, Event, From, To ) + self:F( { "BeforeRoute 1", self.DisplayCount, self.DisplayInterval } ) if ProcessUnit:IsAlive() then + self:F( "BeforeRoute 2" ) local HasArrived = self:onfuncHasArrived( ProcessUnit ) -- Polymorphic if self.DisplayCount >= self.DisplayInterval then self:T( { HasArrived = HasArrived } ) if not HasArrived then - self:__Report( 1 ) + self:Report() end self.DisplayCount = 1 else @@ -208,6 +210,7 @@ do -- ACT_ROUTE_ZONE function ACT_ROUTE_ZONE:Init( FsmRoute ) self.TargetZone = FsmRoute.TargetZone + self.DisplayInterval = 30 self.DisplayCount = 30 self.DisplayMessage = true diff --git a/Moose Development/Moose/Core/Fsm.lua b/Moose Development/Moose/Core/Fsm.lua index ee4563e39..736c9c6e7 100644 --- a/Moose Development/Moose/Core/Fsm.lua +++ b/Moose Development/Moose/Core/Fsm.lua @@ -550,6 +550,8 @@ do -- FSM_PROCESS return self:GetTask():GetMission():GetCommandCenter() end +-- TODO: Need to check and fix that an FSM_PROCESS is only for a UNIT. Not for a GROUP. + --- Send a message of the @{Task} to the Group of the Unit. -- @param #FSM_PROCESS self function FSM_PROCESS:Message( Message ) @@ -558,6 +560,12 @@ function FSM_PROCESS:Message( Message ) local CC = self:GetCommandCenter() local TaskGroup = self.Controllable:GetGroup() + local PlayerName = self.Controllable:GetPlayerName() -- Only for a unit + PlayerName = PlayerName and " (" .. PlayerName .. ")" or "" -- If PlayerName is nil, then keep it nil, otherwise add brackets. + local Callsign = self.Controllable:GetCallsign() + local Prefix = Callsign and " @ " .. Callsign .. PlayerName or "" + + Message = Prefix .. ": " .. Message CC:MessageToGroup( Message, TaskGroup ) end diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index ebe26cc70..ed94d776b 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -1475,6 +1475,25 @@ function SET_UNIT:GetUnitThreatLevels() return UnitThreatLevels end +--- Calculate the maxium A2G threat level of the SET_UNIT. +-- @param #SET_UNIT self +function SET_UNIT:CalculateThreatLevelA2G() + + local MaxThreatLevelA2G = 0 + for UnitName, UnitData in pairs( self:GetSet() ) do + local ThreatUnit = UnitData -- Wrapper.Unit#UNIT + local ThreatLevelA2G = ThreatUnit:GetThreatLevel() + if ThreatLevelA2G > MaxThreatLevelA2G then + MaxThreatLevelA2G = ThreatLevelA2G + end + end + + self:T3( MaxThreatLevelA2G ) + return MaxThreatLevelA2G + +end + + --- Returns if the @{Set} has targets having a radar (of a given type). -- @param #SET_UNIT self -- @param Dcs.DCSWrapper.Unit#Unit.RadarType RadarType diff --git a/Moose Development/Moose/Tasking/CommandCenter.lua b/Moose Development/Moose/Tasking/CommandCenter.lua index 34a5ffad3..10fce8124 100644 --- a/Moose Development/Moose/Tasking/CommandCenter.lua +++ b/Moose Development/Moose/Tasking/CommandCenter.lua @@ -64,7 +64,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName ) self.CommandCenterName = CommandCenterName or CommandCenterPositionable:GetName() self.CommandCenterCoalition = CommandCenterPositionable:GetCoalition() - self.Missions = setmetatable( {}, { __mode = "v" } ) + self.Missions = {} self:EventOnBirth( --- @param #COMMANDCENTER self @@ -142,7 +142,7 @@ end -- @return #string function COMMANDCENTER:GetName() - return self.HQName + return self.CommandCenterName end --- Gets the POSITIONABLE of the HQ command center. @@ -188,7 +188,12 @@ end function COMMANDCENTER:SetMenu() self:F() - self.CommandCenterMenu = self.CommandCenterMenu or MENU_COALITION:New( self.CommandCenterCoalition, "HQ" ) + self.CommandCenterMenu = self.CommandCenterMenu or MENU_COALITION:New( self.CommandCenterCoalition, "Command Center (" .. self:GetName() .. ")" ) + + for MissionID, Mission in pairs( self:GetMissions() ) do + local Mission = Mission -- Tasking.Mission#MISSION + Mission:RemoveMenu() + end for MissionID, Mission in pairs( self:GetMissions() ) do local Mission = Mission -- Tasking.Mission#MISSION @@ -218,9 +223,14 @@ end --- Send a CC message to a GROUP. -- @param #COMMANDCENTER self -function COMMANDCENTER:MessageToGroup( Message, TaskGroup ) +-- @param #string Message +-- @param Wrapper.Group#GROUP TaskGroup +-- @param #sring Name (optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown. +function COMMANDCENTER:MessageToGroup( Message, TaskGroup, Name ) - self:GetPositionable():MessageToGroup( Message , 20, TaskGroup ) + local Prefix = Name and "@ Group (" .. Name .. "): " or '' + Message = Prefix .. Message + self:GetPositionable():MessageToGroup( Message , 20, TaskGroup, self:GetName() ) end diff --git a/Moose Development/Moose/Tasking/DetectionManager.lua b/Moose Development/Moose/Tasking/DetectionManager.lua index d40836b6c..a28a63ce0 100644 --- a/Moose Development/Moose/Tasking/DetectionManager.lua +++ b/Moose Development/Moose/Tasking/DetectionManager.lua @@ -382,7 +382,6 @@ do -- DETECTION_DISPATCHER if Task then if Task:IsStatePlanned() and DetectedArea.Changed == true then self:E( "Removing Tasking: " .. Task:GetTaskName() ) - Mission:RemoveTaskMenu( Task ) Task = Mission:RemoveTask( Task ) end end @@ -486,7 +485,7 @@ do -- DETECTION_DISPATCHER end -- TODO set menus using the HQ coordinator - Mission:SetMenu() + Mission:GetCommandCenter():SetMenu() if #AreaMsg > 0 then for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do diff --git a/Moose Development/Moose/Tasking/Mission.lua b/Moose Development/Moose/Tasking/Mission.lua index c0ae13e21..eaa4e789d 100644 --- a/Moose Development/Moose/Tasking/Mission.lua +++ b/Moose Development/Moose/Tasking/Mission.lua @@ -200,7 +200,6 @@ end --- Sets the Planned Task menu. -- @param #MISSION self --- @param Core.Menu#MENU_COALITION CommandCenterMenu function MISSION:SetMenu() self:F() @@ -210,6 +209,17 @@ function MISSION:SetMenu() end end +--- Removes the Planned Task menu. +-- @param #MISSION self +function MISSION:RemoveMenu() + self:F() + + for _, Task in pairs( self:GetTasks() ) do + local Task = Task -- Tasking.Task#TASK + Task:RemoveMenu() + end +end + --- Gets the COMMANDCENTER. -- @param #MISSION self diff --git a/Moose Development/Moose/Tasking/Task.lua b/Moose Development/Moose/Tasking/Task.lua index b5b4fa110..4f92b2680 100644 --- a/Moose Development/Moose/Tasking/Task.lua +++ b/Moose Development/Moose/Tasking/Task.lua @@ -439,7 +439,8 @@ function TASK:MessageToGroups( Message ) local CC = Mission:GetCommandCenter() for TaskGroupName, TaskGroup in pairs( self.SetGroup:GetSet() ) do - CC:MessageToGroup( Message, TaskGroup ) + local TaskGroup = TaskGroup -- Wrapper.Group#GROUP + CC:MessageToGroup( Message, TaskGroup, TaskGroup:GetName() ) end end @@ -527,7 +528,6 @@ function TASK:SetMenu() self.SetGroup:Flush() for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do - self:RemoveMenuForGroup( TaskGroup ) if self:IsStatePlanned() or self:IsStateReplanned() then self:SetMenuForGroup( TaskGroup ) end @@ -873,7 +873,7 @@ function TASK:onenterAssigned( Event, From, To ) self:E("Task Assigned") - self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned!" ) + self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." ) self:GetMission():__Start() end @@ -992,9 +992,11 @@ function TASK:ReportDetails() PlayerNames[#PlayerNames+1] = PlayerName end end - PlayerNameText = table.concat( PlayerNames, ", " ) + local PlayerNameText = table.concat( PlayerNames, ", " ) Report:Add( "Task " .. Name .. " - State '" .. State .. "' - Players " .. PlayerNameText ) end + + -- Loop each Process in the Task, and find Reporting Details. return Report:Text() end diff --git a/Moose Development/Moose/Tasking/TaskMenu.lua b/Moose Development/Moose/Tasking/TaskMenu.lua deleted file mode 100644 index 7b81bdcac..000000000 --- a/Moose Development/Moose/Tasking/TaskMenu.lua +++ /dev/null @@ -1,84 +0,0 @@ ---- @module Task_Client_Menu - ---- TASK2_MENU_CLIENT class --- @type TASK2_MENU_CLIENT --- @field Wrapper.Unit#UNIT TaskUnit --- @field Core.Set#SET_UNIT TargetSet --- @field Core.Menu#MENU_CLIENT_COMMAND MenuTask --- @extends Task2#TASK2 -TASK2_MENU_CLIENT = { - ClassName = "TASK2_MENU_CLIENT", - TargetSet = nil, -} - - ---- Creates a new MENU handling machine. --- @param #TASK2_MENU_CLIENT self --- @param Tasking.Mission#MISSION Mission --- @param Wrapper.Unit#UNIT TaskUnit --- @param #string MenuText The text of the menu item. --- @return #TASK2_MENU_CLIENT self -function TASK2_MENU_CLIENT:New( Mission, TaskUnit, MenuText ) - - -- Inherits from BASE - local self = BASE:Inherit( self, TASK2:New( Mission, TaskUnit ) ) -- #TASK2_MENU_CLIENT - - self.MenuText = MenuText - - self.Fsm = FSM_TASK:New( self, { - initial = 'Unassigned', - events = { - { name = 'Menu', from = 'Unassigned', to = 'AwaitingMenu' }, - { name = 'Assign', from = 'AwaitingMenu', to = 'Assigned' }, - }, - callbacks = { - onMenu = self.OnMenu, - onAssign = self.OnAssign, - }, - endstates = { - 'Assigned' - }, - } ) - - return self -end - ---- Task Events - ---- StateMachine callback function for a TASK2 --- @param #TASK2_MENU_CLIENT self --- @param Core.Fsm#FSM_TASK Fsm --- @param #string Event --- @param #string From --- @param #string To -function TASK2_MENU_CLIENT:OnMenu( Fsm, Event, From, To ) - self:E( { Event, From, To, self.TaskUnit.UnitName} ) - - self.TaskUnit:Message( "Press F10 for task menu", 15 ) - self.Menu = MENU_CLIENT:New( self.TaskUnit, self.Mission:GetName(), nil ) - self.MenuTask = MENU_CLIENT_COMMAND:New( self.TaskUnit, self.MenuText, self.Menu, self.MenuAssign, self ) -end - ---- Menu function. --- @param #TASK2_MENU_CLIENT self -function TASK2_MENU_CLIENT:MenuAssign() - self:E( ) - - self.TaskUnit:Message( "Menu Assign", 15 ) - - self:NextEvent( self.Fsm.Assign ) -end - ---- StateMachine callback function for a TASK2 --- @param #TASK2_MENU_CLIENT self --- @param Core.Fsm#FSM_TASK Fsm --- @param #string Event --- @param #string From --- @param #string To -function TASK2_MENU_CLIENT:OnAssign( Fsm, Event, From, To ) - self:E( { Event, From, To, self.TaskUnit.UnitName} ) - - self.TaskUnit:Message( "Assign Task", 15 ) - self.MenuTask:Remove() -end - diff --git a/Moose Development/Moose/Tasking/Task_A2G.lua b/Moose Development/Moose/Tasking/Task_A2G.lua index 35f49a277..bb9002d5b 100644 --- a/Moose Development/Moose/Tasking/Task_A2G.lua +++ b/Moose Development/Moose/Tasking/Task_A2G.lua @@ -45,19 +45,19 @@ do -- TASK_A2G self.TargetZone = TargetZone self.FACUnit = FACUnit - local Fsm = self:GetUnitProcess() + local A2GUnitProcess = self:GetUnitProcess() - Fsm:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } ) - Fsm:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) - Fsm:AddAction ( "Rejected", "Eject", "Planned" ) - Fsm:AddAction ( "Arrived", "Update", "Updated" ) - Fsm:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } ) - Fsm:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) - --Fsm:AddProcess( "Updated", "JTAC", PROCESS_JTAC:New( self, TaskUnit, self.TargetSetUnit, self.FACUnit ) ) - Fsm:AddAction ( "Accounted", "Success", "Success" ) - Fsm:AddAction ( "Failed", "Fail", "Failed" ) + A2GUnitProcess:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } ) + A2GUnitProcess:AddProcess ( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) + A2GUnitProcess:AddTransition( "Rejected", "Eject", "Planned" ) + A2GUnitProcess:AddTransition( "Arrived", "Update", "Updated" ) + A2GUnitProcess:AddProcess ( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } ) + A2GUnitProcess:AddProcess ( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) + --Fsm:AddProcess ( "Updated", "JTAC", PROCESS_JTAC:New( self, TaskUnit, self.TargetSetUnit, self.FACUnit ) ) + A2GUnitProcess:AddTransition( "Accounted", "Success", "Success" ) + A2GUnitProcess:AddTransition( "Failed", "Fail", "Failed" ) - function Fsm:onenterUpdated( TaskUnit ) + function A2GUnitProcess:onenterUpdated( TaskUnit ) self:E( { self } ) self:Account() self:Smoke() diff --git a/Moose Development/Moose/Tasking/Task_AIBalancer.lua b/Moose Development/Moose/Tasking/Task_AIBalancer.lua deleted file mode 100644 index d68c991f8..000000000 --- a/Moose Development/Moose/Tasking/Task_AIBalancer.lua +++ /dev/null @@ -1,283 +0,0 @@ ---- This module contains the AI_BALANCER class. --- --- === --- --- 1) @{AI.AI_Balancer#AI_BALANCER} class, extends @{Core.Base#BASE} --- ======================================================= --- The @{AI.AI_Balancer#AI_BALANCER} class controls the dynamic spawning of AI GROUPS depending on a SET_CLIENT. --- There will be as many AI GROUPS spawned as there at CLIENTS in SET_CLIENT not spawned. --- The AI_Balancer uses the @{PatrolCore.Zone#AI_PATROLZONE} class to make AI patrol an zone until the fuel treshold is reached. --- --- 1.1) AI_BALANCER construction method: --- ------------------------------------ --- Create a new AI_BALANCER object with the @{#AI_BALANCER.New} method: --- --- * @{#AI_BALANCER.New}: Creates a new AI_BALANCER object. --- --- 1.2) AI_BALANCER returns AI to Airbases: --- --------------------------------------- --- You can configure to have the AI to return to: --- --- * @{#AI_BALANCER.ReturnToHomeAirbase}: Returns the AI to the home @{Wrapper.Airbase#AIRBASE}. --- * @{#AI_BALANCER.ReturnToNearestAirbases}: Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}. --- --- 1.3) AI_BALANCER allows AI to patrol specific zones: --- --------------------------------------------------- --- Use @{AI.AI_Balancer#AI_BALANCER.SetPatrolZone}() to specify a zone where the AI needs to patrol. --- --- === --- --- **API CHANGE HISTORY** --- ====================== --- --- The underlying change log documents the API changes. Please read this carefully. The following notation is used: --- --- * **Added** parts are expressed in bold type face. --- * _Removed_ parts are expressed in italic type face. --- --- Hereby the change log: --- --- 2016-08-17: SPAWN:**InitCleanUp**( SpawnCleanUpInterval ) replaces SPAWN:_CleanUp_( SpawnCleanUpInterval ) --- --- * Want to ensure that the methods starting with **Init** are the first called methods before any _Spawn_ method is called! --- * This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods. --- --- === --- --- AUTHORS and CONTRIBUTIONS --- ========================= --- --- ### Contributions: --- --- * **Dutch_Baron (James)**: Who you can search on the Eagle Dynamics Forums. --- Working together with James has resulted in the creation of the AI_BALANCER class. --- James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-) --- --- * **SNAFU**: --- Had a couple of mails with the guys to validate, if the same concept in the GCI/CAP script could be reworked within MOOSE. --- None of the script code has been used however within the new AI_BALANCER moose class. --- --- ### Authors: --- --- * FlightControl: Framework Design & Programming --- --- @module AI_Balancer - - - ---- AI_BALANCER class --- @type AI_BALANCER --- @field Core.Set#SET_CLIENT SetClient --- @field Functional.Spawn#SPAWN SpawnAI --- @field #boolean ToNearestAirbase --- @field Core.Set#SET_AIRBASE ReturnAirbaseSet --- @field Dcs.DCSTypes#Distance ReturnTresholdRange --- @field #boolean ToHomeAirbase --- @field PatrolCore.Zone#AI_PATROLZONE PatrolZone --- @extends Core.Base#BASE -AI_BALANCER = { - ClassName = "AI_BALANCER", - PatrolZones = {}, - AIGroups = {}, -} - ---- Creates a new AI_BALANCER object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names. --- @param #AI_BALANCER self --- @param SetClient A SET_CLIENT object that will contain the CLIENT objects to be monitored if they are alive or not (joined by a player). --- @param SpawnAI A SPAWN object that will spawn the AI units required, balancing the SetClient. --- @return #AI_BALANCER self -function AI_BALANCER:New( SetClient, SpawnAI ) - - -- Inherits from BASE - local self = BASE:Inherit( self, BASE:New() ) - - self.SetClient = SetClient - if type( SpawnAI ) == "table" then - if SpawnAI.ClassName and SpawnAI.ClassName == "SPAWN" then - self.SpawnAI = { SpawnAI } - else - local SpawnObjects = true - for SpawnObjectID, SpawnObject in pairs( SpawnAI ) do - if SpawnObject.ClassName and SpawnObject.ClassName == "SPAWN" then - self:E( SpawnObject.ClassName ) - else - self:E( "other object" ) - SpawnObjects = false - end - end - if SpawnObjects == true then - self.SpawnAI = SpawnAI - else - error( "No SPAWN object given in parameter SpawnAI, either as a single object or as a table of objects!" ) - end - end - end - - self.ToNearestAirbase = false - self.ReturnHomeAirbase = false - - self.AIMonitorSchedule = SCHEDULER:New( self, self._ClientAliveMonitorScheduler, {}, 1, 10, 0 ) - - return self -end - ---- Returns the AI to the nearest friendly @{Wrapper.Airbase#AIRBASE}. --- @param #AI_BALANCER self --- @param Dcs.DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Wrapper.Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Wrapper.Airbase#AIRBASE}. --- @param Core.Set#SET_AIRBASE ReturnAirbaseSet The SET of @{Core.Set#SET_AIRBASE}s to evaluate where to return to. -function AI_BALANCER:ReturnToNearestAirbases( ReturnTresholdRange, ReturnAirbaseSet ) - - self.ToNearestAirbase = true - self.ReturnTresholdRange = ReturnTresholdRange - self.ReturnAirbaseSet = ReturnAirbaseSet -end - ---- Returns the AI to the home @{Wrapper.Airbase#AIRBASE}. --- @param #AI_BALANCER self --- @param Dcs.DCSTypes#Distance ReturnTresholdRange If there is an enemy @{Wrapper.Client#CLIENT} within the ReturnTresholdRange given in meters, the AI will not return to the nearest @{Wrapper.Airbase#AIRBASE}. -function AI_BALANCER:ReturnToHomeAirbase( ReturnTresholdRange ) - - self.ToHomeAirbase = true - self.ReturnTresholdRange = ReturnTresholdRange -end - ---- Let the AI patrol a @{Zone} with a given Speed range and Altitude range. --- @param #AI_BALANCER self --- @param PatrolCore.Zone#AI_PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol. --- @return PatrolCore.Zone#AI_PATROLZONE self -function AI_BALANCER:SetPatrolZone( PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed ) - - self.PatrolZone = AI_PATROLZONE:New( - self.SpawnAI, - PatrolZone, - PatrolFloorAltitude, - PatrolCeilingAltitude, - PatrolMinSpeed, - PatrolMaxSpeed - ) -end - ---- Get the @{PatrolZone} object assigned by the @{AI_Balancer} object. --- @param #AI_BALANCER self --- @return PatrolCore.Zone#AI_PATROLZONE PatrolZone The @{PatrolZone} where the AI needs to patrol. -function AI_BALANCER:GetPatrolZone() - - return self.PatrolZone -end - - - ---- @param #AI_BALANCER self -function AI_BALANCER:_ClientAliveMonitorScheduler() - - self.SetClient:ForEachClient( - --- @param Wrapper.Client#CLIENT Client - function( Client ) - local ClientAIAliveState = Client:GetState( self, 'AIAlive' ) - self:T( ClientAIAliveState ) - if Client:IsAlive() then - if ClientAIAliveState == true then - Client:SetState( self, 'AIAlive', false ) - - local AIGroup = self.AIGroups[Client.UnitName] -- Wrapper.Group#GROUP - --- local PatrolZone = Client:GetState( self, "PatrolZone" ) --- if PatrolZone then --- PatrolZone = nil --- Client:ClearState( self, "PatrolZone" ) --- end - - if self.ToNearestAirbase == false and self.ToHomeAirbase == false then - AIGroup:Destroy() - else - -- We test if there is no other CLIENT within the self.ReturnTresholdRange of the first unit of the AI group. - -- If there is a CLIENT, the AI stays engaged and will not return. - -- If there is no CLIENT within the self.ReturnTresholdRange, then the unit will return to the Airbase return method selected. - - local PlayerInRange = { Value = false } - local RangeZone = ZONE_RADIUS:New( 'RangeZone', AIGroup:GetVec2(), self.ReturnTresholdRange ) - - self:E( RangeZone ) - - _DATABASE:ForEachPlayer( - --- @param Wrapper.Unit#UNIT RangeTestUnit - function( RangeTestUnit, RangeZone, AIGroup, PlayerInRange ) - self:E( { PlayerInRange, RangeTestUnit.UnitName, RangeZone.ZoneName } ) - if RangeTestUnit:IsInZone( RangeZone ) == true then - self:E( "in zone" ) - if RangeTestUnit:GetCoalition() ~= AIGroup:GetCoalition() then - self:E( "in range" ) - PlayerInRange.Value = true - end - end - end, - - --- @param Core.Zone#ZONE_RADIUS RangeZone - -- @param Wrapper.Group#GROUP AIGroup - function( RangeZone, AIGroup, PlayerInRange ) - local AIGroupTemplate = AIGroup:GetTemplate() - if PlayerInRange.Value == false then - if self.ToHomeAirbase == true then - local WayPointCount = #AIGroupTemplate.route.points - local SwitchWayPointCommand = AIGroup:CommandSwitchWayPoint( 1, WayPointCount, 1 ) - AIGroup:SetCommand( SwitchWayPointCommand ) - AIGroup:MessageToRed( "Returning to home base ...", 30 ) - else - -- Okay, we need to send this Group back to the nearest base of the Coalition of the AI. - --TODO: i need to rework the POINT_VEC2 thing. - local PointVec2 = POINT_VEC2:New( AIGroup:GetVec2().x, AIGroup:GetVec2().y ) - local ClosestAirbase = self.ReturnAirbaseSet:FindNearestAirbaseFromPointVec2( PointVec2 ) - self:T( ClosestAirbase.AirbaseName ) - AIGroup:MessageToRed( "Returning to " .. ClosestAirbase:GetName().. " ...", 30 ) - local RTBRoute = AIGroup:RouteReturnToAirbase( ClosestAirbase ) - AIGroupTemplate.route = RTBRoute - AIGroup:Respawn( AIGroupTemplate ) - end - end - end - , RangeZone, AIGroup, PlayerInRange - ) - - end - end - else - if not ClientAIAliveState or ClientAIAliveState == false then - Client:SetState( self, 'AIAlive', true ) - - - -- OK, spawn a new group from the SpawnAI objects provided. - local SpawnAICount = #self.SpawnAI - local SpawnAIIndex = math.random( 1, SpawnAICount ) - local AIGroup = self.SpawnAI[SpawnAIIndex]:Spawn() - AIGroup:E( "spawning new AIGroup" ) - --TODO: need to rework UnitName thing ... - self.AIGroups[Client.UnitName] = AIGroup - - --- Now test if the AIGroup needs to patrol a zone, otherwise let it follow its route... - if self.PatrolZone then - self.PatrolZones[#self.PatrolZones+1] = AI_PATROLZONE:New( - self.PatrolZone.PatrolZone, - self.PatrolZone.PatrolFloorAltitude, - self.PatrolZone.PatrolCeilingAltitude, - self.PatrolZone.PatrolMinSpeed, - self.PatrolZone.PatrolMaxSpeed - ) - - if self.PatrolZone.PatrolManageFuel == true then - self.PatrolZones[#self.PatrolZones]:ManageFuel( self.PatrolZone.PatrolFuelTresholdPercentage, self.PatrolZone.PatrolOutOfFuelOrbitTime ) - end - self.PatrolZones[#self.PatrolZones]:SetGroup( AIGroup ) - - --self.PatrolZones[#self.PatrolZones+1] = PatrolZone - - --Client:SetState( self, "PatrolZone", PatrolZone ) - end - end - end - end - ) - return true -end - - - diff --git a/Moose Development/Moose/Tasking/Task_SEAD.lua b/Moose Development/Moose/Tasking/Task_SEAD.lua index d9acf5157..fe68d5b97 100644 --- a/Moose Development/Moose/Tasking/Task_SEAD.lua +++ b/Moose Development/Moose/Tasking/Task_SEAD.lua @@ -47,14 +47,14 @@ do -- TASK_SEAD local Fsm = self:GetUnitProcess() - Fsm:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } ) - Fsm:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) - Fsm:AddAction ( "Rejected", "Eject", "Planned" ) - Fsm:AddAction ( "Arrived", "Update", "Updated" ) - Fsm:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } ) - Fsm:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) - Fsm:AddAction ( "Accounted", "Success", "Success" ) - Fsm:AddAction ( "Failed", "Fail", "Failed" ) + Fsm:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } ) + Fsm:AddProcess ( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) + Fsm:AddTransition( "Rejected", "Eject", "Planned" ) + Fsm:AddTransition( "Arrived", "Update", "Updated" ) + Fsm:AddProcess ( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } ) + Fsm:AddProcess ( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) + Fsm:AddTransition( "Accounted", "Success", "Success" ) + Fsm:AddTransition( "Failed", "Fail", "Failed" ) function Fsm:onenterUpdated( TaskUnit ) self:E( { self } ) diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua index c547eca2d..a5ba2121e 100644 --- a/Moose Development/Moose/Wrapper/Group.lua +++ b/Moose Development/Moose/Wrapper/Group.lua @@ -865,4 +865,22 @@ function GROUP:CopyRoute( Begin, End, Randomize, Radius ) return nil end +--- Calculate the maxium A2G threat level of the Group. +-- @param #GROUP self +function GROUP:CalculateThreatLevelA2G() + + local MaxThreatLevelA2G = 0 + for UnitName, UnitData in pairs( self:GetUnits() ) do + local ThreatUnit = UnitData -- Wrapper.Unit#UNIT + local ThreatLevelA2G = ThreatUnit:GetThreatLevel() + if ThreatLevelA2G > MaxThreatLevelA2G then + MaxThreatLevelA2G = ThreatLevelA2G + end + end + + self:T3( MaxThreatLevelA2G ) + return MaxThreatLevelA2G +end + + diff --git a/Moose Development/Moose/Wrapper/Identifiable.lua b/Moose Development/Moose/Wrapper/Identifiable.lua index 865f9c398..34f87b25a 100644 --- a/Moose Development/Moose/Wrapper/Identifiable.lua +++ b/Moose Development/Moose/Wrapper/Identifiable.lua @@ -210,6 +210,13 @@ function IDENTIFIABLE:GetDesc() return nil end +--- Gets the CallSign of the IDENTIFIABLE, which is a blank by default. +-- @param #IDENTIFIABLE self +-- @return #string The CallSign of the IDENTIFIABLE. +function IDENTIFIABLE:GetCallsign() + return '' +end + diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua index 8b449bf7e..e011f6f8c 100644 --- a/Moose Development/Moose/Wrapper/Positionable.lua +++ b/Moose Development/Moose/Wrapper/Positionable.lua @@ -280,12 +280,14 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. -- @return Core.Message#MESSAGE -function POSITIONABLE:GetMessage( Message, Duration ) +function POSITIONABLE:GetMessage( Message, Duration, Name ) local DCSObject = self:GetDCSObject() if DCSObject then - return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")" ) + Name = Name or self:GetTypeName() + return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. Name .. ")" ) end return nil @@ -296,12 +298,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToAll( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToAll( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToAll() + self:GetMessage( Message, Duration, Name ):ToAll() end return nil @@ -312,12 +315,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTYpes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToCoalition( MessageCoalition ) + self:GetMessage( Message, Duration, Name ):ToCoalition( MessageCoalition ) end return nil @@ -329,12 +333,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTYpes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToRed( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToRed( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToRed() + self:GetMessage( Message, Duration, Name ):ToRed() end return nil @@ -345,12 +350,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToBlue( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToBlue( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToBlue() + self:GetMessage( Message, Duration, Name ):ToBlue() end return nil @@ -362,12 +368,13 @@ end -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -- @param Wrapper.Client#CLIENT Client The client object receiving the message. -function POSITIONABLE:MessageToClient( Message, Duration, Client ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToClient( Message, Duration, Client, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToClient( Client ) + self:GetMessage( Message, Duration, Name ):ToClient( Client ) end return nil @@ -379,13 +386,14 @@ end -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -- @param Wrapper.Group#GROUP MessageGroup The GROUP object receiving the message. -function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then if DCSObject:isExist() then - self:GetMessage( Message, Duration ):ToGroup( MessageGroup ) + self:GetMessage( Message, Duration, Name ):ToGroup( MessageGroup ) end end @@ -397,12 +405,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:Message( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:Message( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToGroup( self ) + self:GetMessage( Message, Duration, Name ):ToGroup( self ) end return nil 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 780374fdd..0fcc139ec 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: 20161217_2210' ) +env.info( 'Moose Generation Timestamp: 20161218_1138' ) local base = _G Include = {} @@ -8818,6 +8818,25 @@ function SET_UNIT:GetUnitThreatLevels() return UnitThreatLevels end +--- Calculate the maxium A2G threat level of the SET_UNIT. +-- @param #SET_UNIT self +function SET_UNIT:CalculateThreatLevelA2G() + + local MaxThreatLevelA2G = 0 + for UnitName, UnitData in pairs( self:GetSet() ) do + local ThreatUnit = UnitData -- Wrapper.Unit#UNIT + local ThreatLevelA2G = ThreatUnit:GetThreatLevel() + if ThreatLevelA2G > MaxThreatLevelA2G then + MaxThreatLevelA2G = ThreatLevelA2G + end + end + + self:T3( MaxThreatLevelA2G ) + return MaxThreatLevelA2G + +end + + --- Returns if the @{Set} has targets having a radar (of a given type). -- @param #SET_UNIT self -- @param Dcs.DCSWrapper.Unit#Unit.RadarType RadarType @@ -11141,6 +11160,8 @@ do -- FSM_PROCESS return self:GetTask():GetMission():GetCommandCenter() end +-- TODO: Need to check and fix that an FSM_PROCESS is only for a UNIT. Not for a GROUP. + --- Send a message of the @{Task} to the Group of the Unit. -- @param #FSM_PROCESS self function FSM_PROCESS:Message( Message ) @@ -11149,6 +11170,12 @@ function FSM_PROCESS:Message( Message ) local CC = self:GetCommandCenter() local TaskGroup = self.Controllable:GetGroup() + local PlayerName = self.Controllable:GetPlayerName() -- Only for a unit + PlayerName = PlayerName and " (" .. PlayerName .. ")" or "" -- If PlayerName is nil, then keep it nil, otherwise add brackets. + local Callsign = self.Controllable:GetCallsign() + local Prefix = Callsign and " @ " .. Callsign .. PlayerName or "" + + Message = Prefix .. ": " .. Message CC:MessageToGroup( Message, TaskGroup ) end @@ -11619,6 +11646,13 @@ function IDENTIFIABLE:GetDesc() return nil end +--- Gets the CallSign of the IDENTIFIABLE, which is a blank by default. +-- @param #IDENTIFIABLE self +-- @return #string The CallSign of the IDENTIFIABLE. +function IDENTIFIABLE:GetCallsign() + return '' +end + @@ -11909,12 +11943,14 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. -- @return Core.Message#MESSAGE -function POSITIONABLE:GetMessage( Message, Duration ) +function POSITIONABLE:GetMessage( Message, Duration, Name ) local DCSObject = self:GetDCSObject() if DCSObject then - return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")" ) + Name = Name or self:GetTypeName() + return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. Name .. ")" ) end return nil @@ -11925,12 +11961,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToAll( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToAll( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToAll() + self:GetMessage( Message, Duration, Name ):ToAll() end return nil @@ -11941,12 +11978,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTYpes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToCoalition( MessageCoalition ) + self:GetMessage( Message, Duration, Name ):ToCoalition( MessageCoalition ) end return nil @@ -11958,12 +11996,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTYpes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToRed( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToRed( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToRed() + self:GetMessage( Message, Duration, Name ):ToRed() end return nil @@ -11974,12 +12013,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToBlue( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToBlue( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToBlue() + self:GetMessage( Message, Duration, Name ):ToBlue() end return nil @@ -11991,12 +12031,13 @@ end -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -- @param Wrapper.Client#CLIENT Client The client object receiving the message. -function POSITIONABLE:MessageToClient( Message, Duration, Client ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToClient( Message, Duration, Client, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToClient( Client ) + self:GetMessage( Message, Duration, Name ):ToClient( Client ) end return nil @@ -12008,13 +12049,14 @@ end -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -- @param Wrapper.Group#GROUP MessageGroup The GROUP object receiving the message. -function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then if DCSObject:isExist() then - self:GetMessage( Message, Duration ):ToGroup( MessageGroup ) + self:GetMessage( Message, Duration, Name ):ToGroup( MessageGroup ) end end @@ -12026,12 +12068,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:Message( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:Message( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToGroup( self ) + self:GetMessage( Message, Duration, Name ):ToGroup( self ) end return nil @@ -15114,6 +15157,24 @@ function GROUP:CopyRoute( Begin, End, Randomize, Radius ) return nil end +--- Calculate the maxium A2G threat level of the Group. +-- @param #GROUP self +function GROUP:CalculateThreatLevelA2G() + + local MaxThreatLevelA2G = 0 + for UnitName, UnitData in pairs( self:GetUnits() ) do + local ThreatUnit = UnitData -- Wrapper.Unit#UNIT + local ThreatLevelA2G = ThreatUnit:GetThreatLevel() + if ThreatLevelA2G > MaxThreatLevelA2G then + MaxThreatLevelA2G = ThreatLevelA2G + end + end + + self:T3( MaxThreatLevelA2G ) + return MaxThreatLevelA2G +end + + --- This module contains the UNIT class. -- @@ -25821,13 +25882,15 @@ do -- ACT_ROUTE -- @param #string From -- @param #string To function ACT_ROUTE:onbeforeRoute( ProcessUnit, Event, From, To ) + self:F( { "BeforeRoute 1", self.DisplayCount, self.DisplayInterval } ) if ProcessUnit:IsAlive() then + self:F( "BeforeRoute 2" ) local HasArrived = self:onfuncHasArrived( ProcessUnit ) -- Polymorphic if self.DisplayCount >= self.DisplayInterval then self:T( { HasArrived = HasArrived } ) if not HasArrived then - self:__Report( 1 ) + self:Report() end self.DisplayCount = 1 else @@ -25885,6 +25948,7 @@ do -- ACT_ROUTE_ZONE function ACT_ROUTE_ZONE:Init( FsmRoute ) self.TargetZone = FsmRoute.TargetZone + self.DisplayInterval = 30 self.DisplayCount = 30 self.DisplayMessage = true @@ -26461,7 +26525,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName ) self.CommandCenterName = CommandCenterName or CommandCenterPositionable:GetName() self.CommandCenterCoalition = CommandCenterPositionable:GetCoalition() - self.Missions = setmetatable( {}, { __mode = "v" } ) + self.Missions = {} self:EventOnBirth( --- @param #COMMANDCENTER self @@ -26539,7 +26603,7 @@ end -- @return #string function COMMANDCENTER:GetName() - return self.HQName + return self.CommandCenterName end --- Gets the POSITIONABLE of the HQ command center. @@ -26585,7 +26649,12 @@ end function COMMANDCENTER:SetMenu() self:F() - self.CommandCenterMenu = self.CommandCenterMenu or MENU_COALITION:New( self.CommandCenterCoalition, "HQ" ) + self.CommandCenterMenu = self.CommandCenterMenu or MENU_COALITION:New( self.CommandCenterCoalition, "Command Center (" .. self:GetName() .. ")" ) + + for MissionID, Mission in pairs( self:GetMissions() ) do + local Mission = Mission -- Tasking.Mission#MISSION + Mission:RemoveMenu() + end for MissionID, Mission in pairs( self:GetMissions() ) do local Mission = Mission -- Tasking.Mission#MISSION @@ -26615,9 +26684,14 @@ end --- Send a CC message to a GROUP. -- @param #COMMANDCENTER self -function COMMANDCENTER:MessageToGroup( Message, TaskGroup ) +-- @param #string Message +-- @param Wrapper.Group#GROUP TaskGroup +-- @param #sring Name (optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown. +function COMMANDCENTER:MessageToGroup( Message, TaskGroup, Name ) - self:GetPositionable():MessageToGroup( Message , 20, TaskGroup ) + local Prefix = Name and "@ Group (" .. Name .. "): " or '' + Message = Prefix .. Message + self:GetPositionable():MessageToGroup( Message , 20, TaskGroup, self:GetName() ) end @@ -26865,7 +26939,6 @@ end --- Sets the Planned Task menu. -- @param #MISSION self --- @param Core.Menu#MENU_COALITION CommandCenterMenu function MISSION:SetMenu() self:F() @@ -26875,6 +26948,17 @@ function MISSION:SetMenu() end end +--- Removes the Planned Task menu. +-- @param #MISSION self +function MISSION:RemoveMenu() + self:F() + + for _, Task in pairs( self:GetTasks() ) do + local Task = Task -- Tasking.Task#TASK + Task:RemoveMenu() + end +end + --- Gets the COMMANDCENTER. -- @param #MISSION self @@ -28048,7 +28132,8 @@ function TASK:MessageToGroups( Message ) local CC = Mission:GetCommandCenter() for TaskGroupName, TaskGroup in pairs( self.SetGroup:GetSet() ) do - CC:MessageToGroup( Message, TaskGroup ) + local TaskGroup = TaskGroup -- Wrapper.Group#GROUP + CC:MessageToGroup( Message, TaskGroup, TaskGroup:GetName() ) end end @@ -28136,7 +28221,6 @@ function TASK:SetMenu() self.SetGroup:Flush() for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do - self:RemoveMenuForGroup( TaskGroup ) if self:IsStatePlanned() or self:IsStateReplanned() then self:SetMenuForGroup( TaskGroup ) end @@ -28482,7 +28566,7 @@ function TASK:onenterAssigned( Event, From, To ) self:E("Task Assigned") - self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned!" ) + self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." ) self:GetMission():__Start() end @@ -28601,9 +28685,11 @@ function TASK:ReportDetails() PlayerNames[#PlayerNames+1] = PlayerName end end - PlayerNameText = table.concat( PlayerNames, ", " ) + local PlayerNameText = table.concat( PlayerNames, ", " ) Report:Add( "Task " .. Name .. " - State '" .. State .. "' - Players " .. PlayerNameText ) end + + -- Loop each Process in the Task, and find Reporting Details. return Report:Text() end @@ -28994,7 +29080,6 @@ do -- DETECTION_DISPATCHER if Task then if Task:IsStatePlanned() and DetectedArea.Changed == true then self:E( "Removing Tasking: " .. Task:GetTaskName() ) - Mission:RemoveTaskMenu( Task ) Task = Mission:RemoveTask( Task ) end end @@ -29098,7 +29183,7 @@ do -- DETECTION_DISPATCHER end -- TODO set menus using the HQ coordinator - Mission:SetMenu() + Mission:GetCommandCenter():SetMenu() if #AreaMsg > 0 then for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do @@ -29167,14 +29252,14 @@ do -- TASK_SEAD local Fsm = self:GetUnitProcess() - Fsm:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } ) - Fsm:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) - Fsm:AddAction ( "Rejected", "Eject", "Planned" ) - Fsm:AddAction ( "Arrived", "Update", "Updated" ) - Fsm:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } ) - Fsm:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) - Fsm:AddAction ( "Accounted", "Success", "Success" ) - Fsm:AddAction ( "Failed", "Fail", "Failed" ) + Fsm:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } ) + Fsm:AddProcess ( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) + Fsm:AddTransition( "Rejected", "Eject", "Planned" ) + Fsm:AddTransition( "Arrived", "Update", "Updated" ) + Fsm:AddProcess ( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } ) + Fsm:AddProcess ( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) + Fsm:AddTransition( "Accounted", "Success", "Success" ) + Fsm:AddTransition( "Failed", "Fail", "Failed" ) function Fsm:onenterUpdated( TaskUnit ) self:E( { self } ) @@ -29243,19 +29328,19 @@ do -- TASK_A2G self.TargetZone = TargetZone self.FACUnit = FACUnit - local Fsm = self:GetUnitProcess() + local A2GUnitProcess = self:GetUnitProcess() - Fsm:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } ) - Fsm:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) - Fsm:AddAction ( "Rejected", "Eject", "Planned" ) - Fsm:AddAction ( "Arrived", "Update", "Updated" ) - Fsm:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } ) - Fsm:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) - --Fsm:AddProcess( "Updated", "JTAC", PROCESS_JTAC:New( self, TaskUnit, self.TargetSetUnit, self.FACUnit ) ) - Fsm:AddAction ( "Accounted", "Success", "Success" ) - Fsm:AddAction ( "Failed", "Fail", "Failed" ) + A2GUnitProcess:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } ) + A2GUnitProcess:AddProcess ( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) + A2GUnitProcess:AddTransition( "Rejected", "Eject", "Planned" ) + A2GUnitProcess:AddTransition( "Arrived", "Update", "Updated" ) + A2GUnitProcess:AddProcess ( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } ) + A2GUnitProcess:AddProcess ( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) + --Fsm:AddProcess ( "Updated", "JTAC", PROCESS_JTAC:New( self, TaskUnit, self.TargetSetUnit, self.FACUnit ) ) + A2GUnitProcess:AddTransition( "Accounted", "Success", "Success" ) + A2GUnitProcess:AddTransition( "Failed", "Fail", "Failed" ) - function Fsm:onenterUpdated( TaskUnit ) + function A2GUnitProcess:onenterUpdated( TaskUnit ) self:E( { self } ) self:Account() self:Smoke() diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 780374fdd..0fcc139ec 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: 20161217_2210' ) +env.info( 'Moose Generation Timestamp: 20161218_1138' ) local base = _G Include = {} @@ -8818,6 +8818,25 @@ function SET_UNIT:GetUnitThreatLevels() return UnitThreatLevels end +--- Calculate the maxium A2G threat level of the SET_UNIT. +-- @param #SET_UNIT self +function SET_UNIT:CalculateThreatLevelA2G() + + local MaxThreatLevelA2G = 0 + for UnitName, UnitData in pairs( self:GetSet() ) do + local ThreatUnit = UnitData -- Wrapper.Unit#UNIT + local ThreatLevelA2G = ThreatUnit:GetThreatLevel() + if ThreatLevelA2G > MaxThreatLevelA2G then + MaxThreatLevelA2G = ThreatLevelA2G + end + end + + self:T3( MaxThreatLevelA2G ) + return MaxThreatLevelA2G + +end + + --- Returns if the @{Set} has targets having a radar (of a given type). -- @param #SET_UNIT self -- @param Dcs.DCSWrapper.Unit#Unit.RadarType RadarType @@ -11141,6 +11160,8 @@ do -- FSM_PROCESS return self:GetTask():GetMission():GetCommandCenter() end +-- TODO: Need to check and fix that an FSM_PROCESS is only for a UNIT. Not for a GROUP. + --- Send a message of the @{Task} to the Group of the Unit. -- @param #FSM_PROCESS self function FSM_PROCESS:Message( Message ) @@ -11149,6 +11170,12 @@ function FSM_PROCESS:Message( Message ) local CC = self:GetCommandCenter() local TaskGroup = self.Controllable:GetGroup() + local PlayerName = self.Controllable:GetPlayerName() -- Only for a unit + PlayerName = PlayerName and " (" .. PlayerName .. ")" or "" -- If PlayerName is nil, then keep it nil, otherwise add brackets. + local Callsign = self.Controllable:GetCallsign() + local Prefix = Callsign and " @ " .. Callsign .. PlayerName or "" + + Message = Prefix .. ": " .. Message CC:MessageToGroup( Message, TaskGroup ) end @@ -11619,6 +11646,13 @@ function IDENTIFIABLE:GetDesc() return nil end +--- Gets the CallSign of the IDENTIFIABLE, which is a blank by default. +-- @param #IDENTIFIABLE self +-- @return #string The CallSign of the IDENTIFIABLE. +function IDENTIFIABLE:GetCallsign() + return '' +end + @@ -11909,12 +11943,14 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. -- @return Core.Message#MESSAGE -function POSITIONABLE:GetMessage( Message, Duration ) +function POSITIONABLE:GetMessage( Message, Duration, Name ) local DCSObject = self:GetDCSObject() if DCSObject then - return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. self:GetTypeName() .. ")" ) + Name = Name or self:GetTypeName() + return MESSAGE:New( Message, Duration, self:GetCallsign() .. " (" .. Name .. ")" ) end return nil @@ -11925,12 +11961,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToAll( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToAll( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToAll() + self:GetMessage( Message, Duration, Name ):ToAll() end return nil @@ -11941,12 +11978,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTYpes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToCoalition( Message, Duration, MessageCoalition, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToCoalition( MessageCoalition ) + self:GetMessage( Message, Duration, Name ):ToCoalition( MessageCoalition ) end return nil @@ -11958,12 +11996,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTYpes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToRed( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToRed( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToRed() + self:GetMessage( Message, Duration, Name ):ToRed() end return nil @@ -11974,12 +12013,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:MessageToBlue( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToBlue( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToBlue() + self:GetMessage( Message, Duration, Name ):ToBlue() end return nil @@ -11991,12 +12031,13 @@ end -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -- @param Wrapper.Client#CLIENT Client The client object receiving the message. -function POSITIONABLE:MessageToClient( Message, Duration, Client ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToClient( Message, Duration, Client, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToClient( Client ) + self:GetMessage( Message, Duration, Name ):ToClient( Client ) end return nil @@ -12008,13 +12049,14 @@ end -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -- @param Wrapper.Group#GROUP MessageGroup The GROUP object receiving the message. -function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then if DCSObject:isExist() then - self:GetMessage( Message, Duration ):ToGroup( MessageGroup ) + self:GetMessage( Message, Duration, Name ):ToGroup( MessageGroup ) end end @@ -12026,12 +12068,13 @@ end -- @param #POSITIONABLE self -- @param #string Message The message text -- @param Dcs.DCSTypes#Duration Duration The duration of the message. -function POSITIONABLE:Message( Message, Duration ) +-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. +function POSITIONABLE:Message( Message, Duration, Name ) self:F2( { Message, Duration } ) local DCSObject = self:GetDCSObject() if DCSObject then - self:GetMessage( Message, Duration ):ToGroup( self ) + self:GetMessage( Message, Duration, Name ):ToGroup( self ) end return nil @@ -15114,6 +15157,24 @@ function GROUP:CopyRoute( Begin, End, Randomize, Radius ) return nil end +--- Calculate the maxium A2G threat level of the Group. +-- @param #GROUP self +function GROUP:CalculateThreatLevelA2G() + + local MaxThreatLevelA2G = 0 + for UnitName, UnitData in pairs( self:GetUnits() ) do + local ThreatUnit = UnitData -- Wrapper.Unit#UNIT + local ThreatLevelA2G = ThreatUnit:GetThreatLevel() + if ThreatLevelA2G > MaxThreatLevelA2G then + MaxThreatLevelA2G = ThreatLevelA2G + end + end + + self:T3( MaxThreatLevelA2G ) + return MaxThreatLevelA2G +end + + --- This module contains the UNIT class. -- @@ -25821,13 +25882,15 @@ do -- ACT_ROUTE -- @param #string From -- @param #string To function ACT_ROUTE:onbeforeRoute( ProcessUnit, Event, From, To ) + self:F( { "BeforeRoute 1", self.DisplayCount, self.DisplayInterval } ) if ProcessUnit:IsAlive() then + self:F( "BeforeRoute 2" ) local HasArrived = self:onfuncHasArrived( ProcessUnit ) -- Polymorphic if self.DisplayCount >= self.DisplayInterval then self:T( { HasArrived = HasArrived } ) if not HasArrived then - self:__Report( 1 ) + self:Report() end self.DisplayCount = 1 else @@ -25885,6 +25948,7 @@ do -- ACT_ROUTE_ZONE function ACT_ROUTE_ZONE:Init( FsmRoute ) self.TargetZone = FsmRoute.TargetZone + self.DisplayInterval = 30 self.DisplayCount = 30 self.DisplayMessage = true @@ -26461,7 +26525,7 @@ function COMMANDCENTER:New( CommandCenterPositionable, CommandCenterName ) self.CommandCenterName = CommandCenterName or CommandCenterPositionable:GetName() self.CommandCenterCoalition = CommandCenterPositionable:GetCoalition() - self.Missions = setmetatable( {}, { __mode = "v" } ) + self.Missions = {} self:EventOnBirth( --- @param #COMMANDCENTER self @@ -26539,7 +26603,7 @@ end -- @return #string function COMMANDCENTER:GetName() - return self.HQName + return self.CommandCenterName end --- Gets the POSITIONABLE of the HQ command center. @@ -26585,7 +26649,12 @@ end function COMMANDCENTER:SetMenu() self:F() - self.CommandCenterMenu = self.CommandCenterMenu or MENU_COALITION:New( self.CommandCenterCoalition, "HQ" ) + self.CommandCenterMenu = self.CommandCenterMenu or MENU_COALITION:New( self.CommandCenterCoalition, "Command Center (" .. self:GetName() .. ")" ) + + for MissionID, Mission in pairs( self:GetMissions() ) do + local Mission = Mission -- Tasking.Mission#MISSION + Mission:RemoveMenu() + end for MissionID, Mission in pairs( self:GetMissions() ) do local Mission = Mission -- Tasking.Mission#MISSION @@ -26615,9 +26684,14 @@ end --- Send a CC message to a GROUP. -- @param #COMMANDCENTER self -function COMMANDCENTER:MessageToGroup( Message, TaskGroup ) +-- @param #string Message +-- @param Wrapper.Group#GROUP TaskGroup +-- @param #sring Name (optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown. +function COMMANDCENTER:MessageToGroup( Message, TaskGroup, Name ) - self:GetPositionable():MessageToGroup( Message , 20, TaskGroup ) + local Prefix = Name and "@ Group (" .. Name .. "): " or '' + Message = Prefix .. Message + self:GetPositionable():MessageToGroup( Message , 20, TaskGroup, self:GetName() ) end @@ -26865,7 +26939,6 @@ end --- Sets the Planned Task menu. -- @param #MISSION self --- @param Core.Menu#MENU_COALITION CommandCenterMenu function MISSION:SetMenu() self:F() @@ -26875,6 +26948,17 @@ function MISSION:SetMenu() end end +--- Removes the Planned Task menu. +-- @param #MISSION self +function MISSION:RemoveMenu() + self:F() + + for _, Task in pairs( self:GetTasks() ) do + local Task = Task -- Tasking.Task#TASK + Task:RemoveMenu() + end +end + --- Gets the COMMANDCENTER. -- @param #MISSION self @@ -28048,7 +28132,8 @@ function TASK:MessageToGroups( Message ) local CC = Mission:GetCommandCenter() for TaskGroupName, TaskGroup in pairs( self.SetGroup:GetSet() ) do - CC:MessageToGroup( Message, TaskGroup ) + local TaskGroup = TaskGroup -- Wrapper.Group#GROUP + CC:MessageToGroup( Message, TaskGroup, TaskGroup:GetName() ) end end @@ -28136,7 +28221,6 @@ function TASK:SetMenu() self.SetGroup:Flush() for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do - self:RemoveMenuForGroup( TaskGroup ) if self:IsStatePlanned() or self:IsStateReplanned() then self:SetMenuForGroup( TaskGroup ) end @@ -28482,7 +28566,7 @@ function TASK:onenterAssigned( Event, From, To ) self:E("Task Assigned") - self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned!" ) + self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." ) self:GetMission():__Start() end @@ -28601,9 +28685,11 @@ function TASK:ReportDetails() PlayerNames[#PlayerNames+1] = PlayerName end end - PlayerNameText = table.concat( PlayerNames, ", " ) + local PlayerNameText = table.concat( PlayerNames, ", " ) Report:Add( "Task " .. Name .. " - State '" .. State .. "' - Players " .. PlayerNameText ) end + + -- Loop each Process in the Task, and find Reporting Details. return Report:Text() end @@ -28994,7 +29080,6 @@ do -- DETECTION_DISPATCHER if Task then if Task:IsStatePlanned() and DetectedArea.Changed == true then self:E( "Removing Tasking: " .. Task:GetTaskName() ) - Mission:RemoveTaskMenu( Task ) Task = Mission:RemoveTask( Task ) end end @@ -29098,7 +29183,7 @@ do -- DETECTION_DISPATCHER end -- TODO set menus using the HQ coordinator - Mission:SetMenu() + Mission:GetCommandCenter():SetMenu() if #AreaMsg > 0 then for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do @@ -29167,14 +29252,14 @@ do -- TASK_SEAD local Fsm = self:GetUnitProcess() - Fsm:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } ) - Fsm:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) - Fsm:AddAction ( "Rejected", "Eject", "Planned" ) - Fsm:AddAction ( "Arrived", "Update", "Updated" ) - Fsm:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } ) - Fsm:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) - Fsm:AddAction ( "Accounted", "Success", "Success" ) - Fsm:AddAction ( "Failed", "Fail", "Failed" ) + Fsm:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( self.TaskBriefing ), { Assigned = "Route", Rejected = "Eject" } ) + Fsm:AddProcess ( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) + Fsm:AddTransition( "Rejected", "Eject", "Planned" ) + Fsm:AddTransition( "Arrived", "Update", "Updated" ) + Fsm:AddProcess ( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "SEAD" ), { Accounted = "Success" } ) + Fsm:AddProcess ( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) + Fsm:AddTransition( "Accounted", "Success", "Success" ) + Fsm:AddTransition( "Failed", "Fail", "Failed" ) function Fsm:onenterUpdated( TaskUnit ) self:E( { self } ) @@ -29243,19 +29328,19 @@ do -- TASK_A2G self.TargetZone = TargetZone self.FACUnit = FACUnit - local Fsm = self:GetUnitProcess() + local A2GUnitProcess = self:GetUnitProcess() - Fsm:AddProcess( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } ) - Fsm:AddProcess( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) - Fsm:AddAction ( "Rejected", "Eject", "Planned" ) - Fsm:AddAction ( "Arrived", "Update", "Updated" ) - Fsm:AddProcess( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } ) - Fsm:AddProcess( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) - --Fsm:AddProcess( "Updated", "JTAC", PROCESS_JTAC:New( self, TaskUnit, self.TargetSetUnit, self.FACUnit ) ) - Fsm:AddAction ( "Accounted", "Success", "Success" ) - Fsm:AddAction ( "Failed", "Fail", "Failed" ) + A2GUnitProcess:AddProcess ( "Planned", "Accept", ACT_ASSIGN_ACCEPT:New( "Attack the Area" ), { Assigned = "Route", Rejected = "Eject" } ) + A2GUnitProcess:AddProcess ( "Assigned", "Route", ACT_ROUTE_ZONE:New( self.TargetZone ), { Arrived = "Update" } ) + A2GUnitProcess:AddTransition( "Rejected", "Eject", "Planned" ) + A2GUnitProcess:AddTransition( "Arrived", "Update", "Updated" ) + A2GUnitProcess:AddProcess ( "Updated", "Account", ACT_ACCOUNT_DEADS:New( self.TargetSetUnit, "Attack" ), { Accounted = "Success" } ) + A2GUnitProcess:AddProcess ( "Updated", "Smoke", ACT_ASSIST_SMOKE_TARGETS_ZONE:New( self.TargetSetUnit, self.TargetZone ) ) + --Fsm:AddProcess ( "Updated", "JTAC", PROCESS_JTAC:New( self, TaskUnit, self.TargetSetUnit, self.FACUnit ) ) + A2GUnitProcess:AddTransition( "Accounted", "Success", "Success" ) + A2GUnitProcess:AddTransition( "Failed", "Fail", "Failed" ) - function Fsm:onenterUpdated( TaskUnit ) + function A2GUnitProcess:onenterUpdated( TaskUnit ) self:E( { self } ) self:Account() self:Smoke() diff --git a/Moose Test Missions/ABP - Airbase Police/APL-001 - Caucasus/APL-001 - Caucasus.miz b/Moose Test Missions/ABP - Airbase Police/APL-001 - Caucasus/APL-001 - Caucasus.miz index d01f0f98c..6ea6d43bb 100644 Binary files a/Moose Test Missions/ABP - Airbase Police/APL-001 - Caucasus/APL-001 - Caucasus.miz and b/Moose Test Missions/ABP - Airbase Police/APL-001 - Caucasus/APL-001 - Caucasus.miz differ diff --git a/Moose Test Missions/ABP - Airbase Police/APL-002 - Nevada/APL-002 - Nevada.miz b/Moose Test Missions/ABP - Airbase Police/APL-002 - Nevada/APL-002 - Nevada.miz index 35d7c685c..25f85f876 100644 Binary files a/Moose Test Missions/ABP - Airbase Police/APL-002 - Nevada/APL-002 - Nevada.miz and b/Moose Test Missions/ABP - Airbase Police/APL-002 - Nevada/APL-002 - Nevada.miz differ diff --git a/Moose Test Missions/ACL - Airbase Cleaner/ACL-001 - Airbase CleanUp/ACL-001 - Airbase CleanUp.miz b/Moose Test Missions/ACL - Airbase Cleaner/ACL-001 - Airbase CleanUp/ACL-001 - Airbase CleanUp.miz index ad810878d..66d6b8a3a 100644 Binary files a/Moose Test Missions/ACL - Airbase Cleaner/ACL-001 - Airbase CleanUp/ACL-001 - Airbase CleanUp.miz and b/Moose Test Missions/ACL - Airbase Cleaner/ACL-001 - Airbase CleanUp/ACL-001 - Airbase CleanUp.miz differ diff --git a/Moose Test Missions/AIB - AI Balancing/AIB-001 - Spawned AI/AIB-001 -Spawned AI.miz b/Moose Test Missions/AIB - AI Balancing/AIB-001 - Spawned AI/AIB-001 -Spawned AI.miz index 4824f6038..d9c679edf 100644 Binary files a/Moose Test Missions/AIB - AI Balancing/AIB-001 - Spawned AI/AIB-001 -Spawned AI.miz and b/Moose Test Missions/AIB - AI Balancing/AIB-001 - Spawned AI/AIB-001 -Spawned AI.miz differ 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 ec1791bfc..dd0df499e 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-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.miz b/Moose Test Missions/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.miz index 23cb7de0a..af8d1d26e 100644 Binary files a/Moose Test Missions/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.miz and b/Moose Test Missions/AIB - AI Balancing/AIB-003 - Two coalitions InitCleanUp test/AIB-003 - Two coalitions InitCleanUp test.miz differ diff --git a/Moose Test Missions/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.miz b/Moose Test Missions/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.miz index f898ecf30..69150c8b1 100644 Binary files a/Moose Test Missions/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.miz and b/Moose Test Missions/CGO - Cargo/CGO-001 - Unit Boarding/CGO-001 - Unit Boarding.miz differ diff --git a/Moose Test Missions/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.miz b/Moose Test Missions/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.miz index 5a24f1637..f63a8ded8 100644 Binary files a/Moose Test Missions/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.miz and b/Moose Test Missions/CGO - Cargo/CGO-002 - Unit Unboarding/CGO-002 - Unit Unboarding.miz differ diff --git a/Moose Test Missions/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.miz b/Moose Test Missions/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.miz index 668bf90ed..ac3a03438 100644 Binary files a/Moose Test Missions/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.miz and b/Moose Test Missions/CGO - Cargo/CGO-003 - Unit Transferring/CGO-003 - Unit Transferring.miz differ diff --git a/Moose Test Missions/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.miz b/Moose Test Missions/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.miz index da5e4da96..ac4da4e09 100644 Binary files a/Moose Test Missions/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.miz and b/Moose Test Missions/CGO - Cargo/CGO-101 - Group Boarding/CGO-101 - Group Boarding.miz differ diff --git a/Moose Test Missions/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.miz b/Moose Test Missions/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.miz index 2911e80aa..aaf37bc7d 100644 Binary files a/Moose Test Missions/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.miz and b/Moose Test Missions/CGO - Cargo/CGO-102 - Group Unboarding/CGO-102 - Group Unboarding.miz differ diff --git a/Moose Test Missions/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.miz b/Moose Test Missions/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.miz index b88e67794..2d90f4bf4 100644 Binary files a/Moose Test Missions/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.miz and b/Moose Test Missions/CGO - Cargo/CGO-103 - Group Transferring/CGO-103 - Group Transferring.miz differ diff --git a/Moose Test Missions/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.miz b/Moose Test Missions/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.miz index 9575027aa..f56865945 100644 Binary files a/Moose Test Missions/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.miz and b/Moose Test Missions/CGO - Cargo/CGO-201 - Package Boarding/CGO-201 - Package Boarding.miz differ diff --git a/Moose Test Missions/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.miz b/Moose Test Missions/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.miz index 51b6e3380..6877f21ff 100644 Binary files a/Moose Test Missions/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.miz and b/Moose Test Missions/CGO - Cargo/CGO-202 - Package Unboarding/CGO-202 - Package Unboarding.miz differ diff --git a/Moose Test Missions/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.miz b/Moose Test Missions/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.miz index c5529ed4d..61d039bb2 100644 Binary files a/Moose Test Missions/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.miz and b/Moose Test Missions/DET - Detection/DET-001 - Detection Areas/DET-001 - Detection Areas.miz differ diff --git a/Moose Test Missions/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.miz b/Moose Test Missions/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.miz index 0d4983458..46fbb48d4 100644 Binary files a/Moose Test Missions/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.miz and b/Moose Test Missions/DET - Detection/DET-101 - Detection Reporting/DET-101 - Detection Reporting.miz differ diff --git a/Moose Test Missions/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.miz b/Moose Test Missions/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.miz index 26754a26b..9664e9bdc 100644 Binary files a/Moose Test Missions/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.miz and b/Moose Test Missions/ESC - Escorting/ESC-001 - Escorting Helicopters/ESC-001 - Escorting Helicopters.miz differ diff --git a/Moose Test Missions/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.miz b/Moose Test Missions/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.miz index 26f27e03a..de71cd61c 100644 Binary files a/Moose Test Missions/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.miz and b/Moose Test Missions/GRP - Group Commands/GRP-200 - Follow Group/GRP-200 - Follow Group.miz differ diff --git a/Moose Test Missions/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.miz b/Moose Test Missions/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.miz index 24674d0bc..dd611ce10 100644 Binary files a/Moose Test Missions/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.miz and b/Moose Test Missions/GRP - Group Commands/GRP-300 - Switch WayPoints/GRP-300 - Switch WayPoints.miz differ diff --git a/Moose Test Missions/GRP - Group Commands/Moose_Test_WRAPPER.miz b/Moose Test Missions/GRP - Group Commands/Moose_Test_WRAPPER.miz index ac5c34a28..98d3d11f9 100644 Binary files a/Moose Test Missions/GRP - Group Commands/Moose_Test_WRAPPER.miz and b/Moose Test Missions/GRP - Group Commands/Moose_Test_WRAPPER.miz differ diff --git a/Moose Test Missions/MEN - Menu Options/MEN-001 - Menu Client/MEN-001 - Menu Client.miz b/Moose Test Missions/MEN - Menu Options/MEN-001 - Menu Client/MEN-001 - Menu Client.miz index 854d16c22..5ade71def 100644 Binary files a/Moose Test Missions/MEN - Menu Options/MEN-001 - Menu Client/MEN-001 - Menu Client.miz and b/Moose Test Missions/MEN - Menu Options/MEN-001 - Menu Client/MEN-001 - Menu Client.miz differ diff --git a/Moose Test Missions/MEN - Menu Options/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.miz b/Moose Test Missions/MEN - Menu Options/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.miz index c7cae1686..bfe9b2a08 100644 Binary files a/Moose Test Missions/MEN - Menu Options/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.miz and b/Moose Test Missions/MEN - Menu Options/MEN-002 - Menu Coalition/MEN-002 - Menu Coalition.miz differ diff --git a/Moose Test Missions/MEN - Menu Options/MEN-003 - Menu Group/MEN-003 - Menu Group.miz b/Moose Test Missions/MEN - Menu Options/MEN-003 - Menu Group/MEN-003 - Menu Group.miz index 78e96fb67..3e4faf976 100644 Binary files a/Moose Test Missions/MEN - Menu Options/MEN-003 - Menu Group/MEN-003 - Menu Group.miz and b/Moose Test Missions/MEN - Menu Options/MEN-003 - Menu Group/MEN-003 - Menu Group.miz differ diff --git a/Moose Test Missions/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.miz b/Moose Test Missions/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.miz index 74b83893a..661dd71bd 100644 Binary files a/Moose Test Missions/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.miz and b/Moose Test Missions/MIT - Missile Trainer/MIT-001 - Missile Trainer/MIT-001 - Missile Trainer.miz differ diff --git a/Moose Test Missions/MOOSE_Test_Template.miz b/Moose Test Missions/MOOSE_Test_Template.miz index e6ff1ac46..2a79331a1 100644 Binary files a/Moose Test Missions/MOOSE_Test_Template.miz and b/Moose Test Missions/MOOSE_Test_Template.miz differ diff --git a/Moose Test Missions/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.miz b/Moose Test Missions/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.miz index 762233b7a..d8e2e6f4f 100644 Binary files a/Moose Test Missions/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.miz and b/Moose Test Missions/PAT - Patrolling/PAT-001 - Switching Patrol Zones/PAT-001 - Switching Patrol Zones.miz differ diff --git a/Moose Test Missions/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.miz b/Moose Test Missions/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.miz index c9d276aef..0d2b04b03 100644 Binary files a/Moose Test Missions/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.miz and b/Moose Test Missions/SCH - Scheduler/SCH-000 - Simple Scheduling/SCH-000 - Simple Scheduling.miz differ diff --git a/Moose Test Missions/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.miz b/Moose Test Missions/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.miz index d20d1cbda..1f0f43bac 100644 Binary files a/Moose Test Missions/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.miz and b/Moose Test Missions/SCH - Scheduler/SCH-001 - Simple Object Scheduling/SCH-001 - Simple Object Scheduling.miz differ diff --git a/Moose Test Missions/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.miz b/Moose Test Missions/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.miz index e9d8e4dc4..5b0cb8dea 100644 Binary files a/Moose Test Missions/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.miz and b/Moose Test Missions/SCH - Scheduler/SCH-100 - Simple Repeat Scheduling/SCH-100 - Simple Repeat Scheduling.miz differ diff --git a/Moose Test Missions/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.miz b/Moose Test Missions/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.miz index 59d7c4685..dae1bcf35 100644 Binary files a/Moose Test Missions/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.miz and b/Moose Test Missions/SCH - Scheduler/SCH-110 - Object Repeat Scheduling/SCH-110 - Object Repeat Scheduling.miz differ diff --git a/Moose Test Missions/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.miz b/Moose Test Missions/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.miz index f6f283945..1253fc910 100644 Binary files a/Moose Test Missions/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.miz and b/Moose Test Missions/SCH - Scheduler/SCH-200 - Simple Repeat Scheduling Stop and Start/SCH-200 - Simple Repeat Scheduling Stop and Start.miz differ diff --git a/Moose Test Missions/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.miz b/Moose Test Missions/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.miz index ae26a0388..06231f13a 100644 Binary files a/Moose Test Missions/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.miz and b/Moose Test Missions/SCH - Scheduler/SCH-300 - GC Simple Object Scheduling/SCH-300 - GC Simple Object Scheduling.miz differ diff --git a/Moose Test Missions/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.miz b/Moose Test Missions/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.miz index a2e065e4b..af0bf947e 100644 Binary files a/Moose Test Missions/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.miz and b/Moose Test Missions/SCH - Scheduler/SCH-310 - GC Object Repeat Scheduling/SCH-310 - GC Object Repeat Scheduling.miz differ diff --git a/Moose Test Missions/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.miz b/Moose Test Missions/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.miz index 6a037d769..d54836678 100644 Binary files a/Moose Test Missions/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.miz and b/Moose Test Missions/SET - Data Sets/SET-001 - Airbase Sets/SET-001 - Airbase Sets.miz differ diff --git a/Moose Test Missions/SET - Data Sets/SET-101 - Group Sets/SET-101 - Group Sets.miz b/Moose Test Missions/SET - Data Sets/SET-101 - Group Sets/SET-101 - Group Sets.miz index aef90a4aa..b39eeb930 100644 Binary files a/Moose Test Missions/SET - Data Sets/SET-101 - Group Sets/SET-101 - Group Sets.miz and b/Moose Test Missions/SET - Data Sets/SET-101 - Group Sets/SET-101 - Group Sets.miz differ diff --git a/Moose Test Missions/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.miz b/Moose Test Missions/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.miz index 0282e85ae..d02f5684f 100644 Binary files a/Moose Test Missions/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.miz and b/Moose Test Missions/SET - Data Sets/SET-201 - Client Sets/SET-201 - Client Sets.miz differ diff --git a/Moose Test Missions/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.miz b/Moose Test Missions/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.miz index 86c369ca3..36964a97f 100644 Binary files a/Moose Test Missions/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.miz and b/Moose Test Missions/SEV - SEAD Evasion/SEV-001 - SEAD Evasion/SEV-001 - SEAD Evasion.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-010 - Spawn Demo/SPA-010 - Spawn Demo.miz b/Moose Test Missions/SPA - Spawning/SPA-010 - Spawn Demo/SPA-010 - Spawn Demo.miz index 5d2da3e51..efc0ff631 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-010 - Spawn Demo/SPA-010 - Spawn Demo.miz and b/Moose Test Missions/SPA - Spawning/SPA-010 - Spawn Demo/SPA-010 - Spawn Demo.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-100 - CleanUp Inactive Units/SPA-100 - CleanUp Inactive Units.miz b/Moose Test Missions/SPA - Spawning/SPA-100 - CleanUp Inactive Units/SPA-100 - CleanUp Inactive Units.miz index 7a37cec5f..97fd5a422 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-100 - CleanUp Inactive Units/SPA-100 - CleanUp Inactive Units.miz and b/Moose Test Missions/SPA - Spawning/SPA-100 - CleanUp Inactive Units/SPA-100 - CleanUp Inactive Units.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz b/Moose Test Missions/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz index 8fb322c9f..39ff2bbfd 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz and b/Moose Test Missions/SPA - Spawning/SPA-110 - Limit Spawning/SPA-110 - Limit Spawning.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz b/Moose Test Missions/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz index 8b426b426..4a60e1874 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz and b/Moose Test Missions/SPA - Spawning/SPA-120 - Repeat Spawning/SPA-120 - Repeat Spawning.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz b/Moose Test Missions/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz index d4a57ff19..e017756ac 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz and b/Moose Test Missions/SPA - Spawning/SPA-200 - Randomize Unit Types/SPA-200 - Randomize Unit Types.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz b/Moose Test Missions/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz index 3ef6f65b9..968707a85 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz and b/Moose Test Missions/SPA - Spawning/SPA-220 - Randomize Zones/SPA-220 - Randomize Zones.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz b/Moose Test Missions/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz index ffa73d50e..3e3ed269d 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz and b/Moose Test Missions/SPA - Spawning/SPA-310 - Spawn at Static position/SPA-310 - Spawn at Static position.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz b/Moose Test Missions/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz index 4cf1fa5e5..a6cd39426 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz and b/Moose Test Missions/SPA - Spawning/SPA-320 - Spawn at Unit position/SPA-320 - Spawn at Unit position.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz b/Moose Test Missions/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz index 3e6127506..995f802dc 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz and b/Moose Test Missions/SPA - Spawning/SPA-330 - Spawn at Vec2 position/SPA-330 - Spawn at Vec2 position.miz differ diff --git a/Moose Test Missions/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz b/Moose Test Missions/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz index 4c77497dc..88ae8e6df 100644 Binary files a/Moose Test Missions/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz and b/Moose Test Missions/SPA - Spawning/SPA-340 - Spawn at Vec3 position/SPA-340 - Spawn at Vec3 position.miz differ diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-010 - Task Dispatching Demo/TAD-010 - Task Dispatching Demo.lua b/Moose Test Missions/TAD - Task Dispatching/TAD-010 - Task Dispatching Demo/TAD-010 - Task Dispatching Demo.lua index a28827b61..855ed008d 100644 --- a/Moose Test Missions/TAD - Task Dispatching/TAD-010 - Task Dispatching Demo/TAD-010 - Task Dispatching Demo.lua +++ b/Moose Test Missions/TAD - Task Dispatching/TAD-010 - Task Dispatching Demo/TAD-010 - Task Dispatching Demo.lua @@ -1,7 +1,7 @@ local HQ = GROUP:FindByName( "HQ", "Bravo HQ" ) -local CommandCenter = COMMANDCENTER:New( HQ ) +local CommandCenter = COMMANDCENTER:New( HQ, "Lima" ) local Scoring = SCORING:New( "Detect Demo" ) diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-010 - Task Dispatching Demo/TAD-010 - Task Dispatching Demo.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-010 - Task Dispatching Demo/TAD-010 - Task Dispatching Demo.miz index fb001e43b..3a7091512 100644 Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-010 - Task Dispatching Demo/TAD-010 - Task Dispatching Demo.miz and b/Moose Test Missions/TAD - Task Dispatching/TAD-010 - Task Dispatching Demo/TAD-010 - Task Dispatching Demo.miz differ diff --git a/Moose Test Missions/TSK - Task Modelling/TSK-010 - Task Modelling - SEAD/TSK-010 - Task Modelling - SEAD.lua b/Moose Test Missions/TSK - Task Modelling/TSK-010 - Task Modelling - SEAD/TSK-010 - Task Modelling - SEAD.lua index 0b7662db9..060b7ad45 100644 --- a/Moose Test Missions/TSK - Task Modelling/TSK-010 - Task Modelling - SEAD/TSK-010 - Task Modelling - SEAD.lua +++ b/Moose Test Missions/TSK - Task Modelling/TSK-010 - Task Modelling - SEAD/TSK-010 - Task Modelling - SEAD.lua @@ -110,7 +110,11 @@ local TargetZone = ZONE:New( "Target Zone" ) -- 2. The set of groups of planes that pilots can join. -- 3. The name of the Task... This can be any name, and will be provided when the Pilot joins the task. -- 4. A type of the Task. When Tasks are in state Planned, then a menu can be provided that group the task based on this given type. -local SEADTask = TASK:New( Mission, SEADSet, "SEAD Radars Vector 1", "SEAD" ) -- Tasking.Task#TASK +local SEADTask = TASK:New( + Mission, + SEADSet, + "SEAD Radars Vector 1", + "SEAD" ) -- Tasking.Task#TASK -- This is now an important part of the Task process definition. -- Each TASK contains a "Process Template". diff --git a/Moose Test Missions/TSK - Task Modelling/TSK-010 - Task Modelling - SEAD/TSK-010 - Task Modelling - SEAD.miz b/Moose Test Missions/TSK - Task Modelling/TSK-010 - Task Modelling - SEAD/TSK-010 - Task Modelling - SEAD.miz index f45eb2666..f446dd936 100644 Binary files a/Moose Test Missions/TSK - Task Modelling/TSK-010 - Task Modelling - SEAD/TSK-010 - Task Modelling - SEAD.miz and b/Moose Test Missions/TSK - Task Modelling/TSK-010 - Task Modelling - SEAD/TSK-010 - Task Modelling - SEAD.miz differ diff --git a/Moose Test Missions/TSK - Task Modelling/TSK-020 - Task Modelling - Pickup/TSK-020 - Task Modelling - Pickup.miz b/Moose Test Missions/TSK - Task Modelling/TSK-020 - Task Modelling - Pickup/TSK-020 - Task Modelling - Pickup.miz index 35d203041..cc1930529 100644 Binary files a/Moose Test Missions/TSK - Task Modelling/TSK-020 - Task Modelling - Pickup/TSK-020 - Task Modelling - Pickup.miz and b/Moose Test Missions/TSK - Task Modelling/TSK-020 - Task Modelling - Pickup/TSK-020 - Task Modelling - Pickup.miz differ diff --git a/Moose Test Missions/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz b/Moose Test Missions/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz index 3994c5480..98d91c92f 100644 Binary files a/Moose Test Missions/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz and b/Moose Test Missions/ZON - Zones/ZON-100 - Normal Zone/ZON-100 - Normal Zone.miz differ diff --git a/Moose Test Missions/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.miz b/Moose Test Missions/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.miz index 6aa2862b9..52773d504 100644 Binary files a/Moose Test Missions/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.miz and b/Moose Test Missions/ZON - Zones/ZON-200 - Group Zone/ZON-200 - Group Zone.miz differ diff --git a/Moose Test Missions/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.miz b/Moose Test Missions/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.miz index 25eceddfa..ee2b5acce 100644 Binary files a/Moose Test Missions/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.miz and b/Moose Test Missions/ZON - Zones/ZON-300 - Unit Zone/ZON-300 - Unit Zone.miz differ diff --git a/Moose Test Missions/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.miz b/Moose Test Missions/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.miz index 03865f803..15dbd6c41 100644 Binary files a/Moose Test Missions/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.miz and b/Moose Test Missions/ZON - Zones/ZON-400 - Radius Zone/ZON-400 - Radius Zone.miz differ diff --git a/Moose Test Missions/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.miz b/Moose Test Missions/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.miz index 7bde10f72..9c928dca1 100644 Binary files a/Moose Test Missions/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.miz and b/Moose Test Missions/ZON - Zones/ZON-500 - Polygon Zone/ZON-500 - Polygon Zone.miz differ