mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
Working
This commit is contained in:
parent
96546e21f5
commit
ff69012c8d
@ -1657,55 +1657,6 @@ function CONTROLLABLE:TaskRouteToZone( Zone, Randomize, Speed, Formation )
|
||||
return nil
|
||||
end
|
||||
|
||||
--- (AIR) Return the Controllable to an @{Airbase#AIRBASE}
|
||||
-- A speed can be given in km/h.
|
||||
-- A given formation can be given.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param Wrapper.Airbase#AIRBASE ReturnAirbase (optional) The @{Airbase#AIRBASE} to return to. If blank, the controllable will return to the nearest friendly airbase.
|
||||
-- @param #number Speed (optional) The speed.
|
||||
-- @return #CONTROLLABLE
|
||||
function CONTROLLABLE:RouteReturnToAirbase( ReturnAirbase, Speed )
|
||||
self:F2( { ReturnAirbase, Speed } )
|
||||
|
||||
local DCSControllable = self:GetDCSObject()
|
||||
|
||||
if DCSControllable then
|
||||
|
||||
if ReturnAirbase then
|
||||
local ControllablePoint = self:GetVec2()
|
||||
local ControllableVelocity = self:GetMaxVelocity()
|
||||
|
||||
local PointFrom = {}
|
||||
PointFrom.x = ControllablePoint.x
|
||||
PointFrom.y = ControllablePoint.y
|
||||
PointFrom.type = "Turning Point"
|
||||
PointFrom.action = "Turning Point"
|
||||
PointFrom.speed = ControllableVelocity
|
||||
|
||||
|
||||
local PointTo = {}
|
||||
local AirbasePointVec2 = ReturnAirbase:GetPointVec2()
|
||||
local AirbaseAirPoint = AirbasePointVec2:RoutePointAir(
|
||||
POINT_VEC3.RoutePointAltType.BARO,
|
||||
POINT_VEC3.RoutePointType.TurningPoint,
|
||||
POINT_VEC3.RoutePointAction.TurningPoint,
|
||||
Speed or 600
|
||||
)
|
||||
|
||||
self:E(AirbaseAirPoint )
|
||||
|
||||
local Points = { PointFrom, AirbaseAirPoint }
|
||||
|
||||
self:T3( Points )
|
||||
|
||||
self:Route( Points )
|
||||
else
|
||||
self:ClearTasks()
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
-- Commands
|
||||
|
||||
@ -1746,6 +1697,8 @@ function CONTROLLABLE:GetTaskRoute()
|
||||
return routines.utils.deepCopy( _DATABASE.Templates.Controllables[self.ControllableName].Template.route.points )
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- Return the route of a controllable by using the @{Database#DATABASE} class.
|
||||
-- @param #CONTROLLABLE self
|
||||
-- @param #number Begin The route point from where the copy will start. The base route point is 0.
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
--- This module contains the GROUP class.
|
||||
--
|
||||
-- 1) @{Group#GROUP} class, extends @{Controllable#CONTROLLABLE}
|
||||
-- =============================================================
|
||||
-- The @{Group#GROUP} class is a wrapper class to handle the DCS Group objects:
|
||||
-- The @{#GROUP} class is a wrapper class to handle the DCS Group objects:
|
||||
--
|
||||
-- * Support all DCS Group APIs.
|
||||
-- * Enhance with Group specific APIs not in the DCS Group API set.
|
||||
@ -11,60 +9,8 @@
|
||||
--
|
||||
-- **IMPORTANT: ONE SHOULD NEVER SANATIZE these GROUP OBJECT REFERENCES! (make the GROUP object references nil).**
|
||||
--
|
||||
-- 1.1) GROUP reference methods
|
||||
-- -----------------------
|
||||
-- For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the _@{DATABASE} object.
|
||||
-- This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Group objects are spawned (using the @{SPAWN} class).
|
||||
--
|
||||
-- The GROUP class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference
|
||||
-- using the DCS Group or the DCS GroupName.
|
||||
--
|
||||
-- Another thing to know is that GROUP objects do not "contain" the DCS Group object.
|
||||
-- The GROUP methods will reference the DCS Group object by name when it is needed during API execution.
|
||||
-- If the DCS Group object does not exist or is nil, the GROUP methods will return nil and log an exception in the DCS.log file.
|
||||
--
|
||||
-- The GROUP class provides the following functions to retrieve quickly the relevant GROUP instance:
|
||||
--
|
||||
-- * @{#GROUP.Find}(): Find a GROUP instance from the _DATABASE object using a DCS Group object.
|
||||
-- * @{#GROUP.FindByName}(): Find a GROUP instance from the _DATABASE object using a DCS Group name.
|
||||
--
|
||||
-- ## 1.2) GROUP task methods
|
||||
--
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} task methods section for a description of the task methods.
|
||||
--
|
||||
-- ### 1.2.4) Obtain the mission from group templates
|
||||
-- See the detailed documentation on the GROUP class.
|
||||
--
|
||||
-- Group templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a group and assign it to another:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.TaskMission}: (AIR + GROUND) Return a mission task from a mission template.
|
||||
--
|
||||
-- ## 1.3) GROUP Command methods
|
||||
--
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} command methods section for a description of the command methods.
|
||||
--
|
||||
-- ## 1.4) GROUP option methods
|
||||
--
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} option methods section for a description of the option methods.
|
||||
--
|
||||
-- ## 1.5) GROUP Zone validation methods
|
||||
--
|
||||
-- The group can be validated whether it is completely, partly or not within a @{Zone}.
|
||||
-- Use the following Zone validation methods on the group:
|
||||
--
|
||||
-- * @{#GROUP.IsCompletelyInZone}: Returns true if all units of the group are within a @{Zone}.
|
||||
-- * @{#GROUP.IsPartlyInZone}: Returns true if some units of the group are within a @{Zone}.
|
||||
-- * @{#GROUP.IsNotInZone}: Returns true if none of the group units of the group are within a @{Zone}.
|
||||
--
|
||||
-- The zone can be of any @{Zone} class derived from @{Zone#ZONE_BASE}. So, these methods are polymorphic to the zones tested on.
|
||||
--
|
||||
-- ## 1.6) GROUP AI methods
|
||||
--
|
||||
-- A GROUP has AI methods to control the AI activation.
|
||||
--
|
||||
-- * @{#GROUP.SetAIOnOff}(): Turns the GROUP AI On or Off.
|
||||
-- * @{#GROUP.SetAIOn}(): Turns the GROUP AI On.
|
||||
-- * @{#GROUP.SetAIOff}(): Turns the GROUP AI Off.
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- # **API CHANGE HISTORY**
|
||||
@ -100,10 +46,68 @@
|
||||
-- @module Group
|
||||
-- @author FlightControl
|
||||
|
||||
--- The GROUP class
|
||||
-- @type GROUP
|
||||
--- @type GROUP
|
||||
-- @extends Wrapper.Controllable#CONTROLLABLE
|
||||
-- @field #string GroupName The name of the group.
|
||||
|
||||
---
|
||||
-- # GROUP class, extends @{Controllable#CONTROLLABLE}
|
||||
--
|
||||
-- ## GROUP reference methods
|
||||
--
|
||||
-- For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the _@{DATABASE} object.
|
||||
-- This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Group objects are spawned (using the @{SPAWN} class).
|
||||
--
|
||||
-- The GROUP class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference
|
||||
-- using the DCS Group or the DCS GroupName.
|
||||
--
|
||||
-- Another thing to know is that GROUP objects do not "contain" the DCS Group object.
|
||||
-- The GROUP methods will reference the DCS Group object by name when it is needed during API execution.
|
||||
-- If the DCS Group object does not exist or is nil, the GROUP methods will return nil and log an exception in the DCS.log file.
|
||||
--
|
||||
-- The GROUP class provides the following functions to retrieve quickly the relevant GROUP instance:
|
||||
--
|
||||
-- * @{#GROUP.Find}(): Find a GROUP instance from the _DATABASE object using a DCS Group object.
|
||||
-- * @{#GROUP.FindByName}(): Find a GROUP instance from the _DATABASE object using a DCS Group name.
|
||||
--
|
||||
-- ## GROUP task methods
|
||||
--
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} task methods section for a description of the task methods.
|
||||
--
|
||||
-- ### Obtain the mission from group templates
|
||||
--
|
||||
-- Group templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a group and assign it to another:
|
||||
--
|
||||
-- * @{Controllable#CONTROLLABLE.TaskMission}: (AIR + GROUND) Return a mission task from a mission template.
|
||||
--
|
||||
-- ## GROUP Command methods
|
||||
--
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} command methods section for a description of the command methods.
|
||||
--
|
||||
-- ## GROUP option methods
|
||||
--
|
||||
-- A GROUP is a @{Controllable}. See the @{Controllable} option methods section for a description of the option methods.
|
||||
--
|
||||
-- ## GROUP Zone validation methods
|
||||
--
|
||||
-- The group can be validated whether it is completely, partly or not within a @{Zone}.
|
||||
-- Use the following Zone validation methods on the group:
|
||||
--
|
||||
-- * @{#GROUP.IsCompletelyInZone}: Returns true if all units of the group are within a @{Zone}.
|
||||
-- * @{#GROUP.IsPartlyInZone}: Returns true if some units of the group are within a @{Zone}.
|
||||
-- * @{#GROUP.IsNotInZone}: Returns true if none of the group units of the group are within a @{Zone}.
|
||||
--
|
||||
-- The zone can be of any @{Zone} class derived from @{Zone#ZONE_BASE}. So, these methods are polymorphic to the zones tested on.
|
||||
--
|
||||
-- ## GROUP AI methods
|
||||
--
|
||||
-- A GROUP has AI methods to control the AI activation.
|
||||
--
|
||||
-- * @{#GROUP.SetAIOnOff}(): Turns the GROUP AI On or Off.
|
||||
-- * @{#GROUP.SetAIOn}(): Turns the GROUP AI On.
|
||||
-- * @{#GROUP.SetAIOff}(): Turns the GROUP AI Off.
|
||||
--
|
||||
-- @field #GROUP GROUP
|
||||
GROUP = {
|
||||
ClassName = "GROUP",
|
||||
}
|
||||
@ -895,6 +899,76 @@ function GROUP:InAir()
|
||||
return nil
|
||||
end
|
||||
|
||||
do -- Route methods
|
||||
|
||||
--- (AIR) Return the Group to an @{Airbase#AIRBASE}.
|
||||
-- The following things are to be taken into account:
|
||||
--
|
||||
-- * The group is respawned to achieve the RTB, there may be side artefacts as a result of this. (Like weapons suddenly come back).
|
||||
-- * A group consisting out of more than one unit, may rejoin formation when respawned.
|
||||
-- * A speed can be given in km/h. If no speed is specified, the maximum speed of the first unit will be taken to return to base.
|
||||
-- * When there is no @{Airbase} object specified, the group will return to the home base if the route of the group is pinned at take-off or at landing to a base.
|
||||
-- * When there is no @{Airbase} object specified and the group route is not pinned to any airbase, it will return to the nearest airbase.
|
||||
--
|
||||
-- @param #GROUP self
|
||||
-- @param Wrapper.Airbase#AIRBASE RTBAirbase (optional) The @{Airbase} to return to. If blank, the controllable will return to the nearest friendly airbase.
|
||||
-- @param #number Speed (optional) The Speed, if no Speed is given, the maximum Speed of the first unit is selected.
|
||||
-- @return #GROUP
|
||||
function GROUP:RouteRTB( RTBAirbase, Speed )
|
||||
self:F2( { RTBAirbase, Speed } )
|
||||
|
||||
local DCSGroup = self:GetDCSObject()
|
||||
|
||||
if DCSGroup then
|
||||
|
||||
if RTBAirbase then
|
||||
|
||||
local GroupPoint = self:GetVec2()
|
||||
local GroupVelocity = self:GetUnit(1):GetDesc().speedMax
|
||||
|
||||
local PointFrom = {}
|
||||
PointFrom.x = GroupPoint.x
|
||||
PointFrom.y = GroupPoint.y
|
||||
PointFrom.type = "Turning Point"
|
||||
PointFrom.action = "Turning Point"
|
||||
PointFrom.speed = GroupVelocity
|
||||
|
||||
|
||||
local PointTo = {}
|
||||
local AirbasePointVec2 = RTBAirbase:GetPointVec2()
|
||||
local AirbaseAirPoint = AirbasePointVec2:RoutePointAir(
|
||||
POINT_VEC3.RoutePointAltType.BARO,
|
||||
"Land",
|
||||
"Landing",
|
||||
Speed or self:GetUnit(1):GetDesc().speedMax
|
||||
)
|
||||
|
||||
AirbaseAirPoint["airdromeId"] = RTBAirbase:GetID()
|
||||
AirbaseAirPoint["speed_locked"] = true,
|
||||
|
||||
self:E(AirbaseAirPoint )
|
||||
|
||||
local Points = { PointFrom, AirbaseAirPoint }
|
||||
|
||||
self:T3( Points )
|
||||
|
||||
local Template = self:GetTemplate()
|
||||
Template.route.points = Points
|
||||
self:Respawn( Template )
|
||||
|
||||
self:Route( Points )
|
||||
|
||||
self:Respawn(Template)
|
||||
else
|
||||
self:ClearTasks()
|
||||
end
|
||||
end
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function GROUP:OnReSpawn( ReSpawnFunction )
|
||||
|
||||
self.ReSpawnFunction = ReSpawnFunction
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -5,31 +5,30 @@
|
||||
--
|
||||
-- # Situation:
|
||||
-- Three air units are flying and are commanded to return a specific airbase.
|
||||
-- The return commands are given after 10 seconds.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the Air1 group return to Batumi.
|
||||
-- 2. Observe the Air2 group returning to Sochi.
|
||||
-- 3. Observe the Air3 group returning to the nearest airbase after 120 seconds.
|
||||
-- 1. Observe the Air1 group return to Batumi after 10 seconds.
|
||||
-- 2. Observe the Air2 group returning to Kobuleti after 300 seconds. (It was planned to land at Kutaisi).
|
||||
-- 3. Observe the Air3 group returning to the home (landing) airbase after 300 seconds. (It was planned to land at Kutaisi).
|
||||
--
|
||||
|
||||
--- @param Wrapper.Group#GROUP AirGroup
|
||||
function ReturnToBatumi( AirGroup )
|
||||
BASE:E("ReturnToBatumi")
|
||||
AirGroup:RouteReturnToAirbase( AIRBASE:FindByName("Batumi") )
|
||||
AirGroup:RouteRTB( AIRBASE:FindByName("Batumi") )
|
||||
end
|
||||
|
||||
--- @param Wrapper.Group#GROUP AirGroup
|
||||
function ReturnToSochi( AirGroup )
|
||||
BASE:E("ReturnToSochi")
|
||||
AirGroup:RouteReturnToAirbase( AIRBASE:FindByName("Sochi-Adler") )
|
||||
function ReturnToKobuleti( AirGroup )
|
||||
BASE:E("ReturnToKobuleti")
|
||||
AirGroup:RouteRTB( AIRBASE:FindByName("Kobuleti") )
|
||||
end
|
||||
|
||||
--- @param Wrapper.Group#GROUP AirGroup
|
||||
function ReturnToNearest( AirGroup )
|
||||
BASE:E("ReturnToHomeBase")
|
||||
AirGroup:RouteReturnToAirbase()
|
||||
function ReturnToHome( AirGroup )
|
||||
BASE:E("ReturnToHome")
|
||||
AirGroup:RouteRTB()
|
||||
end
|
||||
|
||||
Air1Group = GROUP:FindByName( "Air1" )
|
||||
@ -38,8 +37,8 @@ Air3Group = GROUP:FindByName( "Air3" )
|
||||
|
||||
Scheduler = SCHEDULER:New( nil )
|
||||
ScheduleIDAir1 = Scheduler:Schedule(nil, ReturnToBatumi, { Air1Group }, 10 )
|
||||
ScheduleIDAir2 = Scheduler:Schedule(nil, ReturnToSochi, { Air2Group }, 120 )
|
||||
ScheduleIDAir3 = Scheduler:Schedule(nil, ReturnToNearest, { Air3Group }, 120 )
|
||||
ScheduleIDAir2 = Scheduler:Schedule(nil, ReturnToKobuleti, { Air2Group }, 300 )
|
||||
ScheduleIDAir3 = Scheduler:Schedule(nil, ReturnToHome, { Air3Group }, 300 )
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@ -913,6 +913,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">
|
||||
|
||||
@ -2426,6 +2426,7 @@ The UNIT carrying the package.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(AI_CARGO_UNIT).CargoCarrier" >
|
||||
<strong>AI_CARGO_UNIT.CargoCarrier</strong>
|
||||
</a>
|
||||
|
||||
@ -483,13 +483,6 @@ This is different from the EnRoute tasks, where the targets of the task need to
|
||||
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).Route">CONTROLLABLE:Route(GoPoints)</a></td>
|
||||
<td class="summary">
|
||||
<p>Make the controllable to follow a given route.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(CONTROLLABLE).RouteReturnToAirbase">CONTROLLABLE:RouteReturnToAirbase(ReturnAirbase, Speed)</a></td>
|
||||
<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>
|
||||
@ -1862,43 +1855,6 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(CONTROLLABLE).RouteReturnToAirbase" >
|
||||
<strong>CONTROLLABLE:RouteReturnToAirbase(ReturnAirbase, Speed)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>(AIR) Return the Controllable to an <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>
|
||||
A speed can be given in km/h.</p>
|
||||
|
||||
|
||||
<p>A given formation can be given.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a> ReturnAirbase </em></code>:
|
||||
The <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a> to return to.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number Speed </em></code>:
|
||||
(optional) The speed.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#string:</em>
|
||||
The route</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(CONTROLLABLE).RouteToVec2" >
|
||||
<strong>CONTROLLABLE:RouteToVec2(Point, Speed)</strong>
|
||||
</a>
|
||||
|
||||
@ -2112,7 +2112,6 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(DETECTION_BASE).DetectedItemCount" >
|
||||
<strong>DETECTION_BASE.DetectedItemCount</strong>
|
||||
</a>
|
||||
@ -2240,7 +2239,7 @@ self</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<em></em>
|
||||
<a id="#(DETECTION_BASE).DetectionInterval" >
|
||||
<strong>DETECTION_BASE.DetectionInterval</strong>
|
||||
</a>
|
||||
|
||||
@ -77,8 +77,7 @@
|
||||
|
||||
|
||||
|
||||
<h1>1) <a href="Group.html##(GROUP)">Group#GROUP</a> class, extends <a href="Controllable.html##(CONTROLLABLE)">Controllable#CONTROLLABLE</a></h1>
|
||||
<p>The <a href="Group.html##(GROUP)">Group#GROUP</a> class is a wrapper class to handle the DCS Group objects:</p>
|
||||
<p>The <a href="##(GROUP)">#GROUP</a> class is a wrapper class to handle the DCS Group objects:</p>
|
||||
|
||||
<ul>
|
||||
<li>Support all DCS Group APIs.</li>
|
||||
@ -89,66 +88,7 @@
|
||||
|
||||
<p><strong>IMPORTANT: ONE SHOULD NEVER SANATIZE these GROUP OBJECT REFERENCES! (make the GROUP object references nil).</strong></p>
|
||||
|
||||
<h2>1.1) GROUP reference methods</h2>
|
||||
<p>For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the _<a href="DATABASE.html">DATABASE</a> object.
|
||||
This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Group objects are spawned (using the <a href="SPAWN.html">SPAWN</a> class).</p>
|
||||
|
||||
<p>The GROUP class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference
|
||||
using the DCS Group or the DCS GroupName.</p>
|
||||
|
||||
<p>Another thing to know is that GROUP objects do not "contain" the DCS Group object.
|
||||
The GROUP methods will reference the DCS Group object by name when it is needed during API execution.
|
||||
If the DCS Group object does not exist or is nil, the GROUP methods will return nil and log an exception in the DCS.log file.</p>
|
||||
|
||||
<p>The GROUP class provides the following functions to retrieve quickly the relevant GROUP instance:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).Find">GROUP.Find</a>(): Find a GROUP instance from the _DATABASE object using a DCS Group object.</li>
|
||||
<li><a href="##(GROUP).FindByName">GROUP.FindByName</a>(): Find a GROUP instance from the _DATABASE object using a DCS Group name.</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.2) GROUP task methods</h2>
|
||||
|
||||
<p>A GROUP is a <a href="Controllable.html">Controllable</a>. See the <a href="Controllable.html">Controllable</a> task methods section for a description of the task methods.</p>
|
||||
|
||||
<h3>1.2.4) Obtain the mission from group templates</h3>
|
||||
|
||||
<p>Group templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a group and assign it to another:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="Controllable.html##(CONTROLLABLE).TaskMission">Controllable#CONTROLLABLE.TaskMission</a>: (AIR + GROUND) Return a mission task from a mission template.</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.3) GROUP Command methods</h2>
|
||||
|
||||
<p>A GROUP is a <a href="Controllable.html">Controllable</a>. See the <a href="Controllable.html">Controllable</a> command methods section for a description of the command methods.</p>
|
||||
|
||||
<h2>1.4) GROUP option methods</h2>
|
||||
|
||||
<p>A GROUP is a <a href="Controllable.html">Controllable</a>. See the <a href="Controllable.html">Controllable</a> option methods section for a description of the option methods.</p>
|
||||
|
||||
<h2>1.5) GROUP Zone validation methods</h2>
|
||||
|
||||
<p>The group can be validated whether it is completely, partly or not within a <a href="Zone.html">Zone</a>.
|
||||
Use the following Zone validation methods on the group:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).IsCompletelyInZone">GROUP.IsCompletelyInZone</a>: Returns true if all units of the group are within a <a href="Zone.html">Zone</a>.</li>
|
||||
<li><a href="##(GROUP).IsPartlyInZone">GROUP.IsPartlyInZone</a>: Returns true if some units of the group are within a <a href="Zone.html">Zone</a>.</li>
|
||||
<li><a href="##(GROUP).IsNotInZone">GROUP.IsNotInZone</a>: Returns true if none of the group units of the group are within a <a href="Zone.html">Zone</a>.</li>
|
||||
</ul>
|
||||
|
||||
<p>The zone can be of any <a href="Zone.html">Zone</a> class derived from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>. So, these methods are polymorphic to the zones tested on.</p>
|
||||
|
||||
<h2>1.6) GROUP AI methods</h2>
|
||||
|
||||
<p>A GROUP has AI methods to control the AI activation.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).SetAIOnOff">GROUP.SetAIOnOff</a>(): Turns the GROUP AI On or Off.</li>
|
||||
<li><a href="##(GROUP).SetAIOn">GROUP.SetAIOn</a>(): Turns the GROUP AI On.</li>
|
||||
<li><a href="##(GROUP).SetAIOff">GROUP.SetAIOff</a>(): Turns the GROUP AI Off.</li>
|
||||
</ul>
|
||||
<p>See the detailed documentation on the GROUP class.</p>
|
||||
|
||||
<hr/>
|
||||
|
||||
@ -194,7 +134,11 @@ Use the following Zone validation methods on the group:</p>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="#GROUP">GROUP</a></td>
|
||||
<td class="summary">
|
||||
<h1>GROUP class, extends <a href="Controllable.html##(CONTROLLABLE)">Controllable#CONTROLLABLE</a></h1>
|
||||
|
||||
<h2>GROUP reference methods</h2>
|
||||
|
||||
<p>For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the _<a href="DATABASE.html">DATABASE</a> object.</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -216,12 +160,6 @@ Use the following Zone validation methods on the group:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).CalculateThreatLevelA2G">GROUP:CalculateThreatLevelA2G()</a></td>
|
||||
<td class="summary">
|
||||
<p>Calculate the maxium A2G threat level of the Group.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).ClassName">GROUP.ClassName</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -470,6 +408,12 @@ Use the following Zone validation methods on the group:</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).Respawn">GROUP:Respawn(Template)</a></td>
|
||||
<td class="summary">
|
||||
<p>Respawn the <a href="GROUP.html">GROUP</a> using a (tweaked) template of the Group.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).RouteRTB">GROUP:RouteRTB(RTBAirbase, Speed)</a></td>
|
||||
<td class="summary">
|
||||
<p>(AIR) Return the Group to an <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -527,6 +471,71 @@ Use the following Zone validation methods on the group:</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<h1>GROUP class, extends <a href="Controllable.html##(CONTROLLABLE)">Controllable#CONTROLLABLE</a></h1>
|
||||
|
||||
<h2>GROUP reference methods</h2>
|
||||
|
||||
<p>For each DCS Group object alive within a running mission, a GROUP wrapper object (instance) will be created within the _<a href="DATABASE.html">DATABASE</a> object.</p>
|
||||
|
||||
|
||||
<p>This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Group objects are spawned (using the <a href="SPAWN.html">SPAWN</a> class).</p>
|
||||
|
||||
<p>The GROUP class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference
|
||||
using the DCS Group or the DCS GroupName.</p>
|
||||
|
||||
<p>Another thing to know is that GROUP objects do not "contain" the DCS Group object.
|
||||
The GROUP methods will reference the DCS Group object by name when it is needed during API execution.
|
||||
If the DCS Group object does not exist or is nil, the GROUP methods will return nil and log an exception in the DCS.log file.</p>
|
||||
|
||||
<p>The GROUP class provides the following functions to retrieve quickly the relevant GROUP instance:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).Find">GROUP.Find</a>(): Find a GROUP instance from the _DATABASE object using a DCS Group object.</li>
|
||||
<li><a href="##(GROUP).FindByName">GROUP.FindByName</a>(): Find a GROUP instance from the _DATABASE object using a DCS Group name.</li>
|
||||
</ul>
|
||||
|
||||
<h2>GROUP task methods</h2>
|
||||
|
||||
<p>A GROUP is a <a href="Controllable.html">Controllable</a>. See the <a href="Controllable.html">Controllable</a> task methods section for a description of the task methods.</p>
|
||||
|
||||
<h3>Obtain the mission from group templates</h3>
|
||||
|
||||
<p>Group templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a group and assign it to another:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="Controllable.html##(CONTROLLABLE).TaskMission">Controllable#CONTROLLABLE.TaskMission</a>: (AIR + GROUND) Return a mission task from a mission template.</li>
|
||||
</ul>
|
||||
|
||||
<h2>GROUP Command methods</h2>
|
||||
|
||||
<p>A GROUP is a <a href="Controllable.html">Controllable</a>. See the <a href="Controllable.html">Controllable</a> command methods section for a description of the command methods.</p>
|
||||
|
||||
<h2>GROUP option methods</h2>
|
||||
|
||||
<p>A GROUP is a <a href="Controllable.html">Controllable</a>. See the <a href="Controllable.html">Controllable</a> option methods section for a description of the option methods.</p>
|
||||
|
||||
<h2>GROUP Zone validation methods</h2>
|
||||
|
||||
<p>The group can be validated whether it is completely, partly or not within a <a href="Zone.html">Zone</a>.
|
||||
Use the following Zone validation methods on the group:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).IsCompletelyInZone">GROUP.IsCompletelyInZone</a>: Returns true if all units of the group are within a <a href="Zone.html">Zone</a>.</li>
|
||||
<li><a href="##(GROUP).IsPartlyInZone">GROUP.IsPartlyInZone</a>: Returns true if some units of the group are within a <a href="Zone.html">Zone</a>.</li>
|
||||
<li><a href="##(GROUP).IsNotInZone">GROUP.IsNotInZone</a>: Returns true if none of the group units of the group are within a <a href="Zone.html">Zone</a>.</li>
|
||||
</ul>
|
||||
|
||||
<p>The zone can be of any <a href="Zone.html">Zone</a> class derived from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>. So, these methods are polymorphic to the zones tested on.</p>
|
||||
|
||||
<h2>GROUP AI methods</h2>
|
||||
|
||||
<p>A GROUP has AI methods to control the AI activation.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).SetAIOnOff">GROUP.SetAIOnOff</a>(): Turns the GROUP AI On or Off.</li>
|
||||
<li><a href="##(GROUP).SetAIOn">GROUP.SetAIOn</a>(): Turns the GROUP AI On.</li>
|
||||
<li><a href="##(GROUP).SetAIOff">GROUP.SetAIOff</a>(): Turns the GROUP AI Off.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</dd>
|
||||
@ -534,10 +543,7 @@ Use the following Zone validation methods on the group:</p>
|
||||
<h2><a id="#(Group)" >Type <code>Group</code></a></h2>
|
||||
|
||||
<h2><a id="#(GROUP)" >Type <code>GROUP</code></a></h2>
|
||||
|
||||
<p>The GROUP class</p>
|
||||
|
||||
<h3>Field(s)</h3>
|
||||
<h3>Field(s)</h3>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
@ -583,20 +589,6 @@ All units on the ground result.</p>
|
||||
|
||||
<p>Calculate the maxium A2G threat level of the Group.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#string</em>
|
||||
<a id="#(GROUP).ClassName" >
|
||||
<strong>GROUP.ClassName</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -1541,6 +1533,51 @@ The template of the Group retrieved with GROUP:GetTemplate()</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).RouteRTB" >
|
||||
<strong>GROUP:RouteRTB(RTBAirbase, Speed)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>(AIR) Return the Group to an <a href="Airbase.html##(AIRBASE)">Airbase#AIRBASE</a>.</p>
|
||||
|
||||
|
||||
<p>The following things are to be taken into account:</p>
|
||||
|
||||
<ul>
|
||||
<li>The group is respawned to achieve the RTB, there may be side artefacts as a result of this. (Like weapons suddenly come back).</li>
|
||||
<li>A group consisting out of more than one unit, may rejoin formation when respawned.</li>
|
||||
<li>A speed can be given in km/h. If no speed is specified, the maximum speed of the first unit will be taken to return to base.</li>
|
||||
<li>When there is no <a href="Airbase.html">Airbase</a> object specified, the group will return to the home base if the route of the group is pinned at take-off or at landing to a base.</li>
|
||||
<li>When there is no <a href="Airbase.html">Airbase</a> object specified and the group route is not pinned to any airbase, it will return to the nearest airbase.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Wrapper.Airbase.html##(AIRBASE)">Wrapper.Airbase#AIRBASE</a> RTBAirbase </em></code>:
|
||||
(optional) The <a href="Airbase.html">Airbase</a> to return to. If blank, the controllable will return to the nearest friendly airbase.</p>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em>#number Speed </em></code>:
|
||||
(optional) The Speed, if no Speed is given, the maximum Speed of the first unit is selected. </p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em><a href="##(GROUP)">#GROUP</a>:</em></p>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).SetAIOff" >
|
||||
<strong>GROUP:SetAIOff()</strong>
|
||||
</a>
|
||||
|
||||
@ -191,7 +191,6 @@ on defined intervals (currently every minute).</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em>#number</em>
|
||||
<a id="#(MOVEMENT).AliveUnits" >
|
||||
<strong>MOVEMENT.AliveUnits</strong>
|
||||
</a>
|
||||
@ -200,9 +199,6 @@ on defined intervals (currently every minute).</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Contains the counter how many units are currently alive</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
|
||||
@ -872,12 +872,6 @@ and any spaces before and after the resulting name are removed.</p>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPAWN)._TranslateRotate">SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(SPAWN).uncontrolled">SPAWN.uncontrolled</a></td>
|
||||
<td class="summary">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@ -1865,6 +1859,9 @@ The group that was spawned. You can use this group for further actions.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2332,6 +2329,9 @@ when nothing was spawned.</p>
|
||||
|
||||
|
||||
|
||||
|
||||
<p> By default, no InitLimit</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -2367,7 +2367,7 @@ when nothing was spawned.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<em>#number</em>
|
||||
<a id="#(SPAWN).SpawnMaxGroups" >
|
||||
<strong>SPAWN.SpawnMaxGroups</strong>
|
||||
</a>
|
||||
@ -2384,7 +2384,7 @@ when nothing was spawned.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<em>#number</em>
|
||||
<a id="#(SPAWN).SpawnMaxUnitsAlive" >
|
||||
<strong>SPAWN.SpawnMaxUnitsAlive</strong>
|
||||
</a>
|
||||
@ -3292,20 +3292,6 @@ True = Continue Scheduler</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<em></em>
|
||||
<a id="#(SPAWN).uncontrolled" >
|
||||
<strong>SPAWN.uncontrolled</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user