diff --git a/Moose Development/Moose/Functional/Designate.lua b/Moose Development/Moose/Functional/Designate.lua index 31e7d0686..46aebc274 100644 --- a/Moose Development/Moose/Functional/Designate.lua +++ b/Moose Development/Moose/Functional/Designate.lua @@ -477,7 +477,7 @@ do -- DESIGNATE self:SetThreatLevelPrioritization( false ) -- self.ThreatLevelPrioritization, default is threat level priorization off self:SetMaximumDesignations( 5 ) -- Sets the maximum designations. The default is 5 designations. - self:SetMaximumDistanceDesignations( 12000 ) -- Sets the maximum distance on which designations can be accepted. The default is 8000 meters. + self:SetMaximumDistanceDesignations( 8000 ) -- Sets the maximum distance on which designations can be accepted. The default is 8000 meters. self:SetMaximumMarkings( 2 ) -- Per target group, a maximum of 2 markings will be made by default. self:SetDesignateMenu() diff --git a/Moose Development/Moose/Functional/Scoring.lua b/Moose Development/Moose/Functional/Scoring.lua index 8c259f6d5..087d79f1f 100644 --- a/Moose Development/Moose/Functional/Scoring.lua +++ b/Moose Development/Moose/Functional/Scoring.lua @@ -767,7 +767,7 @@ function SCORING:_AddMissionTaskScore( Mission, PlayerUnit, Text, Score ) PlayerData.Score = self.Players[PlayerName].Score + Score PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score - MESSAGE:NewType( self.DisplayMessagePrefix .. MissionName .. " : " .. Text .. " Score: " .. Score, MESSAGE.Type.Information ):ToAll() + MESSAGE:NewType( self.DisplayMessagePrefix .. Mission:GetText() .. " : " .. Text .. " Score: " .. Score, MESSAGE.Type.Information ):ToAll() self:ScoreCSV( PlayerName, "", "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score, PlayerUnit:GetName() ) end @@ -801,7 +801,7 @@ function SCORING:_AddMissionGoalScore( Mission, PlayerName, Text, Score ) PlayerData.Score = self.Players[PlayerName].Score + Score PlayerData.Mission[MissionName].ScoreTask = self.Players[PlayerName].Mission[MissionName].ScoreTask + Score - MESSAGE:NewType( string.format( "%s%s: %s! Player %s receives %d score!", self.DisplayMessagePrefix, MissionName, Text, PlayerName, Score ), MESSAGE.Type.Information ):ToAll() + MESSAGE:NewType( string.format( "%s%s: %s! Player %s receives %d score!", self.DisplayMessagePrefix, Mission:GetText(), Text, PlayerName, Score ), MESSAGE.Type.Information ):ToAll() self:ScoreCSV( PlayerName, "", "TASK_" .. MissionName:gsub( ' ', '_' ), 1, Score ) end @@ -828,7 +828,7 @@ function SCORING:_AddMissionScore( Mission, Text, Score ) PlayerData.Score = PlayerData.Score + Score PlayerData.Mission[MissionName].ScoreMission = PlayerData.Mission[MissionName].ScoreMission + Score - MESSAGE:NewType( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' has " .. Text .. " in Mission '" .. MissionName .. "'. " .. + MESSAGE:NewType( self.DisplayMessagePrefix .. "Player '" .. PlayerName .. "' has " .. Text .. " in " .. Mission:GetText() .. ". " .. Score .. " mission score!", MESSAGE.Type.Information ):ToAll() diff --git a/Moose Development/Moose/Tasking/CommandCenter.lua b/Moose Development/Moose/Tasking/CommandCenter.lua index 61ce8da1f..0c95d95bc 100644 --- a/Moose Development/Moose/Tasking/CommandCenter.lua +++ b/Moose Development/Moose/Tasking/CommandCenter.lua @@ -204,6 +204,24 @@ function COMMANDCENTER:GetName() return self.CommandCenterName end +--- Gets the text string of the HQ command center. +-- @param #COMMANDCENTER self +-- @return #string +function COMMANDCENTER:GetText() + + return "Command Center [" .. self.CommandCenterName .. "]" +end + +--- Gets the short text string of the HQ command center. +-- @param #COMMANDCENTER self +-- @return #string +function COMMANDCENTER:GetShortText() + + return "CC [" .. self.CommandCenterName .. "]" +end + + + --- Gets the POSITIONABLE of the HQ command center. -- @param #COMMANDCENTER self -- @return Wrapper.Positionable#POSITIONABLE @@ -360,7 +378,7 @@ end -- @param Wrapper.Group#GROUP TaskGroup function COMMANDCENTER:MessageToGroup( Message, TaskGroup ) - self:GetPositionable():MessageToGroup( Message, 15, TaskGroup, self:GetName() ) + self:GetPositionable():MessageToGroup( Message, 15, TaskGroup, self:GetShortText() ) end @@ -371,7 +389,7 @@ end -- @param Core.Message#MESSAGE.MessageType MessageType The type of the message, resulting in automatic time duration and prefix of the message. function COMMANDCENTER:MessageTypeToGroup( Message, TaskGroup, MessageType ) - self:GetPositionable():MessageTypeToGroup( Message, MessageType, TaskGroup, self:GetName() ) + self:GetPositionable():MessageTypeToGroup( Message, MessageType, TaskGroup, self:GetShortText() ) end diff --git a/Moose Development/Moose/Tasking/Mission.lua b/Moose Development/Moose/Tasking/Mission.lua index 4106f3ba0..897180d16 100644 --- a/Moose Development/Moose/Tasking/Mission.lua +++ b/Moose Development/Moose/Tasking/Mission.lua @@ -271,16 +271,33 @@ end -- @param #string To function MISSION:onenterCOMPLETED( From, Event, To ) - self:GetCommandCenter():MessageTypeToCoalition( self:GetName() .. " has been completed! Good job guys!", MESSAGE.Type.Information ) + self:GetCommandCenter():MessageTypeToCoalition( self:GetText() .. " has been completed! Good job guys!", MESSAGE.Type.Information ) end --- Gets the mission name. -- @param #MISSION self -- @return #MISSION self function MISSION:GetName() + return self.Name +end + + +--- Gets the mission text. +-- @param #MISSION self +-- @return #MISSION self +function MISSION:GetText() return string.format( 'Mission "%s (%s)"', self.Name, self.MissionPriority ) end + +--- Gets the short mission text. +-- @param #MISSION self +-- @return #MISSION self +function MISSION:GetShortText() + return string.format( 'Mission "%s"', self.Name ) +end + + --- Add a Unit to join the Mission. -- For each Task within the Mission, the Unit is joined with the Task. -- If the Unit was not part of a Task in the Mission, false is returned. @@ -490,10 +507,10 @@ function MISSION:GetRootMenu( TaskGroup ) -- R2.2 local CommandCenter = self:GetCommandCenter() local CommandCenterMenu = CommandCenter:GetMenu() - local MissionName = self:GetName() + local MissionName = self:GetText() --local MissionMenu = CommandCenterMenu:GetMenu( MissionName ) - self.MissionMenu = MENU_COALITION:New( self.MissionCoalition, self:GetName(), CommandCenterMenu ) + self.MissionMenu = MENU_COALITION:New( self.MissionCoalition, MissionName, CommandCenterMenu ) return self.MissionMenu end @@ -506,7 +523,6 @@ function MISSION:GetMenu( TaskGroup ) -- R2.1 -- Changed Menu Structure local CommandCenter = self:GetCommandCenter() local CommandCenterMenu = CommandCenter:GetMenu() - local MissionName = self:GetName() --local MissionMenu = CommandCenterMenu:GetMenu( MissionName ) self.MissionGroupMenu = self.MissionGroupMenu or {} @@ -514,9 +530,11 @@ function MISSION:GetMenu( TaskGroup ) -- R2.1 -- Changed Menu Structure local GroupMenu = self.MissionGroupMenu[TaskGroup] - CommandCenterMenu = MENU_GROUP:New( TaskGroup, "Command Center (" .. CommandCenter:GetName() .. ")" ) + local CommandCenterText = CommandCenter:GetText() + CommandCenterMenu = MENU_GROUP:New( TaskGroup, CommandCenterText ) - self.MissionMenu = MENU_GROUP:New( TaskGroup, self:GetName(), CommandCenterMenu ) + local MissionText = self:GetText() + self.MissionMenu = MENU_GROUP:New( TaskGroup, MissionText, CommandCenterMenu ) GroupMenu.BriefingMenu = MENU_GROUP_COMMAND:New( TaskGroup, "Mission Briefing", self.MissionMenu, self.MenuReportBriefing, self, TaskGroup ) @@ -711,7 +729,7 @@ function MISSION:ReportBriefing() local Report = REPORT:New() -- List the name of the mission. - local Name = self:GetName() + local Name = self:GetText() -- Determine the status of the mission. local Status = "<" .. self:GetState() .. ">" @@ -744,7 +762,7 @@ function MISSION:ReportSummary() local Report = REPORT:New() -- List the name of the mission. - local Name = self:GetName() + local Name = self:GetText() -- Determine the status of the mission. local Status = "<" .. self:GetState() .. ">" @@ -792,7 +810,7 @@ function MISSION:ReportPlayersPerTask( ReportGroup ) local Report = REPORT:New() -- List the name of the mission. - local Name = self:GetName() + local Name = self:GetText() -- Determine the status of the mission. local Status = "<" .. self:GetState() .. ">" @@ -833,7 +851,7 @@ function MISSION:ReportPlayersProgress( ReportGroup ) local Report = REPORT:New() -- List the name of the mission. - local Name = self:GetName() + local Name = self:GetText() -- Determine the status of the mission. local Status = "<" .. self:GetState() .. ">" @@ -878,7 +896,7 @@ function MISSION:MarkTargetLocations( ReportGroup ) local Report = REPORT:New() -- List the name of the mission. - local Name = self:GetName() + local Name = self:GetText() -- Determine the status of the mission. local Status = "<" .. self:GetState() .. ">" @@ -904,7 +922,7 @@ function MISSION:ReportSummary( ReportGroup ) local Report = REPORT:New() -- List the name of the mission. - local Name = self:GetName() + local Name = self:GetText() -- Determine the status of the mission. local Status = "<" .. self:GetState() .. ">" @@ -930,7 +948,7 @@ function MISSION:ReportOverview( ReportGroup, TaskStatus ) local Report = REPORT:New() -- List the name of the mission. - local Name = self:GetName() + local Name = self:GetText() -- Determine the status of the mission. local Status = "<" .. self:GetState() .. ">" @@ -962,7 +980,7 @@ function MISSION:ReportDetails( ReportGroup ) local Report = REPORT:New() -- List the name of the mission. - local Name = self:GetName() + local Name = self:GetText() -- Determine the status of the mission. local Status = "<" .. self:GetState() .. ">" diff --git a/Moose Development/Moose/Tasking/Task_A2A_Dispatcher.lua b/Moose Development/Moose/Tasking/Task_A2A_Dispatcher.lua index c577919fd..eb96a4761 100644 --- a/Moose Development/Moose/Tasking/Task_A2A_Dispatcher.lua +++ b/Moose Development/Moose/Tasking/Task_A2A_Dispatcher.lua @@ -511,7 +511,7 @@ do -- TASK_A2A_DISPATCHER if not DetectedItem then local TaskText = Task:GetName() for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do - Mission:GetCommandCenter():MessageToGroup( string.format( "Obsolete A2A task %s for %s removed.", TaskText, Mission:GetName() ), TaskGroup ) + Mission:GetCommandCenter():MessageToGroup( string.format( "Obsolete A2A task %s for %s removed.", TaskText, Mission:GetShortText() ), TaskGroup ) end Task = self:RemoveTask( TaskIndex ) end @@ -586,7 +586,7 @@ do -- TASK_A2A_DISPATCHER for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do if ( not Mission:IsGroupAssigned(TaskGroup) ) and TaskText ~= "" then - Mission:GetCommandCenter():MessageToGroup( string.format( "%s has tasks %s. Subscribe to a task using the radio menu.", Mission:GetName(), TaskText ), TaskGroup ) + Mission:GetCommandCenter():MessageToGroup( string.format( "%s has tasks %s. Subscribe to a task using the radio menu.", Mission:GetShortText(), TaskText ), TaskGroup ) end end diff --git a/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua b/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua index 9016721eb..495b88695 100644 --- a/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua +++ b/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua @@ -1,6 +1,4 @@ ---- **Tasking** - The TASK_A2G_DISPATCHER creates and manages player TASK_A2G tasks based on detected targets. --- --- +--- **Tasking** - The TASK\_A2G\_DISPATCHER dispatches A2G Tasks to Players based on enemy location detection. -- -- ==== -- @@ -30,8 +28,8 @@ do -- TASK_A2G_DISPATCHER -- It provides a truly dynamic battle environment for pilots and ground commanders to engage upon, -- in a true co-operation environment wherein **Multiple Teams** will collaborate in Missions to **achieve a common Mission Goal**. -- - -- The A2G dispatcher will dispatch the A2G Tasks to a defined @{Set} of @{Group}s that will be manned by **Players**. - -- We call this the **AttackSet** of the A2G dispatcher. So, Players are seated in @{Unit}s of @{Group}s that contain @{Client}s. + -- The A2G dispatcher will dispatch the A2G Tasks to a defined @{Set} of @{Group}s that will be manned by **Players**. + -- We call this the **AttackSet** of the A2G dispatcher. So, the Players are seated in the @{Client}s of the @{Group} @{Set}. -- -- Depending on the actions of the enemy, preventive tasks are dispatched to the players to orchestrate the engagement in a true co-operation. -- The detection object will group the detected targets by its grouping method, and integrates a @{Set} of @{Group}s that are Recce vehicles or air units. @@ -40,9 +38,9 @@ do -- TASK_A2G_DISPATCHER -- Depending on the current detected tactical situation, different task types will be dispatched to the Players seated in the AttackSet.. -- There are currently 3 **Task Types** implemented in the TASK\_A2G\_DISPATCHER: -- - -- - **SEAD Task**: Is dispatched when there are enemy ground units wihtin range of the FAC, which have **air 2 air search radars**. - -- - **CAS Task**: Is dispatched when there are friendly ground units within range of the enemy targets. - -- - **BAI Task**: Is dispatched when there are no friendly ground units within range of the enemy targets. + -- - **SEAD Task**: Dispatched when there are ground based Radar Emitters detected within an area. + -- - **CAS Task**: Dispatched when there are no ground based Radar Emitters within the area, but there are friendly ground Units within 6 km from the enemy. + -- - **BAI Task**: Dispatched when there are no ground based Radar Emitters within the area, and there aren't friendly ground Units within 6 km from the enemy. -- -- # 0. Tactical Situations -- @@ -51,7 +49,7 @@ do -- TASK_A2G_DISPATCHER -- -- # 0.1. SEAD Task -- - -- A SEAD Task is created when there are Ground based Radar Emitters detected within an area. + -- A SEAD Task is dispatched when there are ground based Radar Emitters detected within an area. -- -- ![](..\Presentations\TASK_A2G_DISPATCHER\Dia11.JPG) -- @@ -60,7 +58,7 @@ do -- TASK_A2G_DISPATCHER -- -- # 0.2. CAS Task -- - -- A CAS Task is created when there are no Radar Emitters within the area, but there are friendly ground Units within 6 km of the area. + -- A CAS Task is dispatched when there are no ground based Radar Emitters within the area, but there are friendly ground Units within 6 km from the enemy. -- -- ![](..\Presentations\TASK_A2G_DISPATCHER\Dia12.JPG) -- @@ -69,7 +67,7 @@ do -- TASK_A2G_DISPATCHER -- -- # 0.3. BAI Task -- - -- A BAI Task is created when there are no Radar Emitters within the area, and there aren't any friendly ground Units within 6 km of the area. + -- A BAI Task is dispatched when there are no ground based Radar Emitters within the area, and there aren't friendly ground Units within 6 km from the enemy. -- -- ![](..\Presentations\TASK_A2G_DISPATCHER\Dia13.JPG) -- @@ -89,12 +87,12 @@ do -- TASK_A2G_DISPATCHER -- F1. Mission "Alpha" -- F2. Mission "Beta" -- F3. Mission "Gamma" - -- F1. Command Center |Gudauta| + -- F1. Command Center |Lima| -- F1. Mission "Overlord" -- F2. Mission "Desert Storm" -- -- CC |Gori| is controlling Mission "Alpha", "Beta", "Gamma". - -- CC |Gudauta| is controlling Missions "Overlord" and "Desert Storm". + -- CC |Lima| is controlling Missions "Overlord" and "Desert Storm". -- -- ## 1.1. Mission Menu (Under the Command Center Menu) -- @@ -105,18 +103,19 @@ do -- TASK_A2G_DISPATCHER -- - **Create Task Reports**: A menu to create various reports of the current tasks dispatched by the A2G dispatcher. -- - **Create Mission Reports**: A menu to create various reports on the current mission. -- - -- ![](..\Presentations\TASK_A2G_DISPATCHER\Dia6.JPG) - -- - -- For CC |Gori|, Mission "Alpha", the menu structure could look like this: + -- For CC |Lima|, Mission "Overlord", the menu structure could look like this: -- -- Radio MENU Structure (F10. Other) -- - -- F1. Command Center |Gori| - -- F1. Mission "Alpha" + -- F1. Command Center |Lima| + -- F1. Mission "Overlord" -- F1. Mission Briefing -- F2. Mark Task Locations on Map -- F3. Task Reports -- F4. Mission Reports + -- + -- ![](..\Presentations\TASK_A2G_DISPATCHER\Dia6.JPG) + -- -- -- -- ### 1.1.1. Mission Briefing Menu @@ -358,39 +357,39 @@ do -- TASK_A2G_DISPATCHER -- -- Below an example mission declaration that is defines a Task A2G Dispatcher object. -- - -- -- Declare the Command Center - -- local HQ = GROUP - -- :FindByName( "HQ", "Bravo HQ" ) + -- -- Declare the Command Center + -- local HQ = GROUP + -- :FindByName( "HQ", "Bravo HQ" ) -- - -- local CommandCenter = COMMANDCENTER - -- :New( HQ, "Lima" ) + -- local CommandCenter = COMMANDCENTER + -- :New( HQ, "Lima" ) -- - -- -- Declare the Mission for the Command Center. - -- local Mission = MISSION - -- :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) + -- -- Declare the Mission for the Command Center. + -- local Mission = MISSION + -- :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED ) -- - -- -- Define the RecceSet that will detect the enemy. - -- local RecceSet = SET_GROUP - -- :New() - -- :FilterPrefixes( "FAC" ) - -- :FilterCoalitions("red") - -- :FilterStart() + -- -- Define the RecceSet that will detect the enemy. + -- local RecceSet = SET_GROUP + -- :New() + -- :FilterPrefixes( "FAC" ) + -- :FilterCoalitions("red") + -- :FilterStart() -- - -- -- Setup the detection. We use DETECTION_AREAS to detect and group the enemies within areas of 3 km radius. - -- local DetectionAreas = DETECTION_AREAS - -- :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies. + -- -- Setup the detection. We use DETECTION_AREAS to detect and group the enemies within areas of 3 km radius. + -- local DetectionAreas = DETECTION_AREAS + -- :New( RecceSet, 3000 ) -- The RecceSet will detect the enemies. -- - -- -- Setup the AttackSet, which is a SET_GROUP. - -- -- The SET_GROUP is a dynamic collection of GROUP objects. - -- local AttackSet = SET_GROUP - -- :New() -- Create the SET_GROUP object. - -- :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. - -- :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. - -- :FilterStart() -- Enable the dynamic filtering. From this moment the AttackSet will contain all groups that are red and start with the name Attack. + -- -- Setup the AttackSet, which is a SET_GROUP. + -- -- The SET_GROUP is a dynamic collection of GROUP objects. + -- local AttackSet = SET_GROUP + -- :New() -- Create the SET_GROUP object. + -- :FilterCoalitions( "red" ) -- Only incorporate the RED coalitions. + -- :FilterPrefixes( "Attack" ) -- Only incorporate groups that start with the name Attack. + -- :FilterStart() -- Enable the dynamic filtering. From this moment the AttackSet will contain all groups that are red and start with the name Attack. -- - -- -- Now we have everything to setup the main A2G TaskDispatcher. - -- TaskDispatcher = TASK_A2G_DISPATCHER - -- :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. + -- -- Now we have everything to setup the main A2G TaskDispatcher. + -- TaskDispatcher = TASK_A2G_DISPATCHER + -- :New( Mission, AttackSet, DetectionAreas ) -- We assign the TaskDispatcher under Mission. The AttackSet will engage the enemy and will recieve the dispatched Tasks. The DetectionAreas will report any detected enemies to the TaskDispatcher. -- -- -- @@ -581,7 +580,7 @@ do -- TASK_A2G_DISPATCHER if not DetectedItem then local TaskText = Task:GetName() for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do - Mission:GetCommandCenter():MessageToGroup( string.format( "Obsolete A2G task %s for %s removed.", TaskText, Mission:GetName() ), TaskGroup ) + Mission:GetCommandCenter():MessageToGroup( string.format( "Obsolete A2G task %s for %s removed.", TaskText, Mission:GetShortText() ), TaskGroup ) end Task = self:RemoveTask( TaskIndex ) end @@ -752,7 +751,7 @@ do -- TASK_A2G_DISPATCHER local TaskText = TaskReport:Text(", ") for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do if ( not Mission:IsGroupAssigned(TaskGroup) ) and TaskText ~= "" then - Mission:GetCommandCenter():MessageToGroup( string.format( "%s has tasks %s. Subscribe to a task using the radio menu.", Mission:GetName(), TaskText ), TaskGroup ) + Mission:GetCommandCenter():MessageToGroup( string.format( "%s has tasks %s. Subscribe to a task using the radio menu.", Mission:GetShortText(), TaskText ), TaskGroup ) end end diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua index 970dab26f..142ef1400 100644 --- a/Moose Development/Moose/Wrapper/Positionable.lua +++ b/Moose Development/Moose/Wrapper/Positionable.lua @@ -456,13 +456,12 @@ end -- @param #string Message The message text -- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable. -- @return #string The message text -function POSITIONABLE:GetMessageText( Message, Name ) --R2.1 added +function POSITIONABLE:GetMessageText( Message, Name ) local DCSObject = self:GetDCSObject() if DCSObject then - Name = Name and ( " (" .. Name .. ")" ) or "" - local Callsign = string.format( "%s", self:GetCallsign() ~= "" and self:GetCallsign() or self:GetName() ) - local MessageText = string.format("[%s%s]: %s", Callsign, Name, Message ) + local Callsign = string.format( "%s", ( ( Name ~= "" and Name ) or self:GetCallsign() ~= "" and self:GetCallsign() ) or self:GetName() ) + local MessageText = string.format("%s - %s", Callsign, Message ) return MessageText end