mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Documentation + Zone functions
Implemented zone functions for GROUP and UNIT Documentation improvement for GROUP, UNIT, CLIENT.
This commit is contained in:
parent
64f67e2ae0
commit
0d42c1670e
@ -1,10 +1,10 @@
|
||||
--- The CLIENT models client units in multi player missions.
|
||||
--- This module contains the CLIENT class.
|
||||
--
|
||||
-- @{#CLIENT} class
|
||||
-- ================
|
||||
-- 1) @{Client#CLIENT} class, extends @{Unit#UNIT}
|
||||
-- ===============================================
|
||||
-- Clients are those **Units** defined within the Mission Editor that have the skillset defined as __Client__ or __Player__.
|
||||
-- Note that clients are NOT the same as Units, they are NOT necessarily alive.
|
||||
-- The @{CLIENT} class is a wrapper class to handle the DCS Unit objects that have the skillset defined as __Client__ or __Player__:
|
||||
-- The @{Client#CLIENT} class is a wrapper class to handle the DCS Unit objects that have the skillset defined as __Client__ or __Player__:
|
||||
--
|
||||
-- * Wraps the DCS Unit objects with skill level set to Player or Client.
|
||||
-- * Support all DCS Unit APIs.
|
||||
@ -15,8 +15,8 @@
|
||||
--
|
||||
-- Clients are being used by the @{MISSION} class to follow players and register their successes.
|
||||
--
|
||||
-- CLIENT reference methods
|
||||
-- =======================
|
||||
-- 1.1) CLIENT reference methods
|
||||
-- -----------------------------
|
||||
-- For each DCS Unit having skill level Player or Client, a CLIENT wrapper object (instance) will be created within the _@{DATABASE} object.
|
||||
-- This is done at the beginning of the mission (when the mission starts).
|
||||
--
|
||||
|
||||
@ -1,17 +1,18 @@
|
||||
--- GROUP class.
|
||||
--
|
||||
-- @{GROUP} class
|
||||
-- ==============
|
||||
-- The @{GROUP} class is a wrapper class to handle the DCS Group objects:
|
||||
--- This module contains the GROUP class.
|
||||
--
|
||||
-- 1) @{Group#GROUP} class, extends @{Base#BASE}
|
||||
-- =============================================
|
||||
-- The @{Group#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.
|
||||
-- * Handle local Group Controller.
|
||||
-- * Manage the "state" of the DCS Group.
|
||||
--
|
||||
-- **IMPORTANT: ONE SHOULD NEVER SANATIZE these GROUP OBJECT REFERENCES! (make the GROUP object references nil).**
|
||||
--
|
||||
-- GROUP reference methods
|
||||
-- =======================
|
||||
-- 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).
|
||||
--
|
||||
@ -27,7 +28,121 @@
|
||||
-- * @{#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.
|
||||
--
|
||||
-- IMPORTANT: ONE SHOULD NEVER SANATIZE these GROUP OBJECT REFERENCES! (make the GROUP object references nil).
|
||||
-- 1.2) GROUP task methods
|
||||
-- -----------------------
|
||||
-- Several group task methods are available that help you to prepare tasks.
|
||||
-- These methods return a string consisting of the task description, which can then be given to either a @{Group#GROUP.PushTask} or @{Group#SetTask} method to assign the task to the GROUP.
|
||||
-- Tasks are specific for the category of the GROUP, more specific, for AIR, GROUND or AIR and GROUND.
|
||||
-- Each task description where applicable indicates for which group category the task is valid.
|
||||
-- There are 2 main subdivisions of tasks: Assigned tasks and EnRoute tasks.
|
||||
--
|
||||
-- ### 1.2.1) Assigned task methods
|
||||
--
|
||||
-- Assigned task methods make the group execute the task where the location of the (possible) targets of the task are known before being detected.
|
||||
-- This is different from the EnRoute tasks, where the targets of the task need to be detected before the task can be executed.
|
||||
--
|
||||
-- Find below a list of the **assigned task** methods:
|
||||
--
|
||||
-- * @{#GROUP.TaskAttackGroup}: (AIR) Attack a Group.
|
||||
-- * @{#GROUP.TaskAttackMapObject}: (AIR) Attacking the map object (building, structure, e.t.c).
|
||||
-- * @{#GROUP.TaskAttackUnit}: (AIR) Attack the Unit.
|
||||
-- * @{#GROUP.TaskBombing}: (AIR) Delivering weapon at the point on the ground.
|
||||
-- * @{#GROUP.TaskBombingRunway}: (AIR) Delivering weapon on the runway.
|
||||
-- * @{#GROUP.TaskEmbarking}: (AIR) Move the group to a Vec2 Point, wait for a defined duration and embark a group.
|
||||
-- * @{#GROUP.TaskEmbarkToTransport}: (GROUND) Embark to a Transport landed at a location.
|
||||
-- * @{#GROUP.TaskEscort}: (AIR) Escort another airborne group.
|
||||
-- * @{#GROUP.TaskFAC_AttackGroup}: (AIR + GROUND) The task makes the group/unit a FAC and orders the FAC to control the target (enemy ground group) destruction.
|
||||
-- * @{#GROUP.TaskFireAtPoint}: (GROUND) Fire at a VEC2 point until ammunition is finished.
|
||||
-- * @{#GROUP.TaskFollow}: (AIR) Following another airborne group.
|
||||
-- * @{#GROUP.TaskHold}: (GROUND) Hold ground group from moving.
|
||||
-- * @{#GROUP.TaskHoldPosition}: (AIR) Hold position at the current position of the first unit of the group.
|
||||
-- * @{#GROUP.TaskLand}: (AIR HELICOPTER) Landing at the ground. For helicopters only.
|
||||
-- * @{#GROUP.TaskLandAtZone}: (AIR) Land the group at a @{Zone#ZONE_RADIUS).
|
||||
-- * @{#GROUP.TaskOrbitCircle}: (AIR) Orbit at the current position of the first unit of the group at a specified alititude.
|
||||
-- * @{#GROUP.TaskOrbitCircleAtVec2}: (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.
|
||||
-- * @{#GROUP.TaskRefueling}: (AIR) Refueling from the nearest tanker. No parameters.
|
||||
-- * @{#GROUP.TaskRoute}: (AIR + GROUND) Return a Misson task to follow a given route defined by Points.
|
||||
-- * @{#GROUP.TaskRouteToVec2}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{#GROUP.TaskRouteToVec3}: (AIR + GROUND) Make the Group move to a given point.
|
||||
-- * @{#GROUP.TaskRouteToZone}: (AIR + GROUND) Route the group to a given zone.
|
||||
--
|
||||
-- ### 1.2.2) EnRoute task methods
|
||||
--
|
||||
-- EnRoute tasks require the targets of the task need to be detected by the group (using its sensors) before the task can be executed:
|
||||
--
|
||||
-- * @{#GROUP.EnRouteTaskAWACS}: (AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts). No parameters.
|
||||
-- * @{#GROUP.EnRouteTaskEngageGroup}: (AIR) Engaging a group. The task does not assign the target group to the unit/group to attack now; it just allows the unit/group to engage the target group as well as other assigned targets.
|
||||
-- * @{#GROUP.EnRouteTaskEngageTargets}: (AIR) Engaging targets of defined types.
|
||||
-- * @{#GROUP.EnRouteTaskEWR}: (AIR) Attack the Unit.
|
||||
-- * @{#GROUP.EnRouteTaskFAC}: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose a targets (enemy ground group) around as well as other assigned targets.
|
||||
-- * @{#GROUP.EnRouteTaskFAC_EngageGroup}: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose the target (enemy ground group) as well as other assigned targets.
|
||||
-- * @{#GROUP.EnRouteTaskTanker}: (AIR) Aircraft will act as a tanker for friendly units. No parameters.
|
||||
--
|
||||
-- ### 1.2.3) Preparation task methods
|
||||
--
|
||||
-- There are certain task methods that allow to tailor the task behaviour:
|
||||
--
|
||||
-- * @{#GROUP.TaskWrappedAction}: Return a WrappedAction Task taking a Command.
|
||||
-- * @{#GROUP.TaskCombo}: Return a Combo Task taking an array of Tasks.
|
||||
-- * @{#GROUP.TaskCondition}: Return a condition section for a controlled task.
|
||||
-- * @{#GROUP.TaskControlled}: Return a Controlled Task taking a Task and a TaskCondition.
|
||||
--
|
||||
-- ### 1.2.4) 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:
|
||||
--
|
||||
-- * @{#GROUP.TaskMission}: (AIR + GROUND) Return a mission task from a mission template.
|
||||
--
|
||||
-- 1.3) GROUP Command methods
|
||||
-- --------------------------
|
||||
-- Group **command methods** prepare the execution of commands using the @{#GROUP.SetCommand} method:
|
||||
--
|
||||
-- * @{#GROUP.CommandDoScript}: Do Script command.
|
||||
-- * @{#GROUP.CommandSwitchWayPoint}: Perform a switch waypoint command.
|
||||
--
|
||||
-- 1.4) GROUP Option methods
|
||||
-- -------------------------
|
||||
-- Group **Option methods** change the behaviour of the Group while being alive.
|
||||
--
|
||||
-- ### 1.4.1) Rule of Engagement:
|
||||
--
|
||||
-- * @{#GROUP.OptionROEWeaponFree}
|
||||
-- * @{#GROUP.OptionROEOpenFire}
|
||||
-- * @{#GROUP.OptionROEReturnFire}
|
||||
-- * @{#GROUP.OptionROEEvadeFire}
|
||||
--
|
||||
-- To check whether an ROE option is valid for a specific group, use:
|
||||
--
|
||||
-- * @{#GROUP.OptionROEWeaponFreePossible}
|
||||
-- * @{#GROUP.OptionROEOpenFirePossible}
|
||||
-- * @{#GROUP.OptionROEReturnFirePossible}
|
||||
-- * @{#GROUP.OptionROEEvadeFirePossible}
|
||||
--
|
||||
-- ### 1.4.2) Rule on thread:
|
||||
--
|
||||
-- * @{#GROUP.OptionROTNoReaction}
|
||||
-- * @{#GROUP.OptionROTPassiveDefense}
|
||||
-- * @{#GROUP.OptionROTEvadeFire}
|
||||
-- * @{#GROUP.OptionROTVertical}
|
||||
--
|
||||
-- To test whether an ROT option is valid for a specific group, use:
|
||||
--
|
||||
-- * @{#GROUP.OptionROTNoReactionPossible}
|
||||
-- * @{#GROUP.OptionROTPassiveDefensePossible}
|
||||
-- * @{#GROUP.OptionROTEvadeFirePossible}
|
||||
-- * @{#GROUP.OptionROTVerticalPossible}
|
||||
--
|
||||
-- 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.
|
||||
--
|
||||
-- @module Group
|
||||
-- @author FlightControl
|
||||
|
||||
@ -524,12 +639,12 @@ end
|
||||
|
||||
|
||||
|
||||
-- Is Functions
|
||||
-- Is Zone Functions
|
||||
|
||||
--- Returns if all units of the group are within a @{Zone#ZONE}.
|
||||
--- Returns true if all units of the group are within a @{Zone}.
|
||||
-- @param #GROUP self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE}
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
||||
function GROUP:IsCompletelyInZone( Zone )
|
||||
self:F2( { self.GroupName, Zone } )
|
||||
|
||||
@ -544,6 +659,40 @@ function GROUP:IsCompletelyInZone( Zone )
|
||||
return true
|
||||
end
|
||||
|
||||
--- Returns true if some units of the group are within a @{Zone}.
|
||||
-- @param #GROUP self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
||||
function GROUP:IsPartlyInZone( Zone )
|
||||
self:F2( { self.GroupName, Zone } )
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local Unit = UnitData -- Unit#UNIT
|
||||
if Zone:IsPointVec3InZone( Unit:GetPointVec3() ) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
--- Returns true if none of the group units of the group are within a @{Zone}.
|
||||
-- @param #GROUP self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the Group is completely within the @{Zone#ZONE_BASE}
|
||||
function GROUP:IsNotInZone( Zone )
|
||||
self:F2( { self.GroupName, Zone } )
|
||||
|
||||
for UnitID, UnitData in pairs( self:GetUnits() ) do
|
||||
local Unit = UnitData -- Unit#UNIT
|
||||
if Zone:IsPointVec3InZone( Unit:GetPointVec3() ) then
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
--- Returns if the group is of an air category.
|
||||
-- If the group is a helicopter or a plane, then this method will return true, otherwise false.
|
||||
-- @param #GROUP self
|
||||
@ -777,7 +926,7 @@ function GROUP:SetTask( DCSTask, WaitTime )
|
||||
end
|
||||
|
||||
|
||||
--- Return a condition section for a controlled task
|
||||
--- Return a condition section for a controlled task.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSTime#Time time
|
||||
-- @param #string userFlag
|
||||
@ -801,7 +950,7 @@ function GROUP:TaskCondition( time, userFlag, userFlagValue, condition, duration
|
||||
return DCSStopCondition
|
||||
end
|
||||
|
||||
--- Return a Controlled Task taking a Task and a TaskCondition
|
||||
--- Return a Controlled Task taking a Task and a TaskCondition.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSTask#Task DCSTask
|
||||
-- @param #DCSStopCondition DCSStopCondition
|
||||
@ -823,7 +972,7 @@ function GROUP:TaskControlled( DCSTask, DCSStopCondition )
|
||||
return DCSTaskControlled
|
||||
end
|
||||
|
||||
--- Return a Combo Task taking an array of Tasks
|
||||
--- Return a Combo Task taking an array of Tasks.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSTask#TaskArray DCSTasks Array of @{DCSTask#Task}
|
||||
-- @return DCSTask#Task
|
||||
@ -843,7 +992,7 @@ function GROUP:TaskCombo( DCSTasks )
|
||||
return DCSTaskCombo
|
||||
end
|
||||
|
||||
--- Return a WrappedAction Task taking a Command
|
||||
--- Return a WrappedAction Task taking a Command.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSCommand#Command DCSCommand
|
||||
-- @return DCSTask#Task
|
||||
@ -1095,7 +1244,7 @@ function GROUP:TaskOrbitCircleAtVec2( Point, Altitude, Speed )
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
--- (AIR) Orbit at the current position of the first unit of the group at a specified alititude
|
||||
--- (AIR) Orbit at the current position of the first unit of the group at a specified alititude.
|
||||
-- @param #GROUP self
|
||||
-- @param #number Altitude The altitude to hold the position.
|
||||
-- @param #number Speed The speed flying when holding the position.
|
||||
@ -1271,7 +1420,7 @@ function GROUP:TaskLandAtVec2( Point, Duration )
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
--- (AIR) Land the group at a @{Zone#ZONE).
|
||||
--- (AIR) Land the group at a @{Zone#ZONE_RADIUS).
|
||||
-- @param #GROUP self
|
||||
-- @param Zone#ZONE Zone The zone where to land.
|
||||
-- @param #number Duration The duration in seconds to stay on the ground.
|
||||
@ -1292,6 +1441,8 @@ function GROUP:TaskLandAtZone( Zone, Duration, RandomPoint )
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- (AIR) Following another airborne group.
|
||||
-- The unit / group will follow lead unit of another group, wingmens of both groups will continue following their leaders.
|
||||
-- If another group is on land the unit / group will orbit around.
|
||||
@ -1432,6 +1583,7 @@ function GROUP:TaskHold()
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
|
||||
-- TASKS FOR AIRBORNE AND GROUND UNITS/GROUPS
|
||||
|
||||
--- (AIR + GROUND) The task makes the group/unit a FAC and orders the FAC to control the target (enemy ground group) destruction.
|
||||
@ -1504,6 +1656,7 @@ function GROUP:EnRouteTaskEngageTargets( Distance, TargetTypes, Priority )
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- (AIR) Engaging a targets of defined types at circle-shaped zone.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSTypes#Vec2 PointVec2 2D-coordinates of the zone.
|
||||
@ -1538,6 +1691,7 @@ function GROUP:EnRouteTaskEngageTargets( PointVec2, Radius, TargetTypes, Priorit
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
|
||||
--- (AIR) Engaging a group. The task does not assign the target group to the unit/group to attack now; it just allows the unit/group to engage the target group as well as other assigned targets.
|
||||
-- @param #GROUP self
|
||||
-- @param Group#GROUP AttackGroup The Group to be attacked.
|
||||
@ -1646,6 +1800,7 @@ function GROUP:EnRouteTaskEngageUnit( AttackUnit, Priority, WeaponType, WeaponEx
|
||||
end
|
||||
|
||||
|
||||
|
||||
--- (AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts). No parameters.
|
||||
-- @param #GROUP self
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
@ -1792,13 +1947,13 @@ end
|
||||
|
||||
|
||||
|
||||
--- Move the group to a Vec2 Point, wait for a defined duration and embark a group.
|
||||
--- (AIR) Move the group to a Vec2 Point, wait for a defined duration and embark a group.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSTypes#Vec2 Point The point where to wait.
|
||||
-- @param #number Duration The duration in seconds to wait.
|
||||
-- @param #GROUP EmbarkingGroup The group to be embarked.
|
||||
-- @return DCSTask#Task The DCS task structure
|
||||
function GROUP:TaskEmbarkingAtVec2( Point, Duration, EmbarkingGroup )
|
||||
function GROUP:TaskEmbarking( Point, Duration, EmbarkingGroup )
|
||||
self:F2( { self.GroupName, Point, Duration, EmbarkingGroup.DCSGroup } )
|
||||
|
||||
local DCSTask
|
||||
@ -1817,12 +1972,14 @@ function GROUP:TaskEmbarkingAtVec2( Point, Duration, EmbarkingGroup )
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
--- (GROUND) Embark to a Transport landed at a location.
|
||||
|
||||
--- Move to a defined Vec2 Point, and embark to a group when arrived within a defined Radius.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSTypes#Vec2 Point The point where to wait.
|
||||
-- @param #number Radius The radius of the embarking zone around the Point.
|
||||
-- @return DCSTask#Task The DCS task structure.
|
||||
function GROUP:TaskEmbarkToTransportAtVec2( Point, Radius )
|
||||
function GROUP:TaskEmbarkToTransport( Point, Radius )
|
||||
self:F2( { self.GroupName, Point, Radius } )
|
||||
|
||||
local DCSTask --DCSTask#Task
|
||||
@ -1837,7 +1994,9 @@ function GROUP:TaskEmbarkToTransportAtVec2( Point, Radius )
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
--- Return a Misson task from a mission template.
|
||||
|
||||
|
||||
--- (AIR + GROUND) Return a mission task from a mission template.
|
||||
-- @param #GROUP self
|
||||
-- @param #table TaskMission A table containing the mission task.
|
||||
-- @return DCSTask#Task
|
||||
@ -1865,7 +2024,7 @@ function GROUP:TaskRoute( Points )
|
||||
return DCSTask
|
||||
end
|
||||
|
||||
--- Make the DCS Group to fly to a given point and hover.
|
||||
--- (AIR + GROUND) Make the Group move to fly to a given point.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSTypes#Vec3 Point The destination point in Vec3 format.
|
||||
-- @param #number Speed The speed to travel.
|
||||
@ -1916,7 +2075,7 @@ function GROUP:TaskRouteToVec2( Point, Speed )
|
||||
return self
|
||||
end
|
||||
|
||||
--- Make the DCS Group to fly to a given point and hover.
|
||||
--- (AIR + GROUND) Make the Group move to a given point.
|
||||
-- @param #GROUP self
|
||||
-- @param DCSTypes#Vec3 Point The destination point in Vec3 format.
|
||||
-- @param #number Speed The speed to travel.
|
||||
@ -1997,7 +2156,7 @@ end
|
||||
|
||||
|
||||
|
||||
--- Route the group to a given zone.
|
||||
--- (AIR + GROUND) Route the group to a given zone.
|
||||
-- The group final destination point can be randomized.
|
||||
-- A speed can be given in km/h.
|
||||
-- A given formation can be given.
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
--- UNIT Class
|
||||
--- This module contains the UNIT class.
|
||||
--
|
||||
-- @{UNIT} class
|
||||
-- ==============
|
||||
-- The @{UNIT} class is a wrapper class to handle the DCS Unit objects:
|
||||
-- 1) @{Unit#UNIT} class, extends @{Base#BASE}
|
||||
-- ===========================================
|
||||
-- The @{Unit#UNIT} class is a wrapper class to handle the DCS Unit objects:
|
||||
--
|
||||
-- * Support all DCS Unit APIs.
|
||||
-- * Enhance with Unit specific APIs not in the DCS Unit API set.
|
||||
@ -10,8 +10,8 @@
|
||||
-- * Manage the "state" of the DCS Unit.
|
||||
--
|
||||
--
|
||||
-- UNIT reference methods
|
||||
-- ======================
|
||||
-- 1.1) UNIT reference methods
|
||||
-- ----------------------
|
||||
-- For each DCS Unit object alive within a running mission, a UNIT 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 Unit objects are spawned (using the @{SPAWN} class).
|
||||
--
|
||||
@ -29,19 +29,15 @@
|
||||
--
|
||||
-- IMPORTANT: ONE SHOULD NEVER SANATIZE these UNIT OBJECT REFERENCES! (make the UNIT object references nil).
|
||||
--
|
||||
-- DCS UNIT APIs
|
||||
-- =============
|
||||
-- 1.2) DCS UNIT APIs
|
||||
-- ------------------
|
||||
-- The DCS Unit APIs are used extensively within MOOSE. The UNIT class has for each DCS Unit API a corresponding method.
|
||||
-- To be able to distinguish easily in your code the difference between a UNIT API call and a DCS Unit API call,
|
||||
-- the first letter of the method is also capitalized. So, by example, the DCS Unit method @{DCSUnit#Unit.getName}()
|
||||
-- is implemented in the UNIT class as @{#UNIT.GetName}().
|
||||
--
|
||||
-- Additional UNIT APIs
|
||||
-- ====================
|
||||
-- The UNIT class comes with additional methods. Find below a summary.
|
||||
--
|
||||
-- Smoke, Flare Units
|
||||
-- ------------------
|
||||
-- 1.3) Smoke, Flare Units
|
||||
-- -----------------------
|
||||
-- The UNIT class provides methods to smoke or flare units easily.
|
||||
-- The @{#UNIT.SmokeBlue}(), @{#UNIT.SmokeGreen}(),@{#UNIT.SmokeOrange}(), @{#UNIT.SmokeRed}(), @{#UNIT.SmokeRed}() methods
|
||||
-- will smoke the unit in the corresponding color. Note that smoking a unit is done at the current position of the DCS Unit.
|
||||
@ -49,26 +45,25 @@
|
||||
-- The @{#UNIT.FlareGreen}(), @{#UNIT.FlareRed}(), @{#UNIT.FlareWhite}(), @{#UNIT.FlareYellow}()
|
||||
-- methods will fire off a flare in the air with the corresponding color. Note that a flare is a one-off shot and its effect is of very short duration.
|
||||
--
|
||||
-- Position, Point
|
||||
-- ---------------
|
||||
-- 1.4) Location Position, Point
|
||||
-- -----------------------------
|
||||
-- The UNIT class provides methods to obtain the current point or position of the DCS Unit.
|
||||
-- The @{#UNIT.GetPointVec2}(), @{#UNIT.GetPointVec3}() will obtain the current location of the DCS Unit in a Vec2 (2D) or a Vec3 (3D) vector respectively.
|
||||
-- If you want to obtain the complete 3D position including oriëntation and direction vectors, consult the @{#UNIT.GetPositionVec3}() method respectively.
|
||||
-- The @{#UNIT.GetPointVec2}(), @{#UNIT.GetPointVec3}() will obtain the current **location** of the DCS Unit in a Vec2 (2D) or a **point** in a Vec3 (3D) vector respectively.
|
||||
-- If you want to obtain the complete **3D position** including oriëntation and direction vectors, consult the @{#UNIT.GetPositionVec3}() method respectively.
|
||||
--
|
||||
-- Alive
|
||||
-- -----
|
||||
-- 1.5) Test if alive
|
||||
-- ------------------
|
||||
-- The @{#UNIT.IsAlive}(), @{#UNIT.IsActive}() methods determines if the DCS Unit is alive, meaning, it is existing and active.
|
||||
--
|
||||
-- Test for other units in radius
|
||||
-- ------------------------------
|
||||
-- One can test if another DCS Unit is within a given radius of the current DCS Unit, by using the @{#UNIT.OtherUnitInRadius}() method.
|
||||
--
|
||||
-- More functions will be added
|
||||
-- ----------------------------
|
||||
-- During the MOOSE development, more functions will be added. A complete list of the current functions is below.
|
||||
--
|
||||
-- 1.6) Test for proximity
|
||||
-- -----------------------
|
||||
-- The UNIT class contains methods to test the location or proximity against zones or other objects.
|
||||
--
|
||||
-- ### 1.6.1) Zones
|
||||
-- To test whether the Unit is within a **zone**, use the @{#UNIT.IsInZone}() or the @{#UNIT.IsNotInZone}() methods. Any zone can be tested on, but the zone must be derived from @{Zone#ZONE_BASE}.
|
||||
--
|
||||
-- ### 1.6.2) Units
|
||||
-- Test if another DCS Unit is within a given radius of the current DCS Unit, use the @{#UNIT.OtherUnitInRadius}() method.
|
||||
--
|
||||
-- @module Unit
|
||||
-- @author FlightControl
|
||||
@ -601,7 +596,35 @@ function UNIT:GetVelocity()
|
||||
|
||||
return nil
|
||||
end
|
||||
|
||||
|
||||
-- Is functions
|
||||
|
||||
--- Returns true if the unit is within a @{Zone}.
|
||||
-- @param #UNIT self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the unit is within the @{Zone#ZONE_BASE}
|
||||
function UNIT:IsInZone( Zone )
|
||||
self:F2( { self.UnitName, Zone } )
|
||||
|
||||
local IsInZone = Zone:IsPointVec3InZone( self:GetPointVec3() )
|
||||
|
||||
self:T( { IsInZone } )
|
||||
return IsInZone
|
||||
end
|
||||
|
||||
--- Returns true if the unit is not within a @{Zone}.
|
||||
-- @param #UNIT self
|
||||
-- @param Zone#ZONE_BASE Zone The zone to test.
|
||||
-- @return #boolean Returns true if the unit is not within the @{Zone#ZONE_BASE}
|
||||
function UNIT:IsNotInZone( Zone )
|
||||
self:F2( { self.UnitName, Zone } )
|
||||
|
||||
local IsInZone = not Zone:IsPointVec3InZone( self:GetPointVec3() )
|
||||
|
||||
self:T( { IsInZone } )
|
||||
return IsInZone
|
||||
end
|
||||
|
||||
--- Returns true if the DCS Unit is in the air.
|
||||
-- @param Unit#UNIT self
|
||||
-- @return #boolean true if in the air.
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
--- ZONE Classes
|
||||
-- =============
|
||||
-- This module contains the ZONE classes, inherited from @{Zone#ZONE_BASE}.
|
||||
--- This module contains the ZONE classes, inherited from @{Zone#ZONE_BASE}.
|
||||
-- There are essentially two core functions that zones accomodate:
|
||||
--
|
||||
-- * Test if an object is within the zone boundaries.
|
||||
@ -23,12 +21,30 @@
|
||||
-- * @{Zone#ZONE_UNIT}: The ZONE_UNIT class defined by a zone around a @{Unit#UNIT} with a radius.
|
||||
-- * @{Zone#ZONE_POLYGON}: The ZONE_POLYGON class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
--
|
||||
-- Polymorphic methods
|
||||
-- ===================
|
||||
-- Each zone implements two polymorphic functions defined in @{Zone#ZONE_BASE}:
|
||||
--
|
||||
-- * @{#ZONE_BASE.IsPointVec2InZone}: Returns if a location is within the zone.
|
||||
-- * @{#ZONE_BASE.IsPointVec3InZone}: Returns if a point is within the zone.
|
||||
-- * @{#ZONE_BASE.IsPointVec2InZone}: Returns if a location is within the zone.
|
||||
-- * @{#ZONE_BASE.IsPointVec3InZone}: Returns if a point is within the zone.
|
||||
--
|
||||
-- 1) @{Zone#ZONE_BASE} class, extends @{Base#BASE}
|
||||
-- ================================================
|
||||
-- The ZONE_BASE class defining the base for all other zone classes.
|
||||
--
|
||||
-- 2) @{Zone#ZONE_RADIUS} class, extends @{Zone#ZONE_BASE}
|
||||
-- =======================================================
|
||||
-- The ZONE_RADIUS class defined by a zone name, a location and a radius.
|
||||
--
|
||||
-- 3) @{Zone#ZONE} class, extends @{Zone#ZONE_RADIUS}
|
||||
-- ==========================================
|
||||
-- The ZONE class, defined by the zone name as defined within the Mission Editor.
|
||||
--
|
||||
-- 4) @{Zone#ZONE_UNIT} class, extends @{Zone#ZONE_RADIUS}
|
||||
-- =======================================================
|
||||
-- The ZONE_UNIT class defined by a zone around a @{Unit#UNIT} with a radius.
|
||||
--
|
||||
-- 5) @{Zone#ZONE_POLYGON} class, extends @{Zone#ZONE_BASE}
|
||||
-- ========================================================
|
||||
-- The ZONE_POLYGON class defined by a sequence of @{Group#GROUP} waypoints within the Mission Editor, forming a polygon.
|
||||
--
|
||||
-- @module Zone
|
||||
-- @author FlightControl
|
||||
|
||||
@ -71,14 +71,14 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Client</code></h1>
|
||||
|
||||
<p>The CLIENT models client units in multi player missions.</p>
|
||||
<p>This module contains the CLIENT class.</p>
|
||||
|
||||
|
||||
|
||||
<h1><a href="##(CLIENT)">#CLIENT</a> class</h1>
|
||||
<h1>1) <a href="Client.html##(CLIENT)">Client#CLIENT</a> class, extends <a href="Unit.html##(UNIT)">Unit#UNIT</a></h1>
|
||||
<p>Clients are those <strong>Units</strong> defined within the Mission Editor that have the skillset defined as <strong>Client</strong> or <strong>Player</strong>.
|
||||
Note that clients are NOT the same as Units, they are NOT necessarily alive.
|
||||
The <a href="CLIENT.html">CLIENT</a> class is a wrapper class to handle the DCS Unit objects that have the skillset defined as <strong>Client</strong> or <strong>Player</strong>:</p>
|
||||
The <a href="Client.html##(CLIENT)">Client#CLIENT</a> class is a wrapper class to handle the DCS Unit objects that have the skillset defined as <strong>Client</strong> or <strong>Player</strong>:</p>
|
||||
|
||||
<ul>
|
||||
<li>Wraps the DCS Unit objects with skill level set to Player or Client.</li>
|
||||
@ -91,7 +91,7 @@ The <a href="CLIENT.html">CLIENT</a> class is a wrapper class to handle the DCS
|
||||
|
||||
<p>Clients are being used by the <a href="MISSION.html">MISSION</a> class to follow players and register their successes.</p>
|
||||
|
||||
<h1>CLIENT reference methods</h1>
|
||||
<h2>1.1) CLIENT reference methods</h2>
|
||||
<p>For each DCS Unit having skill level Player or Client, a CLIENT 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).</p>
|
||||
|
||||
|
||||
@ -71,12 +71,12 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Group</code></h1>
|
||||
|
||||
<p>GROUP class.</p>
|
||||
<p>This module contains the GROUP class.</p>
|
||||
|
||||
|
||||
|
||||
<h1><a href="GROUP.html">GROUP</a> class</h1>
|
||||
<p>The <a href="GROUP.html">GROUP</a> class is a wrapper class to handle the DCS Group objects:</p>
|
||||
<h1>1) <a href="Group.html##(GROUP)">Group#GROUP</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
<p>The <a href="Group.html##(GROUP)">Group#GROUP</a> class is a wrapper class to handle the DCS Group objects:</p>
|
||||
|
||||
<ul>
|
||||
<li>Support all DCS Group APIs.</li>
|
||||
@ -85,8 +85,9 @@
|
||||
<li>Manage the "state" of the DCS Group.</li>
|
||||
</ul>
|
||||
|
||||
<p><strong>IMPORTANT: ONE SHOULD NEVER SANATIZE these GROUP OBJECT REFERENCES! (make the GROUP object references nil).</strong></p>
|
||||
|
||||
<h1>GROUP reference methods</h1>
|
||||
<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>
|
||||
|
||||
@ -104,7 +105,136 @@ If the DCS Group object does not exist or is nil, the GROUP methods will return
|
||||
<li><a href="##(GROUP).FindByName">GROUP.FindByName</a>(): Find a GROUP instance from the _DATABASE object using a DCS Group name.</li>
|
||||
</ul>
|
||||
|
||||
<p>IMPORTANT: ONE SHOULD NEVER SANATIZE these GROUP OBJECT REFERENCES! (make the GROUP object references nil).</p>
|
||||
<h2>1.2) GROUP task methods</h2>
|
||||
<p>Several group task methods are available that help you to prepare tasks.
|
||||
These methods return a string consisting of the task description, which can then be given to either a <a href="Group.html##(GROUP).PushTask">Group#GROUP.PushTask</a> or <a href="Group.html##(SetTask)">Group#SetTask</a> method to assign the task to the GROUP.
|
||||
Tasks are specific for the category of the GROUP, more specific, for AIR, GROUND or AIR and GROUND.
|
||||
Each task description where applicable indicates for which group category the task is valid.
|
||||
There are 2 main subdivisions of tasks: Assigned tasks and EnRoute tasks.</p>
|
||||
|
||||
<h3>1.2.1) Assigned task methods</h3>
|
||||
|
||||
<p>Assigned task methods make the group execute the task where the location of the (possible) targets of the task are known before being detected.
|
||||
This is different from the EnRoute tasks, where the targets of the task need to be detected before the task can be executed.</p>
|
||||
|
||||
<p>Find below a list of the <strong>assigned task</strong> methods:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).TaskAttackGroup">GROUP.TaskAttackGroup</a>: (AIR) Attack a Group.</li>
|
||||
<li><a href="##(GROUP).TaskAttackMapObject">GROUP.TaskAttackMapObject</a>: (AIR) Attacking the map object (building, structure, e.t.c).</li>
|
||||
<li><a href="##(GROUP).TaskAttackUnit">GROUP.TaskAttackUnit</a>: (AIR) Attack the Unit.</li>
|
||||
<li><a href="##(GROUP).TaskBombing">GROUP.TaskBombing</a>: (AIR) Delivering weapon at the point on the ground.</li>
|
||||
<li><a href="##(GROUP).TaskBombingRunway">GROUP.TaskBombingRunway</a>: (AIR) Delivering weapon on the runway.</li>
|
||||
<li><a href="##(GROUP).TaskEmbarking">GROUP.TaskEmbarking</a>: (AIR) Move the group to a Vec2 Point, wait for a defined duration and embark a group.</li>
|
||||
<li><a href="##(GROUP).TaskEmbarkToTransport">GROUP.TaskEmbarkToTransport</a>: (GROUND) Embark to a Transport landed at a location.</li>
|
||||
<li><a href="##(GROUP).TaskEscort">GROUP.TaskEscort</a>: (AIR) Escort another airborne group. </li>
|
||||
<li><a href="##(GROUP).TaskFAC_AttackGroup">GROUP.TaskFAC_AttackGroup</a>: (AIR + GROUND) The task makes the group/unit a FAC and orders the FAC to control the target (enemy ground group) destruction.</li>
|
||||
<li><a href="##(GROUP).TaskFireAtPoint">GROUP.TaskFireAtPoint</a>: (GROUND) Fire at a VEC2 point until ammunition is finished.</li>
|
||||
<li><a href="##(GROUP).TaskFollow">GROUP.TaskFollow</a>: (AIR) Following another airborne group.</li>
|
||||
<li><a href="##(GROUP).TaskHold">GROUP.TaskHold</a>: (GROUND) Hold ground group from moving.</li>
|
||||
<li><a href="##(GROUP).TaskHoldPosition">GROUP.TaskHoldPosition</a>: (AIR) Hold position at the current position of the first unit of the group.</li>
|
||||
<li><a href="##(GROUP).TaskLand">GROUP.TaskLand</a>: (AIR HELICOPTER) Landing at the ground. For helicopters only.</li>
|
||||
<li><a href="##(GROUP).TaskLandAtZone">GROUP.TaskLandAtZone</a>: (AIR) Land the group at a <a href="##(GROUP).TaskOrbitCircle">GROUP.TaskOrbitCircle</a>: (AIR) Orbit at the current position of the first unit of the group at a specified alititude.</li>
|
||||
<li><a href="##(GROUP).TaskOrbitCircleAtVec2">GROUP.TaskOrbitCircleAtVec2</a>: (AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.</li>
|
||||
<li><a href="##(GROUP).TaskRefueling">GROUP.TaskRefueling</a>: (AIR) Refueling from the nearest tanker. No parameters.</li>
|
||||
<li><a href="##(GROUP).TaskRoute">GROUP.TaskRoute</a>: (AIR + GROUND) Return a Misson task to follow a given route defined by Points.</li>
|
||||
<li><a href="##(GROUP).TaskRouteToVec2">GROUP.TaskRouteToVec2</a>: (AIR + GROUND) Make the Group move to a given point.</li>
|
||||
<li><a href="##(GROUP).TaskRouteToVec3">GROUP.TaskRouteToVec3</a>: (AIR + GROUND) Make the Group move to a given point.</li>
|
||||
<li><a href="##(GROUP).TaskRouteToZone">GROUP.TaskRouteToZone</a>: (AIR + GROUND) Route the group to a given zone.</li>
|
||||
</ul>
|
||||
|
||||
<h3>1.2.2) EnRoute task methods</h3>
|
||||
|
||||
<p>EnRoute tasks require the targets of the task need to be detected by the group (using its sensors) before the task can be executed:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).EnRouteTaskAWACS">GROUP.EnRouteTaskAWACS</a>: (AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts). No parameters.</li>
|
||||
<li><a href="##(GROUP).EnRouteTaskEngageGroup">GROUP.EnRouteTaskEngageGroup</a>: (AIR) Engaging a group. The task does not assign the target group to the unit/group to attack now; it just allows the unit/group to engage the target group as well as other assigned targets.</li>
|
||||
<li><a href="##(GROUP).EnRouteTaskEngageTargets">GROUP.EnRouteTaskEngageTargets</a>: (AIR) Engaging targets of defined types.</li>
|
||||
<li><a href="##(GROUP).EnRouteTaskEWR">GROUP.EnRouteTaskEWR</a>: (AIR) Attack the Unit.</li>
|
||||
<li><a href="##(GROUP).EnRouteTaskFAC">GROUP.EnRouteTaskFAC</a>: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose a targets (enemy ground group) around as well as other assigned targets.</li>
|
||||
<li><a href="##(GROUP).EnRouteTaskFAC_EngageGroup">GROUP.EnRouteTaskFAC_EngageGroup</a>: (AIR + GROUND) The task makes the group/unit a FAC and lets the FAC to choose the target (enemy ground group) as well as other assigned targets.</li>
|
||||
<li><a href="##(GROUP).EnRouteTaskTanker">GROUP.EnRouteTaskTanker</a>: (AIR) Aircraft will act as a tanker for friendly units. No parameters.</li>
|
||||
</ul>
|
||||
|
||||
<h3>1.2.3) Preparation task methods</h3>
|
||||
|
||||
<p>There are certain task methods that allow to tailor the task behaviour:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).TaskWrappedAction">GROUP.TaskWrappedAction</a>: Return a WrappedAction Task taking a Command.</li>
|
||||
<li><a href="##(GROUP).TaskCombo">GROUP.TaskCombo</a>: Return a Combo Task taking an array of Tasks.</li>
|
||||
<li><a href="##(GROUP).TaskCondition">GROUP.TaskCondition</a>: Return a condition section for a controlled task.</li>
|
||||
<li><a href="##(GROUP).TaskControlled">GROUP.TaskControlled</a>: Return a Controlled Task taking a Task and a TaskCondition.</li>
|
||||
</ul>
|
||||
|
||||
<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="##(GROUP).TaskMission">GROUP.TaskMission</a>: (AIR + GROUND) Return a mission task from a mission template.</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.3) GROUP Command methods</h2>
|
||||
<p>Group <strong>command methods</strong> prepare the execution of commands using the <a href="##(GROUP).SetCommand">GROUP.SetCommand</a> method:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).CommandDoScript">GROUP.CommandDoScript</a>: Do Script command.</li>
|
||||
<li><a href="##(GROUP).CommandSwitchWayPoint">GROUP.CommandSwitchWayPoint</a>: Perform a switch waypoint command.</li>
|
||||
</ul>
|
||||
|
||||
<h2>1.4) GROUP Option methods</h2>
|
||||
<p>Group <strong>Option methods</strong> change the behaviour of the Group while being alive.</p>
|
||||
|
||||
<h3>1.4.1) Rule of Engagement:</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).OptionROEWeaponFree">GROUP.OptionROEWeaponFree</a> </li>
|
||||
<li><a href="##(GROUP).OptionROEOpenFire">GROUP.OptionROEOpenFire</a></li>
|
||||
<li><a href="##(GROUP).OptionROEReturnFire">GROUP.OptionROEReturnFire</a></li>
|
||||
<li><a href="##(GROUP).OptionROEEvadeFire">GROUP.OptionROEEvadeFire</a></li>
|
||||
</ul>
|
||||
|
||||
<p>To check whether an ROE option is valid for a specific group, use:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).OptionROEWeaponFreePossible">GROUP.OptionROEWeaponFreePossible</a> </li>
|
||||
<li><a href="##(GROUP).OptionROEOpenFirePossible">GROUP.OptionROEOpenFirePossible</a></li>
|
||||
<li><a href="##(GROUP).OptionROEReturnFirePossible">GROUP.OptionROEReturnFirePossible</a></li>
|
||||
<li><a href="##(GROUP).OptionROEEvadeFirePossible">GROUP.OptionROEEvadeFirePossible</a></li>
|
||||
</ul>
|
||||
|
||||
<h3>1.4.2) Rule on thread:</h3>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).OptionROTNoReaction">GROUP.OptionROTNoReaction</a></li>
|
||||
<li><a href="##(GROUP).OptionROTPassiveDefense">GROUP.OptionROTPassiveDefense</a></li>
|
||||
<li><a href="##(GROUP).OptionROTEvadeFire">GROUP.OptionROTEvadeFire</a></li>
|
||||
<li><a href="##(GROUP).OptionROTVertical">GROUP.OptionROTVertical</a></li>
|
||||
</ul>
|
||||
|
||||
<p>To test whether an ROT option is valid for a specific group, use:</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="##(GROUP).OptionROTNoReactionPossible">GROUP.OptionROTNoReactionPossible</a></li>
|
||||
<li><a href="##(GROUP).OptionROTPassiveDefensePossible">GROUP.OptionROTPassiveDefensePossible</a></li>
|
||||
<li><a href="##(GROUP).OptionROTEvadeFirePossible">GROUP.OptionROTEvadeFirePossible</a></li>
|
||||
<li><a href="##(GROUP).OptionROTVerticalPossible">GROUP.OptionROTVerticalPossible</a></li>
|
||||
</ul>
|
||||
|
||||
<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>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
@ -409,6 +539,12 @@ If the DCS Group object does not exist or is nil, the GROUP methods will return
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).IsAlive">GROUP:IsAlive()</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns if the DCS Group is alive.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).IsCompletelyInZone">GROUP:IsCompletelyInZone(Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns true if all units of the group are within a <a href="Zone.html">Zone</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -421,6 +557,18 @@ If the DCS Group object does not exist or is nil, the GROUP methods will return
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).IsHelicopter">GROUP:IsHelicopter()</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns if the DCS Group contains Helicopters.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).IsNotInZone">GROUP:IsNotInZone(Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns true if none of the group units of the group are within a <a href="Zone.html">Zone</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).IsPartlyInZone">GROUP:IsPartlyInZone(Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns true if some units of the group are within a <a href="Zone.html">Zone</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -630,31 +778,31 @@ If the DCS Group object does not exist or is nil, the GROUP methods will return
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskCombo">GROUP:TaskCombo(DCSTasks)</a></td>
|
||||
<td class="summary">
|
||||
<p>Return a Combo Task taking an array of Tasks</p>
|
||||
<p>Return a Combo Task taking an array of Tasks.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskCondition">GROUP:TaskCondition(time, userFlag, userFlagValue, condition, duration, lastWayPoint)</a></td>
|
||||
<td class="summary">
|
||||
<p>Return a condition section for a controlled task</p>
|
||||
<p>Return a condition section for a controlled task.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskControlled">GROUP:TaskControlled(DCSTask, DCSStopCondition)</a></td>
|
||||
<td class="summary">
|
||||
<p>Return a Controlled Task taking a Task and a TaskCondition</p>
|
||||
<p>Return a Controlled Task taking a Task and a TaskCondition.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskEmbarkToTransportAtVec2">GROUP:TaskEmbarkToTransportAtVec2(Point, Radius)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskEmbarkToTransport">GROUP:TaskEmbarkToTransport(Point, Radius)</a></td>
|
||||
<td class="summary">
|
||||
<p>Move to a defined Vec2 Point, and embark to a group when arrived within a defined Radius.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskEmbarkingAtVec2">GROUP:TaskEmbarkingAtVec2(Point, Duration, EmbarkingGroup)</a></td>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskEmbarking">GROUP:TaskEmbarking(Point, Duration, EmbarkingGroup)</a></td>
|
||||
<td class="summary">
|
||||
<p>Move the group to a Vec2 Point, wait for a defined duration and embark a group.</p>
|
||||
<p>(AIR) Move the group to a Vec2 Point, wait for a defined duration and embark a group.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -708,19 +856,19 @@ If the DCS Group object does not exist or is nil, the GROUP methods will return
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskLandAtZone">GROUP:TaskLandAtZone(Zone, Duration, RandomPoint)</a></td>
|
||||
<td class="summary">
|
||||
<p>(AIR) Land the group at a @{Zone#ZONE).</p>
|
||||
<p>(AIR) Land the group at a @{Zone#ZONE_RADIUS).</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskMission">GROUP:TaskMission(TaskMission)</a></td>
|
||||
<td class="summary">
|
||||
<p>Return a Misson task from a mission template.</p>
|
||||
<p>(AIR + GROUND) Return a mission task from a mission template.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskOrbitCircle">GROUP:TaskOrbitCircle(Altitude, Speed)</a></td>
|
||||
<td class="summary">
|
||||
<p>(AIR) Orbit at the current position of the first unit of the group at a specified alititude</p>
|
||||
<p>(AIR) Orbit at the current position of the first unit of the group at a specified alititude.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -744,25 +892,25 @@ If the DCS Group object does not exist or is nil, the GROUP methods will return
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskRouteToVec2">GROUP:TaskRouteToVec2(Point, Speed)</a></td>
|
||||
<td class="summary">
|
||||
<p>Make the DCS Group to fly to a given point and hover.</p>
|
||||
<p>(AIR + GROUND) Make the Group move to fly to a given point.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskRouteToVec3">GROUP:TaskRouteToVec3(Point, Speed)</a></td>
|
||||
<td class="summary">
|
||||
<p>Make the DCS Group to fly to a given point and hover.</p>
|
||||
<p>(AIR + GROUND) Make the Group move to a given point.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskRouteToZone">GROUP:TaskRouteToZone(Zone, Randomize, Speed, Formation)</a></td>
|
||||
<td class="summary">
|
||||
<p>Route the group to a given zone.</p>
|
||||
<p>(AIR + GROUND) Route the group to a given zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(GROUP).TaskWrappedAction">GROUP:TaskWrappedAction(DCSCommand, Index)</a></td>
|
||||
<td class="summary">
|
||||
<p>Return a WrappedAction Task taking a Command</p>
|
||||
<p>Return a WrappedAction Task taking a Command.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -843,8 +991,6 @@ If the DCS Group object does not exist or is nil, the GROUP methods will return
|
||||
|
||||
<h2><a id="#(DCSStopCondition)" >Type <code>DCSStopCondition</code></a></h2>
|
||||
|
||||
<h2><a id="#(Duration)" >Type <code>Duration</code></a></h2>
|
||||
|
||||
<h2><a id="#(GROUP)" >Type <code>GROUP</code></a></h2>
|
||||
|
||||
<p>The GROUP class</p>
|
||||
@ -1984,6 +2130,33 @@ true if the DCS Group is alive.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).IsCompletelyInZone" >
|
||||
<strong>GROUP:IsCompletelyInZone(Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns true if all units of the group are within a <a href="Zone.html">Zone</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a> Zone </em></code>:
|
||||
The zone to test.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
Returns true if the Group is completely within the <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).IsGround" >
|
||||
<strong>GROUP:IsGround()</strong>
|
||||
</a>
|
||||
@ -2020,6 +2193,60 @@ true if DCS Group contains Helicopters.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).IsNotInZone" >
|
||||
<strong>GROUP:IsNotInZone(Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns true if none of the group units of the group are within a <a href="Zone.html">Zone</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a> Zone </em></code>:
|
||||
The zone to test.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
Returns true if the Group is completely within the <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).IsPartlyInZone" >
|
||||
<strong>GROUP:IsPartlyInZone(Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns true if some units of the group are within a <a href="Zone.html">Zone</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a> Zone </em></code>:
|
||||
The zone to test.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
Returns true if the Group is completely within the <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).IsShip" >
|
||||
<strong>GROUP:IsShip()</strong>
|
||||
</a>
|
||||
@ -2077,7 +2304,7 @@ The message text</p>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(Duration)">#Duration</a> Duration </em></code>:
|
||||
<p><code><em><a href="DCSTypes.html##(Duration)">DCSTypes#Duration</a> Duration </em></code>:
|
||||
The duration of the message.</p>
|
||||
|
||||
</li>
|
||||
@ -2113,7 +2340,7 @@ The message text</p>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(Duration)">#Duration</a> Duration </em></code>:
|
||||
<p><code><em><a href="DCSTypes.html##(Duration)">DCSTypes#Duration</a> Duration </em></code>:
|
||||
The duration of the message.</p>
|
||||
|
||||
</li>
|
||||
@ -2144,7 +2371,7 @@ The message text</p>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(Duration)">#Duration</a> Duration </em></code>:
|
||||
<p><code><em><a href="DCSTypes.html##(Duration)">DCSTypes#Duration</a> Duration </em></code>:
|
||||
The duration of the message.</p>
|
||||
|
||||
</li>
|
||||
@ -2175,7 +2402,7 @@ The message text</p>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(Duration)">#Duration</a> Duration </em></code>:
|
||||
<p><code><em><a href="DCSTypes.html##(Duration)">DCSTypes#Duration</a> Duration </em></code>:
|
||||
The duration of the message.</p>
|
||||
|
||||
</li>
|
||||
@ -2212,7 +2439,7 @@ The message text</p>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="##(Duration)">#Duration</a> Duration </em></code>:
|
||||
<p><code><em><a href="DCSTYpes.html##(Duration)">DCSTYpes#Duration</a> Duration </em></code>:
|
||||
The duration of the message.</p>
|
||||
|
||||
</li>
|
||||
@ -2973,7 +3200,7 @@ The DCS task structure.</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Return a Combo Task taking an array of Tasks</p>
|
||||
<p>Return a Combo Task taking an array of Tasks.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
@ -3000,7 +3227,7 @@ Array of <a href="DCSTask.html##(Task)">DCSTask#Task</a></p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Return a condition section for a controlled task</p>
|
||||
<p>Return a condition section for a controlled task.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -3047,7 +3274,7 @@ return DCSTask#Task</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Return a Controlled Task taking a Task and a TaskCondition</p>
|
||||
<p>Return a Controlled Task taking a Task and a TaskCondition.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -3072,8 +3299,8 @@ return DCSTask#Task</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).TaskEmbarkToTransportAtVec2" >
|
||||
<strong>GROUP:TaskEmbarkToTransportAtVec2(Point, Radius)</strong>
|
||||
<a id="#(GROUP).TaskEmbarkToTransport" >
|
||||
<strong>GROUP:TaskEmbarkToTransport(Point, Radius)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
@ -3105,13 +3332,13 @@ The DCS task structure.</p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(GROUP).TaskEmbarkingAtVec2" >
|
||||
<strong>GROUP:TaskEmbarkingAtVec2(Point, Duration, EmbarkingGroup)</strong>
|
||||
<a id="#(GROUP).TaskEmbarking" >
|
||||
<strong>GROUP:TaskEmbarking(Point, Duration, EmbarkingGroup)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Move the group to a Vec2 Point, wait for a defined duration and embark a group.</p>
|
||||
<p>(AIR) Move the group to a Vec2 Point, wait for a defined duration and embark a group.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -3457,7 +3684,7 @@ self</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>(AIR) Land the group at a @{Zone#ZONE).</p>
|
||||
<p>(AIR) Land the group at a @{Zone#ZONE_RADIUS).</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -3495,7 +3722,7 @@ self</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Return a Misson task from a mission template.</p>
|
||||
<p>(AIR + GROUND) Return a mission task from a mission template.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
@ -3522,7 +3749,7 @@ A table containing the mission task.</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>(AIR) Orbit at the current position of the first unit of the group at a specified alititude</p>
|
||||
<p>(AIR) Orbit at the current position of the first unit of the group at a specified alititude.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -3642,7 +3869,7 @@ A table of route points.</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Make the DCS Group to fly to a given point and hover.</p>
|
||||
<p>(AIR + GROUND) Make the Group move to fly to a given point.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -3675,7 +3902,7 @@ self</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Make the DCS Group to fly to a given point and hover.</p>
|
||||
<p>(AIR + GROUND) Make the Group move to a given point.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
@ -3708,7 +3935,7 @@ self</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Route the group to a given zone.</p>
|
||||
<p>(AIR + GROUND) Route the group to a given zone.</p>
|
||||
|
||||
|
||||
<p>The group final destination point can be randomized.
|
||||
@ -3753,7 +3980,7 @@ The formation string.</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Return a WrappedAction Task taking a Command</p>
|
||||
<p>Return a WrappedAction Task taking a Command.</p>
|
||||
|
||||
<h3>Parameters</h3>
|
||||
<ul>
|
||||
|
||||
@ -71,24 +71,22 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Unit</code></h1>
|
||||
|
||||
<p>UNIT Class</p>
|
||||
<p>This module contains the UNIT class.</p>
|
||||
|
||||
<h1><a href="UNIT.html">UNIT</a> class</h1>
|
||||
<p>The <a href="UNIT.html">UNIT</a> class is a wrapper class to handle the DCS Unit objects:</p>
|
||||
|
||||
|
||||
<h1>1) <a href="Unit.html##(UNIT)">Unit#UNIT</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
<p>The <a href="Unit.html##(UNIT)">Unit#UNIT</a> class is a wrapper class to handle the DCS Unit objects:</p>
|
||||
|
||||
<ul>
|
||||
<li>Support all DCS Unit APIs.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul>
|
||||
<li>Enhance with Unit specific APIs not in the DCS Unit API set.</li>
|
||||
<li>Handle local Unit Controller.</li>
|
||||
<li>Manage the "state" of the DCS Unit.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<h1>UNIT reference methods</h1>
|
||||
<h2>1.1) UNIT reference methods</h2>
|
||||
<p>For each DCS Unit object alive within a running mission, a UNIT 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 Unit objects are spawned (using the <a href="SPAWN.html">SPAWN</a> class).</p>
|
||||
|
||||
@ -108,16 +106,13 @@ If the DCS Unit object does not exist or is nil, the UNIT methods will return ni
|
||||
|
||||
<p>IMPORTANT: ONE SHOULD NEVER SANATIZE these UNIT OBJECT REFERENCES! (make the UNIT object references nil).</p>
|
||||
|
||||
<h1>DCS UNIT APIs</h1>
|
||||
<h2>1.2) DCS UNIT APIs</h2>
|
||||
<p>The DCS Unit APIs are used extensively within MOOSE. The UNIT class has for each DCS Unit API a corresponding method.
|
||||
To be able to distinguish easily in your code the difference between a UNIT API call and a DCS Unit API call,
|
||||
the first letter of the method is also capitalized. So, by example, the DCS Unit method <a href="DCSUnit.html##(Unit).getName">DCSUnit#Unit.getName</a>()
|
||||
is implemented in the UNIT class as <a href="##(UNIT).GetName">UNIT.GetName</a>().</p>
|
||||
|
||||
<h1>Additional UNIT APIs</h1>
|
||||
<p>The UNIT class comes with additional methods. Find below a summary.</p>
|
||||
|
||||
<h2>Smoke, Flare Units</h2>
|
||||
<h2>1.3) Smoke, Flare Units</h2>
|
||||
<p>The UNIT class provides methods to smoke or flare units easily.
|
||||
The <a href="##(UNIT).SmokeBlue">UNIT.SmokeBlue</a>(), <a href="##(UNIT).SmokeGreen">UNIT.SmokeGreen</a>(),<a href="##(UNIT).SmokeOrange">UNIT.SmokeOrange</a>(), <a href="##(UNIT).SmokeRed">UNIT.SmokeRed</a>(), <a href="##(UNIT).SmokeRed">UNIT.SmokeRed</a>() methods
|
||||
will smoke the unit in the corresponding color. Note that smoking a unit is done at the current position of the DCS Unit.
|
||||
@ -125,22 +120,22 @@ When the DCS Unit moves for whatever reason, the smoking will still continue!
|
||||
The <a href="##(UNIT).FlareGreen">UNIT.FlareGreen</a>(), <a href="##(UNIT).FlareRed">UNIT.FlareRed</a>(), <a href="##(UNIT).FlareWhite">UNIT.FlareWhite</a>(), <a href="##(UNIT).FlareYellow">UNIT.FlareYellow</a>()
|
||||
methods will fire off a flare in the air with the corresponding color. Note that a flare is a one-off shot and its effect is of very short duration.</p>
|
||||
|
||||
<h2>Position, Point</h2>
|
||||
<h2>1.4) Location Position, Point</h2>
|
||||
<p>The UNIT class provides methods to obtain the current point or position of the DCS Unit.
|
||||
The <a href="##(UNIT).GetPointVec2">UNIT.GetPointVec2</a>(), <a href="##(UNIT).GetPointVec3">UNIT.GetPointVec3</a>() will obtain the current location of the DCS Unit in a Vec2 (2D) or a Vec3 (3D) vector respectively.
|
||||
If you want to obtain the complete 3D position including oriëntation and direction vectors, consult the <a href="##(UNIT).GetPositionVec3">UNIT.GetPositionVec3</a>() method respectively.</p>
|
||||
The <a href="##(UNIT).GetPointVec2">UNIT.GetPointVec2</a>(), <a href="##(UNIT).GetPointVec3">UNIT.GetPointVec3</a>() will obtain the current <strong>location</strong> of the DCS Unit in a Vec2 (2D) or a <strong>point</strong> in a Vec3 (3D) vector respectively.
|
||||
If you want to obtain the complete <strong>3D position</strong> including oriëntation and direction vectors, consult the <a href="##(UNIT).GetPositionVec3">UNIT.GetPositionVec3</a>() method respectively.</p>
|
||||
|
||||
<h2>Alive</h2>
|
||||
<h2>1.5) Test if alive</h2>
|
||||
<p>The <a href="##(UNIT).IsAlive">UNIT.IsAlive</a>(), <a href="##(UNIT).IsActive">UNIT.IsActive</a>() methods determines if the DCS Unit is alive, meaning, it is existing and active.</p>
|
||||
|
||||
<h2>Test for other units in radius</h2>
|
||||
<p>One can test if another DCS Unit is within a given radius of the current DCS Unit, by using the <a href="##(UNIT).OtherUnitInRadius">UNIT.OtherUnitInRadius</a>() method.</p>
|
||||
|
||||
<h2>More functions will be added</h2>
|
||||
<p>During the MOOSE development, more functions will be added. A complete list of the current functions is below.</p>
|
||||
|
||||
<h2>1.6) Test for proximity</h2>
|
||||
<p>The UNIT class contains methods to test the location or proximity against zones or other objects.</p>
|
||||
|
||||
<h3>1.6.1) Zones</h3>
|
||||
<p>To test whether the Unit is within a <strong>zone</strong>, use the <a href="##(UNIT).IsInZone">UNIT.IsInZone</a>() or the <a href="##(UNIT).IsNotInZone">UNIT.IsNotInZone</a>() methods. Any zone can be tested on, but the zone must be derived from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>. </p>
|
||||
|
||||
<h3>1.6.2) Units</h3>
|
||||
<p>Test if another DCS Unit is within a given radius of the current DCS Unit, use the <a href="##(UNIT).OtherUnitInRadius">UNIT.OtherUnitInRadius</a>() method.</p>
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
@ -384,6 +379,18 @@ If you want to obtain the complete 3D position including ori
|
||||
<td class="name" nowrap="nowrap"><a href="##(UNIT).IsAlive">UNIT:IsAlive()</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns if the unit is alive.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(UNIT).IsInZone">UNIT:IsInZone(Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns true if the unit is within a <a href="Zone.html">Zone</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(UNIT).IsNotInZone">UNIT:IsNotInZone(Zone)</a></td>
|
||||
<td class="summary">
|
||||
<p>Returns true if the unit is not within a <a href="Zone.html">Zone</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -1487,6 +1494,60 @@ The DCS Unit is not existing or alive. </p>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(UNIT).IsInZone" >
|
||||
<strong>UNIT:IsInZone(Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns true if the unit is within a <a href="Zone.html">Zone</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a> Zone </em></code>:
|
||||
The zone to test.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
Returns true if the unit is within the <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(UNIT).IsNotInZone" >
|
||||
<strong>UNIT:IsNotInZone(Zone)</strong>
|
||||
</a>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
<p>Returns true if the unit is not within a <a href="Zone.html">Zone</a>.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em><a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a> Zone </em></code>:
|
||||
The zone to test.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
Returns true if the unit is not within the <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
<dt>
|
||||
|
||||
<a id="#(UNIT).OtherUnitInRadius" >
|
||||
<strong>UNIT:OtherUnitInRadius(AwaitUnit, Radius)</strong>
|
||||
</a>
|
||||
|
||||
@ -71,7 +71,6 @@
|
||||
<div id="content">
|
||||
<h1>Module <code>Zone</code></h1>
|
||||
|
||||
<h1>ZONE Classes</h1>
|
||||
<p>This module contains the ZONE classes, inherited from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>.</p>
|
||||
|
||||
|
||||
@ -103,7 +102,6 @@
|
||||
<li><a href="Zone.html##(ZONE_POLYGON)">Zone#ZONE_POLYGON</a>: The ZONE_POLYGON class defined by a sequence of <a href="Group.html##(GROUP)">Group#GROUP</a> waypoints within the Mission Editor, forming a polygon.</li>
|
||||
</ul>
|
||||
|
||||
<h1>Polymorphic methods</h1>
|
||||
<p>Each zone implements two polymorphic functions defined in <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>:</p>
|
||||
|
||||
<ul>
|
||||
@ -111,6 +109,21 @@
|
||||
<li><a href="##(ZONE_BASE).IsPointVec3InZone">ZONE_BASE.IsPointVec3InZone</a>: Returns if a point is within the zone.</li>
|
||||
</ul>
|
||||
|
||||
<h1>1) <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
||||
<p>The ZONE_BASE class defining the base for all other zone classes.</p>
|
||||
|
||||
<h1>2) <a href="Zone.html##(ZONE_RADIUS)">Zone#ZONE_RADIUS</a> class, extends <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></h1>
|
||||
<p>The ZONE_RADIUS class defined by a zone name, a location and a radius.</p>
|
||||
|
||||
<h1>3) <a href="Zone.html##(ZONE)">Zone#ZONE</a> class, extends <a href="Zone.html##(ZONE_RADIUS)">Zone#ZONE_RADIUS</a></h1>
|
||||
<p>The ZONE class, defined by the zone name as defined within the Mission Editor.</p>
|
||||
|
||||
<h1>4) <a href="Zone.html##(ZONE_UNIT)">Zone#ZONE_UNIT</a> class, extends <a href="Zone.html##(ZONE_RADIUS)">Zone#ZONE_RADIUS</a></h1>
|
||||
<p>The ZONE_UNIT class defined by a zone around a <a href="Unit.html##(UNIT)">Unit#UNIT</a> with a radius.</p>
|
||||
|
||||
<h1>5) <a href="Zone.html##(ZONE_POLYGON)">Zone#ZONE_POLYGON</a> class, extends <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a></h1>
|
||||
<p>The ZONE_POLYGON class defined by a sequence of <a href="Group.html##(GROUP)">Group#GROUP</a> waypoints within the Mission Editor, forming a polygon.</p>
|
||||
|
||||
|
||||
<h2>Global(s)</h2>
|
||||
<table class="function_list">
|
||||
@ -172,13 +185,13 @@
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).IsPointVec2InZone">ZONE_BASE:IsPointVec2InZone(PointVec2)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
<p>Returns if a location is within the zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="##(ZONE_BASE).IsPointVec3InZone">ZONE_BASE:IsPointVec3InZone(PointVec3)</a></td>
|
||||
<td class="summary">
|
||||
|
||||
<p>Returns if a point is within the zone.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -466,16 +479,22 @@ The name of the zone as defined within the mission editor.</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<p>Returns if a location is within the zone.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> PointVec2 </em></code>: </p>
|
||||
<p><code><em><a href="DCSTypes.html##(Vec2)">DCSTypes#Vec2</a> PointVec2 </em></code>:
|
||||
The location to test.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
true if the location is within the zone.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
@ -487,16 +506,22 @@ The name of the zone as defined within the mission editor.</p>
|
||||
</dt>
|
||||
<dd>
|
||||
|
||||
|
||||
<p>Returns if a point is within the zone.</p>
|
||||
|
||||
<h3>Parameter</h3>
|
||||
<ul>
|
||||
<li>
|
||||
|
||||
<p><code><em> PointVec3 </em></code>: </p>
|
||||
<p><code><em><a href="DCSTypes.html##(Vec3)">DCSTypes#Vec3</a> PointVec3 </em></code>:
|
||||
The point to test.</p>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
<h3>Return value</h3>
|
||||
|
||||
<p><em>#boolean:</em>
|
||||
true if the point is within the zone.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="function">
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Client.html">Client</a></td>
|
||||
<td class="summary">
|
||||
<p>The CLIENT models client units in multi player missions.</p>
|
||||
<p>This module contains the CLIENT class.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -231,7 +231,7 @@
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Group.html">Group</a></td>
|
||||
<td class="summary">
|
||||
<p>GROUP class.</p>
|
||||
<p>This module contains the GROUP class.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -339,14 +339,7 @@
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Unit.html">Unit</a></td>
|
||||
<td class="summary">
|
||||
<p>UNIT Class</p>
|
||||
|
||||
<h1><a href="UNIT.html">UNIT</a> class</h1>
|
||||
<p>The <a href="UNIT.html">UNIT</a> class is a wrapper class to handle the DCS Unit objects:</p>
|
||||
|
||||
<ul>
|
||||
<li>Support all DCS Unit APIs.</li>
|
||||
</ul>
|
||||
<p>This module contains the UNIT class.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@ -358,7 +351,6 @@
|
||||
<tr>
|
||||
<td class="name" nowrap="nowrap"><a href="Zone.html">Zone</a></td>
|
||||
<td class="summary">
|
||||
<h1>ZONE Classes</h1>
|
||||
<p>This module contains the ZONE classes, inherited from <a href="Zone.html##(ZONE_BASE)">Zone#ZONE_BASE</a>.</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user