MOOSE/doc/classes/MISSION.html
2015-10-25 10:41:34 +01:00

974 lines
35 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>MOOSE</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>MOOSE</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>Contents</h2>
<ul>
<li><a href="#Tables">Tables</a></li>
<li><a href="#Issues">Issues</a></li>
<li><a href="#Methods">Methods</a></li>
<li><a href="#Class_MISSIONSCHEDULER">Class MISSIONSCHEDULER </a></li>
</ul>
<h2>Classes</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../classes/BASE.html">BASE</a></li>
<li><a href="../classes/CARGO.html">CARGO</a></li>
<li><a href="../classes/CLEANUP.html">CLEANUP</a></li>
<li><a href="../classes/CLIENT.html">CLIENT</a></li>
<li><a href="../classes/DATABASE.html">DATABASE</a></li>
<li><a href="../classes/DEPLOYTASK.html">DEPLOYTASK</a></li>
<li><a href="../classes/DESTROYBASETASK.html">DESTROYBASETASK</a></li>
<li><a href="../classes/DESTROYGROUPSTASK.html">DESTROYGROUPSTASK</a></li>
<li><a href="../classes/DESTROYRADARSTASK.html">DESTROYRADARSTASK</a></li>
<li><a href="../classes/DESTROYUNITTYPESTASK.html">DESTROYUNITTYPESTASK</a></li>
<li><a href="../classes/GOHOMETASK.html">GOHOMETASK</a></li>
<li><a href="../classes/MENU.html">MENU</a></li>
<li><a href="../classes/MESSAGE.html">MESSAGE</a></li>
<li><strong>MISSION</strong></li>
<li><a href="../classes/MOVEMENT.html">MOVEMENT</a></li>
<li><a href="../classes/NOTASK.html">NOTASK</a></li>
<li><a href="../classes/PICKUPTASK.html">PICKUPTASK</a></li>
<li><a href="../classes/ROUTETASK.html">ROUTETASK</a></li>
<li><a href="../classes/SEAD.html">SEAD</a></li>
<li><a href="../classes/SLINGLOADHOOKTASK.html">SLINGLOADHOOKTASK</a></li>
<li><a href="../classes/SLINGLOADUNHOOKTASK.html">SLINGLOADUNHOOKTASK</a></li>
<li><a href="../classes/SPAWN.html">SPAWN</a></li>
<li><a href="../classes/STAGE.html">STAGE</a></li>
<li><a href="../classes/TASK.html">TASK</a></li>
</ul>
<h2>Modules</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../modules/routines.html">routines</a></li>
<li><a href="../modules/trace.html">trace</a></li>
</ul>
<h2>Scripts</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../scripts/eStatHandler.html">eStatHandler</a></li>
</ul>
<h2>Topics</h2>
<ul class="$(kind=='Topics' and '' or 'nowrap'">
<li><a href="../topics/manual.md.html">manual</a></li>
</ul>
</div>
<div id="content">
<h1>Class <code>MISSION</code></h1>
<p>A MISSION is the main owner of a Mission orchestration within MOOSE .</p>
<p> The Mission framework orchestrates <a href="../classes/CLIENT.html#">CLIENT</a>s, <a href="../classes/TASK.html#">TASK</a>s, <a href="../classes/STAGE.html#">STAGE</a>s etc.
A <a href="../classes/CLIENT.html#">CLIENT</a> needs to be registered within the <a href="../classes/MISSION.html#">MISSION</a> through the function <a href="../classes/MISSION.html#MISSION:AddClient">AddClient</a>. A <a href="../classes/TASK.html#">TASK</a> needs to be registered within the <a href="../classes/MISSION.html#">MISSION</a> through the function <a href="../classes/MISSION.html#MISSION:AddTask">AddTask</a>.</p>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#MISSION.SpawnCargo">MISSION.SpawnCargo</a></td>
<td class="summary">Add Cargo to the mission...</td>
</tr>
</table>
<h2><a href="#Issues">Issues</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#MISSION.SpawnCargo-todo1">MISSION.SpawnCargo-todo1</a></td>
<td class="summary">check this</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION.SpawnCargo-todo1-todo2">MISSION.SpawnCargo-todo1-todo2</a></td>
<td class="summary">check this</td>
</tr>
</table>
<h2><a href="#Methods">Methods</a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#MISSION:New">MISSION:New (MissionName, MissionPriority, MissionBriefing, MissionCoalition)</a></td>
<td class="summary">This is the main MISSION declaration method.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:IsCompleted">MISSION:IsCompleted ()</a></td>
<td class="summary">Returns if a Mission has completed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:Completed">MISSION:Completed ()</a></td>
<td class="summary">Set a Mission to completed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:IsOngoing">MISSION:IsOngoing ()</a></td>
<td class="summary">Returns if a Mission is ongoing.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:Ongoing">MISSION:Ongoing ()</a></td>
<td class="summary">Set a Mission to ongoing.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:IsPending">MISSION:IsPending ()</a></td>
<td class="summary">Returns if a Mission is pending.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:Pending">MISSION:Pending ()</a></td>
<td class="summary">Set a Mission to pending.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:IsFailed">MISSION:IsFailed ()</a></td>
<td class="summary">Returns if a Mission has failed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:Failed">MISSION:Failed ()</a></td>
<td class="summary">Set a Mission to failed.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:StatusToClients">MISSION:StatusToClients ()</a></td>
<td class="summary">Send the status of the MISSION to all Clients.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:ReportTrigger">MISSION:ReportTrigger ()</a></td>
<td class="summary">Handles the reporting.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:ReportToAll">MISSION:ReportToAll ()</a></td>
<td class="summary">Report the status of all MISSIONs to all active Clients.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:AddGoalFunction">MISSION:AddGoalFunction (GoalFunction)</a></td>
<td class="summary">Add a goal function to a MISSION.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:ShowBriefing">MISSION:ShowBriefing (Client)</a></td>
<td class="summary">Show the briefing of the MISSION to the CLIENT.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:AddClient">MISSION:AddClient (Client)</a></td>
<td class="summary">Register a new <a href="../classes/CLIENT.html#">CLIENT</a> to participate within the mission.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:FindClient">MISSION:FindClient (ClientName)</a></td>
<td class="summary">Find a <a href="../classes/CLIENT.html#">CLIENT</a> object within the <a href="../classes/MISSION.html#">MISSION</a> by its ClientName.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:AddTask">MISSION:AddTask (Task, TaskNumber)</a></td>
<td class="summary">Register a <a href="../classes/TASK.html#">TASK</a> to be completed within the <a href="../classes/MISSION.html#">MISSION</a>.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:GetTask">MISSION:GetTask (TaskNumber)</a></td>
<td class="summary">Get the TASK idenified by the TaskNumber from the Mission.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSION:GetTasks">MISSION:GetTasks ()</a></td>
<td class="summary">Get all the TASKs from the Mission.</td>
</tr>
</table>
<h2><a href="#Class_MISSIONSCHEDULER">Class MISSIONSCHEDULER </a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap><a href="#MISSIONSCHEDULER.Scheduler">MISSIONSCHEDULER.Scheduler ()</a></td>
<td class="summary">This is the main MISSIONSCHEDULER Scheduler function.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSIONSCHEDULER.Start">MISSIONSCHEDULER.Start ()</a></td>
<td class="summary">Start the MISSIONSCHEDULER.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSIONSCHEDULER.Stop">MISSIONSCHEDULER.Stop ()</a></td>
<td class="summary">Stop the MISSIONSCHEDULER.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSIONSCHEDULER.AddMission">MISSIONSCHEDULER.AddMission (Mission)</a></td>
<td class="summary">This is the main MISSION declaration method.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSIONSCHEDULER.RemoveMission">MISSIONSCHEDULER.RemoveMission (MissionName)</a></td>
<td class="summary">Remove a MISSION from the MISSIONSCHEDULER.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSIONSCHEDULER.FindMission">MISSIONSCHEDULER.FindMission (MissionName)</a></td>
<td class="summary">Find a MISSION within the MISSIONSCHEDULER.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSIONSCHEDULER.ReportMenu">MISSIONSCHEDULER.ReportMenu ()</a></td>
<td class="summary">Enables a MENU option in the communications menu under F10 to control the status of the active missions.</td>
</tr>
<tr>
<td class="name" nowrap><a href="#MISSIONSCHEDULER:TimeShow">MISSIONSCHEDULER:TimeShow ()</a></td>
<td class="summary">Show the remaining mission time.</td>
</tr>
</table>
<br/>
<br/>
<h2><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "MISSION.SpawnCargo"></a>
<strong>MISSION.SpawnCargo</strong>
</dt>
<dd>
Add Cargo to the mission... Cargo functionality needs to be reworked a bit, so this is still under construction. I need to make a CARGO Class...
</dd>
</dl>
<h2><a name="Issues"></a>Issues</h2>
<dl class="function">
<dt>
<a name = "MISSION.SpawnCargo-todo1"></a>
<strong>MISSION.SpawnCargo-todo1</strong>
</dt>
<dd>
check this
</dd>
<dt>
<a name = "MISSION.SpawnCargo-todo1-todo2"></a>
<strong>MISSION.SpawnCargo-todo1-todo2</strong>
</dt>
<dd>
check this
</dd>
</dl>
<h2><a name="Methods"></a>Methods</h2>
<dl class="function">
<dt>
<a name = "MISSION:New"></a>
<strong>MISSION:New (MissionName, MissionPriority, MissionBriefing, MissionCoalition)</strong>
</dt>
<dd>
This is the main MISSION declaration method. Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">MissionName</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
is the name of the mission. This name will be used to reference the status of each mission by the players.
</li>
<li><span class="parameter">MissionPriority</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
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.
</li>
<li><span class="parameter">MissionBriefing</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
is a string indicating the mission briefing to be shown when a player joins a <a href="../classes/CLIENT.html#">CLIENT</a>.
</li>
<li><span class="parameter">MissionCoalition</span>
<span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
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"...
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/MISSION.html#">MISSION</a></span>
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- Declare a few missions.
</span> <span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'Russia Transport Troops SA-6'</span>, <span class="string">'Operational'</span>, <span class="string">'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.'</span>, <span class="string">'Russia'</span> )
<span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'Patriots'</span>, <span class="string">'Primary'</span>, <span class="string">'Our intelligence reports that 3 Patriot SAM defense batteries are located near Ruisi, Kvarhiti and Gori.'</span>, <span class="string">'Russia'</span> )
<span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'Package Delivery'</span>, <span class="string">'Operational'</span>, <span class="string">'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.'</span>, <span class="string">'Russia'</span> )
<span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'Rescue General'</span>, <span class="string">'Tactical'</span>, <span class="string">'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.'</span>, <span class="string">'Russia'</span> )
<span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'NATO Transport Troops'</span>, <span class="string">'Operational'</span>, <span class="string">'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.'</span>, <span class="string">'NATO'</span> )
<span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'SA-6 SAMs'</span>, <span class="string">'Primary'</span>, <span class="string">'Our intelligence reports that 3 SA-6 SAM defense batteries are located near Didmukha, Khetagurov and Berula. Eliminate the Russian SAMs.'</span>, <span class="string">'NATO'</span> )
<span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'NATO Sling Load'</span>, <span class="string">'Operational'</span>, <span class="string">'Fly to the cargo pickup zone at Dzegvi or Kaspi, and sling the cargo to Soganlug airbase.'</span>, <span class="string">'NATO'</span> )
<span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'Rescue secret agent'</span>, <span class="string">'Tactical'</span>, <span class="string">'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.'</span>, <span class="string">'NATO'</span> )</pre>
</ul>
</dd>
<dt>
<a name = "MISSION:IsCompleted"></a>
<strong>MISSION:IsCompleted ()</strong>
</dt>
<dd>
Returns if a Mission has completed.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool</span></span>
</ol>
</dd>
<dt>
<a name = "MISSION:Completed"></a>
<strong>MISSION:Completed ()</strong>
</dt>
<dd>
Set a Mission to completed.
</dd>
<dt>
<a name = "MISSION:IsOngoing"></a>
<strong>MISSION:IsOngoing ()</strong>
</dt>
<dd>
Returns if a Mission is ongoing.
treturn bool
</dd>
<dt>
<a name = "MISSION:Ongoing"></a>
<strong>MISSION:Ongoing ()</strong>
</dt>
<dd>
Set a Mission to ongoing.
</dd>
<dt>
<a name = "MISSION:IsPending"></a>
<strong>MISSION:IsPending ()</strong>
</dt>
<dd>
Returns if a Mission is pending.
treturn bool
</dd>
<dt>
<a name = "MISSION:Pending"></a>
<strong>MISSION:Pending ()</strong>
</dt>
<dd>
Set a Mission to pending.
</dd>
<dt>
<a name = "MISSION:IsFailed"></a>
<strong>MISSION:IsFailed ()</strong>
</dt>
<dd>
Returns if a Mission has failed.
treturn bool
</dd>
<dt>
<a name = "MISSION:Failed"></a>
<strong>MISSION:Failed ()</strong>
</dt>
<dd>
Set a Mission to failed.
</dd>
<dt>
<a name = "MISSION:StatusToClients"></a>
<strong>MISSION:StatusToClients ()</strong>
</dt>
<dd>
Send the status of the MISSION to all Clients.
</dd>
<dt>
<a name = "MISSION:ReportTrigger"></a>
<strong>MISSION:ReportTrigger ()</strong>
</dt>
<dd>
Handles the reporting. After certain time intervals, a MISSION report MESSAGE will be shown to All Players.
</dd>
<dt>
<a name = "MISSION:ReportToAll"></a>
<strong>MISSION:ReportToAll ()</strong>
</dt>
<dd>
Report the status of all MISSIONs to all active Clients.
</dd>
<dt>
<a name = "MISSION:AddGoalFunction"></a>
<strong>MISSION:AddGoalFunction (GoalFunction)</strong>
</dt>
<dd>
Add a goal function to a MISSION. Goal functions are called when a <a href="../classes/TASK.html#">TASK</a> within a mission has been completed.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">GoalFunction</span>
<span class="types"><span class="type">function</span></span>
is the function defined by the mission designer to evaluate whether a certain goal has been reached after a <a href="../classes/TASK.html#">TASK</a> finishes within the <a href="../classes/MISSION.html#">MISSION</a>. A GoalFunction must accept 2 parameters: Mission, Client, which contains the current MISSION object and the current CLIENT object respectively.
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">
PatriotActivation = {
{ <span class="string">"US SAM Patriot Zerti"</span>, <span class="keyword">false</span> },
{ <span class="string">"US SAM Patriot Zegduleti"</span>, <span class="keyword">false</span> },
{ <span class="string">"US SAM Patriot Gvleti"</span>, <span class="keyword">false</span> }
}
<span class="keyword">function</span> DeployPatriotTroopsGoal( Mission, Client )
<span class="comment">-- Check if the cargo is all deployed for mission success.
</span> <span class="keyword">for</span> CargoID, CargoData <span class="keyword">in</span> <span class="global">pairs</span>( Mission._Cargos ) <span class="keyword">do</span>
<span class="keyword">if</span> Group.getByName( CargoData.CargoGroupName ) <span class="keyword">then</span>
CargoGroup = Group.getByName( CargoData.CargoGroupName )
<span class="keyword">if</span> CargoGroup <span class="keyword">then</span>
<span class="comment">-- Check if the cargo is ready to activate
</span> CurrentLandingZoneID = routines.IsUnitInZones( CargoGroup:getUnits()[<span class="number">1</span>], Mission:GetTask( <span class="number">2</span> ).LandingZones ) <span class="comment">-- The second task is the Deploytask to measure mission success upon
</span> <span class="keyword">if</span> CurrentLandingZoneID <span class="keyword">then</span>
<span class="keyword">if</span> PatriotActivation[CurrentLandingZoneID][<span class="number">2</span>] == <span class="keyword">false</span> <span class="keyword">then</span>
<span class="comment">-- Now check if this is a new Mission Task to be completed...
</span> trigger.action.setGroupAIOn( Group.getByName( PatriotActivation[CurrentLandingZoneID][<span class="number">1</span>] ) )
PatriotActivation[CurrentLandingZoneID][<span class="number">2</span>] = <span class="keyword">true</span>
MessageToBlue( <span class="string">"Mission Command: Message to all airborne units! The "</span> .. PatriotActivation[CurrentLandingZoneID][<span class="number">1</span>] .. <span class="string">" is armed. Our air defenses are now stronger."</span>, <span class="number">60</span>, <span class="string">"BLUE/PatriotDefense"</span> )
MessageToRed( <span class="string">"Mission Command: Our satellite systems are detecting additional NATO air defenses. To all airborne units: Take care!!!"</span>, <span class="number">60</span>, <span class="string">"RED/PatriotDefense"</span> )
Mission:GetTask( <span class="number">2</span> ):AddGoalCompletion( <span class="string">"Patriots activated"</span>, PatriotActivation[CurrentLandingZoneID][<span class="number">1</span>], <span class="number">1</span> ) <span class="comment">-- Register Patriot activation as part of mission goal.
</span> <span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">end</span>
<span class="keyword">local</span> Mission = MISSIONSCHEDULER.AddMission( <span class="string">'NATO Transport Troops'</span>, <span class="string">'Operational'</span>, <span class="string">'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.'</span>, <span class="string">'NATO'</span> )
Mission:AddGoalFunction( DeployPatriotTroopsGoal )</pre>
</ul>
</dd>
<dt>
<a name = "MISSION:ShowBriefing"></a>
<strong>MISSION:ShowBriefing (Client)</strong>
</dt>
<dd>
Show the briefing of the MISSION to the CLIENT.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Client</span>
<span class="types"><a class="type" href="../classes/CLIENT.html#">CLIENT</a></span>
to show briefing to.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/CLIENT.html#">CLIENT</a></span>
</ol>
</dd>
<dt>
<a name = "MISSION:AddClient"></a>
<strong>MISSION:AddClient (Client)</strong>
</dt>
<dd>
Register a new <a href="../classes/CLIENT.html#">CLIENT</a> to participate within the mission.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Client</span>
<span class="types"><a class="type" href="../classes/CLIENT.html#">CLIENT</a></span>
is the <a href="../classes/CLIENT.html#">CLIENT</a> object. The object must have been instantiated with <a href="../classes/CLIENT.html#CLIENT:New">CLIENT:New</a>.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/CLIENT.html#">CLIENT</a></span>
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">
Add a number of Client objects to the Mission.
Mission:AddClient( CLIENT:New( <span class="string">'US UH-1H*HOT-Deploy Troops 1'</span>, <span class="string">'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.'</span> ):Transport() )
Mission:AddClient( CLIENT:New( <span class="string">'US UH-1H*RAMP-Deploy Troops 3'</span>, <span class="string">'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.'</span> ):Transport() )
Mission:AddClient( CLIENT:New( <span class="string">'US UH-1H*HOT-Deploy Troops 2'</span>, <span class="string">'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.'</span> ):Transport() )
Mission:AddClient( CLIENT:New( <span class="string">'US UH-1H*RAMP-Deploy Troops 4'</span>, <span class="string">'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.'</span> ):Transport() )</pre>
</ul>
</dd>
<dt>
<a name = "MISSION:FindClient"></a>
<strong>MISSION:FindClient (ClientName)</strong>
</dt>
<dd>
Find a <a href="../classes/CLIENT.html#">CLIENT</a> object within the <a href="../classes/MISSION.html#">MISSION</a> by its ClientName.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">ClientName</span>
<span class="types"><a class="type" href="../classes/CLIENT.html#">CLIENT</a></span>
is a string defining the Client Group as defined within the ME.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/CLIENT.html#">CLIENT</a></span>
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- Seach for Client "Bomber" within the Mission.
</span> <span class="keyword">local</span> BomberClient = Mission:FindClient( <span class="string">"Bomber"</span> )</pre>
</ul>
</dd>
<dt>
<a name = "MISSION:AddTask"></a>
<strong>MISSION:AddTask (Task, TaskNumber)</strong>
</dt>
<dd>
Register a <a href="../classes/TASK.html#">TASK</a> to be completed within the <a href="../classes/MISSION.html#">MISSION</a>. Note that there can be multiple <a href="../classes/TASK.html#">TASK</a>s registered to be completed. Each TASK can be set a certain Goal. The MISSION will not be completed until all Goals are reached.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Task</span>
<span class="types"><a class="type" href="../classes/TASK.html#">TASK</a></span>
is the <a href="../classes/TASK.html#">TASK</a> object. The object must have been instantiated with <a href="../classes/TASK.html#TASK:New">TASK:New</a> or any of its inherited <a href="../classes/TASK.html#">TASK</a>s.
</li>
<li><span class="parameter">TaskNumber</span>
<span class="types"><span class="type">number</span></span>
is the sequence number of the TASK within the MISSION. This number does have to be chronological.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/TASK.html#">TASK</a></span>
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- Define a few tasks for the Mission.
</span> PickupZones = { <span class="string">"NATO Gold Pickup Zone"</span>, <span class="string">"NATO Titan Pickup Zone"</span> }
PickupSignalUnits = { <span class="string">"NATO Gold Coordination Center"</span>, <span class="string">"NATO Titan Coordination Center"</span> }
<span class="comment">-- Assign the Pickup Task
</span> <span class="keyword">local</span> PickupTask = PICKUPTASK:New( PickupZones, CARGO_TYPE.ENGINEERS, CLIENT.ONBOARDSIDE.LEFT )
PickupTask:AddSmokeBlue( PickupSignalUnits )
PickupTask:SetGoalTotal( <span class="number">3</span> )
Mission:AddTask( PickupTask, <span class="number">1</span> )
<span class="comment">-- Assign the Deploy Task
</span> <span class="keyword">local</span> PatriotActivationZones = { <span class="string">"US Patriot Battery 1 Activation"</span>, <span class="string">"US Patriot Battery 2 Activation"</span>, <span class="string">"US Patriot Battery 3 Activation"</span> }
<span class="keyword">local</span> PatriotActivationZonesSmokeUnits = { <span class="string">"US SAM Patriot - Battery 1 Control"</span>, <span class="string">"US SAM Patriot - Battery 2 Control"</span>, <span class="string">"US SAM Patriot - Battery 3 Control"</span> }
<span class="keyword">local</span> DeployTask = DEPLOYTASK:New( PatriotActivationZones, CARGO_TYPE.ENGINEERS )
<span class="comment">--DeployTask:SetCargoTargetZoneName( 'US Troops Attack ' .. math.random(2) )
</span> DeployTask:AddSmokeBlue( PatriotActivationZonesSmokeUnits )
DeployTask:SetGoalTotal( <span class="number">3</span> )
DeployTask:SetGoalTotal( <span class="number">3</span>, <span class="string">"Patriots activated"</span> )
Mission:AddTask( DeployTask, <span class="number">2</span> )</pre>
</ul>
</dd>
<dt>
<a name = "MISSION:GetTask"></a>
<strong>MISSION:GetTask (TaskNumber)</strong>
</dt>
<dd>
Get the TASK idenified by the TaskNumber from the Mission. This function is useful in GoalFunctions.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">TaskNumber</span>
<span class="types"><span class="type">number</span></span>
is the number of the <a href="../classes/TASK.html#">TASK</a> within the <a href="../classes/MISSION.html#">MISSION</a>.
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/TASK.html#">TASK</a></span>
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- Get Task 2 from the Mission.
</span> Task2 = Mission:GetTask( <span class="number">2</span> )</pre>
</ul>
</dd>
<dt>
<a name = "MISSION:GetTasks"></a>
<strong>MISSION:GetTasks ()</strong>
</dt>
<dd>
Get all the TASKs from the Mission. This function is useful in GoalFunctions.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../classes/TASK.html#">{TASK,...}</a></span>
Structure of TASKS with the <a href="../classes/TASK.html#">TASK</a> number as the key.
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- Get Tasks from the Mission.
</span> Tasks = Mission:GetTasks()
env.info( <span class="string">"Task 2 Completion = "</span> .. Tasks[<span class="number">2</span>]:GetGoalPercentage() .. <span class="string">"%"</span> )</pre>
</ul>
</dd>
</dl>
<h2><a name="Class_MISSIONSCHEDULER"></a>Class MISSIONSCHEDULER </h2>
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.
<dl class="function">
<dt>
<a name = "MISSIONSCHEDULER.Scheduler"></a>
<strong>MISSIONSCHEDULER.Scheduler ()</strong>
</dt>
<dd>
This is the main MISSIONSCHEDULER Scheduler function. It is considered internal and is automatically created when the Mission.lua file is included.
</dd>
<dt>
<a name = "MISSIONSCHEDULER.Start"></a>
<strong>MISSIONSCHEDULER.Start ()</strong>
</dt>
<dd>
Start the MISSIONSCHEDULER.
</dd>
<dt>
<a name = "MISSIONSCHEDULER.Stop"></a>
<strong>MISSIONSCHEDULER.Stop ()</strong>
</dt>
<dd>
Stop the MISSIONSCHEDULER.
</dd>
<dt>
<a name = "MISSIONSCHEDULER.AddMission"></a>
<strong>MISSIONSCHEDULER.AddMission (Mission)</strong>
</dt>
<dd>
This is the main MISSION declaration method. Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Mission</span>
is the MISSION object instantiated by <a href="../classes/MISSION.html#MISSION:New">MISSION:New</a>.
</li>
</ul>
<h3>Returns:</h3>
<ol>
MISSION
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- Declare a mission.
</span> Mission = MISSION:New( <span class="string">'Russia Transport Troops SA-6'</span>,
<span class="string">'Operational'</span>,
<span class="string">'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.'</span>,
<span class="string">'Russia'</span> )
MISSIONSCHEDULER:AddMission( Mission )</pre>
</ul>
</dd>
<dt>
<a name = "MISSIONSCHEDULER.RemoveMission"></a>
<strong>MISSIONSCHEDULER.RemoveMission (MissionName)</strong>
</dt>
<dd>
Remove a MISSION from the MISSIONSCHEDULER.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">MissionName</span>
is the name of the MISSION given at declaration using <a href="../classes/MISSION.html#MISSIONSCHEDULER.AddMission">AddMission</a>.
</li>
</ul>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- Declare a mission.
</span> Mission = MISSION:New( <span class="string">'Russia Transport Troops SA-6'</span>,
<span class="string">'Operational'</span>,
<span class="string">'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.'</span>,
<span class="string">'Russia'</span> )
MISSIONSCHEDULER:AddMission( Mission )
<span class="comment">-- Now remove the Mission.
</span> MISSIONSCHEDULER:RemoveMission( <span class="string">'Russia Transport Troops SA-6'</span> )</pre>
</ul>
</dd>
<dt>
<a name = "MISSIONSCHEDULER.FindMission"></a>
<strong>MISSIONSCHEDULER.FindMission (MissionName)</strong>
</dt>
<dd>
Find a MISSION within the MISSIONSCHEDULER.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">MissionName</span>
is the name of the MISSION given at declaration using <a href="../classes/MISSION.html#MISSIONSCHEDULER.AddMission">AddMission</a>.
</li>
</ul>
<h3>Returns:</h3>
<ol>
MISSION
</ol>
<h3>Usage:</h3>
<ul>
<pre class="example">
<span class="comment">-- Declare a mission.
</span> Mission = MISSION:New( <span class="string">'Russia Transport Troops SA-6'</span>,
<span class="string">'Operational'</span>,
<span class="string">'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.'</span>,
<span class="string">'Russia'</span> )
MISSIONSCHEDULER:AddMission( Mission )
<span class="comment">-- Now find the Mission.
</span> MissionFind = MISSIONSCHEDULER:FindMission( <span class="string">'Russia Transport Troops SA-6'</span> )</pre>
</ul>
</dd>
<dt>
<a name = "MISSIONSCHEDULER.ReportMenu"></a>
<strong>MISSIONSCHEDULER.ReportMenu ()</strong>
</dt>
<dd>
Enables a MENU option in the communications menu under F10 to control the status of the active missions.
This function should be called only once when starting the MISSIONSCHEDULER.
</dd>
<dt>
<a name = "MISSIONSCHEDULER:TimeShow"></a>
<strong>MISSIONSCHEDULER:TimeShow ()</strong>
</dt>
<dd>
Show the remaining mission time.
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.3</a></i>
<i style="float:right;">Last updated 2015-01-29 21:06:10 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>