A MISSION is the main owner of a Mission orchestration within MOOSE .
-
MISSION:New (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:
- MissionName
string
is the name of the mission. This name will be used to reference the status of each mission by the players.
- MissionPriority
string
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.
- MissionBriefing
string
is a string indicating the mission briefing to be shown when a player joins a CLIENT.
- MissionCoalition
string
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"...
Returns:
MISSION
Usage:
local Mission = MISSIONSCHEDULER.AddMission( 'Russia Transport Troops SA-6', 'Operational', 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 'Russia' )
local Mission = MISSIONSCHEDULER.AddMission( 'Patriots', 'Primary', 'Our intelligence reports that 3 Patriot SAM defense batteries are located near Ruisi, Kvarhiti and Gori.', 'Russia' )
local Mission = MISSIONSCHEDULER.AddMission( 'Package Delivery', 'Operational', 'In order to be in full control of the situation, we need you to deliver a very important package at a secret location. Fly undetected through the NATO defenses and deliver the secret package. The secret agent is located at waypoint 4.', 'Russia' )
local Mission = MISSIONSCHEDULER.AddMission( 'Rescue General', 'Tactical', 'Our intelligence has received a remote signal behind Gori. We believe it is a very important Russian General that was captured by Georgia. Go out there and rescue him! Ensure you stay out of the battle zone, keep south. Waypoint 4 is the location of our Russian General.', 'Russia' )
local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
local Mission = MISSIONSCHEDULER.AddMission( 'SA-6 SAMs', 'Primary', 'Our intelligence reports that 3 SA-6 SAM defense batteries are located near Didmukha, Khetagurov and Berula. Eliminate the Russian SAMs.', 'NATO' )
local Mission = MISSIONSCHEDULER.AddMission( 'NATO Sling Load', 'Operational', 'Fly to the cargo pickup zone at Dzegvi or Kaspi, and sling the cargo to Soganlug airbase.', 'NATO' )
local Mission = MISSIONSCHEDULER.AddMission( 'Rescue secret agent', 'Tactical', 'In order to be in full control of the situation, we need you to rescue a secret agent from the woods behind enemy lines. Avoid the Russian defenses and rescue the agent. Keep south until Khasuri, and keep your eyes open for any SAM presence. The agent is located at waypoint 4 on your kneeboard.', 'NATO' )
-
MISSION:IsCompleted ()
-
Returns if a Mission has completed.
Returns:
bool
-
MISSION:Completed ()
-
Set a Mission to completed.
-
MISSION:IsOngoing ()
-
Returns if a Mission is ongoing.
treturn bool
-
MISSION:Ongoing ()
-
Set a Mission to ongoing.
-
MISSION:IsPending ()
-
Returns if a Mission is pending.
treturn bool
-
MISSION:Pending ()
-
Set a Mission to pending.
-
MISSION:IsFailed ()
-
Returns if a Mission has failed.
treturn bool
-
MISSION:Failed ()
-
Set a Mission to failed.
-
MISSION:StatusToClients ()
-
Send the status of the MISSION to all Clients.
-
MISSION:ReportTrigger ()
-
Handles the reporting. After certain time intervals, a MISSION report MESSAGE will be shown to All Players.
-
MISSION:ReportToAll ()
-
Report the status of all MISSIONs to all active Clients.
-
MISSION:AddGoalFunction (GoalFunction)
-
Add a goal function to a MISSION. Goal functions are called when a TASK within a mission has been completed.
Parameters:
- GoalFunction
function
is the function defined by the mission designer to evaluate whether a certain goal has been reached after a TASK finishes within the MISSION. A GoalFunction must accept 2 parameters: Mission, Client, which contains the current MISSION object and the current CLIENT object respectively.
Usage:
PatriotActivation = {
{ "US SAM Patriot Zerti", false },
{ "US SAM Patriot Zegduleti", false },
{ "US SAM Patriot Gvleti", false }
}
function DeployPatriotTroopsGoal( Mission, Client )
for CargoID, CargoData in pairs( Mission._Cargos ) do
if Group.getByName( CargoData.CargoGroupName ) then
CargoGroup = Group.getByName( CargoData.CargoGroupName )
if CargoGroup then
CurrentLandingZoneID = routines.IsUnitInZones( CargoGroup:getUnits()[1], Mission:GetTask( 2 ).LandingZones ) if CurrentLandingZoneID then
if PatriotActivation[CurrentLandingZoneID][2] == false then
trigger.action.setGroupAIOn( Group.getByName( PatriotActivation[CurrentLandingZoneID][1] ) )
PatriotActivation[CurrentLandingZoneID][2] = true
MessageToBlue( "Mission Command: Message to all airborne units! The " .. PatriotActivation[CurrentLandingZoneID][1] .. " is armed. Our air defenses are now stronger.", 60, "BLUE/PatriotDefense" )
MessageToRed( "Mission Command: Our satellite systems are detecting additional NATO air defenses. To all airborne units: Take care!!!", 60, "RED/PatriotDefense" )
Mission:GetTask( 2 ):AddGoalCompletion( "Patriots activated", PatriotActivation[CurrentLandingZoneID][1], 1 ) end
end
end
end
end
end
local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
Mission:AddGoalFunction( DeployPatriotTroopsGoal )
-
MISSION:ShowBriefing (Client)
-
Show the briefing of the MISSION to the CLIENT.
Parameters:
- Client
CLIENT
to show briefing to.
Returns:
CLIENT
-
MISSION:AddClient (Client)
-
Register a new CLIENT to participate within the mission.
Parameters:
Returns:
CLIENT
Usage:
Add a number of Client objects to the Mission.
Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:New( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
Mission:AddClient( CLIENT:New( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
-
MISSION:FindClient (ClientName)
-
Find a CLIENT object within the MISSION by its ClientName.
Parameters:
- ClientName
CLIENT
is a string defining the Client Group as defined within the ME.
Returns:
CLIENT
Usage:
local BomberClient = Mission:FindClient( "Bomber" )
-
MISSION:AddTask (Task, TaskNumber)
-
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 Goal. The MISSION will not be completed until all Goals are reached.
Parameters:
- Task
TASK
is the TASK object. The object must have been instantiated with TASK:New or any of its inherited TASKs.
- TaskNumber
number
is the sequence number of the TASK within the MISSION. This number does have to be chronological.
Returns:
TASK
Usage:
PickupZones = { "NATO Gold Pickup Zone", "NATO Titan Pickup Zone" }
PickupSignalUnits = { "NATO Gold Coordination Center", "NATO Titan Coordination Center" }
local PickupTask = PICKUPTASK:New( PickupZones, CARGO_TYPE.ENGINEERS, CLIENT.ONBOARDSIDE.LEFT )
PickupTask:AddSmokeBlue( PickupSignalUnits )
PickupTask:SetGoalTotal( 3 )
Mission:AddTask( PickupTask, 1 )
local PatriotActivationZones = { "US Patriot Battery 1 Activation", "US Patriot Battery 2 Activation", "US Patriot Battery 3 Activation" }
local PatriotActivationZonesSmokeUnits = { "US SAM Patriot - Battery 1 Control", "US SAM Patriot - Battery 2 Control", "US SAM Patriot - Battery 3 Control" }
local DeployTask = DEPLOYTASK:New( PatriotActivationZones, CARGO_TYPE.ENGINEERS )
DeployTask:AddSmokeBlue( PatriotActivationZonesSmokeUnits )
DeployTask:SetGoalTotal( 3 )
DeployTask:SetGoalTotal( 3, "Patriots activated" )
Mission:AddTask( DeployTask, 2 )
-
MISSION:GetTask (TaskNumber)
-
Get the TASK idenified by the TaskNumber from the Mission. This function is useful in GoalFunctions.
Parameters:
- TaskNumber
number
is the number of the TASK within the MISSION.
Returns:
TASK
Usage:
Task2 = Mission:GetTask( 2 )
-
MISSION:GetTasks ()
-
Get all the TASKs from the Mission. This function is useful in GoalFunctions.
Returns:
{TASK,...}
Structure of TASKS with the TASK number as the key.
Usage:
Tasks = Mission:GetTasks()
env.info( "Task 2 Completion = " .. Tasks[2]:GetGoalPercentage() .. "%" )
The MISSIONSCHEDULER is an OBJECT and is the main scheduler of ALL active MISSIONs registered within this scheduler. It's workings are considered internal and is automatically created when the Mission.lua file is included.