Module Mission

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

The Mission framework orchestrates CLIENTs, TASKs, STAGEs etc. A CLIENT needs to be registered within the MISSION through the function AddClient. A TASK needs to be registered within the MISSION through the function AddTask.

Global(s)

MISSION

Type MISSION

MISSION:AbortUnit(PlayerUnit)

Aborts a PlayerUnit from the Mission.

MISSION:AddScoring(Scoring)

Add a scoring to the mission.

MISSION:AddTask(Task)

Register a Task to be completed within the Mission.

MISSION.ClassName
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:GetGroups()

Get the groups for which TASKS are given in the mission

MISSION:GetMenu(TaskGroup)

Gets the mission menu for the coalition.

MISSION:GetName()

Gets the mission name.

MISSION:GetNextTaskID(Task)

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

MISSION:GetScoring()

Get the scoring object of a mission.

MISSION.GetTask(TaskName, self)

Get the TASK identified by the TaskNumber from the Mission.

MISSION:GetTasks()

Get all the TASKs from the Mission.

MISSION.HasGroup(#, self, TaskGroup)

Validates if the Mission has a Group

MISSION:IsCompleted()

Is the Mission Completed.

MISSION:IsFailed()

Is the Mission Failed.

MISSION:IsHold()

Is the Mission Hold.

MISSION:IsIdle()

Is the Mission Idle.

MISSION:IsOngoing()

Is the Mission Ongoing.

MISSION:JoinUnit(PlayerUnit, PlayerGroup)

Add a Unit to join the Mission.

MISSION.MissionBriefing
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: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: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:OnEnterFailed(From, Event, To)

OnEnter Transition Handler for State Failed.

MISSION:OnEnterIdle(From, Event, To)

OnEnter Transition Handler for State Idle.

MISSION:OnEnterOngoing(From, Event, To)

OnEnter Transition Handler for State Ongoing.

MISSION:OnLeaveCompleted(From, Event, To)

OnLeave Transition Handler for State Completed.

MISSION:OnLeaveFailed(From, Event, To)

OnLeave Transition Handler for State Failed.

MISSION:OnLeaveIdle(From, Event, To)

OnLeave Transition Handler for State Idle.

MISSION:OnLeaveOngoing(From, Event, To)

OnLeave Transition Handler for State Ongoing.

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:ReportDetails()

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

MISSION:ReportOverview()

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

MISSION:ReportSummary()

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

MISSION.Scoring
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._Clients
MISSION:__Complete(Delay)

Asynchronous Event Trigger for Event Complete.

MISSION:__Fail(Delay)

Asynchronous Event Trigger for Event Fail.

MISSION:__Start(Delay)

Asynchronous Event Trigger for Event Start.

MISSION:__Stop(Delay)

Asynchronous Event Trigger for Event Stop.

MISSION:onbeforeComplete(From, Event, To)
MISSION:onenterCompleted(From, Event, To)

Global(s)

#MISSION MISSION

Type Mission

Type MISSION

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

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

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.

#string MISSION.ClassName
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

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

MISSION:Fail()

Synchronous Event Trigger for Event Fail.

MISSION:GetCommandCenter()

Gets the COMMANDCENTER.

Return value

Tasking.CommandCenter#COMMANDCENTER:

MISSION:GetGroups()

Get the groups for which TASKS are given in the mission

Return value

Core.Set#SET_GROUP:

MISSION:GetMenu(TaskGroup)

Gets the mission menu for the coalition.

Parameter

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:GetScoring()

Get the scoring object of a mission.

Return value

#SCORING: Scoring

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: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.HasGroup(#, self, TaskGroup)

Validates if the Mission has a Group

Parameters

  • # : ISSION

  • self :

  • TaskGroup :

Return value

#boolean: true if the Mission has a Group.

MISSION:IsCompleted()

Is the Mission Completed.

Return value

#boolean:

MISSION:IsFailed()

Is the Mission Failed.

Return value

#boolean:

MISSION:IsHold()

Is the Mission Hold.

Return value

#boolean:

MISSION:IsIdle()

Is the Mission Idle.

Return value

#boolean:

MISSION:IsOngoing()

Is the Mission Ongoing.

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.

#string MISSION.MissionBriefing
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.

  • Dcs.DCSCoalitionWrapper.Object#coalition 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: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: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: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:OnEnterOngoing(From, Event, To)

OnEnter Transition Handler for State Ongoing.

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: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:OnLeaveOngoing(From, Event, To)

OnLeave Transition Handler for State Ongoing.

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:ReportDetails()

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

Return value

#string:

MISSION:ReportOverview()

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

Return value

#string:

MISSION:ReportSummary()

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

Return value

#string:

MISSION.Scoring
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.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:__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:onbeforeComplete(From, Event, To)

FSM function for a MISSION @param #MISSION self @param #string From @param #string Event @param #string To

Parameters

  • From :

  • Event :

  • To :

MISSION:onenterCompleted(From, Event, To)

FSM function for a MISSION @param #MISSION self @param #string From @param #string Event @param #string To

Parameters

  • From :

  • Event :

  • To :

Type MISSION.Clients

Type SCORING