diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua
index 8f64c7b8f..e7d9825e9 100644
--- a/Moose Development/Moose/AI/AI_Designate.lua
+++ b/Moose Development/Moose/AI/AI_Designate.lua
@@ -19,20 +19,57 @@ do -- AI_DESIGNATE
-- so that following a dynamically generated menu system,
-- each detected set of potential targets can be lased or smoked...
--
- -- The Recce group is detecting as part of the DETECTION_ class continuously targets.
- -- Once targets have been detected, they will be reported. The AI_DESIGNATE object will fire the **Detect** event in this case!
- -- As part of the reporting, the following happens:
+ -- Targets can be:
--
- -- * A message is sent to each GROUP of the Attack SET_GROUP, containing the threat level and the target composition.
- -- * A menu is created and updated for each GROUP of the Attack SET_GROUP, containing the the treat level and the target composition.
+ -- * **Lased** for a period of time.
+ -- * **Smoked**. Artillery or airplanes with Illuminatino ordonance need to be present. (WIP, but early demo ready.)
+ -- * **Illuminated** through an illumination bomb. Artillery or airplanes with Illuminatino ordonance need to be present. (WIP, but early demo ready.
--
- -- One of the players in one of the Attack GROUPs, can then select a Target Set by selecting one of the menu options.
- -- Each menu option has two modes:
+ -- The following terminology is being used throughout this document:
--
- -- * If the Target Set is not being designated, then the Designate menu for the target Set will provide options to Lase or Smoke the targets.
- -- * If the Target Set is being designated, then the Designate menu will provide an option to cancel the designation.
+ -- * The **DesignateObject** is the object of the AI_DESIGNATE class, which is this class explained in the document.
+ -- * The **DetectionObject** is the object of a DETECTION_ class (DETECTION_TYPES, DETECTION_AREAS, DETECTION_UNITS), which is executing the detection and grouping of Targets into _DetectionItems_.
+ -- * **DetectionItems** is the list of detected target groupings by the _DetectionObject_. Each _DetectionItem_ contains a _TargetSet_.
+ -- * **DetectionItem** is one element of the _DetectionItems_ list, and contains a _TargetSet_.
+ -- * The **TargetSet** is a SET_UNITS collection of _Targets_, that have been detected by the _DetectionObject_.
+ -- * A **Target** is a detected UNIT object by the _DetectionObject_.
+ -- * A **Threat Level** is a number from 0 to 10 that is calculated based on the threat of the Target in an Air to Ground battle scenario.
+ -- * The **RecceSet** is a SET_GROUP collection that contains the **RecceGroups**.
+ -- * A **RecceGroup** is a GROUP object containing the **Recces**.
+ -- * A **Recce** is a UNIT object executing the reconnaissance as part the _DetectionObject_. A Recce can be of any UNIT type.
+ -- * An **AttackGroup** is a GROUP object that contain _Players_.
+ -- * A **Player** is an active CLIENT object containing a human player.
+ -- * A **Designate Menu** is the menu that is dynamically created during the designation process for each _AttackGroup_.
--
- -- In this way, the AI can assist players to designate ground targets for a coordinated attack!
+ -- The _RecceSet_ is continuously detecting for potential _Targets_, executing its task as part of the _DetectionObject_.
+ -- Once _Targets_ have been detected, the _DesignateObject_ will trigger the **Detect Event**.
+ --
+ -- As part of the Detect Event, the _DetectionItems_ list is used by the _DesignateObject_ to provide the _Players_ with:
+ --
+ -- * The _RecceGroups_ are reporting to each _AttackGroup_, sending **Messages** containing the _Threat Level_ and the _TargetSet_ composition.
+ -- * **Menu options** are created and updated for each _AttackGroup_, containing the _Threat Level_ and the _TargetSet_ composition.
+ --
+ -- A _Player_ can then select an action from the _Designate Menu_.
+ --
+ -- **Note that each selected action will be executed for a _TargetSet_, thus the _Target_ grouping done by the _DetectionObject_.**
+ --
+ -- Each **Menu Option** in the _Designate Menu_ has two modes:
+ --
+ -- 1. If the _TargetSet_ **is not being designated**, then the **Designate Menu** option for the target Set will provide options to **Lase** or **Smoke** the targets.
+ -- 2. If the Target Set **is being designated**, then the **Designate Menu** option will provide an option to stop or cancel the designation.
+ --
+ -- While designating, the _RecceGroups_ will report any change in _TargetSet_ composition or _Target_ presence.
+ --
+ -- The following logic is executed when a _TargetSet_ is selected to be *lased* from the _Designation Menu_:
+ --
+ -- * The _RecceSet_ is searched for any _Recce_ that is within *designation distance* from a _Target_ in the _TargetSet_ that is currently not being designated.
+ -- * If there is a _Recce_ found that is currently no designating a target, and is within designation distance from the _Target_, then that _Target_ will be designated.
+ -- * During designation, any _Recce_ that does not have Line of Sight (LOS) and is not within disignation distance from the _Target_, will stop designating the _Target_, and a report is given.
+ -- * When a _Recce_ is designating a _Target_, and that _Target_ is destroyed, then the _Recce_ will stop designating the _Target_, and will report the event.
+ -- * When a _Recce_ is designating a _Target_, and that _Recce_ is destroyed, then the _Recce_ will be removed from the _RecceSet_ and designation will stop without reporting.
+ -- * When all _RecceGroups_ are destroyed from the _RecceSet_, then the DesignationObject will stop functioning, and nothing will be reported.
+ --
+ -- In this way, the DesignationObject assists players to designate ground targets for a coordinated attack!
--
-- Have FUN!
--
@@ -204,6 +241,32 @@ do -- AI_DESIGNATE
-- @param #AI_DESIGNATE self
-- @param #number Delay
+ self:AddTransition( "*", "Illuminate", "*" )
+
+ --- Illuminate Handler OnBefore for AI_DESIGNATE
+ -- @function [parent=#AI_DESIGNATE] OnBeforeIlluminate
+ -- @param #AI_DESIGNATE self
+ -- @param #string From
+ -- @param #string Event
+ -- @param #string To
+ -- @return #boolean
+
+ --- Illuminate Handler OnAfter for AI_DESIGNATE
+ -- @function [parent=#AI_DESIGNATE] OnAfterIlluminate
+ -- @param #AI_DESIGNATE self
+ -- @param #string From
+ -- @param #string Event
+ -- @param #string To
+
+ --- Illuminate Trigger for AI_DESIGNATE
+ -- @function [parent=#AI_DESIGNATE] Illuminate
+ -- @param #AI_DESIGNATE self
+
+ --- Illuminate Asynchronous Trigger for AI_DESIGNATE
+ -- @function [parent=#AI_DESIGNATE] __Illuminate
+ -- @param #AI_DESIGNATE self
+ -- @param #number Delay
+
self:AddTransition( "*", "Status", "*" )
@@ -236,6 +299,7 @@ do -- AI_DESIGNATE
self.GroupSet = GroupSet
self.RecceSet = Detection:GetDetectionSetGroup()
self.Spots = {}
+ self.Designating = {}
self:SetLaserCodes( 1688 )
@@ -322,7 +386,7 @@ do -- AI_DESIGNATE
DesignateMenu = nil
self:E("Remove Menu")
end
- DesignateMenu = MENU_GROUP:New( AttackGroup, "Designate Targets" )
+ DesignateMenu = MENU_GROUP:New( AttackGroup, "Designate" )
self:E(DesignateMenu)
AttackGroup:SetState( AttackGroup, "DesignateMenu", DesignateMenu )
@@ -333,53 +397,30 @@ do -- AI_DESIGNATE
local Report = self.Detection:DetectedItemReportSummary( Index )
- local DetectedMenu = MENU_GROUP:New(
- AttackGroup,
- Report,
- DesignateMenu
- )
-
- MENU_GROUP_COMMAND:New(
- AttackGroup,
- "Lase target 60 secs",
- DetectedMenu,
- self.MenuLaseOn,
- self,
- AttackGroup,
- Index,
- 60
- )
- MENU_GROUP_COMMAND:New(
- AttackGroup,
- "Lase target 120 secs",
- DetectedMenu,
- self.MenuLaseOn,
- self,
- AttackGroup,
- Index,
- 120
- )
- MENU_GROUP_COMMAND:New(
- AttackGroup,
- "Switch laser Off",
- DetectedMenu,
- self.MenuLaseOff,
- self,
- AttackGroup,
- Index
- )
-
- MENU_GROUP_COMMAND:New(
- AttackGroup,
- "Smoke",
- DetectedMenu,
- self.MenuSmoke,
- self,
- AttackGroup,
- Index
- )
-
-
+ if not self.Designating[Index] then
+ local DetectedMenu = MENU_GROUP:New( AttackGroup, Report, DesignateMenu )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Lase target 60 secs", DetectedMenu, self.MenuLaseOn, self, AttackGroup, Index, 60 )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Lase target 120 secs", DetectedMenu, self.MenuLaseOn, self,AttackGroup, Index, 120 )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke red", DetectedMenu, self.MenuSmoke, self, AttackGroup, Index, SMOKECOLOR.Red )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke blue", DetectedMenu, self.MenuSmoke, self, AttackGroup, Index, SMOKECOLOR.Blue )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke green", DetectedMenu, self.MenuSmoke, self, AttackGroup, Index, SMOKECOLOR.Green )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke white", DetectedMenu, self.MenuSmoke, self, AttackGroup, Index, SMOKECOLOR.White )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke orange", DetectedMenu, self.MenuSmoke, self, AttackGroup, Index, SMOKECOLOR.Orange )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Illuminate", DetectedMenu, self.MenuIlluminate, self, AttackGroup, Index )
+ else
+ if self.Designating[Index] == "Laser" then
+ Report = "Lasing " .. Report
+ elseif self.Designating[Index] == "Smoke" then
+ Report = "Smoking " .. Report
+ elseif self.Designating[Index] == "Illuminate" then
+ Report = "Illuminating " .. Report
+ end
+ local DetectedMenu = MENU_GROUP:New( AttackGroup, Report, DesignateMenu )
+ if self.Designating[Index] == "Laser" then
+ MENU_GROUP_COMMAND:New( AttackGroup, "Stop lasing", DetectedMenu, self.MenuLaseOff, self, AttackGroup, Index )
+ else
+ end
+ end
end
end
)
@@ -389,11 +430,22 @@ do -- AI_DESIGNATE
---
-- @param #AI_DESIGNATE self
- function AI_DESIGNATE:MenuSmoke( AttackGroup, Index )
+ function AI_DESIGNATE:MenuSmoke( AttackGroup, Index, Color )
self:E("Designate through Smoke")
- self:__Smoke( 1, AttackGroup, Index )
+ self.Designating[Index] = "Smoke"
+ self:__Smoke( 1, AttackGroup, Index, Color )
+ end
+
+ ---
+ -- @param #AI_DESIGNATE self
+ function AI_DESIGNATE:MenuIlluminate( AttackGroup, Index )
+
+ self:E("Designate through Illumination")
+
+ self.Designating[Index] = "Illuminate"
+ self:__Illuminate( 1, AttackGroup, Index )
end
---
@@ -401,7 +453,8 @@ do -- AI_DESIGNATE
function AI_DESIGNATE:MenuLaseOn( AttackGroup, Index, Duration )
self:E("Designate through Lase")
-
+
+ self.Designating[Index] = "Laser"
self:__LaseOn( 1, AttackGroup, Index, Duration )
end
@@ -411,6 +464,7 @@ do -- AI_DESIGNATE
self:E("Lasing off")
+ self.Designating[Index] = nil
self:__LaseOff( 1, AttackGroup, Index )
end
@@ -419,7 +473,7 @@ do -- AI_DESIGNATE
-- @return #AI_DESIGNATE
function AI_DESIGNATE:onafterLaseOn( From, Event, To, AttackGroup, Index, Duration )
- self:__Lasing( -5, AttackGroup, Index, Duration )
+ self:__Lasing( 5, AttackGroup, Index, Duration )
end
@@ -448,45 +502,58 @@ do -- AI_DESIGNATE
--- @param Wrapper.Unit#UNIT SmokeUnit
function( TargetUnit )
self:E("In procedure")
- --if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then
if TargetUnit:IsAlive() then
local Spot = self.Spots[TargetUnit]
if (not Spot) or ( Spot and Spot:IsLasing() == false ) then
- local NearestRecceGroup = self.RecceSet:FindNearestGroupFromPointVec2( TargetUnit:GetPointVec2() )
- if NearestRecceGroup then
- for UnitID, UnitData in pairs( NearestRecceGroup:GetUnits() or {} ) do
+ for RecceGroupID, RecceGroup in pairs( self.RecceSet:GetSet() ) do
+ for UnitID, UnitData in pairs( RecceGroup:GetUnits() or {} ) do
local RecceUnit = UnitData -- Wrapper.Unit#UNIT
if RecceUnit:IsLasing() == false then
- local LaserCodeIndex = math.random(1, #self.LaserCodes)
- local LaserCode = self.LaserCodes[LaserCodeIndex]
- if not self.LaserCodesUsed[LaserCode] then
- MoreTargets = true
- self.LaserCodesUsed[LaserCode] = LaserCodeIndex
- local Spot = RecceUnit:LaseUnit( TargetUnit, LaserCode, Duration )
- self.Spots[TargetUnit] = Spot
- RecceUnit:MessageToGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. " seconds. Laser Code: " .. Spot.LaserCode, 15, AttackGroup )
- break
+ if RecceUnit:IsDetected( TargetUnit ) and RecceUnit:IsLOS( TargetUnit ) then
+ local LaserCodeIndex = math.random( 1, #self.LaserCodes )
+ local LaserCode = self.LaserCodes[LaserCodeIndex]
+ if not self.LaserCodesUsed[LaserCode] then
+ MoreTargets = true
+ self.LaserCodesUsed[LaserCode] = LaserCodeIndex
+ local Spot = RecceUnit:LaseUnit( TargetUnit, LaserCode, Duration )
+ function Spot:OnAfterDestroyed( From, Event, To )
+ self:E( "Destroyed Message" )
+ self.Recce:MessageToGroup( "Target " .. TargetUnit:GetTypeName() .. " destroyed." .. TargetSetUnit:Count() .. " targets left.", 5, AttackGroup )
+ end
+ self.Spots[TargetUnit] = Spot
+ RecceUnit:MessageToGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. "s, code: " .. Spot.LaserCode, 5, AttackGroup )
+ break
+ end
end
+ else
+ -- The Recce is lasing, but the Target is not detected or within LOS. So stop lasing and send a report.
+ if not RecceUnit:IsDetected( TargetUnit ) or not RecceUnit:IsLOS( TargetUnit ) then
+ local Spot = self.Spots[TargetUnit] -- Core.Spot#SPOT
+ if Spot then
+ Spot.Recce:LaseOff()
+ Spot.Recce:MessageToGroup( "Target " .. TargetUnit:GetTypeName() "out of LOS. Cancelling lase!", 5, AttackGroup )
+ end
+ end
end
end
end
else
MoreTargets = true
local RecceUnit = Spot.Recce
- RecceUnit:MessageToGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. " seconds. Laser Code: " .. Spot.LaserCode, 15, AttackGroup )
+ RecceUnit:MessageToGroup( "Lasing " .. TargetUnit:GetTypeName() .. ", code " .. Spot.LaserCode, 5, AttackGroup )
end
else
self.Spots[TargetUnit] = nil
end
- --end
end
)
if MoreTargets == true then
- self:__Lasing( -30, AttackGroup, Index, Duration )
+ self:__Lasing( 30, AttackGroup, Index, Duration )
else
self:__LaseOff( 1, AttackGroup, Index )
end
+
self:SetDesignateMenu()
end
@@ -519,7 +586,7 @@ do -- AI_DESIGNATE
---
-- @param #AI_DESIGNATE self
-- @return #AI_DESIGNATE
- function AI_DESIGNATE:onafterSmoke( From, Event, To, AttackGroup, Index )
+ function AI_DESIGNATE:onafterSmoke( From, Event, To, AttackGroup, Index, Color )
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
@@ -532,7 +599,33 @@ do -- AI_DESIGNATE
SCHEDULER:New( self,
function()
if SmokeUnit:IsAlive() then
- SmokeUnit:Smoke( SMOKECOLOR.Red, 150 )
+ SmokeUnit:Smoke( Color, 150 )
+ end
+ end, {}, math.random( 10, 60 )
+ )
+ --end
+ end
+ )
+
+
+ end
+
+ --- Illuminating
+ -- @param #AI_DESIGNATE self
+ -- @return #AI_DESIGNATE
+ function AI_DESIGNATE:onafterIlluminate( From, Event, To, AttackGroup, Index )
+
+ local TargetSetUnit = self.Detection:GetDetectedSet( Index )
+
+ TargetSetUnit:ForEachUnit(
+ --- @param Wrapper.Unit#UNIT SmokeUnit
+ function( SmokeUnit )
+ self:E("In procedure")
+ --if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then
+ SCHEDULER:New( self,
+ function()
+ if SmokeUnit:IsAlive() then
+ SmokeUnit:GetPointVec3():AddY(800):IlluminationBomb()
end
end, {}, math.random( 10, 60 )
)
diff --git a/Moose Development/Moose/Core/Cargo.lua b/Moose Development/Moose/Core/Cargo.lua
index 777a70767..2199ad032 100644
--- a/Moose Development/Moose/Core/Cargo.lua
+++ b/Moose Development/Moose/Core/Cargo.lua
@@ -1,4 +1,4 @@
---- **Core** -- Management of CARGO logistics, that can be transported from and to transportation carriers.
+--- **(R2.1) Core** -- Management of CARGO logistics, that can be transported from and to transportation carriers.
--
-- 
--
@@ -165,7 +165,7 @@ do -- CARGO
-- @field #boolean Representable This flag defines if the cargo can be represented by a DCS Unit.
-- @field #boolean Containable This flag defines if the cargo can be contained within a DCS Unit.
- --- # CARGO class, extends @{Fsm#FSM_PROCESS}
+ --- # (R2.1) CARGO class, extends @{Fsm#FSM_PROCESS}
--
-- The CARGO class defines the core functions that defines a cargo object within MOOSE.
-- A cargo is a logical object defined that is available for transport, and has a life status within a simulation.
@@ -224,7 +224,7 @@ do -- CARGO
-- @map < #string, Wrapper.Positionable#POSITIONABLE > The alive POSITIONABLE objects representing the the cargo.
---- CARGO Constructor. This class is an abstract class and should not be instantiated.
+--- (R2.1) CARGO Constructor. This class is an abstract class and should not be instantiated.
-- @param #CARGO self
-- @param #string Type
-- @param #string Name
@@ -266,7 +266,7 @@ function CARGO:New( Type, Name, Weight )
return self
end
---- Get the name of the Cargo.
+--- (R2.1) Get the name of the Cargo.
-- @param #CARGO self
-- @return #string The name of the Cargo.
function CARGO:GetName()
diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua
index 7067dc690..0c8e1885c 100644
--- a/Moose Development/Moose/Core/Point.lua
+++ b/Moose Development/Moose/Core/Point.lua
@@ -789,6 +789,25 @@ function POINT_VEC3:FlareRed( Azimuth )
self:Flare( FLARECOLOR.Red, Azimuth )
end
+--- (R2.1) Returns if a PointVec3 has Line of Sight (LOS) with the ToPointVec3.
+-- @param #POINT_VEC3 self
+-- @param #POINT_VEC3 ToPointVec3
+-- @return #boolean true If the ToPointVec3 has LOS with the PointVec3, otherwise false.
+function POINT_VEC3:IsLOS( ToPointVec3 )
+
+ -- Measurement of visibility should not be from the ground, so Adding a hypotethical 2 meters to each PointVec3.
+ local FromVec3 = self:GetVec3()
+ FromVec3.y = FromVec3.y + 2
+
+ local ToVec3 = ToPointVec3:GetVec3()
+ ToVec3.y = ToVec3.y + 2
+
+ local IsLOS = land.isVisible( FromVec3, ToVec3 )
+
+ return IsLOS
+end
+
+
end
do -- POINT_VEC2
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 0087fd667..49f4e8369 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -2440,7 +2440,7 @@ end
--- @type SET_CARGO
-- @extends Core.Set#SET_BASE
---- # SET_CARGO class, extends @{Set#SET_BASE}
+--- # (R2.1) SET_CARGO class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_CARGO} class to build sets of cargos optionally belonging to certain:
--
@@ -2502,7 +2502,7 @@ SET_CARGO = {
}
---- Creates a new SET_CARGO object, building a set of cargos belonging to a coalitions and categories.
+--- (R2.1) Creates a new SET_CARGO object, building a set of cargos belonging to a coalitions and categories.
-- @param #SET_CARGO self
-- @return #SET_CARGO self
-- @usage
@@ -2515,7 +2515,7 @@ function SET_CARGO:New()
return self
end
---- Add CARGOs to SET_CARGO.
+--- (R2.1) Add CARGOs to SET_CARGO.
-- @param Core.Set#SET_CARGO self
-- @param #string AddCargoNames A single name or an array of CARGO names.
-- @return self
@@ -2530,7 +2530,7 @@ function SET_CARGO:AddCargosByName( AddCargoNames )
return self
end
---- Remove CARGOs from SET_CARGO.
+--- (R2.1) Remove CARGOs from SET_CARGO.
-- @param Core.Set#SET_CARGO self
-- @param Wrapper.Cargo#CARGO RemoveCargoNames A single name or an array of CARGO names.
-- @return self
@@ -2546,7 +2546,7 @@ function SET_CARGO:RemoveCargosByName( RemoveCargoNames )
end
---- Finds a Cargo based on the Cargo Name.
+--- (R2.1) Finds a Cargo based on the Cargo Name.
-- @param #SET_CARGO self
-- @param #string CargoName
-- @return Wrapper.Cargo#CARGO The found Cargo.
@@ -2558,7 +2558,7 @@ end
---- Builds a set of cargos of coalitions.
+--- (R2.1) Builds a set of cargos of coalitions.
-- Possible current coalitions are red, blue and neutral.
-- @param #SET_CARGO self
-- @param #string Coalitions Can take the following values: "red", "blue", "neutral".
@@ -2576,7 +2576,7 @@ function SET_CARGO:FilterCoalitions( Coalitions )
return self
end
---- Builds a set of cargos of defined cargo types.
+--- (R2.1) Builds a set of cargos of defined cargo types.
-- Possible current types are those types known within DCS world.
-- @param #SET_CARGO self
-- @param #string Types Can take those type strings known within DCS world.
@@ -2595,7 +2595,7 @@ function SET_CARGO:FilterTypes( Types )
end
---- Builds a set of cargos of defined countries.
+--- (R2.1) Builds a set of cargos of defined countries.
-- Possible current countries are those known within DCS world.
-- @param #SET_CARGO self
-- @param #string Countries Can take those country strings known within DCS world.
@@ -2614,7 +2614,7 @@ function SET_CARGO:FilterCountries( Countries )
end
---- Builds a set of cargos of defined cargo prefixes.
+--- (R2.1) Builds a set of cargos of defined cargo prefixes.
-- All the cargos starting with the given prefixes will be included within the set.
-- @param #SET_CARGO self
-- @param #string Prefixes The prefix of which the cargo name starts with.
@@ -2634,7 +2634,7 @@ end
---- Starts the filtering.
+--- (R2.1) Starts the filtering.
-- @param #SET_CARGO self
-- @return #SET_CARGO self
function SET_CARGO:FilterStart()
@@ -2650,7 +2650,7 @@ function SET_CARGO:FilterStart()
end
---- Handles the Database to check on an event (birth) that the Object was added in the Database.
+--- (R2.1) Handles the Database to check on an event (birth) that the Object was added in the Database.
-- This is required, because sometimes the _DATABASE birth event gets called later than the SET_BASE birth event!
-- @param #SET_CARGO self
-- @param Core.Event#EVENTDATA Event
@@ -2662,7 +2662,7 @@ function SET_CARGO:AddInDatabase( Event )
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
end
---- Handles the Database to check on any event that Object exists in the Database.
+--- (R2.1) Handles the Database to check on any event that Object exists in the Database.
-- This is required, because sometimes the _DATABASE event gets called later than the SET_BASE event or vise versa!
-- @param #SET_CARGO self
-- @param Core.Event#EVENTDATA Event
@@ -2674,7 +2674,7 @@ function SET_CARGO:FindInDatabase( Event )
return Event.IniDCSUnitName, self.Database[Event.IniDCSUnitName]
end
---- Iterate the SET_CARGO and call an interator function for each CARGO, providing the CARGO and optional parameters.
+--- (R2.1) Iterate the SET_CARGO and call an interator function for each CARGO, providing the CARGO and optional parameters.
-- @param #SET_CARGO self
-- @param #function IteratorFunction The function that will be called when there is an alive CARGO in the SET_CARGO. The function needs to accept a CARGO parameter.
-- @return #SET_CARGO self
@@ -2686,7 +2686,7 @@ function SET_CARGO:ForEachCargo( IteratorFunction, ... )
return self
end
---- Iterate the SET_CARGO while identifying the nearest @{Cargo#CARGO} from a @{Point#POINT_VEC2}.
+--- (R2.1) Iterate the SET_CARGO while identifying the nearest @{Cargo#CARGO} from a @{Point#POINT_VEC2}.
-- @param #SET_CARGO self
-- @param Core.Point#POINT_VEC2 PointVec2 A @{Point#POINT_VEC2} object from where to evaluate the closest @{Cargo#CARGO}.
-- @return Wrapper.Cargo#CARGO The closest @{Cargo#CARGO}.
@@ -2699,7 +2699,7 @@ end
----
+--- (R2.1)
-- @param #SET_CARGO self
-- @param AI.AI_Cargo#AI_CARGO MCargo
-- @return #SET_CARGO self
@@ -2753,7 +2753,7 @@ function SET_CARGO:IsIncludeObject( MCargo )
return MCargoInclude
end
---- Handles the OnEventNewCargo event for the Set.
+--- (R2.1) Handles the OnEventNewCargo event for the Set.
-- @param #SET_CARGO self
-- @param Core.Event#EVENTDATA EventData
function SET_CARGO:OnEventNewCargo( EventData )
@@ -2765,7 +2765,7 @@ function SET_CARGO:OnEventNewCargo( EventData )
end
end
---- Handles the OnDead or OnCrash event for alive units set.
+--- (R2.1) Handles the OnDead or OnCrash event for alive units set.
-- @param #SET_CARGO self
-- @param Core.Event#EVENTDATA EventData
function SET_CARGO:OnEventDeleteCargo( EventData )
diff --git a/Moose Development/Moose/Core/SpawnStatic.lua b/Moose Development/Moose/Core/SpawnStatic.lua
index ed2493c8c..0ddbe4d12 100644
--- a/Moose Development/Moose/Core/SpawnStatic.lua
+++ b/Moose Development/Moose/Core/SpawnStatic.lua
@@ -1,4 +1,4 @@
---- **Core** -- Spawn dynamically new STATICs in your missions.
+--- (R2.1) **Core** -- Spawn dynamically new STATICs in your missions.
--
-- 
--
@@ -91,7 +91,7 @@ SPAWNSTATIC = {
-- @list SpawnZone
---- Creates the main object to spawn a @{Static} defined in the ME.
+--- (R2.1) Creates the main object to spawn a @{Static} defined in the ME.
-- @param #SPAWNSTATIC self
-- @param #string SpawnTemplatePrefix is the name of the Group in the ME that defines the Template. Each new group will have the name starting with SpawnTemplatePrefix.
-- @return #SPAWNSTATIC
@@ -113,7 +113,7 @@ function SPAWNSTATIC:NewFromStatic( SpawnTemplatePrefix, CountryID )
return self
end
---- Creates the main object to spawn a @{Static} based on a type name.
+--- (R2.1) Creates the main object to spawn a @{Static} based on a type name.
-- @param #SPAWNSTATIC self
-- @param #string SpawnTypeName is the name of the type.
-- @return #SPAWNSTATIC
@@ -131,7 +131,7 @@ function SPAWNSTATIC:NewFromType( SpawnTypeName, SpawnShapeName, SpawnCategory,
end
---- Creates a new @{Static} from a POINT_VEC2.
+--- (R2.1) Creates a new @{Static} from a POINT_VEC2.
-- @param #SPAWNSTATIC self
-- @param Core.Point#POINT_VEC2 PointVec2 The 2D coordinate where to spawn the static.
-- @param #number Heading The heading of the static, which is a number in degrees from 0 to 360.
@@ -161,7 +161,7 @@ function SPAWNSTATIC:SpawnFromPointVec2( PointVec2, Heading, NewName )
return Static
end
---- Creates a new @{Static} from a @{Zone}.
+--- (R2.1) Creates a new @{Static} from a @{Zone}.
-- @param #SPAWNSTATIC self
-- @param Core.Zone#ZONE_BASE Zone The Zone where to spawn the static.
-- @param #number Heading The heading of the static, which is a number in degrees from 0 to 360.
diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua
index f532ffd15..18ba85400 100644
--- a/Moose Development/Moose/Core/Spot.lua
+++ b/Moose Development/Moose/Core/Spot.lua
@@ -50,7 +50,7 @@ do
function SPOT:New( Recce )
local self = BASE:Inherit( self, FSM:New() ) -- #SPOT
- self:F( { Type, Name, Weight } )
+ self:F( {} )
self:SetStartState( "Off" )
self:AddTransition( "Off", "LaseOn", "On" )
@@ -82,7 +82,7 @@ do
self:AddTransition( "On", "Lasing", "On" )
- self:AddTransition( "On" , "LaseOff", "Off" )
+ self:AddTransition( { "On", "Destroyed" } , "LaseOff", "Off" )
--- LaseOff Handler OnBefore for SPOT
-- @function [parent=#SPOT] OnBeforeLaseOff
@@ -108,6 +108,32 @@ do
-- @param #SPOT self
-- @param #number Delay
+ self:AddTransition( "*" , "Destroyed", "Destroyed" )
+
+ --- Destroyed Handler OnBefore for SPOT
+ -- @function [parent=#SPOT] OnBeforeDestroyed
+ -- @param #SPOT self
+ -- @param #string From
+ -- @param #string Event
+ -- @param #string To
+ -- @return #boolean
+
+ --- Destroyed Handler OnAfter for SPOT
+ -- @function [parent=#SPOT] OnAfterDestroyed
+ -- @param #SPOT self
+ -- @param #string From
+ -- @param #string Event
+ -- @param #string To
+
+ --- Destroyed Trigger for SPOT
+ -- @function [parent=#SPOT] Destroyed
+ -- @param #SPOT self
+
+ --- Destroyed Asynchronous Trigger for SPOT
+ -- @function [parent=#SPOT] __Destroyed
+ -- @param #SPOT self
+ -- @param #number Delay
+
self.Recce = Recce
@@ -127,6 +153,7 @@ do
-- @param #number LaserCode
-- @param #number Duration
function SPOT:onafterLaseOn( From, Event, To, Target, LaserCode, Duration )
+ self:E( { "LaseOn", Target, LaserCode, Duration } )
local function StopLase( self )
self:LaseOff()
@@ -137,8 +164,8 @@ do
local RecceDcsUnit = self.Recce:GetDCSObject()
- self.Spot = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, Target:GetPointVec3():AddY(1):GetVec3() )
- self.Spot = Spot.createLaser( RecceDcsUnit, { x = 0, y = 2, z = 0 }, Target:GetPointVec3():AddY(1):GetVec3(), LaserCode )
+ self.SpotIR = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, Target:GetPointVec3():AddY(1):GetVec3() )
+ self.SpotLaser = Spot.createLaser( RecceDcsUnit, { x = 0, y = 2, z = 0 }, Target:GetPointVec3():AddY(1):GetVec3(), LaserCode )
if Duration then
self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration )
@@ -148,14 +175,16 @@ do
self:__Lasing( -0.2 )
end
-
+
--- @param #SPOT self
-- @param Core.Event#EVENTDATA EventData
function SPOT:OnEventDead(EventData)
+ self:E( { Dead = EventData.IniDCSUnitName, Target = self.Target } )
if self.Target then
if EventData.IniDCSUnitName == self.Target:GetName() then
self:E( {"Target dead ", self.Target:GetName() } )
- self:__LaseOff( 0.1 )
+ self:Destroyed()
+ self:LaseOff( 0.1 )
end
end
end
@@ -167,10 +196,11 @@ do
function SPOT:onafterLasing( From, Event, To )
if self.Target:IsAlive() then
- self.Spot:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
+ self.SpotIR:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
+ self.SpotLaser:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
self:__Lasing( -0.2 )
else
- self:__LaseOff( 0.2 )
+ self:E( { "Target is not alive", self.Target:IsAlive() } )
end
end
@@ -182,9 +212,14 @@ do
-- @return #SPOT
function SPOT:onafterLaseOff( From, Event, To )
- self:E( {"Stopped lasing for ", self.Target:GetName() } )
- self.Spot:destroy()
- self.Spot = nil
+ self:E( {"Stopped lasing for ", self.Target:GetName() , SpotIR = self.SportIR, SpotLaser = self.SpotLaser } )
+
+ self.SpotIR:destroy()
+ self.SpotLaser:destroy()
+
+ self.SpotIR = nil
+ self.SpotLaser = nil
+
if self.ScheduleID then
self.LaseScheduler:Stop(self.ScheduleID)
end
@@ -203,7 +238,7 @@ do
local Lasing = false
- if self.Spot then
+ if self.SpotIR then
Lasing = true
end
diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua
index df7f17c85..21a67981b 100644
--- a/Moose Development/Moose/Wrapper/Controllable.lua
+++ b/Moose Development/Moose/Wrapper/Controllable.lua
@@ -1786,17 +1786,21 @@ function CONTROLLABLE:IsTargetDetected( DCSObject )
self:F2( self.ControllableName )
local DCSControllable = self:GetDCSObject()
+
if DCSControllable then
+ local DetectionVisual = ( DetectVisual and DetectVisual == true ) and Controller.Detection.VISUAL or nil
+ local DetectionOptical = ( DetectOptical and DetectOptical == true ) and Controller.Detection.OPTICAL or nil
+ local DetectionRadar = ( DetectRadar and DetectRadar == true ) and Controller.Detection.RADAR or nil
+ local DetectionIRST = ( DetectIRST and DetectIRST == true ) and Controller.Detection.IRST or nil
+ local DetectionRWR = ( DetectRWR and DetectRWR == true ) and Controller.Detection.RWR or nil
+ local DetectionDLINK = ( DetectDLINK and DetectDLINK == true ) and Controller.Detection.DLINK or nil
+
+ local Controller = self:_GetController()
+
local TargetIsDetected, TargetIsVisible, TargetLastTime, TargetKnowType, TargetKnowDistance, TargetLastPos, TargetLastVelocity
- = self:_GetController().isTargetDetected( self:_GetController(), DCSObject,
- Controller.Detection.VISUAL,
- Controller.Detection.OPTIC,
- Controller.Detection.RADAR,
- Controller.Detection.IRST,
- Controller.Detection.RWR,
- Controller.Detection.DLINK
- )
+ = Controller:isTargetDetected( DCSObject, DetectionVisual, DetectionOptical, DetectionRadar, DetectionIRST, DetectionRWR, DetectionDLINK )
+
return TargetIsDetected, TargetIsVisible, TargetLastTime, TargetKnowType, TargetKnowDistance, TargetLastPos, TargetLastVelocity
end
diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua
index be15b3466..c04d1cc06 100644
--- a/Moose Development/Moose/Wrapper/Positionable.lua
+++ b/Moose Development/Moose/Wrapper/Positionable.lua
@@ -443,7 +443,7 @@ function POSITIONABLE:Message( Message, Duration, Name )
return nil
end
---- Create a @{Radio#RADIO}, to allow radio transmission for this POSITIONABLE.
+--- (R2.1) Create a @{Radio#RADIO}, to allow radio transmission for this POSITIONABLE.
-- Set parameters with the methods provided, then use RADIO:Broadcast() to actually broadcast the message
-- @param #POSITIONABLE self
-- @return #RADIO Radio
@@ -452,7 +452,7 @@ function POSITIONABLE:GetRadio()
return RADIO:New(self)
end
---- Create a @{Radio#BEACON}, to allow this POSITIONABLE to broadcast beacon signals
+--- (R2.1) Create a @{Radio#BEACON}, to allow this POSITIONABLE to broadcast beacon signals
-- @param #POSITIONABLE self
-- @return #RADIO Radio
function POSITIONABLE:GetBeacon()
@@ -460,7 +460,7 @@ function POSITIONABLE:GetBeacon()
return BEACON:New(self)
end
---- Start Lasing a POSITIONABLE
+--- (R2.1) Start Lasing a POSITIONABLE
-- @param #POSITIONABLE self
-- @param #POSITIONABLE Target
-- @param #number LaserCode
@@ -482,15 +482,12 @@ function POSITIONABLE:LaseUnit( Target, LaserCode, Duration )
end
---- Stop Lasing a POSITIONABLE
+--- (R2.1) Stop Lasing a POSITIONABLE
-- @param #POSITIONABLE self
--- @param #POSITIONABLE Target
-- @return #POSITIONABLE
-function POSITIONABLE:LaseOff( Target )
+function POSITIONABLE:LaseOff()
self:F2()
- local TargetUnitName = Target:GetName()
-
if self.Spot then
self.Spot:LaseOff()
self.Spot = nil
@@ -499,7 +496,7 @@ function POSITIONABLE:LaseOff( Target )
return self
end
---- Check if the POSITIONABLE is lasing a target
+--- (R2.1) Check if the POSITIONABLE is lasing a target
-- @param #POSITIONABLE self
-- @return #boolean true if it is lasing a target
function POSITIONABLE:IsLasing()
diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua
index 183bc4d5a..d35ffc175 100644
--- a/Moose Development/Moose/Wrapper/Unit.lua
+++ b/Moose Development/Moose/Wrapper/Unit.lua
@@ -64,13 +64,18 @@
--
-- The UNIT class contains methods to test the location or proximity against zones or other objects.
--
--- ### Zones
+-- ### Zones range
--
-- 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}.
--
--- ### Units
+-- ### Unit range
+--
+-- * Test if another DCS Unit is within a given radius of the current DCS Unit, use the @{#UNIT.OtherUnitInRadius}() method.
+--
+-- ## Test Line of Sight
+--
+-- * Use the @{#UNIT.IsLOS}() method to check if the given unit is within line of sight.
--
--- Test if another DCS Unit is within a given radius of the current DCS Unit, use the @{#UNIT.OtherUnitInRadius}() method.
--
-- @field #UNIT UNIT
UNIT = {
@@ -1002,6 +1007,32 @@ do -- Event Handling
return self
end
+
+end
+
+do -- Detection
+
+ --- (R2.1) Returns if a unit is detecting the TargetUnit.
+ -- @param #UNIT self
+ -- @param #UNIT TargetUnit
+ -- @return #boolean true If the TargetUnit is detected by the unit, otherwise false.
+ function UNIT:IsDetected( TargetUnit )
+
+ local TargetIsDetected, TargetIsVisible, TargetLastTime, TargetKnowType, TargetKnowDistance, TargetLastPos, TargetLastVelocity = self:IsTargetDetected( TargetUnit:GetDCSObject() )
+
+ return TargetIsDetected
+ end
+
+ --- (R2.1) Returns if a unit has Line of Sight (LOS) with the TargetUnit.
+ -- @param #UNIT self
+ -- @param #UNIT TargetUnit
+ -- @return #boolean true If the TargetUnit has LOS with the unit, otherwise false.
+ function UNIT:IsLOS( TargetUnit )
+
+ local IsLOS = self:GetPointVec3():IsLOS( TargetUnit:GetPointVec3() )
+
+ return IsLOS
+ end
end
\ No newline at end of file
diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua
index 33149fc5c..07c8fc12b 100644
--- a/Moose Mission Setup/Moose.lua
+++ b/Moose Mission Setup/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20170419_1937' )
+env.info( 'Moose Generation Timestamp: 20170422_1159' )
local base = _G
diff --git a/docs/Documentation/AI_Designate.html b/docs/Documentation/AI_Designate.html
index b551f163f..d8ba9e2c8 100644
--- a/docs/Documentation/AI_Designate.html
+++ b/docs/Documentation/AI_Designate.html
@@ -121,6 +121,12 @@ each detected set of potential targets can be lased or smoked...
+ | AI_DESIGNATE.Designating |
+
+
+ |
+
+
| AI_DESIGNATE:Detect() |
Detect Trigger for AI_DESIGNATE
@@ -154,6 +160,12 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE.LaserCodes |
+ |
+
+
+ | AI_DESIGNATE.LaserCodesUsed |
+
+
|
@@ -328,6 +340,12 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE:onafterLaseOn(From, Event, To, AttackGroup, Index, Duration) |
+ |
+
+
+ | AI_DESIGNATE:onafterLasing(From, Event, To, AttackGroup, Index, Duration) |
+
+
|
@@ -358,24 +376,59 @@ each detected set of potential targets can be lased or smoked...
-The Recce group is detecting as part of the DETECTION_ class continuously targets.
-Once targets have been detected, they will be reported. The AI_DESIGNATE object will fire the Detect event in this case!
-As part of the reporting, the following happens:
+The following terminology is being used throughout this document:
- - A message is sent to each GROUP of the Attack SET_GROUP, containing the threat level and the target composition.
- - A menu is created and updated for each GROUP of the Attack SET_GROUP, containing the the treat level and the target composition.
+ - The DesignateObject is the object of the AI_DESIGNATE class, which is this class explained in the document.
+ - The DetectionObject is the object of a DETECTION_ class (DETECTIONTYPES, DETECTIONAREAS, DETECTION_UNITS), which is executing the detection and grouping of Targets into DetectionItems.
+ - DetectionItems is the list of detected target groupings by the DetectionObject. Each DetectionItem contains a TargetSet.
+ - DetectionItem is one element of the DetectionItems list, and contains a TargetSet.
+ - The TargetSet is a SET_UNITS collection of Targets, that have been detected by the DetectionObject.
+ - A Target is a detected UNIT object by the DetectionObject.
+ - A Threat Level is a number from 0 to 10 that is calculated based on the threat of the Target in an Air to Ground battle scenario.
+ - The RecceSet is a SET_GROUP collection that contains the RecceGroups.
+ - A RecceGroup is a GROUP object containing the Recces.
+ - A Recce is a UNIT object executing the reconnaissance as part the DetectionObject. A Recce can be of any UNIT type.
+ - An AttackGroup is a GROUP object that contain Players.
+ - A Player is an active CLIENT object containing a human player.
+ - A Designate Menu is the menu that is dynamically created during the designation process for each AttackGroup.
-One of the players in one of the Attack GROUPs, can then select a Target Set by selecting one of the menu options.
-Each menu option has two modes:
+The RecceSet is continuously detecting for potential Targets, executing its task as part of the DetectionObject.
+Once Targets have been detected, the DesignateObject will trigger the Detect Event.
+
+As part of the Detect Event, the DetectionItems list is used by the DesignateObject to provide the Players with:
- - If the Target Set is not being designated, then the Designate menu for the target Set will provide options to Lase or Smoke the targets.
- - If the Target Set is being designated, then the Designate menu will provide an option to cancel the designation.
+ - The RecceGroups are reporting to each AttackGroup, sending Messages containing the Threat Level and the TargetSet composition.
+ - Menu options are created and updated for each AttackGroup, containing the Threat Level and the TargetSet composition.
-In this way, the AI can assist players to designate ground targets for a coordinated attack!
+A Player can then select an action from the Designate Menu.
+
+Note that each selected action will be executed for a TargetSet, thus the Target grouping done by the DetectionObject.
+
+Each Menu Option in the Designate Menu has two modes:
+
+
+ - If the TargetSet is not being designated, then the Designate Menu option for the target Set will provide options to Lase or Smoke the targets.
+ - If the Target Set is being designated, then the Designate Menu option will provide an option to stop or cancel the designation.
+
+
+While designating, the RecceGroups will report any change in TargetSet composition or Target presence.
+
+The following logic is executed when a TargetSet is selected to be lased from the Designation Menu:
+
+
+ - The RecceSet is searched for any Recce that is within designation distance from a Target in the TargetSet that is currently not being designated.
+ - If there is a Recce found that is currently no designating a target, and is within designation distance from the Target, then that Target will be designated.
+ - During designation, any Recce that does not have Line of Sight (LOS) and is not within disignation distance from the Target, will stop designating the Target, and a report is given.
+ - When a Recce is designating a Target, and that Target is destroyed, then the Recce will stop designating the Target, and will report the event.
+ - When a Recce is designating a Target, and that Recce is destroyed, then the Recce will be removed from the RecceSet and designation will stop without reporting.
+ - When all RecceGroups are destroyed from the RecceSet, then the DesignationObject will stop functioning, and nothing will be reported.
+
+
+In this way, the DesignationObject assists players to designate ground targets for a coordinated attack!
Have FUN!
@@ -437,6 +490,20 @@ One laser code can be given or an sequence of laser codes through an table...
+
+
+AI_DESIGNATE.Designating
+
+
+
+
+
+
+
+
+
+-
+
AI_DESIGNATE:Detect()
@@ -512,6 +579,20 @@ One laser code can be given or an sequence of laser codes through an table...
+
+
+-
+
+
+
+AI_DESIGNATE.LaserCodesUsed
+
+
+-
+
+
+
@@ -1315,6 +1396,57 @@ number> LaserCodes
#AI_DESIGNATE:
+
+
+
+-
+
+
+AI_DESIGNATE:onafterLasing(From, Event, To, AttackGroup, Index, Duration)
+
+
+-
+
+
+
+
Parameters
+
+ -
+
+
From :
+
+
+ -
+
+
Event :
+
+
+ -
+
+
To :
+
+
+ -
+
+
AttackGroup :
+
+
+ -
+
+
Index :
+
+
+ -
+
+
Duration :
+
+
+
+ Return value
+
+#AI_DESIGNATE:
+
+
diff --git a/docs/Documentation/Base.html b/docs/Documentation/Base.html
index 30a860472..2a7c7a64b 100644
--- a/docs/Documentation/Base.html
+++ b/docs/Documentation/Base.html
@@ -312,6 +312,12 @@ YYYY-MM-DD: CLASS:NewFunction( Params ) added
| BASE:OnEventCrash(EventData) |
Occurs when any aircraft crashes into the ground and is completely destroyed.
+ |
+
+
+ | BASE:OnEventDead(EventData) |
+
+ Occurs when an object is dead.
|
@@ -1398,6 +1404,31 @@ The EventData structure.
-
+
+BASE:OnEventDead(EventData)
+
+
+-
+
+
Occurs when an object is dead.
+
+
+initiator : The unit that is dead.
+
+ Parameter
+
+
+
+
+-
+
BASE:OnEventEjection(EventData)
diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html
index 2b21da531..c0533186b 100644
--- a/docs/Documentation/Cargo.html
+++ b/docs/Documentation/Cargo.html
@@ -95,7 +95,7 @@
Module Cargo
-
Core -- Management of CARGO logistics, that can be transported from and to transportation carriers.
+
(R2.1) Core -- Management of CARGO logistics, that can be transported from and to transportation carriers.
@@ -136,7 +136,7 @@
| CARGO |
-
+
The CARGO class defines the core functions that defines a cargo object within MOOSE.
|
@@ -217,7 +217,7 @@
| CARGO:GetName() |
- Get the name of the Cargo.
+(R2.1) Get the name of the Cargo.
|
@@ -283,7 +283,7 @@
| CARGO:New(Type, Name, Weight, NearRadius) |
- CARGO Constructor.
+(R2.1) CARGO Constructor.
|
@@ -721,7 +721,7 @@
-
-
+
The CARGO class defines the core functions that defines a cargo object within MOOSE.
@@ -970,7 +970,7 @@ The radius when the cargo will board the Carrier (to avoid collision).
-
-
Get the name of the Cargo.
+(R2.1) Get the name of the Cargo.
Return value
@@ -1186,7 +1186,7 @@ The Carrier that will hold the cargo.
-
-
CARGO Constructor.
+(R2.1) CARGO Constructor.
This class is an abstract class and should not be instantiated.
@@ -2847,7 +2847,6 @@ The range till cargo will board.
-
-
CARGO_UNIT.CargoCarrier
diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html
index f5ebc18d1..0e4f07af4 100644
--- a/docs/Documentation/Detection.html
+++ b/docs/Documentation/Detection.html
@@ -2174,6 +2174,7 @@ self
-
+ #number
DETECTION_BASE.DetectedItemCount
@@ -2187,6 +2188,7 @@ self
-
+ #number
DETECTION_BASE.DetectedItemMax
@@ -2300,7 +2302,7 @@ self
-
- #number
+
DETECTION_BASE.DetectionInterval
diff --git a/docs/Documentation/Movement.html b/docs/Documentation/Movement.html
index 6c410e890..6199b647b 100644
--- a/docs/Documentation/Movement.html
+++ b/docs/Documentation/Movement.html
@@ -213,6 +213,7 @@ on defined intervals (currently every minute).
-
+ #number
MOVEMENT.AliveUnits
@@ -221,6 +222,9 @@ on defined intervals (currently every minute).
+
+
Contains the counter how many units are currently alive
+
diff --git a/docs/Documentation/Point.html b/docs/Documentation/Point.html
index 44e1d0d90..3b284b806 100644
--- a/docs/Documentation/Point.html
+++ b/docs/Documentation/Point.html
@@ -484,6 +484,12 @@
| POINT_VEC3:IlluminationBomb() |
Creates an illumination bomb at the point.
+ |
+
+
+ | POINT_VEC3:IsLOS(ToPointVec3) |
+
+ (R2.1) Returns if a PointVec3 has Line of Sight (LOS) with the ToPointVec3.
|
@@ -1445,7 +1451,6 @@ The new calculated POINT_VEC2.
-
-
POINT_VEC2.z
@@ -2140,6 +2145,32 @@ The z coodinate.
-
+
+POINT_VEC3:IsLOS(ToPointVec3)
+
+
+-
+
+
(R2.1) Returns if a PointVec3 has Line of Sight (LOS) with the ToPointVec3.
+
+ Parameter
+
+ Return value
+
+#boolean:
+true If the ToPointVec3 has LOS with the PointVec3, otherwise false.
+
+
+
+
+-
+
POINT_VEC3:IsMetric()
diff --git a/docs/Documentation/Positionable.html b/docs/Documentation/Positionable.html
index 2d0a62858..772ec4f21 100644
--- a/docs/Documentation/Positionable.html
+++ b/docs/Documentation/Positionable.html
@@ -162,7 +162,7 @@
| POSITIONABLE:GetBeacon() |
- Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
+(R2.1) Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
|
@@ -198,7 +198,7 @@
| POSITIONABLE:GetRadio() |
- Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE.
+(R2.1) Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE.
|
@@ -246,19 +246,19 @@
| POSITIONABLE:IsLasing() |
- Check if the POSITIONABLE is lasing a target
+(R2.1) Check if the POSITIONABLE is lasing a target
|
- | POSITIONABLE:LaseOff(Target) |
+ POSITIONABLE:LaseOff() |
- Stop Lasing a POSITIONABLE
+(R2.1) Stop Lasing a POSITIONABLE
|
| POSITIONABLE:LaseUnit(Target, LaserCode, Duration) |
- Start Lasing a POSITIONABLE
+(R2.1) Start Lasing a POSITIONABLE
|
@@ -415,7 +415,7 @@ The POSITIONABLE is not existing or alive.
-
-
Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
+(R2.1) Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
Return value
@@ -584,7 +584,7 @@ The POSITIONABLE is not existing or alive.
-
-
Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE.
+(R2.1) Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE.
Set parameters with the methods provided, then use RADIO:Broadcast() to actually broadcast the message
@@ -816,7 +816,7 @@ The POSITIONABLE is not existing or alive.
-
-
Check if the POSITIONABLE is lasing a target
+(R2.1) Check if the POSITIONABLE is lasing a target
Return value
@@ -829,21 +829,13 @@ true if it is lasing a target
-
-POSITIONABLE:LaseOff(Target)
+POSITIONABLE:LaseOff()
-
-
Stop Lasing a POSITIONABLE
+(R2.1) Stop Lasing a POSITIONABLE
- Parameter
-
Return value
#POSITIONABLE:
@@ -860,7 +852,7 @@ true if it is lasing a target
-
-
Start Lasing a POSITIONABLE
+(R2.1) Start Lasing a POSITIONABLE
Parameters
diff --git a/docs/Documentation/Set.html b/docs/Documentation/Set.html
index a74f207e9..bf13d52ef 100644
--- a/docs/Documentation/Set.html
+++ b/docs/Documentation/Set.html
@@ -170,7 +170,7 @@
| SET_CARGO |
-SET_CARGO class, extends Set#SET_BASE
+(R2.1) SET_CARGO class, extends Set#SET_BASE
Mission designers can use the Set#SET_CARGO class to build sets of cargos optionally belonging to certain:
@@ -349,6 +349,18 @@
| SET_BASE.Filter |
+ |
+
+
+ | SET_BASE:FilterCrashes() |
+
+ Starts the filtering of the Crash events for the collection.
+ |
+
+
+ | SET_BASE:FilterDeads() |
+
+ Starts the filtering of the Dead events for the collection.
|
@@ -508,97 +520,97 @@
| SET_CARGO:AddCargosByName(AddCargoNames) |
- Add CARGOs to SET_CARGO.
+(R2.1) Add CARGOs to SET_CARGO.
|
| SET_CARGO:AddInDatabase(Event) |
- Handles the Database to check on an event (birth) that the Object was added in the Database.
+(R2.1) Handles the Database to check on an event (birth) that the Object was added in the Database.
|
| SET_CARGO:FilterCoalitions(Coalitions) |
- Builds a set of cargos of coalitions.
+(R2.1) Builds a set of cargos of coalitions.
|
| SET_CARGO:FilterCountries(Countries) |
- Builds a set of cargos of defined countries.
+(R2.1) Builds a set of cargos of defined countries.
|
| SET_CARGO:FilterPrefixes(Prefixes) |
- Builds a set of cargos of defined cargo prefixes.
+(R2.1) Builds a set of cargos of defined cargo prefixes.
|
| SET_CARGO:FilterStart() |
- Starts the filtering.
+(R2.1) Starts the filtering.
|
| SET_CARGO:FilterTypes(Types) |
- Builds a set of cargos of defined cargo types.
+(R2.1) Builds a set of cargos of defined cargo types.
|
| SET_CARGO:FindCargo(CargoName) |
- Finds a Cargo based on the Cargo Name.
+(R2.1) Finds a Cargo based on the Cargo Name.
|
| SET_CARGO:FindInDatabase(Event) |
- Handles the Database to check on any event that Object exists in the Database.
+(R2.1) Handles the Database to check on any event that Object exists in the Database.
|
| SET_CARGO:FindNearestCargoFromPointVec2(PointVec2) |
- Iterate the SET_CARGO while identifying the nearest Cargo#CARGO from a Point#POINT_VEC2.
+(R2.1) Iterate the SET_CARGO while identifying the nearest Cargo#CARGO from a Point#POINT_VEC2.
|
| SET_CARGO:ForEachCargo(IteratorFunction, ...) |
- Iterate the SET_CARGO and call an interator function for each CARGO, providing the CARGO and optional parameters.
+(R2.1) Iterate the SET_CARGO and call an interator function for each CARGO, providing the CARGO and optional parameters.
|
| SET_CARGO:IsIncludeObject(MCargo) |
-
+ (R2.1)
|
| SET_CARGO:New() |
- Creates a new SET_CARGO object, building a set of cargos belonging to a coalitions and categories.
+(R2.1) Creates a new SET_CARGO object, building a set of cargos belonging to a coalitions and categories.
|
| SET_CARGO:OnEventDeleteCargo(EventData) |
- Handles the OnDead or OnCrash event for alive units set.
+(R2.1) Handles the OnDead or OnCrash event for alive units set.
|
| SET_CARGO:OnEventNewCargo(EventData) |
- Handles the OnEventNewCargo event for the Set.
+(R2.1) Handles the OnEventNewCargo event for the Set.
|
| SET_CARGO:RemoveCargosByName(RemoveCargoNames) |
- Remove CARGOs from SET_CARGO.
+(R2.1) Remove CARGOs from SET_CARGO.
|
@@ -1085,7 +1097,7 @@ You can set the "yield interval", and the "time interva
-SET_CARGO class, extends Set#SET_BASE
+(R2.1) SET_CARGO class, extends Set#SET_BASE
Mission designers can use the Set#SET_CARGO class to build sets of cargos optionally belonging to certain:
@@ -1856,6 +1868,42 @@ Count
+
+
+
+-
+
+
+SET_BASE:FilterCrashes()
+
+
+-
+
+
Starts the filtering of the Crash events for the collection.
+
+ Return value
+
+#SET_BASE:
+self
+
+
+
+
+-
+
+
+SET_BASE:FilterDeads()
+
+
+-
+
+
Starts the filtering of the Dead events for the collection.
+
+ Return value
+
+#SET_BASE:
+self
+
@@ -2419,7 +2467,7 @@ The Object found.
-
-
Add CARGOs to SET_CARGO.
+(R2.1) Add CARGOs to SET_CARGO.
Parameter
@@ -2446,7 +2494,7 @@ A single name or an array of CARGO names.
-
-
Handles the Database to check on an event (birth) that the Object was added in the Database.
+(R2.1) Handles the Database to check on an event (birth) that the Object was added in the Database.
This is required, because sometimes the DATABASE birth event gets called later than the SETBASE birth event!
@@ -2485,7 +2533,7 @@ The CARGO
-
-
Builds a set of cargos of coalitions.
+(R2.1) Builds a set of cargos of coalitions.
Possible current coalitions are red, blue and neutral.
@@ -2515,7 +2563,7 @@ self
-
-
Builds a set of cargos of defined countries.
+(R2.1) Builds a set of cargos of defined countries.
Possible current countries are those known within DCS world.
@@ -2545,7 +2593,7 @@ self
-
-
Builds a set of cargos of defined cargo prefixes.
+(R2.1) Builds a set of cargos of defined cargo prefixes.
All the cargos starting with the given prefixes will be included within the set.
@@ -2575,7 +2623,7 @@ self
-
-
Starts the filtering.
+(R2.1) Starts the filtering.
Return value
@@ -2593,7 +2641,7 @@ self
-
-
Builds a set of cargos of defined cargo types.
+(R2.1) Builds a set of cargos of defined cargo types.
Possible current types are those types known within DCS world.
@@ -2623,7 +2671,7 @@ self
-
-
Finds a Cargo based on the Cargo Name.
+(R2.1) Finds a Cargo based on the Cargo Name.
Parameter
@@ -2649,7 +2697,7 @@ The found Cargo.
-
-
Handles the Database to check on any event that Object exists in the Database.
+(R2.1) Handles the Database to check on any event that Object exists in the Database.
This is required, because sometimes the DATABASE event gets called later than the SETBASE event or vise versa!
@@ -2688,7 +2736,7 @@ The CARGO
-
-
Iterate the SET_CARGO while identifying the nearest Cargo#CARGO from a Point#POINT_VEC2.
+(R2.1) Iterate the SET_CARGO while identifying the nearest Cargo#CARGO from a Point#POINT_VEC2.
Parameter
@@ -2715,7 +2763,7 @@ The closest Cargo#CARGO.
-
-
Iterate the SET_CARGO and call an interator function for each CARGO, providing the CARGO and optional parameters.
+(R2.1) Iterate the SET_CARGO and call an interator function for each CARGO, providing the CARGO and optional parameters.
Parameters
@@ -2747,7 +2795,7 @@ self
-
-
+
(R2.1)
Parameter
@@ -2773,7 +2821,7 @@ self
-
-
Creates a new SET_CARGO object, building a set of cargos belonging to a coalitions and categories.
+(R2.1) Creates a new SET_CARGO object, building a set of cargos belonging to a coalitions and categories.
Return value
@@ -2795,7 +2843,7 @@ DatabaseSet = SET_CARGO:New()
-
-
Handles the OnDead or OnCrash event for alive units set.
+(R2.1) Handles the OnDead or OnCrash event for alive units set.
Parameter
diff --git a/docs/Documentation/SpawnStatic.html b/docs/Documentation/SpawnStatic.html
index 23a722fcf..1d7c4389e 100644
--- a/docs/Documentation/SpawnStatic.html
+++ b/docs/Documentation/SpawnStatic.html
@@ -95,7 +95,7 @@
Module SpawnStatic
-
Core -- Spawn dynamically new STATICs in your missions.
+
(R2.1) Core -- Spawn dynamically new STATICs in your missions.
@@ -169,25 +169,25 @@
| SPAWNSTATIC:NewFromStatic(SpawnTemplatePrefix, CountryID) |
- Creates the main object to spawn a Static defined in the ME.
+(R2.1) Creates the main object to spawn a Static defined in the ME.
|
| SPAWNSTATIC:NewFromType(SpawnTypeName, SpawnShapeName, SpawnCategory, CountryID) |
- Creates the main object to spawn a Static based on a type name.
+(R2.1) Creates the main object to spawn a Static based on a type name.
|
| SPAWNSTATIC:SpawnFromPointVec2(PointVec2, Heading, (, NewName) |
- Creates a new Static from a POINT_VEC2.
+(R2.1) Creates a new Static from a POINT_VEC2.
|
| SPAWNSTATIC:SpawnFromZone(Zone, Heading, (, NewName) |
- Creates a new Static from a Zone.
+(R2.1) Creates a new Static from a Zone.
|
@@ -288,7 +288,7 @@ By default, spawned Statics will follow a naming conve
-
-
Creates the main object to spawn a Static defined in the ME.
+(R2.1) Creates the main object to spawn a Static defined in the ME.
Parameters