Module Mission

Tasking -- A MISSION is the main owner of a Mission orchestration within MOOSE.


Author: FlightControl

Contributions:


Global(s)

MISSION

Type MISSION

MISSION:AbortUnit(PlayerUnit)

Aborts a PlayerUnit from the Mission.

MISSION:AddGroups(GroupSet)

Adds the groups for which TASKS are given in the mission

MISSION:AddPlayerName(PlayerName)
MISSION:AddScoring(Scoring)

Add a scoring to the mission.

MISSION:AddTask(Task)

Register a Task to be completed within the Mission.

MISSION.AssignedGroups
MISSION.ClassName
MISSION:ClearGroupAssignment(MissionGroup)

Clear the Wrapper.Group assignment from the Mission.

MISSION:Complete()

Synchronous Event Trigger for Event Complete.

MISSION:CrashUnit(PlayerUnit)

Handles a crash of a PlayerUnit from the Mission.

MISSION:Fail()

Synchronous Event Trigger for Event Fail.

MISSION:GetCommandCenter()

Gets the COMMANDCENTER.

MISSION.GetGroupTasks(TaskGroup, self)

Get the relevant tasks of a TaskGroup.

MISSION:GetGroups(GroupSet)

Gets the groups for which TASKS are given in the mission

MISSION:GetMenu(TaskGroup)

Gets the mission menu for the TaskGroup.

MISSION:GetName()

Gets the mission name.

MISSION:GetNextTaskID(Task)

Return the next Task ID to be completed within the Mission.

MISSION:GetPlayerNames()
MISSION:GetRootMenu(TaskGroup)

Gets the root mission menu for the TaskGroup.

MISSION:GetScoring()

Get the scoring object of a mission.

MISSION:GetShortText()

Gets the short mission text.

MISSION.GetTask(TaskName, self)

Get the TASK identified by the TaskNumber from the Mission.

MISSION:GetTaskTypes()
MISSION:GetTasks()

Get all the TASKs from the Mission.

MISSION:GetTasksRemaining()
MISSION:GetText()

Gets the mission text.

MISSION:HasGroup(TaskGroup)

Validates if the Mission has a Group

MISSION:IsCOMPLETED()

Is the Mission COMPLETED.

MISSION:IsENGAGED()

Is the Mission ENGAGED.

MISSION:IsFAILED()

Is the Mission FAILED.

MISSION:IsGroupAssigned(MissionGroup)

Returns if the Mission is assigned to the Group.

MISSION:IsHOLD()

Is the Mission HOLD.

MISSION:IsIDLE()

Is the Mission IDLE.

MISSION:JoinUnit(PlayerUnit, PlayerGroup)

Add a Unit to join the Mission.

MISSION:MarkTargetLocations(ReportGroup)

Mark all the target locations on the Map.

MISSION:MenuMarkTargetLocations(ReportGroup)

Mark all the targets of the Mission on the Map.

MISSION:MenuReportBriefing(ReportGroup)

Reports the briefing.

MISSION:MenuReportPlayersPerTask(ReportGroup)
MISSION:MenuReportPlayersProgress(ReportGroup)
MISSION:MenuReportTasksPerStatus(TaskStatus, ReportGroup)
MISSION:MenuReportTasksSummary(ReportGroup)

Report the task summary.

MISSION.MissionBriefing
MISSION:MissionGoals()

MissionGoals Trigger for MISSION

MISSION.MissionGroupMenu
MISSION.MissionMenu
MISSION.MissionStatus
MISSION.Name
MISSION:New(CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition)

This is the main MISSION declaration method.

MISSION:OnAfterComplete(From, Event, To)

OnAfter Transition Handler for Event Complete.

MISSION:OnAfterFail(From, Event, To)

OnAfter Transition Handler for Event Fail.

MISSION:OnAfterMissionGoals(From, Event, To)

MissionGoals Handler OnAfter for MISSION

MISSION:OnAfterStart(From, Event, To)

OnAfter Transition Handler for Event Start.

MISSION:OnAfterStop(From, Event, To)

OnAfter Transition Handler for Event Stop.

MISSION:OnBeforeComplete(From, Event, To)

OnBefore Transition Handler for Event Complete.

MISSION:OnBeforeFail(From, Event, To)

OnBefore Transition Handler for Event Fail.

MISSION:OnBeforeMissionGoals(From, Event, To)

MissionGoals Handler OnBefore for MISSION

MISSION:OnBeforeStart(From, Event, To)

OnBefore Transition Handler for Event Start.

MISSION:OnBeforeStop(From, Event, To)

OnBefore Transition Handler for Event Stop.

MISSION:OnEnterCOMPLETED(From, Event, To)

OnEnter Transition Handler for State COMPLETED.

MISSION:OnEnterENGAGED(From, Event, To)

OnEnter Transition Handler for State ENGAGED.

MISSION:OnEnterFAILED(From, Event, To)

OnEnter Transition Handler for State FAILED.

MISSION:OnEnterIDLE(From, Event, To)

OnEnter Transition Handler for State IDLE.

MISSION:OnLeaveCOMPLETED(From, Event, To)

OnLeave Transition Handler for State COMPLETED.

MISSION:OnLeaveENGAGED(From, Event, To)

OnLeave Transition Handler for State ENGAGED.

MISSION:OnLeaveFAILED(From, Event, To)

OnLeave Transition Handler for State FAILED.

MISSION:OnLeaveIDLE(From, Event, To)

OnLeave Transition Handler for State IDLE.

MISSION:RemoveMenu(MenuTime)

Removes the Planned Task menu.

MISSION:RemoveTask(Task)

Removes a Task to be completed within the Mission.

MISSION:RemoveTaskMenu(Task)

Removes a Task menu.

MISSION:ReportBriefing()

Create a briefing report of the Mission.

MISSION:ReportDetails(ReportGroup)

Create a detailed report of the Mission, listing all the details of the Task.

MISSION:ReportOverview(ReportGroup, TaskStatus)

Create a overview report of the Mission (multiple lines).

MISSION:ReportPlayersPerTask(ReportGroup)

Create an active player report of the Mission.

MISSION:ReportPlayersProgress(ReportGroup)

Create an Mission Progress report of the Mission.

MISSION:ReportSummary(ReportGroup)

Create a summary report of the Mission (one line).

MISSION.Scoring
MISSION:SetGroupAssigned(MissionGroup)

Set Wrapper.Group assigned to the Mission.

MISSION:SetMenu(MenuTime)

Sets the Planned Task menu.

MISSION:Start()

Synchronous Event Trigger for Event Start.

MISSION:Stop()

Synchronous Event Trigger for Event Stop.

MISSION.TaskNumber
MISSION._Clients
MISSION:__Complete(Delay)

Asynchronous Event Trigger for Event Complete.

MISSION:__Fail(Delay)

Asynchronous Event Trigger for Event Fail.

MISSION:__MissionGoals(Delay)

MissionGoals Asynchronous Trigger for MISSION

MISSION:__Start(Delay)

Asynchronous Event Trigger for Event Start.

MISSION:__Stop(Delay)

Asynchronous Event Trigger for Event Stop.

MISSION:onenterCOMPLETED(From, Event, To)

FSM function for a MISSION

Global(s)

#MISSION MISSION

Type Mission

Type MISSION

Extends Core.Fsm#FSM

The MISSION class

Field(s)

MISSION:AbortUnit(PlayerUnit)

Aborts a PlayerUnit from the Mission.

For each Task within the Mission, the PlayerUnit is removed from Task where it is assigned. If the Unit was not part of a Task in the Mission, false is returned. If the Unit is part of a Task in the Mission, true is returned.

Parameter

  • Wrapper.Unit#UNIT PlayerUnit : The CLIENT or UNIT of the Player joining the Mission.

Return value

#MISSION:

MISSION:AddGroups(GroupSet)

Adds the groups for which TASKS are given in the mission

Parameter

Return value

Core.Set#SET_GROUP:

MISSION:AddPlayerName(PlayerName)

Parameter

  • PlayerName :

MISSION:AddScoring(Scoring)

Add a scoring to the mission.

Parameter

  • Scoring :

Return value

#MISSION: self

MISSION:AddTask(Task)

Register a Task to be completed within the Mission.

Note that there can be multiple Tasks registered to be completed. Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.

Parameter

Return value

Tasking.Task#TASK: The task added.

#table MISSION.AssignedGroups
#string MISSION.ClassName
MISSION:ClearGroupAssignment(MissionGroup)

Clear the Wrapper.Group assignment from the Mission.

Parameter

Return value

#MISSION:

MISSION:Complete()

Synchronous Event Trigger for Event Complete.

MISSION:CrashUnit(PlayerUnit)

Handles a crash of a PlayerUnit from the Mission.

For each Task within the Mission, the PlayerUnit is removed from Task where it is assigned. If the Unit was not part of a Task in the Mission, false is returned. If the Unit is part of a Task in the Mission, true is returned.

Parameter

Return value

#MISSION:

MISSION:Fail()

Synchronous Event Trigger for Event Fail.

MISSION:GetCommandCenter()

Gets the COMMANDCENTER.

Return value

Tasking.CommandCenter#COMMANDCENTER:

MISSION.GetGroupTasks(TaskGroup, self)

Get the relevant tasks of a TaskGroup.

Parameters

Return value

#list<Tasking.Task#TASK>:

MISSION:GetGroups(GroupSet)

Gets the groups for which TASKS are given in the mission

Parameter

Return value

Core.Set#SET_GROUP:

MISSION:GetMenu(TaskGroup)

Gets the mission menu for the TaskGroup.

Parameter

  • TaskGroup :

Return value

Core.Menu#MENU_COALITION: self

MISSION:GetName()

Gets the mission name.

Return value

#MISSION: self

MISSION:GetNextTaskID(Task)

Return the next Task ID to be completed within the Mission.

Parameter

Return value

Tasking.Task#TASK: The task added.

MISSION:GetPlayerNames()
MISSION:GetRootMenu(TaskGroup)

Gets the root mission menu for the TaskGroup.

Parameter

  • TaskGroup :

Return value

Core.Menu#MENU_COALITION: self

MISSION:GetScoring()

Get the scoring object of a mission.

Return value

#SCORING: Scoring

MISSION:GetShortText()

Gets the short mission text.

Return value

#MISSION: self

MISSION.GetTask(TaskName, self)

Get the TASK identified by the TaskNumber from the Mission.

This function is useful in GoalFunctions.

Parameters

  • #string TaskName : The Name of the Task within the Mission.

  • self :

Return values

  1. Tasking.Task#TASK: The Task

  2. #nil: Returns nil if no task was found.

MISSION:GetTaskTypes()

Return value

#number:

MISSION:GetTasks()

Get all the TASKs from the Mission.

This function is useful in GoalFunctions.

Return value

{TASK,...} Structure of TASKS with the TASK number as the key.

Usage:

-- Get Tasks from the Mission.
Tasks = Mission:GetTasks()
env.info( "Task 2 Completion = " .. Tasks[2]:GetGoalPercentage() .. "%" )
MISSION:GetTasksRemaining()

Return value

#number:

MISSION:GetText()

Gets the mission text.

Return value

#MISSION: self

MISSION:HasGroup(TaskGroup)

Validates if the Mission has a Group

Parameter

  • TaskGroup :

Return value

#boolean: true if the Mission has a Group.

MISSION:IsCOMPLETED()

Is the Mission COMPLETED.

Return value

#boolean:

MISSION:IsENGAGED()

Is the Mission ENGAGED.

Return value

#boolean:

MISSION:IsFAILED()

Is the Mission FAILED.

Return value

#boolean:

MISSION:IsGroupAssigned(MissionGroup)

Returns if the Mission is assigned to the Group.

Parameter

Return value

#boolean:

MISSION:IsHOLD()

Is the Mission HOLD.

Return value

#boolean:

MISSION:IsIDLE()

Is the Mission IDLE.

Return value

#boolean:

MISSION:JoinUnit(PlayerUnit, PlayerGroup)

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. If the Unit is part of a Task in the Mission, true is returned.

Parameters

Return value

#boolean: true if Unit is part of a Task in the Mission.

MISSION:MarkTargetLocations(ReportGroup)

Mark all the target locations on the Map.

Parameter

Return value

#string:

MISSION:MenuMarkTargetLocations(ReportGroup)

Mark all the targets of the Mission on the Map.

Parameter

MISSION:MenuReportBriefing(ReportGroup)

Reports the briefing.

Parameter

MISSION:MenuReportPlayersPerTask(ReportGroup)

Parameter

MISSION:MenuReportPlayersProgress(ReportGroup)

Parameter

MISSION:MenuReportTasksPerStatus(TaskStatus, ReportGroup)

Parameters

MISSION:MenuReportTasksSummary(ReportGroup)

Report the task summary.

Parameter

#string MISSION.MissionBriefing
MISSION:MissionGoals()

MissionGoals Trigger for MISSION

MISSION.MissionGroupMenu
Core.Menu#MENU_COALITION MISSION.MissionMenu
#string MISSION.MissionStatus
#string MISSION.Name
MISSION:New(CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition)

This is the main MISSION declaration method.

Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.

Parameters

  • Tasking.CommandCenter#COMMANDCENTER CommandCenter :

  • #string MissionName : is the name of the mission. This name will be used to reference the status of each mission by the players.

  • #string MissionPriority : is a string indicating the "priority" of the Mission. f.e. "Primary", "Secondary" or "First", "Second". It is free format and up to the Mission designer to choose. There are no rules behind this field.

  • #string MissionBriefing : is a string indicating the mission briefing to be shown when a player joins a CLIENT.

  • #string MissionCoalition : is a string indicating the coalition or party to which this mission belongs to. It is free format and can be chosen freely by the mission designer. Note that this field is not to be confused with the coalition concept of the ME. Examples of a Mission Coalition could be "NATO", "CCCP", "Intruders", "Terrorists"...

Return value

#MISSION: self

MISSION:OnAfterComplete(From, Event, To)

OnAfter Transition Handler for Event Complete.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

MISSION:OnAfterFail(From, Event, To)

OnAfter Transition Handler for Event Fail.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

MISSION:OnAfterMissionGoals(From, Event, To)

MissionGoals Handler OnAfter for MISSION

Parameters

  • #string From :

  • #string Event :

  • #string To :

MISSION:OnAfterStart(From, Event, To)

OnAfter Transition Handler for Event Start.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

MISSION:OnAfterStop(From, Event, To)

OnAfter Transition Handler for Event Stop.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

MISSION:OnBeforeComplete(From, Event, To)

OnBefore Transition Handler for Event Complete.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

MISSION:OnBeforeFail(From, Event, To)

OnBefore Transition Handler for Event Fail.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

MISSION:OnBeforeMissionGoals(From, Event, To)

MissionGoals Handler OnBefore for MISSION

Parameters

  • #string From :

  • #string Event :

  • #string To :

Return value

#boolean:

MISSION:OnBeforeStart(From, Event, To)

OnBefore Transition Handler for Event Start.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

MISSION:OnBeforeStop(From, Event, To)

OnBefore Transition Handler for Event Stop.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

MISSION:OnEnterCOMPLETED(From, Event, To)

OnEnter Transition Handler for State COMPLETED.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

MISSION:OnEnterENGAGED(From, Event, To)

OnEnter Transition Handler for State ENGAGED.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

MISSION:OnEnterFAILED(From, Event, To)

OnEnter Transition Handler for State FAILED.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

MISSION:OnEnterIDLE(From, Event, To)

OnEnter Transition Handler for State IDLE.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

MISSION:OnLeaveCOMPLETED(From, Event, To)

OnLeave Transition Handler for State COMPLETED.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

MISSION:OnLeaveENGAGED(From, Event, To)

OnLeave Transition Handler for State ENGAGED.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

MISSION:OnLeaveFAILED(From, Event, To)

OnLeave Transition Handler for State FAILED.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

MISSION:OnLeaveIDLE(From, Event, To)

OnLeave Transition Handler for State IDLE.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

MISSION:RemoveMenu(MenuTime)

Removes the Planned Task menu.

Parameter

  • #number MenuTime :

MISSION:RemoveTask(Task)

Removes a Task to be completed within the Mission.

Note that there can be multiple Tasks registered to be completed. Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.

Parameter

Return value

#nil: The cleaned Task reference.

MISSION:RemoveTaskMenu(Task)

Removes a Task menu.

Parameter

Return value

#MISSION: self

MISSION:ReportBriefing()

Create a briefing report of the Mission.

Return value

#string:

MISSION:ReportDetails(ReportGroup)

Create a detailed report of the Mission, listing all the details of the Task.

Parameter

  • ReportGroup :

Return value

#string:

MISSION:ReportOverview(ReportGroup, TaskStatus)

Create a overview report of the Mission (multiple lines).

Parameters

  • ReportGroup :

  • TaskStatus :

Return value

#string:

MISSION:ReportPlayersPerTask(ReportGroup)

Create an active player report of the Mission.

This reports provides a one liner of the mission status. It indicates how many players and how many Tasks.

Mission "<MissionName>" - <MissionStatus> - Active Players Report
 - Player "<PlayerName>: Task <TaskName> <TaskStatus>, Task <TaskName> <TaskStatus>
 - Player <PlayerName>: Task <TaskName> <TaskStatus>, Task <TaskName> <TaskStatus>
 - ..

Parameter

  • ReportGroup :

Return value

#string:

MISSION:ReportPlayersProgress(ReportGroup)

Create an Mission Progress report of the Mission.

This reports provides a one liner per player of the mission achievements per task.

Mission "<MissionName>" - <MissionStatus> - Active Players Report
 - Player <PlayerName>: Task <TaskName> <TaskStatus>: <Progress>
 - Player <PlayerName>: Task <TaskName> <TaskStatus>: <Progress>
 - ..

Parameter

  • ReportGroup :

Return value

#string:

MISSION:ReportSummary(ReportGroup)

Create a summary report of the Mission (one line).

Parameter

Return value

#string:

MISSION.Scoring
MISSION:SetGroupAssigned(MissionGroup)

Set Wrapper.Group assigned to the Mission.

Parameter

Return value

#MISSION:

MISSION:SetMenu(MenuTime)

Sets the Planned Task menu.

Parameter

  • #number MenuTime :

MISSION:Start()

Synchronous Event Trigger for Event Start.

MISSION:Stop()

Synchronous Event Trigger for Event Stop.

MISSION.TaskNumber
#MISSION.Clients MISSION._Clients
MISSION:__Complete(Delay)

Asynchronous Event Trigger for Event Complete.

Parameter

  • #number Delay : The delay in seconds.

MISSION:__Fail(Delay)

Asynchronous Event Trigger for Event Fail.

Parameter

  • #number Delay : The delay in seconds.

MISSION:__MissionGoals(Delay)

MissionGoals Asynchronous Trigger for MISSION

Parameter

  • #number Delay :

MISSION:__Start(Delay)

Asynchronous Event Trigger for Event Start.

Parameter

  • #number Delay : The delay in seconds.

MISSION:__Stop(Delay)

Asynchronous Event Trigger for Event Stop.

Parameter

  • #number Delay : The delay in seconds.

MISSION:onenterCOMPLETED(From, Event, To)

FSM function for a MISSION

Parameters

  • #string From :

  • #string Event :

  • #string To :

Type MISSION.Clients

Type SCORING