Merge remote-tracking branch 'refs/remotes/origin/master' into FlightControl

# Conflicts:
#	Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
#	Moose Mission Setup/Moose.lua
#	Moose Test Missions/SCO - Scoring/SCO-100 - Scoring of Statics/SCO-100
- Scoring of Statics.miz
#	Moose Test Missions/SCO - Scoring/SCO-101 - Scoring Client to
Client/SCO-101 - Scoring Client to Client.miz
#	docs/Documentation/Point.html
This commit is contained in:
FlightControl 2017-03-06 12:28:27 +01:00
commit 8d73df48ce
12 changed files with 319 additions and 90 deletions

View File

@ -26,7 +26,11 @@
-- Note that the Set and Add methods return the current POINT_VEC3 object, so these manipulation methods can be chained... For example:
--
-- local Vec3 = PointVec3:AddX( 100 ):AddZ( 150 ):GetVec3()
--
--
-- ## 1.3) Create waypoints for routes
--
-- A POINT_VEC3 can prepare waypoints for Ground, Air and Naval groups to be embedded into a Route.
--
--
-- ## 1.5) Smoke, flare, explode, illuminate
--

View File

@ -1121,7 +1121,7 @@ function ESCORT:_FollowScheduler()
self:T( { "Client Speed, Escort Speed, Speed, FollowDistance, Time:", CS, GS, Speed, FollowDistance, Time } )
-- Now route the escort to the desired point with the desired speed.
self.EscortGroup:TaskRouteToVec3( GDV, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second)
self.EscortGroup:RouteToVec3( GDV, Speed / 3.6 ) -- DCS models speed in Mps (Miles per second)
end
return true

View File

@ -1442,7 +1442,7 @@ end
-- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format.
-- @param #number Speed The speed to travel.
-- @return #CONTROLLABLE self
function CONTROLLABLE:TaskRouteToVec2( Point, Speed )
function CONTROLLABLE:RouteToVec2( Point, Speed )
self:F2( { Point, Speed } )
local ControllablePoint = self:GetUnit( 1 ):GetVec2()
@ -1493,7 +1493,7 @@ end
-- @param Dcs.DCSTypes#Vec3 Point The destination point in Vec3 format.
-- @param #number Speed The speed to travel.
-- @return #CONTROLLABLE self
function CONTROLLABLE:TaskRouteToVec3( Point, Speed )
function CONTROLLABLE:RouteToVec3( Point, Speed )
self:F2( { Point, Speed } )
local ControllableVec3 = self:GetUnit( 1 ):GetVec3()

View File

@ -18,9 +18,9 @@ local CommandCenter = COMMANDCENTER:New( HQ, "Bravo" )
local Scoring = SCORING:New( "Shooting Range 1" )
Scoring:SetMultiplierDestroyScore( 10 )
Scoring:SetScaleDestroyScore( 10 )
Scoring:SetMultiplierDestroyPenalty( 40 )
Scoring:SetScaleDestroyPenalty( 40 )
Scoring:AddUnitScore( UNIT:FindByName( "Unit #001" ), 200 )
@ -35,4 +35,4 @@ Scoring:AddZoneScore( ShootingRangeZone, 200 )
local SceneryZone = ZONE:New( "ScoringZone2" )
Scoring:AddZoneScore( SceneryZone, 200 )
Scoring:AddStaticScore(STATIC:FindByName( "Shooting Range #010" ), 100 )

View File

@ -0,0 +1,139 @@
---
-- Name: SCO-500 - Scoring Multi Player Demo Mission 1
-- Author: Pikey and FlightControl
-- Date Created: 1 Mar 2017
--
-- # Situation:
--
-- A demo mission for the scoring. Read the briefing and have fun.
--
-- # Test cases:
--
-- 1. Observe the scoring granted to your flight when you hit and kill targets.
-- Define the patrol zones
local BlueCapZone = ZONE_POLYGON:New( "BlueCapZone", GROUP:FindByName( "Blue CAP Zone Patrol" ) )
local RedCapZone = ZONE_POLYGON:New( "RedCapZone", GROUP:FindByName( "Red CAP Zone Patrol" ) )
-- Define the engage zones
local BlueEngageZone = ZONE_POLYGON:New( "BlueEngageZone", GROUP:FindByName( "Blue CAP Zone Engage" ) )
local RedEngageZone = ZONE_POLYGON:New( "RedEngageZone", GROUP:FindByName( "Red CAP Zone Engage" ) )
-- Define the Spawn zones for ground vehicles
local BlueSpawnGroundZone = ZONE_POLYGON:New( "BlueSpawnGroundZone", GROUP:FindByName( "Blue Spawn Zone" ) )
--local RedSpawnGroundZone = ZONE_POLYGON:New( "RedSpawnGroundZone", GROUP:FindByName( "Red Spawn Zone" ) )
local RedSpawnGroundZone = ZONE:New( "Red Spawn Zone" )
-- Define the Scoring zones that define the shelters
local BlueShelterZone = ZONE_POLYGON:New( "Blue Shelters", GROUP:FindByName( "Blue Shelters" ) )
local RedShelterZone = ZONE_POLYGON:New( "Red Shelters", GROUP:FindByName( "Red Shelters" ) )
-- Define the Set of Clients that are used for the AI Balancers
local BluePlanesClientSet = SET_CLIENT:New():FilterCoalitions( "blue" ):FilterCategories( "plane" ):FilterPrefixes( "Blue Player")
local RedPlanesClientSet = SET_CLIENT:New():FilterCoalitions( "red" ):FilterCategories( "plane" ):FilterPrefixes( "Red Player")
-- Define the Spawn objects for the AI planes
local BluePlanesSpawn = SPAWN:New( "BlueAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
local RedPlanesSpawn = SPAWN:New( "RedAICAP" ):InitCleanUp( 120 ):InitLimit( 5, 0 )
-- Define the AI Balancers for the planes
local BlueAIB = AI_BALANCER:New( BluePlanesClientSet, BluePlanesSpawn ):InitSpawnInterval( 60, 1200 )
local RedAIB = AI_BALANCER:New( RedPlanesClientSet, RedPlanesSpawn ):InitSpawnInterval( 60, 1200 )
-- Define the Spawn objects for the airbase defenses
local BlueAirbaseDefense1Spawn = SPAWN:New( "Blue Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
local BlueAirbaseDefense2Spawn = SPAWN:New( "Blue Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
local RedAirbaseDefense1Spawn = SPAWN:New( "Red Airbase Defense 1" ):InitLimit( 10, 10 ):SpawnScheduled( 60, 0 )
local RedAirbaseDefense2Spawn = SPAWN:New( "Red Airbase Defense 2" ):InitLimit( 2, 10 ):SpawnScheduled( 60, 0 )
-- Define the ground forces spawning engines...
-- First define the template arrays.
local BlueGroundTemplates = { "Blue Ground Forces 1", "Blue Ground Forces 2", "Blue Ground Forces 3" }
local RedGroundTemplates = { "Red Ground Forces 2", "Red Ground Forces 2", "Red Ground Forces 3" }
-- New we are using these templates to define the spawn objects for the ground forces.
-- We spawn them at random places into the define zone.
local BlueGroundSpawn = SPAWN
:New( "Blue Ground Forces" )
:InitLimit( 12, 30 )
:InitRandomizeZones( { BlueSpawnGroundZone } )
:InitRandomizeTemplate( BlueGroundTemplates )
:SpawnScheduled( 60, 0.2 )
local RedGroundSpawn = SPAWN
:New( "Red Ground Forces" )
:InitLimit( 12, 30 )
:InitRandomizeTemplate( RedGroundTemplates )
:InitRandomizeZones( { RedSpawnGroundZone } )
:SpawnScheduled( 60, 0.2 )
local BlueCap = {}
local RedCap = {}
-- Define the OnAfterSpawned events of the AI balancer Spawn Groups
function BlueAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
if AIGroup then
BlueCap[AIGroup] = BlueCap[AIGroup] or AI_CAP_ZONE:New( BlueCapZone, 500, 3000, 450, 1200 )
local Cap = BlueCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
Cap:ManageFuel( 0.4, 180 )
Cap:SetEngageZone( BlueEngageZone )
Cap:SetControllable( AIGroup )
Cap:Start()
end
end
function RedAIB:OnAfterSpawned( SetGroup, From, Event, To, AIGroup )
if AIGroup then
RedCap[AIGroup] = RedCap[AIGroup] or AI_CAP_ZONE:New( RedCapZone, 500, 3000, 450, 1200 )
local Cap = RedCap[AIGroup] -- AI.AI_CAP#AI_CAP_ZONE
Cap:ManageFuel( 0.4, 180 )
Cap:SetEngageZone( BlueEngageZone )
Cap:SetControllable( AIGroup )
Cap:Start()
end
end
-- Okay, now that we defined all this stuff, now make the SCORING setup ...
-- First define a Scoring object
local Scoring = SCORING:New( "SCO-500 - Scoring Demonstration Mission" )
-- Define within the scoring the shelter designated targets.
Scoring:AddZoneScore( BlueShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
Scoring:AddZoneScore( RedShelterZone, 50 ) -- Per shelter destroyed, 50 extra points are granted.
-- Define the static objects that give extra scores
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 1"), 100 )
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 2"), 100 )
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 3"), 100 )
Scoring:AddStaticScore( STATIC:FindByName( "Red Factory 4"), 100 )
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #001"), 80 )
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #002"), 80 )
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #003"), 80 )
Scoring:AddStaticScore( STATIC:FindByName( "Red Truck #004"), 80 )
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 1" ), 100 )
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 2" ), 100 )
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 3" ), 100 )
Scoring:AddStaticScore( STATIC:FindByName( "Blue Factory 4" ), 100 )
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #001" ), 80 )
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #002" ), 80 )
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #003" ), 80 )
Scoring:AddStaticScore( STATIC:FindByName( "Blue Truck #004" ), 80 )
-- Scale the scoring rewarded.
Scoring:SetScaleDestroyScore( 30 )
Scoring:SetScaleDestroyPenalty( 90 ) -- Penalties are punished more than normal destroys.

View File

@ -881,6 +881,9 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<p> This table contains the targets detected during patrol.</p>
</dd>
</dl>
<dl class="function">

View File

@ -483,6 +483,18 @@ This is different from the EnRoute tasks, where the targets of the task need to
<td class="summary">
<p>(AIR) Return the Controllable to an <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>
A speed can be given in km/h.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).RouteToVec2">CONTROLLABLE:RouteToVec2(Point, Speed)</a></td>
<td class="summary">
<p>(AIR + GROUND) Make the Controllable move to fly to a given point.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).RouteToVec3">CONTROLLABLE:RouteToVec3(Point, Speed)</a></td>
<td class="summary">
<p>(AIR + GROUND) Make the Controllable move to a given point.</p>
</td>
</tr>
<tr>
@ -639,18 +651,6 @@ A speed can be given in km/h.</p>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskRoute">CONTROLLABLE:TaskRoute(Points)</a></td>
<td class="summary">
<p>Return a Misson task to follow a given route defined by Points.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskRouteToVec2">CONTROLLABLE:TaskRouteToVec2(Point, Speed)</a></td>
<td class="summary">
<p>(AIR + GROUND) Make the Controllable move to fly to a given point.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).TaskRouteToVec3">CONTROLLABLE:TaskRouteToVec3(Point, Speed)</a></td>
<td class="summary">
<p>(AIR + GROUND) Make the Controllable move to a given point.</p>
</td>
</tr>
<tr>
@ -1866,6 +1866,72 @@ The route</p>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).RouteToVec2" >
<strong>CONTROLLABLE:RouteToVec2(Point, Speed)</strong>
</a>
</dt>
<dd>
<p>(AIR + GROUND) Make the Controllable move to fly to a given point.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec3)">Dcs.DCSTypes#Vec3</a> Point </em></code>:
The destination point in Vec3 format.</p>
</li>
<li>
<p><code><em>#number Speed </em></code>:
The speed to travel.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(CONTROLLABLE)">#CONTROLLABLE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).RouteToVec3" >
<strong>CONTROLLABLE:RouteToVec3(Point, Speed)</strong>
</a>
</dt>
<dd>
<p>(AIR + GROUND) Make the Controllable move to a given point.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec3)">Dcs.DCSTypes#Vec3</a> Point </em></code>:
The destination point in Vec3 format.</p>
</li>
<li>
<p><code><em>#number Speed </em></code>:
The speed to travel.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(CONTROLLABLE)">#CONTROLLABLE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).SetCommand" >
<strong>CONTROLLABLE:SetCommand(DCSCommand)</strong>
</a>
@ -2896,72 +2962,6 @@ A table of route points.</p>
<p><em><a href="Dcs.DCSTasking.Task.html##(Task)">Dcs.DCSTasking.Task#Task</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).TaskRouteToVec2" >
<strong>CONTROLLABLE:TaskRouteToVec2(Point, Speed)</strong>
</a>
</dt>
<dd>
<p>(AIR + GROUND) Make the Controllable move to fly to a given point.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec3)">Dcs.DCSTypes#Vec3</a> Point </em></code>:
The destination point in Vec3 format.</p>
</li>
<li>
<p><code><em>#number Speed </em></code>:
The speed to travel.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(CONTROLLABLE)">#CONTROLLABLE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(CONTROLLABLE).TaskRouteToVec3" >
<strong>CONTROLLABLE:TaskRouteToVec3(Point, Speed)</strong>
</a>
</dt>
<dd>
<p>(AIR + GROUND) Make the Controllable move to a given point.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Vec3)">Dcs.DCSTypes#Vec3</a> Point </em></code>:
The destination point in Vec3 format.</p>
</li>
<li>
<p><code><em>#number Speed </em></code>:
The speed to travel.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(CONTROLLABLE)">#CONTROLLABLE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">

View File

@ -1542,7 +1542,7 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em>#string</em>
<em></em>
<a id="#(FSM)._StartState" >
<strong>FSM._StartState</strong>
</a>
@ -1841,6 +1841,7 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(FSM).current" >
<strong>FSM.current</strong>
</a>

View File

@ -2532,7 +2532,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function">
<dt>
<em>#boolean</em>
<em></em>
<a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong>
</a>

View File

@ -125,7 +125,7 @@ If the DCS Static object does not exist or is nil, the STATIC methods will retur
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(STATIC).FindByName">STATIC:FindByName(StaticName)</a></td>
<td class="name" nowrap="nowrap"><a href="##(STATIC).FindByName">STATIC:FindByName(StaticName, RaiseError)</a></td>
<td class="summary">
<p>Finds a STATIC from the _DATABASE using the relevant Static Name.</p>
</td>
@ -196,7 +196,7 @@ If the DCS Static object does not exist or is nil, the STATIC methods will retur
<dt>
<a id="#(STATIC).FindByName" >
<strong>STATIC:FindByName(StaticName)</strong>
<strong>STATIC:FindByName(StaticName, RaiseError)</strong>
</a>
</dt>
<dd>
@ -206,13 +206,19 @@ If the DCS Static object does not exist or is nil, the STATIC methods will retur
<p>As an optional parameter, a briefing text can be given also.</p>
<h3>Parameter</h3>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string StaticName </em></code>:
Name of the DCS <strong>Static</strong> as defined within the Mission Editor.</p>
</li>
<li>
<p><code><em>#boolean RaiseError </em></code>:
Raise an error if not found.</p>
</li>
</ul>
<h3>Return value</h3>

View File

@ -295,6 +295,12 @@ This class implements the inherited functions from <a href="Zone.html##(ZONE_RAD
<h2><a id="#(ZONE_BASE)">Type <code>ZONE_BASE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).BoundZone">ZONE_BASE:BoundZone()</a></td>
<td class="summary">
<p>Bound the zone boundaries with a tires.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).ClassName">ZONE_BASE.ClassName</a></td>
<td class="summary">
@ -479,6 +485,12 @@ This class implements the inherited functions from <a href="Zone.html##(ZONE_RAD
<h2><a id="#(ZONE_POLYGON_BASE)">Type <code>ZONE_POLYGON_BASE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON_BASE).BoundZone">ZONE_POLYGON_BASE:BoundZone()</a></td>
<td class="summary">
<p>Smokes the zone boundaries in a color.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_POLYGON_BASE).ClassName">ZONE_POLYGON_BASE.ClassName</a></td>
<td class="summary">
@ -531,6 +543,12 @@ This class implements the inherited functions from <a href="Zone.html##(ZONE_RAD
<h2><a id="#(ZONE_RADIUS)">Type <code>ZONE_RADIUS</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).BoundZone">ZONE_RADIUS:BoundZone(Points)</a></td>
<td class="summary">
<p>Bounds the zone with tires.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(ZONE_RADIUS).ClassName">ZONE_RADIUS.ClassName</a></td>
<td class="summary">
@ -821,6 +839,19 @@ The name of the zone as defined within the mission editor.</p>
<dl class="function">
<dt>
<a id="#(ZONE_BASE).BoundZone" >
<strong>ZONE_BASE:BoundZone()</strong>
</a>
</dt>
<dd>
<p>Bound the zone boundaries with a tires.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(ZONE_BASE).ClassName" >
<strong>ZONE_BASE.ClassName</strong>
@ -1420,6 +1451,24 @@ self</p>
<dl class="function">
<dt>
<a id="#(ZONE_POLYGON_BASE).BoundZone" >
<strong>ZONE_POLYGON_BASE:BoundZone()</strong>
</a>
</dt>
<dd>
<p>Smokes the zone boundaries in a color.</p>
<h3>Return value</h3>
<p><em><a href="##(ZONE_POLYGON_BASE)">#ZONE<em>POLYGON</em>BASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(ZONE_POLYGON_BASE).ClassName" >
<strong>ZONE_POLYGON_BASE.ClassName</strong>
@ -1608,6 +1657,33 @@ self</p>
<dl class="function">
<dt>
<a id="#(ZONE_RADIUS).BoundZone" >
<strong>ZONE_RADIUS:BoundZone(Points)</strong>
</a>
</dt>
<dd>
<p>Bounds the zone with tires.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Points </em></code>:
(optional) The amount of points in the circle.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(ZONE_RADIUS)">#ZONE_RADIUS</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(ZONE_RADIUS).ClassName" >
<strong>ZONE_RADIUS.ClassName</strong>