mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Improvements on task assignment logic
This commit is contained in:
@@ -1121,7 +1121,7 @@ end
|
|||||||
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
|
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
|
||||||
|
|
||||||
if self:IsTrace() then
|
if self:IsTrace() then
|
||||||
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
|
--MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
|
||||||
end
|
end
|
||||||
|
|
||||||
self:T( { Scores = self._Scores, To = To } )
|
self:T( { Scores = self._Scores, To = To } )
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ TASK = {
|
|||||||
Mission = nil,
|
Mission = nil,
|
||||||
CommandCenter = nil,
|
CommandCenter = nil,
|
||||||
TimeOut = 0,
|
TimeOut = 0,
|
||||||
|
AssignedGroups = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
--- FSM PlayerAborted event handler prototype for TASK.
|
--- FSM PlayerAborted event handler prototype for TASK.
|
||||||
@@ -164,6 +165,7 @@ function TASK:New( Mission, SetGroupAssign, TaskName, TaskType )
|
|||||||
self:AddTransition( "Planned", "Assign", "Assigned" )
|
self:AddTransition( "Planned", "Assign", "Assigned" )
|
||||||
self:AddTransition( "Assigned", "AssignUnit", "Assigned" )
|
self:AddTransition( "Assigned", "AssignUnit", "Assigned" )
|
||||||
self:AddTransition( "Assigned", "Success", "Success" )
|
self:AddTransition( "Assigned", "Success", "Success" )
|
||||||
|
self:AddTransition( "Assigned", "Hold", "Hold" )
|
||||||
self:AddTransition( "Assigned", "Fail", "Failed" )
|
self:AddTransition( "Assigned", "Fail", "Failed" )
|
||||||
self:AddTransition( "Assigned", "Abort", "Aborted" )
|
self:AddTransition( "Assigned", "Abort", "Aborted" )
|
||||||
self:AddTransition( "Assigned", "Cancel", "Cancelled" )
|
self:AddTransition( "Assigned", "Cancel", "Cancelled" )
|
||||||
@@ -241,9 +243,9 @@ function TASK:JoinUnit( PlayerUnit, PlayerGroup )
|
|||||||
--self:MessageToGroups( PlayerUnit:GetPlayerName() .. " is planning to join Task " .. self:GetName() )
|
--self:MessageToGroups( PlayerUnit:GetPlayerName() .. " is planning to join Task " .. self:GetName() )
|
||||||
end
|
end
|
||||||
if self:IsStateAssigned() then
|
if self:IsStateAssigned() then
|
||||||
local IsAssignedToGroup = self:IsAssignedToGroup( PlayerGroup )
|
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
||||||
self:E( { IsAssignedToGroup = IsAssignedToGroup } )
|
self:E( { IsGroupAssigned = IsGroupAssigned } )
|
||||||
if IsAssignedToGroup then
|
if IsGroupAssigned then
|
||||||
self:AssignToUnit( PlayerUnit )
|
self:AssignToUnit( PlayerUnit )
|
||||||
self:MessageToGroups( PlayerUnit:GetPlayerName() .. " joined Task " .. self:GetName() )
|
self:MessageToGroups( PlayerUnit:GetPlayerName() .. " joined Task " .. self:GetName() )
|
||||||
end
|
end
|
||||||
@@ -273,15 +275,29 @@ function TASK:AbortUnit( PlayerUnit )
|
|||||||
-- Check if the PlayerGroup is already assigned to the Task. If yes, the PlayerGroup is aborted from the Task.
|
-- Check if the PlayerGroup is already assigned to the Task. If yes, the PlayerGroup is aborted from the Task.
|
||||||
-- If the PlayerUnit was the last unit of the PlayerGroup, the menu needs to be removed from the Group.
|
-- If the PlayerUnit was the last unit of the PlayerGroup, the menu needs to be removed from the Group.
|
||||||
if self:IsStateAssigned() then
|
if self:IsStateAssigned() then
|
||||||
local IsAssignedToGroup = self:IsAssignedToGroup( PlayerGroup )
|
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
||||||
self:E( { IsAssignedToGroup = IsAssignedToGroup } )
|
self:E( { IsGroupAssigned = IsGroupAssigned } )
|
||||||
if IsAssignedToGroup then
|
if IsGroupAssigned then
|
||||||
local PlayerName = PlayerUnit:GetPlayerName()
|
local PlayerName = PlayerUnit:GetPlayerName()
|
||||||
self:MessageToGroups( PlayerName .. " aborted Task " .. self:GetName() )
|
self:MessageToGroups( PlayerName .. " aborted Task " .. self:GetName() )
|
||||||
self:UnAssignFromGroup( PlayerGroup )
|
self:UnAssignFromGroup( PlayerGroup )
|
||||||
--self:Abort()
|
--self:Abort()
|
||||||
|
|
||||||
|
-- Now check if the task needs to go to hold...
|
||||||
|
-- It will go to hold, if there are no players in the mission...
|
||||||
|
|
||||||
|
local IsRemaining = false
|
||||||
|
for GroupName, GroupData in pairs( PlayerGroups ) do
|
||||||
|
IsRemaining = ( IsRemaining == false ) and self:IsGroupAssigned( PlayerGroup ) or IsRemaining
|
||||||
|
end
|
||||||
|
|
||||||
|
if IsRemaining == false then
|
||||||
|
self:Abort()
|
||||||
|
end
|
||||||
|
|
||||||
self:PlayerAborted( PlayerUnit )
|
self:PlayerAborted( PlayerUnit )
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -308,14 +324,14 @@ function TASK:CrashUnit( PlayerUnit )
|
|||||||
-- Check if the PlayerGroup is already assigned to the Task. If yes, the PlayerGroup is aborted from the Task.
|
-- Check if the PlayerGroup is already assigned to the Task. If yes, the PlayerGroup is aborted from the Task.
|
||||||
-- If the PlayerUnit was the last unit of the PlayerGroup, the menu needs to be removed from the Group.
|
-- If the PlayerUnit was the last unit of the PlayerGroup, the menu needs to be removed from the Group.
|
||||||
if self:IsStateAssigned() then
|
if self:IsStateAssigned() then
|
||||||
local IsAssignedToGroup = self:IsAssignedToGroup( PlayerGroup )
|
local IsGroupAssigned = self:IsGroupAssigned( PlayerGroup )
|
||||||
self:E( { IsAssignedToGroup = IsAssignedToGroup } )
|
self:E( { IsGroupAssigned = IsGroupAssigned } )
|
||||||
if IsAssignedToGroup then
|
if IsGroupAssigned then
|
||||||
self:UnAssignFromUnit( PlayerUnit )
|
self:UnAssignFromUnit( PlayerUnit )
|
||||||
self:MessageToGroups( PlayerUnit:GetPlayerName() .. " crashed in Task " .. self:GetName() )
|
self:MessageToGroups( PlayerUnit:GetPlayerName() .. " crashed in Task " .. self:GetName() )
|
||||||
self:E( { TaskGroup = PlayerGroup:GetName(), GetUnits = PlayerGroup:GetUnits() } )
|
self:E( { TaskGroup = PlayerGroup:GetName(), GetUnits = PlayerGroup:GetUnits() } )
|
||||||
if #PlayerGroup:GetUnits() == 1 then
|
if #PlayerGroup:GetUnits() == 1 then
|
||||||
PlayerGroup:SetState( PlayerGroup, "Assigned", nil )
|
self:ClearGroupAssignment( PlayerGroup )
|
||||||
end
|
end
|
||||||
self:PlayerCrashed( PlayerUnit )
|
self:PlayerCrashed( PlayerUnit )
|
||||||
end
|
end
|
||||||
@@ -343,7 +359,83 @@ function TASK:GetGroups()
|
|||||||
return self.SetGroup
|
return self.SetGroup
|
||||||
end
|
end
|
||||||
|
|
||||||
|
do -- Group Assignment
|
||||||
|
|
||||||
|
--- Returns if the @{Task} is assigned to the Group.
|
||||||
|
-- @param #TASK self
|
||||||
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
|
-- @return #boolean
|
||||||
|
function TASK:IsGroupAssigned( TaskGroup )
|
||||||
|
|
||||||
|
local TaskGroupName = TaskGroup:GetName()
|
||||||
|
|
||||||
|
if self.AssignedGroups[TaskGroupName] == TaskGroup then
|
||||||
|
self:T( { "Task is assigned to:", TaskGroup:GetName() } )
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
self:T( { "Task is not assigned to:", TaskGroup:GetName() } )
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--- Set @{Group} assigned to the @{Task}.
|
||||||
|
-- @param #TASK self
|
||||||
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
|
-- @return #TASK
|
||||||
|
function TASK:SetGroupAssigned( TaskGroup )
|
||||||
|
|
||||||
|
local TaskName = self:GetName()
|
||||||
|
local TaskGroupName = TaskGroup:GetName()
|
||||||
|
|
||||||
|
self.AssignedGroups[TaskGroupName] = TaskGroup
|
||||||
|
self:E( string.format( "Task %s is assigned to %s", TaskName, TaskGroupName ) )
|
||||||
|
|
||||||
|
local SetAssignedGroups = self:GetGroups()
|
||||||
|
|
||||||
|
SetAssignedGroups:ForEachGroup(
|
||||||
|
function( AssignedGroup )
|
||||||
|
if self:IsGroupAssigned(AssignedGroup) then
|
||||||
|
self:GetMission():GetCommandCenter():MessageToGroup( string.format( "Task %s is assigned to group %s.", TaskName, TaskGroupName ), AssignedGroup )
|
||||||
|
else
|
||||||
|
self:GetMission():GetCommandCenter():MessageToGroup( string.format( "Task %s is assigned to your group.", TaskName ), AssignedGroup )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
--- Clear the @{Group} assignment from the @{Task}.
|
||||||
|
-- @param #TASK self
|
||||||
|
-- @param Wrapper.Group#GROUP TaskGroup
|
||||||
|
-- @return #TASK
|
||||||
|
function TASK:ClearGroupAssignment( TaskGroup )
|
||||||
|
|
||||||
|
local TaskName = self:GetName()
|
||||||
|
local TaskGroupName = TaskGroup:GetName()
|
||||||
|
|
||||||
|
self.AssignedGroups[TaskGroupName] = nil
|
||||||
|
self:E( string.format( "Task %s is unassigned to %s", TaskName, TaskGroupName ) )
|
||||||
|
|
||||||
|
local SetAssignedGroups = self:GetGroups()
|
||||||
|
|
||||||
|
SetAssignedGroups:ForEachGroup(
|
||||||
|
function( AssignedGroup )
|
||||||
|
if self:IsGroupAssigned(AssignedGroup) then
|
||||||
|
self:GetMission():GetCommandCenter():MessageToGroup( string.format( "Task %s is unassigned from group %s.", TaskName, TaskGroupName ), AssignedGroup )
|
||||||
|
else
|
||||||
|
self:GetMission():GetCommandCenter():MessageToGroup( string.format( "Task %s is unassigned from your group.", TaskName ), AssignedGroup )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
)
|
||||||
|
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
do -- Group Assignment
|
||||||
|
|
||||||
--- Assign the @{Task} to a @{Group}.
|
--- Assign the @{Task} to a @{Group}.
|
||||||
-- @param #TASK self
|
-- @param #TASK self
|
||||||
@@ -354,9 +446,7 @@ function TASK:AssignToGroup( TaskGroup )
|
|||||||
|
|
||||||
local TaskGroupName = TaskGroup:GetName()
|
local TaskGroupName = TaskGroup:GetName()
|
||||||
|
|
||||||
TaskGroup:SetState( TaskGroup, "Assigned", self )
|
self:SetGroupAssigned( TaskGroup )
|
||||||
|
|
||||||
self:E("Task is assigned to " .. TaskGroup:GetName() )
|
|
||||||
|
|
||||||
local Mission = self:GetMission()
|
local Mission = self:GetMission()
|
||||||
local MissionMenu = Mission:GetMenu( TaskGroup )
|
local MissionMenu = Mission:GetMenu( TaskGroup )
|
||||||
@@ -377,6 +467,28 @@ function TASK:AssignToGroup( TaskGroup )
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- UnAssign the @{Task} from a @{Group}.
|
||||||
|
-- @param #TASK self
|
||||||
|
function TASK:UnAssignFromGroup( TaskGroup )
|
||||||
|
self:F2( { TaskGroup } )
|
||||||
|
|
||||||
|
self:ClearGroupAssignment( TaskGroup )
|
||||||
|
|
||||||
|
self:RemoveAssignedMenuForGroup( TaskGroup )
|
||||||
|
|
||||||
|
local TaskUnits = TaskGroup:GetUnits()
|
||||||
|
for UnitID, UnitData in pairs( TaskUnits ) do
|
||||||
|
local TaskUnit = UnitData -- Wrapper.Unit#UNIT
|
||||||
|
local PlayerName = TaskUnit:GetPlayerName()
|
||||||
|
if PlayerName ~= nil or PlayerName ~= "" then
|
||||||
|
self:UnAssignFromUnit( TaskUnit )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
-- @param #TASK self
|
-- @param #TASK self
|
||||||
-- @param Wrapper.Group#GROUP FindGroup
|
-- @param Wrapper.Group#GROUP FindGroup
|
||||||
@@ -452,7 +564,7 @@ function TASK:SendBriefingToAssignedGroups()
|
|||||||
|
|
||||||
for TaskGroupName, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
for TaskGroupName, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||||
|
|
||||||
if self:IsAssignedToGroup( TaskGroup ) then
|
if self:IsGroupAssigned( TaskGroup ) then
|
||||||
TaskGroup:Message( self.TaskBriefing, 60 )
|
TaskGroup:Message( self.TaskBriefing, 60 )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -469,47 +581,7 @@ function TASK:UnAssignFromGroups()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- UnAssign the @{Task} from a @{Group}.
|
|
||||||
-- @param #TASK self
|
|
||||||
function TASK:UnAssignFromGroup( TaskGroup )
|
|
||||||
self:F2( { TaskGroup } )
|
|
||||||
|
|
||||||
TaskGroup:SetState( TaskGroup, "Assigned", nil )
|
|
||||||
|
|
||||||
self:E("Task is unassigned from " .. TaskGroup:GetName() )
|
|
||||||
|
|
||||||
self:RemoveAssignedMenuForGroup( TaskGroup )
|
|
||||||
|
|
||||||
local TaskUnits = TaskGroup:GetUnits()
|
|
||||||
for UnitID, UnitData in pairs( TaskUnits ) do
|
|
||||||
local TaskUnit = UnitData -- Wrapper.Unit#UNIT
|
|
||||||
local PlayerName = TaskUnit:GetPlayerName()
|
|
||||||
if PlayerName ~= nil or PlayerName ~= "" then
|
|
||||||
self:UnAssignFromUnit( TaskUnit )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--- Returns if the @{Task} is assigned to the Group.
|
|
||||||
-- @param #TASK self
|
|
||||||
-- @param Wrapper.Group#GROUP TaskGroup
|
|
||||||
-- @return #boolean
|
|
||||||
function TASK:IsAssignedToGroup( TaskGroup )
|
|
||||||
|
|
||||||
local TaskGroupName = TaskGroup:GetName()
|
|
||||||
|
|
||||||
if self:IsStateAssigned() then
|
|
||||||
if TaskGroup:GetState( TaskGroup, "Assigned" ) == self then
|
|
||||||
self:T( { "Task is assigned to:", TaskGroup:GetName() } )
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:T( { "Task is not assigned to:", TaskGroup:GetName() } )
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Returns if the @{Task} has still alive and assigned Units.
|
--- Returns if the @{Task} has still alive and assigned Units.
|
||||||
-- @param #TASK self
|
-- @param #TASK self
|
||||||
@@ -519,7 +591,7 @@ function TASK:HasAliveUnits()
|
|||||||
|
|
||||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||||
if self:IsStateAssigned() then
|
if self:IsStateAssigned() then
|
||||||
if self:IsAssignedToGroup( TaskGroup ) then
|
if self:IsGroupAssigned( TaskGroup ) then
|
||||||
for TaskUnitID, TaskUnit in pairs( TaskGroup:GetUnits() ) do
|
for TaskUnitID, TaskUnit in pairs( TaskGroup:GetUnits() ) do
|
||||||
if TaskUnit:IsAlive() then
|
if TaskUnit:IsAlive() then
|
||||||
self:T( { HasAliveUnits = true } )
|
self:T( { HasAliveUnits = true } )
|
||||||
@@ -560,9 +632,9 @@ function TASK:SetMenu( MenuTime ) --R2.1 Mission Reports and Task Reports added.
|
|||||||
MENU_GROUP_COMMAND:New( TaskGroup, "Report Held Tasks", TaskGroup.MenuReports, Mission.MenuReportOverview, Mission, TaskGroup, "Hold" )
|
MENU_GROUP_COMMAND:New( TaskGroup, "Report Held Tasks", TaskGroup.MenuReports, Mission.MenuReportOverview, Mission, TaskGroup, "Hold" )
|
||||||
end
|
end
|
||||||
|
|
||||||
if self:IsStatePlanned() or self:IsStateReplanned() then
|
-- if self:IsStatePlanned() or self:IsStateReplanned() then
|
||||||
self:SetMenuForGroup( TaskGroup, MenuTime )
|
self:SetMenuForGroup( TaskGroup, MenuTime )
|
||||||
end
|
-- end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -575,12 +647,10 @@ end
|
|||||||
-- @return #TASK
|
-- @return #TASK
|
||||||
function TASK:SetMenuForGroup( TaskGroup, MenuTime )
|
function TASK:SetMenuForGroup( TaskGroup, MenuTime )
|
||||||
|
|
||||||
if not TaskGroup:GetState( TaskGroup, "Assigned" ) then
|
if self:IsGroupAssigned( TaskGroup ) then
|
||||||
self:SetPlannedMenuForGroup( TaskGroup, self:GetTaskName(), MenuTime )
|
|
||||||
else
|
|
||||||
if not self:IsAssignedToGroup( TaskGroup ) then
|
|
||||||
self:SetAssignedMenuForGroup( TaskGroup, MenuTime )
|
self:SetAssignedMenuForGroup( TaskGroup, MenuTime )
|
||||||
end
|
else
|
||||||
|
self:SetPlannedMenuForGroup( TaskGroup, self:GetTaskName(), MenuTime )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -640,7 +710,7 @@ function TASK:RemoveMenu( MenuTime )
|
|||||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||||
local TaskGroup = TaskGroup -- Wrapper.Group#GROUP
|
local TaskGroup = TaskGroup -- Wrapper.Group#GROUP
|
||||||
if TaskGroup:IsAlive() and TaskGroup:GetPlayerNames() then
|
if TaskGroup:IsAlive() and TaskGroup:GetPlayerNames() then
|
||||||
if not self:IsAssignedToGroup( TaskGroup ) then
|
if not self:IsGroupAssigned( TaskGroup ) then
|
||||||
self:RemovePlannedMenuForGroup( TaskGroup, MenuTime )
|
self:RemovePlannedMenuForGroup( TaskGroup, MenuTime )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -723,8 +793,6 @@ function TASK:MenuTaskAbort( TaskGroup )
|
|||||||
self:AbortUnit( PlayerUnit )
|
self:AbortUnit( PlayerUnit )
|
||||||
end
|
end
|
||||||
|
|
||||||
self:GetMission():GetCommandCenter():GetPositionable():MessageToSetGroup( "Abort", 15, self.SetGroup )
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -1020,14 +1088,17 @@ function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
|
|||||||
|
|
||||||
self:E( { "Task Assigned", self.Dispatcher } )
|
self:E( { "Task Assigned", self.Dispatcher } )
|
||||||
|
|
||||||
self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." )
|
if From ~= "Assigned" then
|
||||||
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " is assigned." )
|
||||||
if self.Dispatcher then
|
if self.Dispatcher then
|
||||||
self:E( "Firing Assign event " )
|
self:E( "Firing Assign event " )
|
||||||
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
|
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
|
||||||
end
|
end
|
||||||
|
|
||||||
self:GetMission():__Start( 1 )
|
self:GetMission():__Start( 1 )
|
||||||
|
|
||||||
|
self:SetMenu()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@@ -1057,11 +1128,12 @@ function TASK:onenterAborted( From, Event, To )
|
|||||||
|
|
||||||
self:E( "Task Aborted" )
|
self:E( "Task Aborted" )
|
||||||
|
|
||||||
|
if From ~= "Aborted" then
|
||||||
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been aborted! Task may be replanned." )
|
self:GetMission():GetCommandCenter():MessageToCoalition( "Task " .. self:GetName() .. " has been aborted! Task may be replanned." )
|
||||||
|
|
||||||
self:UnAssignFromGroups()
|
|
||||||
|
|
||||||
self:__Replan( 5 )
|
self:__Replan( 5 )
|
||||||
|
self:SetMenu()
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- FSM function for a TASK
|
--- FSM function for a TASK
|
||||||
@@ -1101,7 +1173,7 @@ end
|
|||||||
function TASK:onstatechange( From, Event, To )
|
function TASK:onstatechange( From, Event, To )
|
||||||
|
|
||||||
if self:IsTrace() then
|
if self:IsTrace() then
|
||||||
MESSAGE:New( "@ Task " .. self.TaskName .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
|
--MESSAGE:New( "@ Task " .. self.TaskName .. " : " .. From .. " changed to " .. To .. " by " .. Event, 2 ):ToAll()
|
||||||
end
|
end
|
||||||
|
|
||||||
if self.Scores[To] then
|
if self.Scores[To] then
|
||||||
|
|||||||
@@ -277,10 +277,8 @@ do -- TASK_A2G_DISPATCHER
|
|||||||
Mission:GetCommandCenter():SetMenu()
|
Mission:GetCommandCenter():SetMenu()
|
||||||
|
|
||||||
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
for TaskGroupID, TaskGroup in pairs( self.SetGroup:GetSet() ) do
|
||||||
if not TaskGroup:GetState( TaskGroup, "Assigned" ) then
|
|
||||||
Mission:GetCommandCenter():MessageToGroup( string.format( "Mission *%s* has tasks %s. Subscribe to a task using the Mission *Overlord* radio menu.", Mission:GetName(), TaskReport:Text(", ") ), TaskGroup )
|
Mission:GetCommandCenter():MessageToGroup( string.format( "Mission *%s* has tasks %s. Subscribe to a task using the Mission *Overlord* radio menu.", Mission:GetName(), TaskReport:Text(", ") ), TaskGroup )
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user