mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
851 lines
31 KiB
HTML
851 lines
31 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html>
|
|
<head>
|
|
<link rel="stylesheet" href="stylesheet.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>
|
|
<div id="main">
|
|
<div id="navigation">
|
|
<h2>Modules</h2>
|
|
<ul><li>
|
|
<a href="index.html">index</a>
|
|
</li></ul>
|
|
<ul>
|
|
<li><a href="AI_A2A.html">AI_A2A</a></li>
|
|
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
|
|
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
|
|
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
|
|
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
|
|
<li><a href="AI_Bai.html">AI_Bai</a></li>
|
|
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
|
|
<li><a href="AI_Cap.html">AI_Cap</a></li>
|
|
<li><a href="AI_Cas.html">AI_Cas</a></li>
|
|
<li><a href="AI_Formation.html">AI_Formation</a></li>
|
|
<li><a href="AI_Patrol.html">AI_Patrol</a></li>
|
|
<li><a href="ATC_Ground.html">ATC_Ground</a></li>
|
|
<li><a href="Account.html">Account</a></li>
|
|
<li><a href="Airbase.html">Airbase</a></li>
|
|
<li><a href="Assign.html">Assign</a></li>
|
|
<li><a href="Base.html">Base</a></li>
|
|
<li><a href="Cargo.html">Cargo</a></li>
|
|
<li><a href="CleanUp.html">CleanUp</a></li>
|
|
<li><a href="Client.html">Client</a></li>
|
|
<li><a href="CommandCenter.html">CommandCenter</a></li>
|
|
<li><a href="Controllable.html">Controllable</a></li>
|
|
<li><a href="DCSAirbase.html">DCSAirbase</a></li>
|
|
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
|
|
<li><a href="DCSCommand.html">DCSCommand</a></li>
|
|
<li><a href="DCSController.html">DCSController</a></li>
|
|
<li><a href="DCSGroup.html">DCSGroup</a></li>
|
|
<li><a href="DCSObject.html">DCSObject</a></li>
|
|
<li><a href="DCSTask.html">DCSTask</a></li>
|
|
<li><a href="DCSTypes.html">DCSTypes</a></li>
|
|
<li><a href="DCSUnit.html">DCSUnit</a></li>
|
|
<li><a href="DCSVec3.html">DCSVec3</a></li>
|
|
<li><a href="DCSWorld.html">DCSWorld</a></li>
|
|
<li><a href="DCSZone.html">DCSZone</a></li>
|
|
<li><a href="DCScountry.html">DCScountry</a></li>
|
|
<li><a href="DCStimer.html">DCStimer</a></li>
|
|
<li><a href="DCStrigger.html">DCStrigger</a></li>
|
|
<li><a href="Database.html">Database</a></li>
|
|
<li><a href="Designate.html">Designate</a></li>
|
|
<li><a href="Detection.html">Detection</a></li>
|
|
<li><a href="DetectionManager.html">DetectionManager</a></li>
|
|
<li><a href="Escort.html">Escort</a></li>
|
|
<li><a href="Event.html">Event</a></li>
|
|
<li><a href="Fsm.html">Fsm</a></li>
|
|
<li><a href="Goal.html">Goal</a></li>
|
|
<li><a href="Group.html">Group</a></li>
|
|
<li><a href="Identifiable.html">Identifiable</a></li>
|
|
<li><a href="Menu.html">Menu</a></li>
|
|
<li><a href="Message.html">Message</a></li>
|
|
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
|
|
<li><a href="Mission.html">Mission</a></li>
|
|
<li><a href="Movement.html">Movement</a></li>
|
|
<li><a href="Object.html">Object</a></li>
|
|
<li><a href="Point.html">Point</a></li>
|
|
<li><a href="Positionable.html">Positionable</a></li>
|
|
<li><a href="Process_JTAC.html">Process_JTAC</a></li>
|
|
<li><a href="Process_Pickup.html">Process_Pickup</a></li>
|
|
<li><a href="Protect.html">Protect</a></li>
|
|
<li><a href="Radio.html">Radio</a></li>
|
|
<li><a href="Rat.html">Rat</a></li>
|
|
<li><a href="Route.html">Route</a></li>
|
|
<li><a href="Scenery.html">Scenery</a></li>
|
|
<li><a href="ScheduleDispatcher.html">ScheduleDispatcher</a></li>
|
|
<li><a href="Scheduler.html">Scheduler</a></li>
|
|
<li><a href="Scoring.html">Scoring</a></li>
|
|
<li><a href="Sead.html">Sead</a></li>
|
|
<li><a href="Set.html">Set</a></li>
|
|
<li><a href="Settings.html">Settings</a></li>
|
|
<li><a href="Smoke.html">Smoke</a></li>
|
|
<li><a href="Spawn.html">Spawn</a></li>
|
|
<li><a href="SpawnStatic.html">SpawnStatic</a></li>
|
|
<li><a href="Spot.html">Spot</a></li>
|
|
<li><a href="Static.html">Static</a></li>
|
|
<li><a href="StaticObject.html">StaticObject</a></li>
|
|
<li><a href="Task.html">Task</a></li>
|
|
<li><a href="TaskZoneCapture.html">TaskZoneCapture</a></li>
|
|
<li><a href="Task_A2A.html">Task_A2A</a></li>
|
|
<li>Task_A2A_Dispatcher</li>
|
|
<li><a href="Task_A2G.html">Task_A2G</a></li>
|
|
<li><a href="Task_A2G_Dispatcher.html">Task_A2G_Dispatcher</a></li>
|
|
<li><a href="Task_Cargo.html">Task_Cargo</a></li>
|
|
<li><a href="Task_PICKUP.html">Task_PICKUP</a></li>
|
|
<li><a href="Unit.html">Unit</a></li>
|
|
<li><a href="UserFlag.html">UserFlag</a></li>
|
|
<li><a href="UserSound.html">UserSound</a></li>
|
|
<li><a href="Utils.html">Utils</a></li>
|
|
<li><a href="Velocity.html">Velocity</a></li>
|
|
<li><a href="Zone.html">Zone</a></li>
|
|
<li><a href="ZoneCaptureCoalition.html">ZoneCaptureCoalition</a></li>
|
|
<li><a href="ZoneGoal.html">ZoneGoal</a></li>
|
|
<li><a href="ZoneGoalCargo.html">ZoneGoalCargo</a></li>
|
|
<li><a href="ZoneGoalCoalition.html">ZoneGoalCoalition</a></li>
|
|
<li><a href="env.html">env</a></li>
|
|
<li><a href="land.html">land</a></li>
|
|
<li><a href="routines.html">routines</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="content">
|
|
<h1>Module <code>Task_A2A_Dispatcher</code></h1>
|
|
|
|
<p><strong>Tasking</strong> - The TASK<em>A2A</em>DISPATCHER creates and manages player TASK_A2A tasks based on detected targets.</p>
|
|
|
|
|
|
|
|
<p>The <a href="##(TASK_A2A_DISPATCHER)">#TASK<em>A2A</em>DISPATCHER</a> classes implement the dynamic dispatching of tasks upon groups of detected units determined a <a href="Set.html">Set</a> of EWR installation groups.</p>
|
|
|
|
<hr/>
|
|
|
|
<h3>Author: <strong>Sven Van de Velde (FlightControl)</strong></h3>
|
|
|
|
<h3>Contributions:</h3>
|
|
|
|
<hr/>
|
|
|
|
|
|
<h2>Global(s)</h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="#TASK_A2A_DISPATCHER">TASK_A2A_DISPATCHER</a></td>
|
|
<td class="summary">
|
|
<h1>TASK<em>A2A</em>DISPATCHER class, extends <a href="Tasking.html##(DETECTION_MANAGER)">Tasking#DETECTION_MANAGER</a></h1>
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia1.JPG" alt="Banner Image"/></p>
|
|
|
|
<p>The <a href="##(TASK_A2A_DISPATCHER)">#TASK<em>A2A</em>DISPATCHER</a> class implements the dynamic dispatching of tasks upon groups of detected units determined a <a href="Set.html">Set</a> of EWR installation groups.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a id="#(TASK_A2A_DISPATCHER)">Type <code>TASK_A2A_DISPATCHER</code></a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).Detection">TASK_A2A_DISPATCHER.Detection</a></td>
|
|
<td class="summary">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).EvaluateENGAGE">TASK_A2A_DISPATCHER:EvaluateENGAGE(DetectedItem)</a></td>
|
|
<td class="summary">
|
|
<p>Creates an ENGAGE task when there are human friendlies airborne near the targets.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).EvaluateINTERCEPT">TASK_A2A_DISPATCHER:EvaluateINTERCEPT(DetectedItem)</a></td>
|
|
<td class="summary">
|
|
<p>Creates an INTERCEPT task when there are targets for it.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).EvaluateRemoveTask">TASK_A2A_DISPATCHER:EvaluateRemoveTask(Mission, Task, Detection, DetectedItemID, DetectedItemChange, DetectedItem, DetectedItemIndex, DetectedItemChanged)</a></td>
|
|
<td class="summary">
|
|
<p>Evaluates the removal of the Task from the Mission.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).EvaluateSWEEP">TASK_A2A_DISPATCHER:EvaluateSWEEP(DetectedItem)</a></td>
|
|
<td class="summary">
|
|
<p>Creates an SWEEP task when there are targets for it.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).GetFriendliesNearBy">TASK_A2A_DISPATCHER:GetFriendliesNearBy(DetectedItem)</a></td>
|
|
<td class="summary">
|
|
<p>Calculates which friendlies are nearby the area</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).GetPlayerFriendliesNearBy">TASK_A2A_DISPATCHER:GetPlayerFriendliesNearBy(DetectedItem)</a></td>
|
|
<td class="summary">
|
|
<p>Calculates which HUMAN friendlies are nearby the area</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).Mission">TASK_A2A_DISPATCHER.Mission</a></td>
|
|
<td class="summary">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).New">TASK_A2A_DISPATCHER:New(Mission, SetGroup, Detection)</a></td>
|
|
<td class="summary">
|
|
<p>TASK<em>A2A</em>DISPATCHER constructor.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).OnAfterAssign">TASK_A2A_DISPATCHER:OnAfterAssign(From, Event, To, Task, TaskUnit, PlayerName)</a></td>
|
|
<td class="summary">
|
|
<p>OnAfter Transition Handler for Event Assign.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).ProcessDetected">TASK_A2A_DISPATCHER:ProcessDetected(Detection)</a></td>
|
|
<td class="summary">
|
|
<p>Assigns tasks in relation to the detected items to the <a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).RemoveTask">TASK_A2A_DISPATCHER:RemoveTask(TaskIndex)</a></td>
|
|
<td class="summary">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(TASK_A2A_DISPATCHER).SetEngageRadius">TASK_A2A_DISPATCHER:SetEngageRadius(EngageRadius)</a></td>
|
|
<td class="summary">
|
|
<p>Define the radius to when an ENGAGE task will be generated for any nearby by airborne friendlies, which are executing cap or returning from an intercept mission.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h2>Global(s)</h2>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<em><a href="##(TASK_A2A_DISPATCHER)">#TASK_A2A_DISPATCHER</a></em>
|
|
<a id="TASK_A2A_DISPATCHER" >
|
|
<strong>TASK_A2A_DISPATCHER</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<h1>TASK<em>A2A</em>DISPATCHER class, extends <a href="Tasking.html##(DETECTION_MANAGER)">Tasking#DETECTION_MANAGER</a></h1>
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia1.JPG" alt="Banner Image"/></p>
|
|
|
|
<p>The <a href="##(TASK_A2A_DISPATCHER)">#TASK<em>A2A</em>DISPATCHER</a> class implements the dynamic dispatching of tasks upon groups of detected units determined a <a href="Set.html">Set</a> of EWR installation groups.</p>
|
|
|
|
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia3.JPG" alt="Banner Image"/></p>
|
|
|
|
<p>The EWR will detect units, will group them, and will dispatch <a href="Task.html">Task</a>s to groups. Depending on the type of target detected, different tasks will be dispatched.
|
|
Find a summary below describing for which situation a task type is created:</p>
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia9.JPG" alt="Banner Image"/></p>
|
|
|
|
<ul>
|
|
<li><strong>INTERCEPT Task</strong>: Is created when the target is known, is detected and within a danger zone, and there is no friendly airborne in range.</li>
|
|
<li><strong>SWEEP Task</strong>: Is created when the target is unknown, was detected and the last position is only known, and within a danger zone, and there is no friendly airborne in range.</li>
|
|
<li><strong>ENGAGE Task</strong>: Is created when the target is known, is detected and within a danger zone, and there is a friendly airborne in range, that will receive this task.</li>
|
|
</ul>
|
|
|
|
<h2>1. TASK_A2A_DISPATCHER constructor:</h2>
|
|
|
|
<p>The <a href="##(TASK_A2A_DISPATCHER).New">TASK<em>A2A</em>DISPATCHER.New</a>() method creates a new TASK_A2A_DISPATCHER instance.</p>
|
|
|
|
<h3>1.1. Define or set the <strong>Mission</strong>:</h3>
|
|
|
|
<p>Tasking is executed to accomplish missions. Therefore, a MISSION object needs to be given as the first parameter.</p>
|
|
|
|
<pre><code>local HQ = GROUP:FindByName( "HQ", "Bravo" )
|
|
local CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
|
|
local Mission = MISSION:New( CommandCenter, "A2A Mission", "High", "Watch the air enemy units being detected.", coalition.side.RED )
|
|
</code></pre>
|
|
|
|
<p>Missions are governed by COMMANDCENTERS, so, ensure you have a COMMANDCENTER object installed and setup within your mission.
|
|
Create the MISSION object, and hook it under the command center.</p>
|
|
|
|
<h3>1.2. Build a set of the groups seated by human players:</h3>
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia6.JPG" alt="Banner Image"/></p>
|
|
|
|
<p>A set or collection of the groups wherein human players can be seated, these can be clients or units that can be joined as a slot or jumping into.</p>
|
|
|
|
<pre><code>local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Defender" ):FilterStart()
|
|
</code></pre>
|
|
|
|
<p>The set is built using the SET_GROUP class. Apply any filter criteria to identify the correct groups for your mission.
|
|
Only these slots or units will be able to execute the mission and will receive tasks for this mission, once available.</p>
|
|
|
|
<h3>1.3. Define the <strong>EWR network</strong>:</h3>
|
|
|
|
<p>As part of the TASK_A2A_DISPATCHER constructor, an EWR network must be given as the third parameter.
|
|
An EWR network, or, Early Warning Radar network, is used to early detect potential airborne targets and to understand the position of patrolling targets of the enemy.</p>
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia5.JPG" alt="Banner Image"/></p>
|
|
|
|
<p>Typically EWR networks are setup using 55G6 EWR, 1L13 EWR, Hawk sr and Patriot str ground based radar units.
|
|
These radars have different ranges and 55G6 EWR and 1L13 EWR radars are Eastern Bloc units (eg Russia, Ukraine, Georgia) while the Hawk and Patriot radars are Western (eg US).
|
|
Additionally, ANY other radar capable unit can be part of the EWR network! Also AWACS airborne units, planes, helicopters can help to detect targets, as long as they have radar.
|
|
The position of these units is very important as they need to provide enough coverage
|
|
to pick up enemy aircraft as they approach so that CAP and GCI flights can be tasked to intercept them.</p>
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia7.JPG" alt="Banner Image"/></p>
|
|
|
|
<p>Additionally in a hot war situation where the border is no longer respected the placement of radars has a big effect on how fast the war escalates.
|
|
For example if they are a long way forward and can detect enemy planes on the ground and taking off
|
|
they will start to vector CAP and GCI flights to attack them straight away which will immediately draw a response from the other coalition.
|
|
Having the radars further back will mean a slower escalation because fewer targets will be detected and
|
|
therefore less CAP and GCI flights will spawn and this will tend to make just the border area active rather than a melee over the whole map.
|
|
It all depends on what the desired effect is. </p>
|
|
|
|
<p>EWR networks are <strong>dynamically constructed</strong>, that is, they form part of the <a href="Functional.html##(DETECTION_BASE)">Functional#DETECTION_BASE</a> object that is given as the input parameter of the TASK_A2A_DISPATCHER class.
|
|
By defining in a <strong>smart way the names or name prefixes of the groups</strong> with EWR capable units, these groups will be <strong>automatically added or deleted</strong> from the EWR network,
|
|
increasing or decreasing the radar coverage of the Early Warning System.</p>
|
|
|
|
<p>See the following example to setup an EWR network containing EWR stations and AWACS.</p>
|
|
|
|
<pre><code>local EWRSet = SET_GROUP:New():FilterPrefixes( "EWR" ):FilterCoalitions("red"):FilterStart()
|
|
|
|
local EWRDetection = DETECTION_AREAS:New( EWRSet, 6000 )
|
|
EWRDetection:SetFriendliesRange( 10000 )
|
|
EWRDetection:SetRefreshTimeInterval(30)
|
|
|
|
-- Setup the A2A dispatcher, and initialize it.
|
|
A2ADispatcher = TASK_A2A_DISPATCHER:New( Mission, AttackGroups, EWRDetection )
|
|
</code></pre>
|
|
|
|
<p>The above example creates a SET_GROUP instance, and stores this in the variable (object) <strong>EWRSet</strong>.
|
|
<strong>EWRSet</strong> is then being configured to filter all active groups with a group name starting with <strong>EWR</strong> to be included in the Set.
|
|
<strong>EWRSet</strong> is then being ordered to start the dynamic filtering. Note that any destroy or new spawn of a group with the above names will be removed or added to the Set.
|
|
Then a new <strong>EWRDetection</strong> object is created from the class DETECTION_AREAS. A grouping radius of 6000 is choosen, which is 6km.
|
|
The <strong>EWRDetection</strong> object is then passed to the <a href="##(TASK_A2A_DISPATCHER).New">TASK<em>A2A</em>DISPATCHER.New</a>() method to indicate the EWR network configuration and setup the A2A tasking and detection mechanism.</p>
|
|
|
|
<h3>2. Define the detected <strong>target grouping radius</strong>:</h3>
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia8.JPG" alt="Banner Image"/></p>
|
|
|
|
<p>The target grouping radius is a property of the Detection object, that was passed to the AI_A2A_DISPATCHER object, but can be changed.
|
|
The grouping radius should not be too small, but also depends on the types of planes and the era of the simulation.
|
|
Fast planes like in the 80s, need a larger radius than WWII planes. <br/>
|
|
Typically I suggest to use 30000 for new generation planes and 10000 for older era aircraft.</p>
|
|
|
|
<p>Note that detected targets are constantly re-grouped, that is, when certain detected aircraft are moving further than the group radius, then these aircraft will become a separate
|
|
group being detected. This may result in additional GCI being started by the dispatcher! So don't make this value too small!</p>
|
|
|
|
<h2>3. Set the <strong>Engage radius</strong>:</h2>
|
|
|
|
<p>Define the radius to engage any target by airborne friendlies, which are executing cap or returning from an intercept mission.</p>
|
|
|
|
<p><img src="..\Presentations\TASK_A2A_DISPATCHER\Dia11.JPG" alt="Banner Image"/></p>
|
|
|
|
<p>So, if there is a target area detected and reported,
|
|
then any friendlies that are airborne near this target area,
|
|
will be commanded to (re-)engage that target when available (if no other tasks were commanded).
|
|
For example, if 100000 is given as a value, then any friendly that is airborne within 100km from the detected target,
|
|
will be considered to receive the command to engage that target area.
|
|
You need to evaluate the value of this parameter carefully.
|
|
If too small, more intercept missions may be triggered upon detected target areas.
|
|
If too large, any airborne cap may not be able to reach the detected target area in time, because it is too far.</p>
|
|
|
|
<h2>4. Set <strong>Scoring</strong> and <strong>Messages</strong>:</h2>
|
|
|
|
<p>The TASK_A2A_DISPATCHER is a state machine. It triggers the event Assign when a new player joins a <a href="Task.html">Task</a> dispatched by the TASK_A2A_DISPATCHER.
|
|
An <em>event handler</em> can be defined to catch the <strong>Assign</strong> event, and add <strong>additional processing</strong> to set <em>scoring</em> and to <em>define messages</em>,
|
|
when the player reaches certain achievements in the task.</p>
|
|
|
|
<p>The prototype to handle the <strong>Assign</strong> event needs to be developed as follows:</p>
|
|
|
|
<pre><code> TaskDispatcher = TASK_A2A_DISPATCHER:New( ... )
|
|
|
|
--- @param #TaskDispatcher self
|
|
-- @param #string From Contains the name of the state from where the Event was triggered.
|
|
-- @param #string Event Contains the name of the event that was triggered. In this case Assign.
|
|
-- @param #string To Contains the name of the state that will be transitioned to.
|
|
-- @param Tasking.Task_A2A#TASK_A2A Task The Task object, which is any derived object from TASK_A2A.
|
|
-- @param Wrapper.Unit#UNIT TaskUnit The Unit or Client that contains the Player.
|
|
-- @param #string PlayerName The name of the Player that joined the TaskUnit.
|
|
function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName )
|
|
Task:SetScoreOnProgress( PlayerName, 20, TaskUnit )
|
|
Task:SetScoreOnSuccess( PlayerName, 200, TaskUnit )
|
|
Task:SetScoreOnFail( PlayerName, -100, TaskUnit )
|
|
end
|
|
</code></pre>
|
|
|
|
<p>The <strong>OnAfterAssign</strong> method (function) is added to the TaskDispatcher object.
|
|
This method will be called when a new player joins a unit in the set of groups in scope of the dispatcher.
|
|
So, this method will be called only <strong>ONCE</strong> when a player joins a unit in scope of the task.</p>
|
|
|
|
<p>The TASK class implements various methods to additional <strong>set scoring</strong> for player achievements:</p>
|
|
|
|
<ul>
|
|
<li><p><a href="Tasking.Task.html##(TASK).SetScoreOnProgress">Tasking.Task#TASK.SetScoreOnProgress</a>() will add additional scores when a player achieves <strong>Progress</strong> while executing the task.
|
|
Examples of <strong>task progress</strong> can be destroying units, arriving at zones etc.</p></li>
|
|
<li><p><a href="Tasking.Task.html##(TASK).SetScoreOnSuccess">Tasking.Task#TASK.SetScoreOnSuccess</a>() will add additional scores when the task goes into <strong>Success</strong> state.
|
|
This means the <strong>task has been successfully completed</strong>.</p></li>
|
|
<li><p><a href="Tasking.Task.html##(TASK).SetScoreOnSuccess">Tasking.Task#TASK.SetScoreOnSuccess</a>() will add additional (negative) scores when the task goes into <strong>Failed</strong> state.
|
|
This means the <strong>task has not been successfully completed</strong>, and the scores must be given with a negative value!</p></li>
|
|
</ul>
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2><a id="#(Task_A2A_Dispatcher)" >Type <code>Task_A2A_Dispatcher</code></a></h2>
|
|
|
|
<h2><a id="#(TASK_A2A_DISPATCHER)" >Type <code>TASK_A2A_DISPATCHER</code></a></h2>
|
|
|
|
<p>TASK<em>A2A</em>DISPATCHER class.</p>
|
|
|
|
<h3>Field(s)</h3>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<em></em>
|
|
<a id="#(TASK_A2A_DISPATCHER).Detection" >
|
|
<strong>TASK_A2A_DISPATCHER.Detection</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).EvaluateENGAGE" >
|
|
<strong>TASK_A2A_DISPATCHER:EvaluateENGAGE(DetectedItem)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Creates an ENGAGE task when there are human friendlies airborne near the targets.</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em><a href="Functional.Detection.html##(DETECTION_BASE.DetectedItem)">Functional.Detection#DETECTION_BASE.DetectedItem</a> DetectedItem </em></code>: </p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return values</h3>
|
|
<ol>
|
|
<li>
|
|
|
|
<p><em><a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a>:</em>
|
|
TargetSetUnit: The target set of units.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><em>#nil:</em>
|
|
If there are no targets to be set.</p>
|
|
|
|
</li>
|
|
</ol>
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).EvaluateINTERCEPT" >
|
|
<strong>TASK_A2A_DISPATCHER:EvaluateINTERCEPT(DetectedItem)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Creates an INTERCEPT task when there are targets for it.</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em><a href="Functional.Detection.html##(DETECTION_BASE.DetectedItem)">Functional.Detection#DETECTION_BASE.DetectedItem</a> DetectedItem </em></code>: </p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return values</h3>
|
|
<ol>
|
|
<li>
|
|
|
|
<p><em><a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a>:</em>
|
|
TargetSetUnit: The target set of units.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><em>#nil:</em>
|
|
If there are no targets to be set.</p>
|
|
|
|
</li>
|
|
</ol>
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).EvaluateRemoveTask" >
|
|
<strong>TASK_A2A_DISPATCHER:EvaluateRemoveTask(Mission, Task, Detection, DetectedItemID, DetectedItemChange, DetectedItem, DetectedItemIndex, DetectedItemChanged)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Evaluates the removal of the Task from the Mission.</p>
|
|
|
|
|
|
<p>Can only occur when the DetectedItem is Changed AND the state of the Task is "Planned".</p>
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em><a href="Tasking.Mission.html##(MISSION)">Tasking.Mission#MISSION</a> Mission </em></code>: </p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em><a href="Tasking.Task.html##(TASK)">Tasking.Task#TASK</a> Task </em></code>: </p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em><a href="Functional.Detection.html##(DETECTION_BASE)">Functional.Detection#DETECTION_BASE</a> Detection </em></code>:
|
|
The detection created by the <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a> derived object.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#boolean DetectedItemID </em></code>: </p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#boolean DetectedItemChange </em></code>: </p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em> DetectedItem </em></code>: </p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em> DetectedItemIndex </em></code>: </p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em> DetectedItemChanged </em></code>: </p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return value</h3>
|
|
|
|
<p><em><a href="Tasking.Task.html##(TASK)">Tasking.Task#TASK</a>:</em></p>
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).EvaluateSWEEP" >
|
|
<strong>TASK_A2A_DISPATCHER:EvaluateSWEEP(DetectedItem)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Creates an SWEEP task when there are targets for it.</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em><a href="Functional.Detection.html##(DETECTION_BASE.DetectedItem)">Functional.Detection#DETECTION_BASE.DetectedItem</a> DetectedItem </em></code>: </p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return values</h3>
|
|
<ol>
|
|
<li>
|
|
|
|
<p><em><a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a>:</em>
|
|
TargetSetUnit: The target set of units.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><em>#nil:</em>
|
|
If there are no targets to be set.</p>
|
|
|
|
</li>
|
|
</ol>
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).GetFriendliesNearBy" >
|
|
<strong>TASK_A2A_DISPATCHER:GetFriendliesNearBy(DetectedItem)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Calculates which friendlies are nearby the area</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em> DetectedItem </em></code>: </p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return value</h3>
|
|
|
|
<p><em>#number, <a href="Core.CommandCenter.html##(REPORT)">Core.CommandCenter#REPORT</a>:</em></p>
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).GetPlayerFriendliesNearBy" >
|
|
<strong>TASK_A2A_DISPATCHER:GetPlayerFriendliesNearBy(DetectedItem)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Calculates which HUMAN friendlies are nearby the area</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em> DetectedItem </em></code>: </p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return value</h3>
|
|
|
|
<p><em>#number, <a href="Core.CommandCenter.html##(REPORT)">Core.CommandCenter#REPORT</a>:</em></p>
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<em></em>
|
|
<a id="#(TASK_A2A_DISPATCHER).Mission" >
|
|
<strong>TASK_A2A_DISPATCHER.Mission</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).New" >
|
|
<strong>TASK_A2A_DISPATCHER:New(Mission, SetGroup, Detection)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>TASK<em>A2A</em>DISPATCHER constructor.</p>
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em><a href="Tasking.Mission.html##(MISSION)">Tasking.Mission#MISSION</a> Mission </em></code>:
|
|
The mission for which the task dispatching is done.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em><a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a> SetGroup </em></code>:
|
|
The set of groups that can join the tasks within the mission.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em><a href="Functional.Detection.html##(DETECTION_BASE)">Functional.Detection#DETECTION_BASE</a> Detection </em></code>:
|
|
The detection results that are used to dynamically assign new tasks to human players.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return value</h3>
|
|
|
|
<p><em><a href="##(TASK_A2A_DISPATCHER)">#TASK<em>A2A</em>DISPATCHER</a>:</em>
|
|
self</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).OnAfterAssign" >
|
|
<strong>TASK_A2A_DISPATCHER:OnAfterAssign(From, Event, To, Task, TaskUnit, PlayerName)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>OnAfter Transition Handler for Event Assign.</p>
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em>#string From </em></code>:
|
|
The From State string.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#string Event </em></code>:
|
|
The Event string.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#string To </em></code>:
|
|
The To State string.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em><a href="Tasking.Task_A2A.html##(TASK_A2A)">Tasking.Task<em>A2A#TASK</em>A2A</a> Task </em></code>: </p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em><a href="Wrapper.Unit.html##(UNIT)">Wrapper.Unit#UNIT</a> TaskUnit </em></code>: </p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#string PlayerName </em></code>: </p>
|
|
|
|
</li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).ProcessDetected" >
|
|
<strong>TASK_A2A_DISPATCHER:ProcessDetected(Detection)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Assigns tasks in relation to the detected items to the <a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a>.</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em><a href="Functional.Detection.html##(DETECTION_BASE)">Functional.Detection#DETECTION_BASE</a> Detection </em></code>:
|
|
The detection created by the <a href="Detection.html##(DETECTION_BASE)">Detection#DETECTION_BASE</a> derived object.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return value</h3>
|
|
|
|
<p><em>#boolean:</em>
|
|
Return true if you want the task assigning to continue... false will cancel the loop.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).RemoveTask" >
|
|
<strong>TASK_A2A_DISPATCHER:RemoveTask(TaskIndex)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em> TaskIndex </em></code>: </p>
|
|
|
|
</li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(TASK_A2A_DISPATCHER).SetEngageRadius" >
|
|
<strong>TASK_A2A_DISPATCHER:SetEngageRadius(EngageRadius)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Define the radius to when an ENGAGE task will be generated for any nearby by airborne friendlies, which are executing cap or returning from an intercept mission.</p>
|
|
|
|
|
|
<p>So, if there is a target area detected and reported,
|
|
then any friendlies that are airborne near this target area,
|
|
will be commanded to (re-)engage that target when available (if no other tasks were commanded).
|
|
An ENGAGE task will be created for those pilots.
|
|
For example, if 100000 is given as a value, then any friendly that is airborne within 100km from the detected target,
|
|
will be considered to receive the command to engage that target area.
|
|
You need to evaluate the value of this parameter carefully.
|
|
If too small, more intercept missions may be triggered upon detected target areas.
|
|
If too large, any airborne cap may not be able to reach the detected target area in time, because it is too far.</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em>#number EngageRadius </em></code>:
|
|
(Optional, Default = 100000) The radius to report friendlies near the target.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return value</h3>
|
|
|
|
<p><em><a href="##(TASK_A2A_DISPATCHER)">#TASK<em>A2A</em>DISPATCHER</a>:</em></p>
|
|
|
|
|
|
<h3>Usage:</h3>
|
|
<pre class="example"><code>
|
|
-- Set 50km as the radius to engage any target by airborne friendlies.
|
|
TaskA2ADispatcher:SetEngageRadius( 50000 )
|
|
|
|
-- Set 100km as the radius to engage any target by airborne friendlies.
|
|
TaskA2ADispatcher:SetEngageRadius() -- 100000 is the default value.
|
|
</code></pre>
|
|
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|