From de2f60ad1fbdfa063c417564d4e27e34f70af0eb Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Fri, 21 Apr 2017 00:43:14 +0200
Subject: [PATCH 01/25] Rmove submodule
---
MOOSE | 1 -
1 file changed, 1 deletion(-)
delete mode 160000 MOOSE
diff --git a/MOOSE b/MOOSE
deleted file mode 160000
index 841e611e3..000000000
--- a/MOOSE
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 841e611e3c685eb6b223370b42042726546e806e
From a79bc11834da7b9f30071ae01cf9c504bc0b38e5 Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Fri, 21 Apr 2017 06:58:28 +0200
Subject: [PATCH 02/25] Progress
---
Moose Development/Moose/AI/AI_Designate.lua | 110 +++++++++++---------
1 file changed, 58 insertions(+), 52 deletions(-)
diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua
index 35ed1639a..d892da22c 100644
--- a/Moose Development/Moose/AI/AI_Designate.lua
+++ b/Moose Development/Moose/AI/AI_Designate.lua
@@ -237,6 +237,9 @@ do -- AI_DESIGNATE
self:SetLaserCodes( 1688 )
+ self.LaserCodesUsed = {}
+
+
self.Detection:__Start( 2 )
@@ -253,6 +256,8 @@ do -- AI_DESIGNATE
self.LaserCodes = ( type( LaserCodes ) == "table" ) and LaserCodes or { LaserCodes }
self:E(self.LaserCodes)
+
+ self.LaserCodesUsed = {}
return self
end
@@ -330,39 +335,35 @@ do -- AI_DESIGNATE
DesignateMenu
)
- if self.Spots[Index] then
-
- MENU_GROUP_COMMAND:New(
- AttackGroup,
- "Switch laser Off",
- DetectedMenu,
- self.MenuLaseOff,
- self,
- AttackGroup,
- Index
- )
- else
- 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
- )
- end
+ 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,
@@ -425,32 +426,37 @@ do -- AI_DESIGNATE
function AI_DESIGNATE:onafterLasing( From, Event, To, AttackGroup, Index, Duration )
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
-
+
local Targets = false
TargetSetUnit:ForEachUnit(
--- @param Wrapper.Unit#UNIT SmokeUnit
- function( SmokeUnit )
+ function( TargetUnit )
self:E("In procedure")
--if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then
- if SmokeUnit:IsAlive() then
- local NearestRecceGroup = self.RecceSet:FindNearestGroupFromPointVec2( SmokeUnit:GetPointVec2() )
- if NearestRecceGroup then
- for UnitID, UnitData in pairs( NearestRecceGroup:GetUnits() or {} ) do
- local RecceUnit = UnitData -- Wrapper.Unit#UNIT
- Targets = true
- if RecceUnit:IsLasing() == false then
- self.Spots[Index] = self.Spots[Index] or {}
- local Spots = self.Spots[Index]
- local LaserCode = self.LaserCodes[math.random(1, #self.LaserCodes)]
- local Spot = RecceUnit:LaseUnit( SmokeUnit, LaserCode, Duration )
- Spots[RecceUnit] = Spot
- RecceUnit:MessageToGroup( "Lasing " .. SmokeUnit:GetTypeName() .. " for " .. Duration .. " seconds. Laser Code: " .. Spot.LaserCode, 15, AttackGroup )
- break
- else
+ 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
+ local RecceUnit = UnitData -- Wrapper.Unit#UNIT
+ Targets = true
+ if RecceUnit:IsLasing() == false then
+ local LaserCode = self.LaserCodes[math.random(1, #self.LaserCodes)]
+ 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
+ end
end
end
+ else
+ local RecceUnit = Spot.Recce
+ RecceUnit:MessageToGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. " seconds. Laser Code: " .. Spot.LaserCode, 15, AttackGroup )
end
+ else
+ self.Spots[TargetUnit] = nil
end
--end
end
@@ -473,7 +479,7 @@ do -- AI_DESIGNATE
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
- local Spots = self.Spots[Index]
+ local Spots = self.Spots
for SpotID, SpotData in pairs( Spots ) do
local Spot = SpotData -- Core.Spot#SPOT
@@ -482,7 +488,7 @@ do -- AI_DESIGNATE
end
Spots = nil
- self.Spots[Index] = nil
+ self.Spots = {}
self:SetDesignateMenu()
end
From 51022be4d4e06ba0b69fc207b12eee4c773eef5e Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Fri, 21 Apr 2017 14:01:01 +0200
Subject: [PATCH 03/25] Working version
---
Moose Development/Moose/AI/AI_Designate.lua | 44 ++++++++---
Moose Development/Moose/Core/Base.lua | 6 ++
Moose Development/Moose/Core/Set.lua | 22 +++++-
Moose Development/Moose/Core/Spot.lua | 74 ++++++++++++++++++-
.../Moose/Functional/Detection.lua | 4 +-
.../Moose/Wrapper/Positionable.lua | 2 +-
6 files changed, 134 insertions(+), 18 deletions(-)
diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua
index d892da22c..8f64c7b8f 100644
--- a/Moose Development/Moose/AI/AI_Designate.lua
+++ b/Moose Development/Moose/AI/AI_Designate.lua
@@ -118,6 +118,8 @@ do -- AI_DESIGNATE
-- @function [parent=#AI_DESIGNATE] __Detect
-- @param #AI_DESIGNATE self
-- @param #number Delay
+
+
self:AddTransition( "*", "LaseOn", "Lasing" )
@@ -308,6 +310,8 @@ do -- AI_DESIGNATE
-- @return #AI_DESIGNATE
function AI_DESIGNATE:SetDesignateMenu()
+ self.GroupSet:Flush()
+
self.GroupSet:ForEachGroup(
--- @param Wrapper.Group#GROUP GroupReport
@@ -426,8 +430,19 @@ do -- AI_DESIGNATE
function AI_DESIGNATE:onafterLasing( From, Event, To, AttackGroup, Index, Duration )
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
+
+ TargetSetUnit:Flush()
- local Targets = false
+ for TargetUnit, SpotData in pairs( self.Spots ) do
+ local Spot = SpotData -- Core.Spot#SPOT
+ if not Spot:IsLasing() then
+ local LaserCode = Spot.LaserCode --(Not deleted when stopping with lasing).
+ self.LaserCodesUsed[LaserCode] = nil
+ self.Spots[TargetUnit] = nil
+ end
+ end
+
+ local MoreTargets = false
TargetSetUnit:ForEachUnit(
--- @param Wrapper.Unit#UNIT SmokeUnit
@@ -441,17 +456,22 @@ do -- AI_DESIGNATE
if NearestRecceGroup then
for UnitID, UnitData in pairs( NearestRecceGroup:GetUnits() or {} ) do
local RecceUnit = UnitData -- Wrapper.Unit#UNIT
- Targets = true
if RecceUnit:IsLasing() == false then
- local LaserCode = self.LaserCodes[math.random(1, #self.LaserCodes)]
- 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
+ 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
+ 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 )
end
@@ -462,12 +482,11 @@ do -- AI_DESIGNATE
end
)
- if Targets == true then
+ if MoreTargets == true then
self:__Lasing( -30, AttackGroup, Index, Duration )
else
- self:__LaseOff( -0.2, AttackGroup, Index )
- end
-
+ self:__LaseOff( 1, AttackGroup, Index )
+ end
self:SetDesignateMenu()
end
@@ -477,6 +496,8 @@ do -- AI_DESIGNATE
-- @return #AI_DESIGNATE
function AI_DESIGNATE:onafterLaseOff( From, Event, To, AttackGroup, Index )
+ self.RecceSet:GetFirst():MessageToGroup( "Stopped lasing.", 15, AttackGroup )
+
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
local Spots = self.Spots
@@ -489,6 +510,7 @@ do -- AI_DESIGNATE
Spots = nil
self.Spots = {}
+ self.LaserCodesUsed = {}
self:SetDesignateMenu()
end
diff --git a/Moose Development/Moose/Core/Base.lua b/Moose Development/Moose/Core/Base.lua
index 64bcd30d2..8e8bec750 100644
--- a/Moose Development/Moose/Core/Base.lua
+++ b/Moose Development/Moose/Core/Base.lua
@@ -454,6 +454,12 @@ do -- Event Handling
-- @param #BASE self
-- @param Core.Event#EVENTDATA EventData The EventData structure.
+ --- Occurs when an object is dead.
+ -- initiator : The unit that is dead.
+ -- @function [parent=#BASE] OnEventDead
+ -- @param #BASE self
+ -- @param Core.Event#EVENTDATA EventData The EventData structure.
+
--- Occurs when an object is completely destroyed.
-- initiator : The unit that is was destroyed.
-- @function [parent=#BASE] OnEvent
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index bac65d9aa..0087fd667 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -342,6 +342,26 @@ function SET_BASE:_FilterStart()
return self
end
+--- Starts the filtering of the Dead events for the collection.
+-- @param #SET_BASE self
+-- @return #SET_BASE self
+function SET_BASE:FilterDeads()
+
+ self:HandleEvent( EVENTS.Dead, self._EventOnDeadOrCrash )
+
+ return self
+end
+
+--- Starts the filtering of the Crash events for the collection.
+-- @param #SET_BASE self
+-- @return #SET_BASE self
+function SET_BASE:FilterCrashes()
+
+ self:HandleEvent( EVENTS.Crash, self._EventOnDeadOrCrash )
+
+ return self
+end
+
--- Stops the filtering for the defined collection.
-- @param #SET_BASE self
-- @return #SET_BASE self
@@ -430,7 +450,7 @@ function SET_BASE:_EventOnDeadOrCrash( Event )
if Event.IniDCSUnit then
local ObjectName, Object = self:FindInDatabase( Event )
- if ObjectName and Object ~= nil then
+ if ObjectName then
self:Remove( ObjectName )
end
end
diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua
index 870a1f3ee..f532ffd15 100644
--- a/Moose Development/Moose/Core/Spot.lua
+++ b/Moose Development/Moose/Core/Spot.lua
@@ -32,7 +32,11 @@
do
--- @type SPOT
- -- @extends BASE
+ -- @extends Core.Base#BASE
+
+
+ ---
+ -- @field #SPOT
SPOT = {
ClassName = "SPOT",
}
@@ -50,8 +54,61 @@ do
self:SetStartState( "Off" )
self:AddTransition( "Off", "LaseOn", "On" )
+
+ --- LaseOn Handler OnBefore for SPOT
+ -- @function [parent=#SPOT] OnBeforeLaseOn
+ -- @param #SPOT self
+ -- @param #string From
+ -- @param #string Event
+ -- @param #string To
+ -- @return #boolean
+
+ --- LaseOn Handler OnAfter for SPOT
+ -- @function [parent=#SPOT] OnAfterLaseOn
+ -- @param #SPOT self
+ -- @param #string From
+ -- @param #string Event
+ -- @param #string To
+
+ --- LaseOn Trigger for SPOT
+ -- @function [parent=#SPOT] LaseOn
+ -- @param #SPOT self
+
+ --- LaseOn Asynchronous Trigger for SPOT
+ -- @function [parent=#SPOT] __LaseOn
+ -- @param #SPOT self
+ -- @param #number Delay
+
+
+
self:AddTransition( "On", "Lasing", "On" )
self:AddTransition( "On" , "LaseOff", "Off" )
+
+ --- LaseOff Handler OnBefore for SPOT
+ -- @function [parent=#SPOT] OnBeforeLaseOff
+ -- @param #SPOT self
+ -- @param #string From
+ -- @param #string Event
+ -- @param #string To
+ -- @return #boolean
+
+ --- LaseOff Handler OnAfter for SPOT
+ -- @function [parent=#SPOT] OnAfterLaseOff
+ -- @param #SPOT self
+ -- @param #string From
+ -- @param #string Event
+ -- @param #string To
+
+ --- LaseOff Trigger for SPOT
+ -- @function [parent=#SPOT] LaseOff
+ -- @param #SPOT self
+
+ --- LaseOff Asynchronous Trigger for SPOT
+ -- @function [parent=#SPOT] __LaseOff
+ -- @param #SPOT self
+ -- @param #number Delay
+
+
self.Recce = Recce
@@ -87,9 +144,22 @@ do
self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration )
end
+ self:HandleEvent( EVENTS.Dead )
+
self:__Lasing( -0.2 )
end
+ --- @param #SPOT self
+ -- @param Core.Event#EVENTDATA EventData
+ function SPOT:OnEventDead(EventData)
+ if self.Target then
+ if EventData.IniDCSUnitName == self.Target:GetName() then
+ self:E( {"Target dead ", self.Target:GetName() } )
+ self:__LaseOff( 0.1 )
+ end
+ end
+ end
+
--- @param #SPOT self
-- @param From
-- @param Event
@@ -112,6 +182,7 @@ do
-- @return #SPOT
function SPOT:onafterLaseOff( From, Event, To )
+ self:E( {"Stopped lasing for ", self.Target:GetName() } )
self.Spot:destroy()
self.Spot = nil
if self.ScheduleID then
@@ -120,7 +191,6 @@ do
self.ScheduleID = nil
self.Target = nil
- self.LaserCode = nil
return self
end
diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua
index 307cd31bb..f876970b7 100644
--- a/Moose Development/Moose/Functional/Detection.lua
+++ b/Moose Development/Moose/Functional/Detection.lua
@@ -506,8 +506,6 @@ do -- DETECTION_BASE
self.DetectionRun = 0
self:UnIdentifyAllDetectedObjects() -- Resets the DetectedObjectsIdentified table
- self.DetectionSetGroup:Flush()
-
for DetectionGroupID, DetectionGroupData in pairs( self.DetectionSetGroup:GetSet() ) do
self:E( {DetectionGroupData})
self:__DetectionGroup( DetectDelay, DetectionGroupData ) -- Process each detection asynchronously.
@@ -1132,7 +1130,7 @@ do -- DETECTION_BASE
self.DetectedItems[self.DetectedItemCount] = DetectedItem
end
- DetectedItem.Set = Set or SET_UNIT:New()
+ DetectedItem.Set = Set or SET_UNIT:New():FilterDeads():FilterCrashes()
DetectedItem.ItemID = self.DetectedItemMax
DetectedItem.Removed = false
diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua
index ffef55978..be15b3466 100644
--- a/Moose Development/Moose/Wrapper/Positionable.lua
+++ b/Moose Development/Moose/Wrapper/Positionable.lua
@@ -475,7 +475,7 @@ function POSITIONABLE:LaseUnit( Target, LaserCode, Duration )
local TargetVec3 = Target:GetVec3()
self:E("bulding spot")
- self.Spot = SPOT:New( self )
+ self.Spot = SPOT:New( self ) -- Core.Spot#SPOT
self.Spot:LaseOn( Target, LaserCode, Duration)
return self.Spot
From 0b39e1a911e2a3c0e5e9945eca03aa49b2b1e0eb Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Fri, 21 Apr 2017 14:07:06 +0200
Subject: [PATCH 04/25] Implement SET_GROUP:HasGroupCompletelyInZone()
---
Moose Development/Moose/Core/Set.lua | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index bac65d9aa..4f7d2beff 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -961,6 +961,30 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
return self
end
+--- Iterate the SET_GROUP and return false if at least one @{Wrapper.Group#GROUP} isn't in the @{Core.Zone#ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean false if one of the @{Wrapper.Group#GROUP} is not in the @{Core.Zone#ZONE}, true otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:HasGroupCompletelyInZone(MyZone) then
+-- MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
+-- else
+-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
+-- end
+function SET_GROUP:HasGroupCompletelyInZone(Zone)
+ self:F2(Zone)
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if not GroupData:IsCompletelyInZone(Zone) then
+ return false
+ end
+ end
+ return true
+end
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
From 56eaa1679280faeb988ec11dc590e83872f0887d Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Fri, 21 Apr 2017 14:16:32 +0200
Subject: [PATCH 05/25] Implement SET_GROUP:IsCompletelyInZone()
---
Moose Development/Moose/Core/Set.lua | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 4f7d2beff..96ad77579 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -961,10 +961,10 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
return self
end
---- Iterate the SET_GROUP and return false if at least one @{Wrapper.Group#GROUP} isn't in the @{Core.Zone#ZONE}
+--- Iterate the SET_GROUP and return true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
--- @return #boolean false if one of the @{Wrapper.Group#GROUP} is not in the @{Core.Zone#ZONE}, true otherwise.
+-- @return #boolean true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}, false otherwise
-- @usage
-- local MyZone = ZONE:New("Zone1")
-- local MySetGroup = SET_GROUP:New()
@@ -975,7 +975,7 @@ end
-- else
-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
-- end
-function SET_GROUP:HasGroupCompletelyInZone(Zone)
+function SET_GROUP:IsCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -986,6 +986,21 @@ function SET_GROUP:HasGroupCompletelyInZone(Zone)
return true
end
+--- Iterate the SET_GROUP and return true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+function SET_GROUP:HasGroupCompletelyInZone(Zone)
+ self:F2(Zone)
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if GroupData:IsCompletlyInZone(Zone) then
+ return true
+ end
+ end
+ return false
+end
+
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
From bfda34e94d2cc52c2d7d86679ea7ea0a1a8e7bc9 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 01:06:35 +0200
Subject: [PATCH 06/25] Implement SET_GROUP:AnyCompletelyInZone
Also renames the 2 previously implemented funcitons
---
Moose Development/Moose/Core/Set.lua | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 96ad77579..9827670cf 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -961,7 +961,7 @@ function SET_GROUP:ForEachGroupNotInZone( ZoneObject, IteratorFunction, ... )
return self
end
---- Iterate the SET_GROUP and return true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}
+--- Iterate the SET_GROUP and return true if all the @{Wrapper.Group#GROUP} are completely in the @{Core.Zone#ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if all the @{Wrapper.Group#GROUP} are completly in the @{Core.Zone#ZONE}, false otherwise
@@ -975,7 +975,7 @@ end
-- else
-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
-- end
-function SET_GROUP:IsCompletelyInZone(Zone)
+function SET_GROUP:AllCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -986,11 +986,11 @@ function SET_GROUP:IsCompletelyInZone(Zone)
return true
end
---- Iterate the SET_GROUP and return true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}
+--- Iterate the SET_GROUP and return true if at least one of the @{Wrapper.Group#GROUP} is completely inside the @{Core.Zone#ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
-function SET_GROUP:HasGroupCompletelyInZone(Zone)
+function SET_GROUP:AnyCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -1001,6 +1001,22 @@ function SET_GROUP:HasGroupCompletelyInZone(Zone)
return false
end
+
+--- Iterate the SET_GROUP and return true if at least one least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+function SET_GROUP:AnyCompletelyInZone(Zone)
+ self:F2(Zone)
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if GroupData:IsPartlyInZone(Zone) then
+ return true
+ end
+ end
+ return false
+end
+
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
From a0585565835370a45736f75e3771e2f091e2d33d Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 01:12:33 +0200
Subject: [PATCH 07/25] Implement SET_GROUP:NoneInZone()
---
Moose Development/Moose/Core/Set.lua | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 9827670cf..ddb6773da 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1006,7 +1006,7 @@ end
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
-function SET_GROUP:AnyCompletelyInZone(Zone)
+function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
@@ -1017,6 +1017,21 @@ function SET_GROUP:AnyCompletelyInZone(Zone)
return false
end
+--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+-- @param #SET_GROUP self
+-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+function SET_GROUP:NoneInZone(Zone)
+ self:F2(Zone)
+ local Set = self:GetSet()
+ for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
+ if not GroupData:IsNotInZone(Zone) then -- If the GROUP is in Zone in any way
+ return false
+ end
+ end
+ return true
+end
+
----- Iterate the SET_GROUP and call an interator function for each **alive** player, providing the Group of the player and optional parameters.
---- @param #SET_GROUP self
---- @param #function IteratorFunction The function that will be called when there is an alive player in the SET_GROUP. The function needs to accept a GROUP parameter.
From 02bb76792afad1447b759d118cfc69faa6f0e57c Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 01:16:19 +0200
Subject: [PATCH 08/25] Improve documentation in newly added methods in
SET_GROUP, correct faulty logic in SET_GROUP:AnyPartlyInZone()
---
Moose Development/Moose/Core/Set.lua | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index ddb6773da..aed86b81b 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1001,16 +1001,15 @@ function SET_GROUP:AnyCompletelyInZone(Zone)
return false
end
-
--- Iterate the SET_GROUP and return true if at least one least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
--- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
- if GroupData:IsPartlyInZone(Zone) then
+ if GroupData:IsPartlyInZone(Zone) or GroupData:IsCompletelyInZone(Zone) then
return true
end
end
@@ -1020,7 +1019,7 @@ end
--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
--- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @return #boolean true if no @{Wrapper.Group#GROUP} is inside the @{Core.Zone#ZONE} in any way, false otherwise.
function SET_GROUP:NoneInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
From 497a2c17d032425d86275b172cd088df1d670aab Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 01:22:48 +0200
Subject: [PATCH 09/25] Add @usage tags to all newly added methods
---
Moose Development/Moose/Core/Set.lua | 36 ++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index aed86b81b..7225ff63f 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -970,7 +970,7 @@ end
-- local MySetGroup = SET_GROUP:New()
-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
--
--- if MySetGroup:HasGroupCompletelyInZone(MyZone) then
+-- if MySetGroup:AllCompletelyInZone(MyZone) then
-- MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
-- else
-- MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
@@ -990,6 +990,16 @@ end
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:AnyCompletelyInZone(MyZone) then
+-- MESSAGE:New("At least one GROUP is completely in zone !", 10):ToAll()
+-- else
+-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+-- end
function SET_GROUP:AnyCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
@@ -1005,6 +1015,16 @@ end
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:AnyPartlyInZone(MyZone) then
+-- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
+-- else
+-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+-- end
function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
@@ -1016,10 +1036,22 @@ function SET_GROUP:AnyPartlyInZone(Zone)
return false
end
---- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+--- Iterate the SET_GROUP and return true if no @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+-- This could also be achieved with `not SET_GROUP:AnyPartlyInZone(Zone)`, but it's easier for the
+-- mission designer to add a dedicated method
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if no @{Wrapper.Group#GROUP} is inside the @{Core.Zone#ZONE} in any way, false otherwise.
+-- @usage
+-- local MyZone = ZONE:New("Zone1")
+-- local MySetGroup = SET_GROUP:New()
+-- MySetGroup:AddGroupsByName({"Group1", "Group2"})
+--
+-- if MySetGroup:NoneInZone(MyZone) then
+-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+-- else
+-- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
+-- end
function SET_GROUP:NoneInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
From 980053916b0924dae7951c80dfa605e845e1118a Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 11:15:16 +0200
Subject: [PATCH 10/25] Solves a bug in GROUP:IsPartlyInZone()
If only the first UNITs of the GROUP where outside the ZONE, the function would still return false
This behaviour is fixed by this commit.
---
Moose Development/Moose/Core/Set.lua | 8 ++++----
Moose Development/Moose/Wrapper/Group.lua | 17 +++++++++--------
2 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 7225ff63f..9bfd27a02 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1004,14 +1004,14 @@ function SET_GROUP:AnyCompletelyInZone(Zone)
self:F2(Zone)
local Set = self:GetSet()
for GroupID, GroupData in pairs(Set) do -- For each GROUP in SET_GROUP
- if GroupData:IsCompletlyInZone(Zone) then
+ if GroupData:IsCompletelyInZone(Zone) then
return true
end
end
return false
end
---- Iterate the SET_GROUP and return true if at least one least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
+--- Iterate the SET_GROUP and return true if at least one @{#UNIT} of one @{GROUP} of the @{SET_GROUP} is in @{ZONE}
-- @param #SET_GROUP self
-- @param Core.Zone#ZONE ZoneObject The Zone to be tested for.
-- @return #boolean true if at least one of the @{Wrapper.Group#GROUP} is partly or completly inside the @{Core.Zone#ZONE}, false otherwise.
@@ -1023,7 +1023,7 @@ end
-- if MySetGroup:AnyPartlyInZone(MyZone) then
-- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
-- else
--- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+-- MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
-- end
function SET_GROUP:AnyPartlyInZone(Zone)
self:F2(Zone)
@@ -1050,7 +1050,7 @@ end
-- if MySetGroup:NoneInZone(MyZone) then
-- MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
-- else
--- MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
+-- MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
-- end
function SET_GROUP:NoneInZone(Zone)
self:F2(Zone)
diff --git a/Moose Development/Moose/Wrapper/Group.lua b/Moose Development/Moose/Wrapper/Group.lua
index 2d845a9f2..3e9e6b5f9 100644
--- a/Moose Development/Moose/Wrapper/Group.lua
+++ b/Moose Development/Moose/Wrapper/Group.lua
@@ -555,22 +555,23 @@ end
function GROUP:IsPartlyInZone( Zone )
self:F2( { self.GroupName, Zone } )
- local PartlyInZone = false
+ local IsOneUnitInZone = false
+ local IsOneUnitOutsideZone = false
for UnitID, UnitData in pairs( self:GetUnits() ) do
local Unit = UnitData -- Wrapper.Unit#UNIT
if Zone:IsVec3InZone( Unit:GetVec3() ) then
- PartlyInZone = true
+ IsOneUnitInZone = true
else
- -- So, if there were groups in the zone found, and suddenly one NOT in the zone,
- -- then the group is partialy in the zone :-)
- if PartlyInZone == true then
- return true
- end
+ IsOneUnitOutsideZone = true
end
end
- return false
+ if IsOneUnitInZone and IsOneUnitOutsideZone then
+ return true
+ else
+ return false
+ end
end
--- Returns true if none of the group units of the group are within a @{Zone}.
From fb6bb635c687cde3e387d90bed3ca98b312f9fa4 Mon Sep 17 00:00:00 2001
From: Grey-Echo
Date: Sat, 22 Apr 2017 11:35:14 +0200
Subject: [PATCH 11/25] Documentation Update
---
docs/Documentation/AI_Designate.html | 77 +++++++
docs/Documentation/AI_Patrol.html | 3 +
docs/Documentation/Base.html | 31 +++
docs/Documentation/Detection.html | 3 +-
docs/Documentation/Fsm.html | 3 +-
docs/Documentation/Movement.html | 4 +
docs/Documentation/Set.html | 248 ++++++++++++++++++++++
docs/Documentation/Spawn.html | 14 +-
docs/Documentation/Spot.html | 300 +++++++++++++++++++++++++--
9 files changed, 653 insertions(+), 30 deletions(-)
diff --git a/docs/Documentation/AI_Designate.html b/docs/Documentation/AI_Designate.html
index b551f163f..e8948271c 100644
--- a/docs/Documentation/AI_Designate.html
+++ b/docs/Documentation/AI_Designate.html
@@ -154,6 +154,12 @@ each detected set of potential targets can be lased or smoked...
AI_DESIGNATE.LaserCodes |
+ |
+
+
+ | AI_DESIGNATE.LaserCodesUsed |
+
+
|
@@ -328,6 +334,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) |
+
+
|
@@ -512,6 +524,20 @@ One laser code can be given or an sequence of laser codes through an table...
+
+
+-
+
+
+
+AI_DESIGNATE.LaserCodesUsed
+
+
+-
+
+
+
@@ -1315,6 +1341,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/AI_Patrol.html b/docs/Documentation/AI_Patrol.html
index 3f3376551..d80d5e9ce 100644
--- a/docs/Documentation/AI_Patrol.html
+++ b/docs/Documentation/AI_Patrol.html
@@ -951,6 +951,9 @@ Use the method AIPATROLZONE.M
+
+ This table contains the targets detected during patrol.
+
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/Detection.html b/docs/Documentation/Detection.html
index f5ebc18d1..5989a6901 100644
--- a/docs/Documentation/Detection.html
+++ b/docs/Documentation/Detection.html
@@ -2187,6 +2187,7 @@ self
-
+ #number
DETECTION_BASE.DetectedItemMax
@@ -2300,7 +2301,7 @@ self
-
- #number
+
DETECTION_BASE.DetectionInterval
diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html
index 7d9bc4a08..9b6918395 100644
--- a/docs/Documentation/Fsm.html
+++ b/docs/Documentation/Fsm.html
@@ -1622,7 +1622,7 @@ A string defining the start state.
-
-
+ #string
FSM._StartState
@@ -1921,7 +1921,6 @@ A string defining the start state.
-
-
FSM.current
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/Set.html b/docs/Documentation/Set.html
index a74f207e9..29ad4f438 100644
--- a/docs/Documentation/Set.html
+++ b/docs/Documentation/Set.html
@@ -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.
|
@@ -715,6 +727,24 @@
| SET_GROUP:AddInDatabase(Event) |
Handles the Database to check on an event (birth) that the Object was added in the Database.
+ |
+
+
+ | SET_GROUP:AllCompletelyInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if all the Wrapper.Group#GROUP are completely in the Core.Zone#ZONE
+ |
+
+
+ | SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if at least one of the Wrapper.Group#GROUP is completely inside the Core.Zone#ZONE
+ |
+
+
+ | SET_GROUP:AnyPartlyInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE
|
@@ -799,6 +829,14 @@
| SET_GROUP:New() |
Creates a new SET_GROUP object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.
+ |
+
+
+ | SET_GROUP:NoneInZone(ZoneObject, Zone) |
+
+ Iterate the SET_GROUP and return true if no GROUP of the SET_GROUP is in ZONE
+This could also be achieved with not SET_GROUP:AnyPartlyInZone(Zone), but it's easier for the
+mission designer to add a dedicated method
|
@@ -1856,6 +1894,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
+
@@ -3412,6 +3486,135 @@ The GROUP
-
+
+SET_GROUP:AllCompletelyInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if all the Wrapper.Group#GROUP are completely in the Core.Zone#ZONE
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if all the Wrapper.Group#GROUP are completly in the Core.Zone#ZONE, false otherwise
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:AllCompletelyInZone(MyZone) then
+ MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
+else
+ MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
+end
+
+
+
+
+-
+
+
+SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if at least one of the Wrapper.Group#GROUP is completely inside the Core.Zone#ZONE
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if at least one of the Wrapper.Group#GROUP is completly inside the Core.Zone#ZONE, false otherwise.
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:AnyCompletelyInZone(MyZone) then
+ MESSAGE:New("At least one GROUP is completely in zone !", 10):ToAll()
+else
+ MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+end
+
+
+
+
+-
+
+
+SET_GROUP:AnyPartlyInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if at least one of the Wrapper.Group#GROUP is partly or completly inside the Core.Zone#ZONE, false otherwise.
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:AnyPartlyInZone(MyZone) then
+ MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
+else
+ MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
+end
+
+
+
+
+-
+
SET_GROUP:FilterCategories(Categories)
@@ -3836,6 +4039,51 @@ DBObject = SET_GROUP:New()
-
+
+SET_GROUP:NoneInZone(ZoneObject, Zone)
+
+
+-
+
+
Iterate the SET_GROUP and return true if no GROUP of the SET_GROUP is in ZONE
+This could also be achieved with not SET_GROUP:AnyPartlyInZone(Zone), but it's easier for the
+mission designer to add a dedicated method
+
+ Parameters
+
+ Return value
+
+#boolean:
+true if no Wrapper.Group#GROUP is inside the Core.Zone#ZONE in any way, false otherwise.
+
+ Usage:
+ local MyZone = ZONE:New("Zone1")
+local MySetGroup = SET_GROUP:New()
+MySetGroup:AddGroupsByName({"Group1", "Group2"})
+
+if MySetGroup:NoneInZone(MyZone) then
+ MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
+else
+ MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
+end
+
+
+
+
+-
+
SET_GROUP:RemoveGroupsByName(RemoveGroupNames)
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index 896cf233e..088a3a7ad 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -2113,6 +2113,9 @@ The group that was spawned. You can use this group for further actions.
+
+
Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.
+
@@ -2583,6 +2586,9 @@ when nothing was spawned.
+
+ By default, no InitLimit
+
@@ -2618,7 +2624,7 @@ when nothing was spawned.
-
-
+ #number
SPAWN.SpawnMaxGroups
@@ -2635,7 +2641,7 @@ when nothing was spawned.
-
-
+ #number
SPAWN.SpawnMaxUnitsAlive
@@ -2963,7 +2969,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
-
+ #boolean
SPAWN.SpawnUnControlled
@@ -2987,7 +2993,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
When the first Spawn executes, all the Groups need to be made visible before start.
+ Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
diff --git a/docs/Documentation/Spot.html b/docs/Documentation/Spot.html
index a9450d82c..220a12388 100644
--- a/docs/Documentation/Spot.html
+++ b/docs/Documentation/Spot.html
@@ -138,15 +138,21 @@
- | SPOT.ClassName |
-
-
- |
-
-
| SPOT:IsLasing() |
Check if the SPOT is lasing
+ |
+
+
+ | SPOT:LaseOff() |
+
+ LaseOff Trigger for SPOT
+ |
+
+
+ | SPOT:LaseOn() |
+
+ LaseOn Trigger for SPOT
|
@@ -165,6 +171,36 @@
| SPOT:New(Recce, LaserCode, Duration) |
SPOT Constructor.
+ |
+
+
+ | SPOT:OnAfterLaseOff(From, Event, To) |
+
+ LaseOff Handler OnAfter for SPOT
+ |
+
+
+ | SPOT:OnAfterLaseOn(From, Event, To) |
+
+ LaseOn Handler OnAfter for SPOT
+ |
+
+
+ | SPOT:OnBeforeLaseOff(From, Event, To) |
+
+ LaseOff Handler OnBefore for SPOT
+ |
+
+
+ | SPOT:OnBeforeLaseOn(From, Event, To) |
+
+ LaseOn Handler OnBefore for SPOT
+ |
+
+
+ | SPOT:OnEventDead(EventData) |
+
+
|
@@ -189,6 +225,18 @@
| SPOT.Target |
+ |
+
+
+ | SPOT:__LaseOff(Delay) |
+
+ LaseOff Asynchronous Trigger for SPOT
+ |
+
+
+ | SPOT:__LaseOn(Delay) |
+
+ LaseOn Asynchronous Trigger for SPOT
|
@@ -233,20 +281,6 @@
-
- #string
-
-SPOT.ClassName
-
-
--
-
-
-
-
-
-
--
-
SPOT:IsLasing()
@@ -260,6 +294,32 @@
#boolean:
true if it is lasing
+
+
+
+-
+
+
+SPOT:LaseOff()
+
+
+-
+
+
LaseOff Trigger for SPOT
+
+
+
+
+-
+
+
+SPOT:LaseOn()
+
+
+-
+
+
LaseOn Trigger for SPOT
+
@@ -324,6 +384,161 @@ true if it is lasing
#SPOT:
+
+
+
+-
+
+
+SPOT:OnAfterLaseOff(From, Event, To)
+
+
+-
+
+
LaseOff Handler OnAfter for SPOT
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+
+
+
+-
+
+
+SPOT:OnAfterLaseOn(From, Event, To)
+
+
+-
+
+
LaseOn Handler OnAfter for SPOT
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+
+
+
+-
+
+
+SPOT:OnBeforeLaseOff(From, Event, To)
+
+
+-
+
+
LaseOff Handler OnBefore for SPOT
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+ Return value
+
+#boolean:
+
+
+
+
+
+-
+
+
+SPOT:OnBeforeLaseOn(From, Event, To)
+
+
+-
+
+
LaseOn Handler OnBefore for SPOT
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+ Return value
+
+#boolean:
+
+
+
+
+
+-
+
+
+SPOT:OnEventDead(EventData)
+
+
+-
+
+
+
+
Parameter
+
@@ -343,7 +558,6 @@ true if it is lasing
-
-
SPOT.ScheduleID
@@ -357,7 +571,6 @@ true if it is lasing
-
-
SPOT.Spot
@@ -371,7 +584,6 @@ true if it is lasing
-
-
SPOT.Target
@@ -380,6 +592,48 @@ true if it is lasing
+
+
+
+-
+
+
+SPOT:__LaseOff(Delay)
+
+
+-
+
+
LaseOff Asynchronous Trigger for SPOT
+
+ Parameter
+
+ -
+
+
#number Delay :
+
+
+
+
+
+
+-
+
+
+SPOT:__LaseOn(Delay)
+
+
+-
+
+
LaseOn Asynchronous Trigger for SPOT
+
+ Parameter
+
+ -
+
+
#number Delay :
+
+
+
From 036768d4007c78e096afbc5e6eabbac091c0bf4f Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Sat, 22 Apr 2017 13:53:54 +0200
Subject: [PATCH 12/25] Progress!
---
Moose Development/Moose/AI/AI_Designate.lua | 253 +++++++----
Moose Development/Moose/Core/Cargo.lua | 8 +-
Moose Development/Moose/Core/Point.lua | 19 +
Moose Development/Moose/Core/Set.lua | 34 +-
Moose Development/Moose/Core/SpawnStatic.lua | 10 +-
Moose Development/Moose/Core/Spot.lua | 59 ++-
.../Moose/Wrapper/Controllable.lua | 20 +-
.../Moose/Wrapper/Positionable.lua | 15 +-
Moose Development/Moose/Wrapper/Unit.lua | 37 +-
Moose Mission Setup/Moose.lua | 2 +-
docs/Documentation/AI_Designate.html | 152 ++++++-
docs/Documentation/Base.html | 31 ++
docs/Documentation/Cargo.html | 15 +-
docs/Documentation/Detection.html | 4 +-
docs/Documentation/Movement.html | 4 +
docs/Documentation/Point.html | 33 +-
docs/Documentation/Positionable.html | 32 +-
docs/Documentation/Set.html | 116 +++--
docs/Documentation/Spawn.html | 3 -
docs/Documentation/SpawnStatic.html | 18 +-
docs/Documentation/Spot.html | 420 +++++++++++++++++-
docs/Documentation/Unit.html | 79 +++-
docs/Documentation/index.html | 4 +-
23 files changed, 1129 insertions(+), 239 deletions(-)
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
+
+
+
+-
+
+
+
+SPAWN.uncontrolled
+
+
+-
+
+
+
diff --git a/docs/Documentation/SpawnStatic.html b/docs/Documentation/SpawnStatic.html
index 23a722fcf..50d0ec61a 100644
--- a/docs/Documentation/SpawnStatic.html
+++ b/docs/Documentation/SpawnStatic.html
@@ -444,7 +444,6 @@ ptional) The name of the new static.
-
- #number
SPAWNSTATIC.SpawnIndex
diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html
index 73897fb41..0d3a4ee9b 100644
--- a/docs/Documentation/Task_Cargo.html
+++ b/docs/Documentation/Task_Cargo.html
@@ -453,7 +453,7 @@ based on the tasking capabilities defined in Task#TA
-
- Core.Cargo#CARGO_GROUP
+
FSM_PROCESS.Cargo
From 456b3f483f4b47d3be462b38f9e5e5a5b027da11 Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Sat, 22 Apr 2017 15:10:31 +0200
Subject: [PATCH 18/25] Progress
---
Moose Development/Moose/AI/AI_Designate.lua | 58 +++++++++++++--------
1 file changed, 35 insertions(+), 23 deletions(-)
diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua
index e7d9825e9..4ca683974 100644
--- a/Moose Development/Moose/AI/AI_Designate.lua
+++ b/Moose Development/Moose/AI/AI_Designate.lua
@@ -186,7 +186,6 @@ do -- AI_DESIGNATE
self:AddTransition( "Lasing", "Lasing", "Lasing" )
-
self:AddTransition( "*", "LaseOff", "Designate" )
--- LaseOff Handler OnBefore for AI_DESIGNATE
@@ -266,8 +265,8 @@ do -- AI_DESIGNATE
-- @function [parent=#AI_DESIGNATE] __Illuminate
-- @param #AI_DESIGNATE self
-- @param #number Delay
-
-
+
+ self:AddTransition( "*", "Done", "*" )
self:AddTransition( "*", "Status", "*" )
@@ -445,7 +444,8 @@ do -- AI_DESIGNATE
self:E("Designate through Illumination")
self.Designating[Index] = "Illuminate"
- self:__Illuminate( 1, AttackGroup, Index )
+
+ self:__Illuminate( 1, AttackGroup, Index )
end
---
@@ -590,20 +590,25 @@ do -- AI_DESIGNATE
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
+ local TargetSetUnitCount = TargetSetUnit:Count()
TargetSetUnit:ForEachUnit(
--- @param Wrapper.Unit#UNIT SmokeUnit
function( SmokeUnit )
self:E("In procedure")
- --if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then
+ if math.random( 1, TargetSetUnitCount ) == math.random( 1, TargetSetUnitCount ) then
+ local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2())
+ local RecceUnit = RecceGroup:GetUnit( 1 )
+ RecceUnit:MessageToGroup( "Smoking " .. SmokeUnit:GetTypeName() .. ".", 5, AttackGroup )
SCHEDULER:New( self,
function()
if SmokeUnit:IsAlive() then
SmokeUnit:Smoke( Color, 150 )
end
- end, {}, math.random( 10, 60 )
+ self:Done( Index )
+ end, {}, math.random( 5, 20 )
)
- --end
+ end
end
)
@@ -616,24 +621,31 @@ do -- 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 )
- )
- --end
- end
- )
+ local TargetUnit = TargetSetUnit:GetFirst()
+
+ if TargetUnit then
+ local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(TargetUnit:GetPointVec2())
+ local RecceUnit = RecceGroup:GetUnit( 1 )
+ RecceUnit:MessageToGroup( "Illuminating " .. TargetUnit:GetTypeName() .. ".", 5, AttackGroup )
+ SCHEDULER:New( self,
+ function()
+ if TargetUnit:IsAlive() then
+ TargetUnit:GetPointVec3():AddY(300):IlluminationBomb()
+ end
+ self:Done( Index )
+ end, {}, math.random( 5, 20 )
+ )
+ end
+ end
+ --- Done
+ -- @param #AI_DESIGNATE self
+ -- @return #AI_DESIGNATE
+ function AI_DESIGNATE:onafterDone( From, Event, To, Index )
+
+ self.Designating[Index] = nil
+ self:SetDesignateMenu()
end
end
From e80b90fcf6f0609c5aeabc64d62a834dd3f1aaf5 Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Sat, 22 Apr 2017 15:11:02 +0200
Subject: [PATCH 19/25] Progress
---
docs/Documentation/AI_Designate.html | 282 ++++++++++++++++++++++++++-
docs/Documentation/AI_Patrol.html | 3 +
docs/Documentation/Cargo.html | 1 +
docs/Documentation/Detection.html | 2 -
docs/Documentation/Fsm.html | 3 +-
docs/Documentation/Movement.html | 4 -
docs/Documentation/Spawn.html | 20 ++
docs/Documentation/SpawnStatic.html | 1 -
docs/Documentation/Spot.html | 4 -
docs/Documentation/Task_Cargo.html | 2 +-
10 files changed, 304 insertions(+), 18 deletions(-)
diff --git a/docs/Documentation/AI_Designate.html b/docs/Documentation/AI_Designate.html
index d8ba9e2c8..df67983a0 100644
--- a/docs/Documentation/AI_Designate.html
+++ b/docs/Documentation/AI_Designate.html
@@ -142,6 +142,12 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE.GroupSet |
+ |
+
+
+ | AI_DESIGNATE:Illuminate() |
+
+ Illuminate Trigger for AI_DESIGNATE
|
@@ -166,6 +172,12 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE.LaserCodesUsed |
+ |
+
+
+ | AI_DESIGNATE:MenuIlluminate(AttackGroup, Index) |
+
+
|
@@ -181,7 +193,7 @@ each detected set of potential targets can be lased or smoked...
- | AI_DESIGNATE:MenuSmoke(AttackGroup, Index) |
+ AI_DESIGNATE:MenuSmoke(AttackGroup, Index, Color) |
|
@@ -196,6 +208,12 @@ each detected set of potential targets can be lased or smoked...
AI_DESIGNATE:OnAfterDetect(From, Event, To) |
Detect Handler OnAfter for AI_DESIGNATE
+ |
+
+
+ | AI_DESIGNATE:OnAfterIlluminate(From, Event, To) |
+
+ Illuminate Handler OnAfter for AI_DESIGNATE
|
@@ -226,6 +244,12 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE:OnBeforeDetect(From, Event, To) |
Detect Handler OnBefore for AI_DESIGNATE
+ |
+
+
+ | AI_DESIGNATE:OnBeforeIlluminate(From, Event, To) |
+
+ Illuminate Handler OnBefore for AI_DESIGNATE
|
@@ -298,6 +322,12 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE:__Detect(Delay) |
Detect Asynchronous Trigger for AI_DESIGNATE
+ |
+
+
+ | AI_DESIGNATE:__Illuminate(Delay) |
+
+ Illuminate Asynchronous Trigger for AI_DESIGNATE
|
@@ -328,6 +358,18 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE:onafterDetect() |
+ |
+
+
+ | AI_DESIGNATE:onafterDone(From, Event, To, Index) |
+
+ Done
+ |
+
+
+ | AI_DESIGNATE:onafterIlluminate(From, Event, To, AttackGroup, Index) |
+
+ Illuminating
|
@@ -349,7 +391,7 @@ each detected set of potential targets can be lased or smoked...
- | AI_DESIGNATE:onafterSmoke(From, Event, To, AttackGroup, Index) |
+ AI_DESIGNATE:onafterSmoke(From, Event, To, AttackGroup, Index, Color) |
|
@@ -376,6 +418,14 @@ each detected set of potential targets can be lased or smoked...
+Targets can be:
+
+
+ - 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.
+
+
The following terminology is being used throughout this document:
@@ -540,6 +590,19 @@ One laser code can be given or an sequence of laser codes through an table...
+
+
+-
+
+
+AI_DESIGNATE:Illuminate()
+
+
+-
+
+
Illuminate Trigger for AI_DESIGNATE
+
@@ -593,6 +656,32 @@ One laser code can be given or an sequence of laser codes through an table...
+
+
+-
+
+
+
+-
+
+
+
+
Parameters
+
+ -
+
+
AttackGroup :
+
+
+ -
+
+
Index :
+
+
+
@@ -661,7 +750,7 @@ One laser code can be given or an sequence of laser codes through an table...
-
@@ -679,6 +768,11 @@ One laser code can be given or an sequence of laser codes through an table...
Index :
+
+ -
+
+
Color :
+
@@ -752,6 +846,37 @@ The set of groups to designate for.
-
+
+AI_DESIGNATE:OnAfterIlluminate(From, Event, To)
+
+
+-
+
+
Illuminate Handler OnAfter for AI_DESIGNATE
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+
+
+
+-
+
AI_DESIGNATE:OnAfterLaseOff(From, Event, To)
@@ -907,6 +1032,42 @@ The set of groups to designate for.
#boolean:
+
+
+
+-
+
+
+AI_DESIGNATE:OnBeforeIlluminate(From, Event, To)
+
+
+-
+
+
Illuminate Handler OnBefore for AI_DESIGNATE
+
+ Parameters
+
+ -
+
+
#string From :
+
+
+ -
+
+
#string Event :
+
+
+ -
+
+
#string To :
+
+
+
+ Return value
+
+#boolean:
+
+
@@ -1202,6 +1363,27 @@ number> LaserCodes
-
+
+AI_DESIGNATE:__Illuminate(Delay)
+
+
+-
+
+
Illuminate Asynchronous Trigger for AI_DESIGNATE
+
+ Parameter
+
+ -
+
+
#number Delay :
+
+
+
+
+
+
+-
+
AI_DESIGNATE:__LaseOff(Delay)
@@ -1299,6 +1481,93 @@ number> LaserCodes
#AI_DESIGNATE:
+
+
+
+-
+
+
+AI_DESIGNATE:onafterDone(From, Event, To, Index)
+
+
+-
+
+
Done
+
+ Parameters
+
+ -
+
+
From :
+
+
+ -
+
+
Event :
+
+
+ -
+
+
To :
+
+
+ -
+
+
Index :
+
+
+
+ Return value
+
+#AI_DESIGNATE:
+
+
+
+
+
+-
+
+
+AI_DESIGNATE:onafterIlluminate(From, Event, To, AttackGroup, Index)
+
+
+-
+
+
Illuminating
+
+ Parameters
+
+ -
+
+
From :
+
+
+ -
+
+
Event :
+
+
+ -
+
+
To :
+
+
+ -
+
+
AttackGroup :
+
+
+ -
+
+
Index :
+
+
+
+ Return value
+
+#AI_DESIGNATE:
+
+
@@ -1453,7 +1722,7 @@ number> LaserCodes
-
-AI_DESIGNATE:onafterSmoke(From, Event, To, AttackGroup, Index)
+AI_DESIGNATE:onafterSmoke(From, Event, To, AttackGroup, Index, Color)
-
@@ -1486,6 +1755,11 @@ number> LaserCodes
Index :
+
+ -
+
+
Color :
+
Return value
diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html
index 3f3376551..d80d5e9ce 100644
--- a/docs/Documentation/AI_Patrol.html
+++ b/docs/Documentation/AI_Patrol.html
@@ -951,6 +951,9 @@ Use the method AIPATROLZONE.M
+
+ This table contains the targets detected during patrol.
+
diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html
index c0533186b..22c529efd 100644
--- a/docs/Documentation/Cargo.html
+++ b/docs/Documentation/Cargo.html
@@ -2847,6 +2847,7 @@ The range till cargo will board.
-
+
CARGO_UNIT.CargoCarrier
diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html
index 0e4f07af4..227aa5e92 100644
--- a/docs/Documentation/Detection.html
+++ b/docs/Documentation/Detection.html
@@ -2174,7 +2174,6 @@ self
-
- #number
DETECTION_BASE.DetectedItemCount
@@ -2188,7 +2187,6 @@ self
-
- #number
DETECTION_BASE.DetectedItemMax
diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html
index 7d9bc4a08..9b6918395 100644
--- a/docs/Documentation/Fsm.html
+++ b/docs/Documentation/Fsm.html
@@ -1622,7 +1622,7 @@ A string defining the start state.
-
-
+ #string
FSM._StartState
@@ -1921,7 +1921,6 @@ A string defining the start state.
-
-
FSM.current
diff --git a/docs/Documentation/Movement.html b/docs/Documentation/Movement.html
index 6199b647b..6c410e890 100644
--- a/docs/Documentation/Movement.html
+++ b/docs/Documentation/Movement.html
@@ -213,7 +213,6 @@ on defined intervals (currently every minute).
-
- #number
MOVEMENT.AliveUnits
@@ -222,9 +221,6 @@ on defined intervals (currently every minute).
-
-
Contains the counter how many units are currently alive
-
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index a2d2ace41..f5ca75de3 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -812,6 +812,12 @@ and any spaces before and after the resulting name are removed.
| SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) |
+ |
+
+
+ | SPAWN.uncontrolled |
+
+
|
@@ -3550,6 +3556,20 @@ True = Continue Scheduler
+
+
+
+-
+
+
+
+SPAWN.uncontrolled
+
+
+-
+
+
+
diff --git a/docs/Documentation/SpawnStatic.html b/docs/Documentation/SpawnStatic.html
index 1d7c4389e..7c5843544 100644
--- a/docs/Documentation/SpawnStatic.html
+++ b/docs/Documentation/SpawnStatic.html
@@ -444,7 +444,6 @@ ptional) The name of the new static.
-
- #number
SPAWNSTATIC.SpawnIndex
diff --git a/docs/Documentation/Spot.html b/docs/Documentation/Spot.html
index acce92694..28ddf54bd 100644
--- a/docs/Documentation/Spot.html
+++ b/docs/Documentation/Spot.html
@@ -668,7 +668,6 @@ true if it is lasing
-
-
SPOT.ScheduleID
@@ -682,7 +681,6 @@ true if it is lasing
-
-
SPOT.SpotIR
@@ -696,7 +694,6 @@ true if it is lasing
-
-
SPOT.SpotLaser
@@ -710,7 +707,6 @@ true if it is lasing
-
-
SPOT.Target
diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html
index 73897fb41..0d3a4ee9b 100644
--- a/docs/Documentation/Task_Cargo.html
+++ b/docs/Documentation/Task_Cargo.html
@@ -453,7 +453,7 @@ based on the tasking capabilities defined in Task#TA
-
- Core.Cargo#CARGO_GROUP
+
FSM_PROCESS.Cargo
From 7961ae90f4ae93cb168a4b35202897e3751669ff Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Sun, 23 Apr 2017 08:48:30 +0200
Subject: [PATCH 20/25] Progress
---
Moose Development/Moose/AI/AI_Designate.lua | 192 ++++++++++++------
Moose Development/Moose/Core/Spot.lua | 4 +-
.../Moose/Wrapper/Positionable.lua | 24 +++
3 files changed, 156 insertions(+), 64 deletions(-)
diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua
index 4ca683974..ec4a26a1e 100644
--- a/Moose Development/Moose/AI/AI_Designate.lua
+++ b/Moose Development/Moose/AI/AI_Designate.lua
@@ -122,9 +122,9 @@ do -- AI_DESIGNATE
--- AI_DESIGNATE Constructor. This class is an abstract class and should not be instantiated.
-- @param #AI_DESIGNATE self
-- @param Functional.Detection#DETECTION_BASE Detection
- -- @param Core.Set#SET_GROUP GroupSet The set of groups to designate for.
+ -- @param Core.Set#SET_GROUP AttackSet The Attack collection of GROUP objects to designate and report for.
-- @return #AI_DESIGNATE
- function AI_DESIGNATE:New( Detection, GroupSet )
+ function AI_DESIGNATE:New( Detection, AttackSet )
local self = BASE:Inherit( self, FSM:New() ) -- #AI_DESIGNATE
self:F( { Detection } )
@@ -295,18 +295,22 @@ do -- AI_DESIGNATE
-- @param #number Delay
self.Detection = Detection
- self.GroupSet = GroupSet
+ self.AttackSet = AttackSet
self.RecceSet = Detection:GetDetectionSetGroup()
self.Spots = {}
self.Designating = {}
- self:SetLaserCodes( 1688 )
+ self.LaseDuration = 60
+
+ self:SetLaserCodes( 1688 ) -- set self.LaserCodes
+ self:SetAutoLase( false ) -- set self.Autolase
self.LaserCodesUsed = {}
self.Detection:__Start( 2 )
-
+
+ self:SetDesignateMenu()
return self
end
@@ -327,6 +331,29 @@ do -- AI_DESIGNATE
return self
end
+ --- Set auto lase.
+ -- Auto lase will start lasing targets immediately when these are in range.
+ -- @param #AI_DESIGNATE self
+ -- @param #boolean AutoLase
+ -- @return #AI_DESIGNATE
+ function AI_DESIGNATE:SetAutoLase( AutoLase )
+
+ self.AutoLase = AutoLase
+
+ local AutoLaseOnOff = ( AutoLase == true ) and "On" or "Off"
+
+ local Recce = self.RecceSet:GetFirst()
+
+ if Recce then
+ Recce:MessageToSetGroup( "Auto Lase " .. AutoLaseOnOff .. ".", 15, self.AttackSet )
+ end
+
+ self:ActivateAutoLase()
+ self:SetDesignateMenu()
+
+ return self
+ end
+
---
-- @param #AI_DESIGNATE self
@@ -335,7 +362,11 @@ do -- AI_DESIGNATE
self:__Detect( -60 )
+ self:ActivateAutoLase()
+
self:SendStatus()
+
+
self:SetDesignateMenu()
return self
@@ -357,11 +388,32 @@ do -- AI_DESIGNATE
local RecceLeader = self.RecceSet:GetFirst() -- Wrapper.Group#GROUP
- self.GroupSet:ForEachGroup(
+ RecceLeader:MessageToSetGroup( DetectedReport:Text( "\n" ), 15, self.AttackSet )
+
+ return self
+ end
+
+ --- Coordinates the Auto Lase.
+ -- @param #AI_DESIGNATE self
+ -- @return #AI_DESIGNATE
+ function AI_DESIGNATE:ActivateAutoLase()
+
+ self.AttackSet:Flush()
+
+ self.AttackSet:ForEachGroup(
--- @param Wrapper.Group#GROUP GroupReport
function( AttackGroup )
- RecceLeader:MessageToGroup( DetectedReport:Text( "\n" ), 15, AttackGroup )
+
+ local DetectedItems = self.Detection:GetDetectedItems()
+
+ for Index, DetectedItemData in pairs( DetectedItems ) do
+ if self.AutoLase then
+ if not self.Designating[Index] then
+ self:LaseOn( Index, self.LaseDuration )
+ end
+ end
+ end
end
)
@@ -373,9 +425,9 @@ do -- AI_DESIGNATE
-- @return #AI_DESIGNATE
function AI_DESIGNATE:SetDesignateMenu()
- self.GroupSet:Flush()
+ self.AttackSet:Flush()
- self.GroupSet:ForEachGroup(
+ self.AttackSet:ForEachGroup(
--- @param Wrapper.Group#GROUP GroupReport
function( AttackGroup )
@@ -389,6 +441,13 @@ do -- AI_DESIGNATE
self:E(DesignateMenu)
AttackGroup:SetState( AttackGroup, "DesignateMenu", DesignateMenu )
+ -- Set Menu option for auto lase
+
+ if self.AutoLase then
+ MENU_GROUP_COMMAND:New( AttackGroup, "Auto Lase Off", DesignateMenu, self.MenuAutoLase, self, false )
+ else
+ MENU_GROUP_COMMAND:New( AttackGroup, "Auto Lase On", DesignateMenu, self.MenuAutoLase, self, true )
+ end
local DetectedItems = self.Detection:GetDetectedItems()
@@ -398,14 +457,14 @@ do -- AI_DESIGNATE
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 )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Lase target 60 secs", DetectedMenu, self.MenuLaseOn, self, Index, 60 )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Lase target 120 secs", DetectedMenu, self.MenuLaseOn, self, Index, 120 )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke red", DetectedMenu, self.MenuSmoke, self, Index, SMOKECOLOR.Red )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke blue", DetectedMenu, self.MenuSmoke, self, Index, SMOKECOLOR.Blue )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke green", DetectedMenu, self.MenuSmoke, self, Index, SMOKECOLOR.Green )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke white", DetectedMenu, self.MenuSmoke, self, Index, SMOKECOLOR.White )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Smoke orange", DetectedMenu, self.MenuSmoke, self, Index, SMOKECOLOR.Orange )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Illuminate", DetectedMenu, self.MenuIlluminate, self, Index )
else
if self.Designating[Index] == "Laser" then
Report = "Lasing " .. Report
@@ -416,7 +475,7 @@ do -- AI_DESIGNATE
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 )
+ MENU_GROUP_COMMAND:New( AttackGroup, "Stop lasing", DetectedMenu, self.MenuLaseOff, self, Index )
else
end
end
@@ -429,59 +488,66 @@ do -- AI_DESIGNATE
---
-- @param #AI_DESIGNATE self
- function AI_DESIGNATE:MenuSmoke( AttackGroup, Index, Color )
+ function AI_DESIGNATE:MenuAutoLase( AutoLase )
- self:E("Designate through Smoke")
+ self:E("AutoLase")
- self.Designating[Index] = "Smoke"
- self:__Smoke( 1, AttackGroup, Index, Color )
+ self:SetAutoLase( AutoLase )
end
---
-- @param #AI_DESIGNATE self
- function AI_DESIGNATE:MenuIlluminate( AttackGroup, Index )
+ function AI_DESIGNATE:MenuSmoke( Index, Color )
+
+ self:E("Designate through Smoke")
+
+ self.Designating[Index] = "Smoke"
+ self:__Smoke( 1, Index, Color )
+ end
+
+ ---
+ -- @param #AI_DESIGNATE self
+ function AI_DESIGNATE:MenuIlluminate( Index )
self:E("Designate through Illumination")
self.Designating[Index] = "Illuminate"
- self:__Illuminate( 1, AttackGroup, Index )
+ self:__Illuminate( 1, Index )
end
---
-- @param #AI_DESIGNATE self
- function AI_DESIGNATE:MenuLaseOn( AttackGroup, Index, Duration )
+ function AI_DESIGNATE:MenuLaseOn( Index, Duration )
self:E("Designate through Lase")
- self.Designating[Index] = "Laser"
- self:__LaseOn( 1, AttackGroup, Index, Duration )
+ self:__LaseOn( 1, Index, Duration )
end
---
-- @param #AI_DESIGNATE self
- function AI_DESIGNATE:MenuLaseOff( AttackGroup, Index, Duration )
+ function AI_DESIGNATE:MenuLaseOff( Index, Duration )
self:E("Lasing off")
self.Designating[Index] = nil
- self:__LaseOff( 1, AttackGroup, Index )
+ self:__LaseOff( 1, Index )
end
---
-- @param #AI_DESIGNATE self
- -- @return #AI_DESIGNATE
- function AI_DESIGNATE:onafterLaseOn( From, Event, To, AttackGroup, Index, Duration )
-
- self:__Lasing( 5, AttackGroup, Index, Duration )
+ function AI_DESIGNATE:onafterLaseOn( From, Event, To, Index, Duration )
+ self.Designating[Index] = "Laser"
+ self:Lasing( Index, Duration )
end
---
-- @param #AI_DESIGNATE self
-- @return #AI_DESIGNATE
- function AI_DESIGNATE:onafterLasing( From, Event, To, AttackGroup, Index, Duration )
+ function AI_DESIGNATE:onafterLasing( From, Event, To, Index, Duration )
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
@@ -496,8 +562,6 @@ do -- AI_DESIGNATE
end
end
- local MoreTargets = false
-
TargetSetUnit:ForEachUnit(
--- @param Wrapper.Unit#UNIT SmokeUnit
function( TargetUnit )
@@ -518,10 +582,10 @@ do -- AI_DESIGNATE
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 )
+ self.Recce:MessageToSetGroup( "Target " .. TargetUnit:GetTypeName() .. " destroyed." .. TargetSetUnit:Count() .. " targets left.", 15, self.AttackSet )
end
self.Spots[TargetUnit] = Spot
- RecceUnit:MessageToGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. "s, code: " .. Spot.LaserCode, 5, AttackGroup )
+ RecceUnit:MessageToSetGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. "s, code: " .. Spot.LaserCode, 5, self.AttackSet )
break
end
end
@@ -531,7 +595,7 @@ do -- AI_DESIGNATE
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 )
+ Spot.Recce:MessageToGroup( "Target " .. TargetUnit:GetTypeName() "out of LOS. Cancelling lase!", 5, self.AttackSet )
end
end
end
@@ -540,7 +604,7 @@ do -- AI_DESIGNATE
else
MoreTargets = true
local RecceUnit = Spot.Recce
- RecceUnit:MessageToGroup( "Lasing " .. TargetUnit:GetTypeName() .. ", code " .. Spot.LaserCode, 5, AttackGroup )
+ RecceUnit:MessageToSetGroup( "Lasing " .. TargetUnit:GetTypeName() .. ", code " .. Spot.LaserCode, 5, self.AttackSet )
end
else
self.Spots[TargetUnit] = nil
@@ -548,11 +612,7 @@ do -- AI_DESIGNATE
end
)
- if MoreTargets == true then
- self:__Lasing( 30, AttackGroup, Index, Duration )
- else
- self:__LaseOff( 1, AttackGroup, Index )
- end
+ self:__Lasing( 15, Index, Duration )
self:SetDesignateMenu()
@@ -561,9 +621,13 @@ do -- AI_DESIGNATE
---
-- @param #AI_DESIGNATE self
-- @return #AI_DESIGNATE
- function AI_DESIGNATE:onafterLaseOff( From, Event, To, AttackGroup, Index )
+ function AI_DESIGNATE:onafterLaseOff( From, Event, To, Index )
- self.RecceSet:GetFirst():MessageToGroup( "Stopped lasing.", 15, AttackGroup )
+ local Recce = self.RecceSet:GetFirst()
+
+ if Recce then
+ Recce:MessageToSetGroup( "Stopped lasing.", 15, self.AttackSet )
+ end
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
@@ -571,7 +635,7 @@ do -- AI_DESIGNATE
for SpotID, SpotData in pairs( Spots ) do
local Spot = SpotData -- Core.Spot#SPOT
- Spot.Recce:MessageToGroup( "Stopped lasing " .. Spot.Target:GetTypeName() .. ".", 15, AttackGroup )
+ Spot.Recce:MessageToSetGroup( "Stopped lasing " .. Spot.Target:GetTypeName() .. ".", 15, self.AttackSet )
Spot:LaseOff()
end
@@ -586,7 +650,7 @@ do -- AI_DESIGNATE
---
-- @param #AI_DESIGNATE self
-- @return #AI_DESIGNATE
- function AI_DESIGNATE:onafterSmoke( From, Event, To, AttackGroup, Index, Color )
+ function AI_DESIGNATE:onafterSmoke( From, Event, To, Index, Color )
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
@@ -599,15 +663,17 @@ do -- AI_DESIGNATE
if math.random( 1, TargetSetUnitCount ) == math.random( 1, TargetSetUnitCount ) then
local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2())
local RecceUnit = RecceGroup:GetUnit( 1 )
- RecceUnit:MessageToGroup( "Smoking " .. SmokeUnit:GetTypeName() .. ".", 5, AttackGroup )
- SCHEDULER:New( self,
- function()
- if SmokeUnit:IsAlive() then
- SmokeUnit:Smoke( Color, 150 )
- end
- self:Done( Index )
- end, {}, math.random( 5, 20 )
- )
+ if RecceUnit then
+ RecceUnit:MessageToSetGroup( "Smoking " .. SmokeUnit:GetTypeName() .. ".", 5, self.AttackSet )
+ SCHEDULER:New( self,
+ function()
+ if SmokeUnit:IsAlive() then
+ SmokeUnit:Smoke( Color, 150 )
+ end
+ self:Done( Index )
+ end, {}, math.random( 5, 20 )
+ )
+ end
end
end
)
@@ -618,16 +684,17 @@ do -- AI_DESIGNATE
--- Illuminating
-- @param #AI_DESIGNATE self
-- @return #AI_DESIGNATE
- function AI_DESIGNATE:onafterIlluminate( From, Event, To, AttackGroup, Index )
+ function AI_DESIGNATE:onafterIlluminate( From, Event, To, Index )
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
local TargetUnit = TargetSetUnit:GetFirst()
if TargetUnit then
- local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(TargetUnit:GetPointVec2())
- local RecceUnit = RecceGroup:GetUnit( 1 )
- RecceUnit:MessageToGroup( "Illuminating " .. TargetUnit:GetTypeName() .. ".", 5, AttackGroup )
+ local RecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(TargetUnit:GetPointVec2())
+ local RecceUnit = RecceGroup:GetUnit( 1 )
+ if RecceUnit then
+ RecceUnit:MessageToGroup( "Illuminating " .. TargetUnit:GetTypeName() .. ".", 5, self.AttackSet )
SCHEDULER:New( self,
function()
if TargetUnit:IsAlive() then
@@ -636,6 +703,7 @@ do -- AI_DESIGNATE
self:Done( Index )
end, {}, math.random( 5, 20 )
)
+ end
end
end
diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua
index 18ba85400..7177cbde8 100644
--- a/Moose Development/Moose/Core/Spot.lua
+++ b/Moose Development/Moose/Core/Spot.lua
@@ -196,9 +196,9 @@ do
function SPOT:onafterLasing( From, Event, To )
if self.Target:IsAlive() then
- self.SpotIR:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
+ self.SpotIR:setPoint( self.Target:GetPointVec3():AddY(1):AddY(math.random(-100,100)/100):AddX(math.random(-100,100)/100):GetVec3() )
self.SpotLaser:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
- self:__Lasing( -0.2 )
+ self:__Lasing( -0.05 )
else
self:E( { "Target is not alive", self.Target:IsAlive() } )
end
diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua
index c04d1cc06..7ebdb3979 100644
--- a/Moose Development/Moose/Wrapper/Positionable.lua
+++ b/Moose Development/Moose/Wrapper/Positionable.lua
@@ -426,6 +426,30 @@ function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup, Name )
return nil
end
+--- (R2.1) Send a message to a @{Set#SET_GROUP}.
+-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
+-- @param #POSITIONABLE self
+-- @param #string Message The message text
+-- @param Dcs.DCSTypes#Duration Duration The duration of the message.
+-- @param Core.Set#SET_GROUP MessageSetGroup The SET_GROUP collection receiving the message.
+-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
+function POSITIONABLE:MessageToSetGroup( Message, Duration, MessageSetGroup, Name )
+ self:F2( { Message, Duration } )
+
+ local DCSObject = self:GetDCSObject()
+ if DCSObject then
+ if DCSObject:isExist() then
+ MessageSetGroup:ForEachGroup(
+ function( MessageGroup )
+ self:GetMessage( Message, Duration, Name ):ToGroup( MessageGroup )
+ end
+ )
+ end
+ end
+
+ return nil
+end
+
--- Send a message to the players in the @{Group}.
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
-- @param #POSITIONABLE self
From 1cc89942d12e8cf86522e15d7348bbe46d1e7a86 Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Sun, 23 Apr 2017 08:49:12 +0200
Subject: [PATCH 21/25] Progress
---
Moose Mission Setup/Moose.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua
index 07c8fc12b..3fb8251c1 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: 20170422_1159' )
+env.info( 'Moose Generation Timestamp: 20170423_0705' )
local base = _G
From 8a5a33d191b8cc1aaf2cec8994e8d21bfc74386c Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Sun, 23 Apr 2017 10:04:11 +0200
Subject: [PATCH 22/25] Progress
---
Moose Development/Moose/AI/AI_Designate.lua | 50 +++++++++----------
.../Moose/Wrapper/Positionable.lua | 8 +++
2 files changed, 32 insertions(+), 26 deletions(-)
diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua
index ec4a26a1e..dee4153ab 100644
--- a/Moose Development/Moose/AI/AI_Designate.lua
+++ b/Moose Development/Moose/AI/AI_Designate.lua
@@ -297,7 +297,7 @@ do -- AI_DESIGNATE
self.Detection = Detection
self.AttackSet = AttackSet
self.RecceSet = Detection:GetDetectionSetGroup()
- self.Spots = {}
+ self.Recces = {}
self.Designating = {}
self.LaseDuration = 60
@@ -553,12 +553,12 @@ do -- AI_DESIGNATE
TargetSetUnit:Flush()
- for TargetUnit, SpotData in pairs( self.Spots ) do
- local Spot = SpotData -- Core.Spot#SPOT
- if not Spot:IsLasing() then
- local LaserCode = Spot.LaserCode --(Not deleted when stopping with lasing).
+ for TargetUnit, RecceData in pairs( self.Recces ) do
+ local Recce = RecceData -- Wrapper.Unit#UNIT
+ if not Recce:IsLasing() then
+ local LaserCode = self.LaserCodesUsed[Recce] --(Not deleted when stopping with lasing).
self.LaserCodesUsed[LaserCode] = nil
- self.Spots[TargetUnit] = nil
+ self.Recces[TargetUnit] = nil
end
end
@@ -567,8 +567,8 @@ do -- AI_DESIGNATE
function( TargetUnit )
self:E("In procedure")
if TargetUnit:IsAlive() then
- local Spot = self.Spots[TargetUnit]
- if (not Spot) or ( Spot and Spot:IsLasing() == false ) then
+ local Recce = self.Recces[TargetUnit]
+ if (not Recce) or ( Recce and Recce:IsLasing() == false ) then
for RecceGroupID, RecceGroup in pairs( self.RecceSet:GetSet() ) do
for UnitID, UnitData in pairs( RecceGroup:GetUnits() or {} ) do
local RecceUnit = UnitData -- Wrapper.Unit#UNIT
@@ -577,37 +577,35 @@ do -- AI_DESIGNATE
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:MessageToSetGroup( "Target " .. TargetUnit:GetTypeName() .. " destroyed." .. TargetSetUnit:Count() .. " targets left.", 15, self.AttackSet )
end
- self.Spots[TargetUnit] = Spot
- RecceUnit:MessageToSetGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. "s, code: " .. Spot.LaserCode, 5, self.AttackSet )
+ self.Recces[TargetUnit] = RecceUnit
+ RecceUnit:MessageToSetGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. "s, code: " .. RecceUnit:GetSpot().LaserCode, 5, self.AttackSet )
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, self.AttackSet )
+ local Recce = self.Recces[TargetUnit] -- Wrapper.Unit#UNIT
+ if Recce then
+ Recce:LaseOff()
+ Recce:MessageToGroup( "Target " .. TargetUnit:GetTypeName() "out of LOS. Cancelling lase!", 5, self.AttackSet )
end
end
end
end
end
else
- MoreTargets = true
- local RecceUnit = Spot.Recce
- RecceUnit:MessageToSetGroup( "Lasing " .. TargetUnit:GetTypeName() .. ", code " .. Spot.LaserCode, 5, self.AttackSet )
+ local RecceUnit = Recce.Recce
+ RecceUnit:MessageToSetGroup( "Lasing " .. TargetUnit:GetTypeName() .. ", code " .. Recce.LaserCode, 5, self.AttackSet )
end
else
- self.Spots[TargetUnit] = nil
+ self.Recces[TargetUnit] = nil
end
end
)
@@ -631,16 +629,16 @@ do -- AI_DESIGNATE
local TargetSetUnit = self.Detection:GetDetectedSet( Index )
- local Spots = self.Spots
+ local Recces = self.Recces
- for SpotID, SpotData in pairs( Spots ) do
- local Spot = SpotData -- Core.Spot#SPOT
- Spot.Recce:MessageToSetGroup( "Stopped lasing " .. Spot.Target:GetTypeName() .. ".", 15, self.AttackSet )
- Spot:LaseOff()
+ for TargetID, RecceData in pairs( Recces ) do
+ local Recce = RecceData -- Wrapper.Unit#UNIT
+ Recce:MessageToSetGroup( "Stopped lasing " .. Recce:GetSpot().Target:GetTypeName() .. ".", 15, self.AttackSet )
+ Recce:LaseOff()
end
- Spots = nil
- self.Spots = {}
+ Recces = nil
+ self.Recces = {}
self.LaserCodesUsed = {}
self:SetDesignateMenu()
diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua
index 7ebdb3979..3157d8bbc 100644
--- a/Moose Development/Moose/Wrapper/Positionable.lua
+++ b/Moose Development/Moose/Wrapper/Positionable.lua
@@ -534,3 +534,11 @@ function POSITIONABLE:IsLasing()
return Lasing
end
+
+--- (R2.1) Get the Spot
+-- @param #POSITIONABLE self
+-- @return Core.Spot#SPOT The Spot
+function POSITIONABLE:GetSpot()
+
+ return self.Spot
+end
From 20b4ebfb2b88be56180963b8229607154656e7b0 Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Sun, 23 Apr 2017 13:49:32 +0200
Subject: [PATCH 23/25] Improvements
---
Moose Development/Moose/AI/AI_Designate.lua | 39 +++++++++++++++----
Moose Development/Moose/Core/Spot.lua | 20 +++++-----
.../Moose/Wrapper/Positionable.lua | 11 ++++++
3 files changed, 51 insertions(+), 19 deletions(-)
diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua
index dee4153ab..5d725e623 100644
--- a/Moose Development/Moose/AI/AI_Designate.lua
+++ b/Moose Development/Moose/AI/AI_Designate.lua
@@ -448,6 +448,8 @@ do -- AI_DESIGNATE
else
MENU_GROUP_COMMAND:New( AttackGroup, "Auto Lase On", DesignateMenu, self.MenuAutoLase, self, true )
end
+
+ MENU_GROUP_COMMAND:New( AttackGroup, "Report Designation Status", DesignateMenu, self.MenuStatus, self, AttackGroup )
local DetectedItems = self.Detection:GetDetectedItems()
@@ -485,6 +487,27 @@ do -- AI_DESIGNATE
return self
end
+
+ ---
+ -- @param #AI_DESIGNATE self
+ function AI_DESIGNATE:MenuStatus( AttackGroup )
+
+ self:E("Status")
+
+ self.RecceSet:ForEachGroup(
+ function( RecceGroup )
+ local RecceUnits = RecceGroup:GetUnits()
+ for UnitID, RecceData in pairs( RecceUnits ) do
+ local Recce = RecceData -- Wrapper.Unit#UNIT
+ if Recce:IsLasing() then
+ Recce:MessageToGroup( "Marking " .. Recce:GetSpot().Target:GetTypeName() .. " with laser " .. Recce:GetSpot().LaserCode .. ".", 5, AttackGroup )
+ end
+ end
+ end
+ )
+
+ end
+
---
-- @param #AI_DESIGNATE self
@@ -556,7 +579,7 @@ do -- AI_DESIGNATE
for TargetUnit, RecceData in pairs( self.Recces ) do
local Recce = RecceData -- Wrapper.Unit#UNIT
if not Recce:IsLasing() then
- local LaserCode = self.LaserCodesUsed[Recce] --(Not deleted when stopping with lasing).
+ local LaserCode = Recce:GetLaserCode() --(Not deleted when stopping with lasing).
self.LaserCodesUsed[LaserCode] = nil
self.Recces[TargetUnit] = nil
end
@@ -568,7 +591,7 @@ do -- AI_DESIGNATE
self:E("In procedure")
if TargetUnit:IsAlive() then
local Recce = self.Recces[TargetUnit]
- if (not Recce) or ( Recce and Recce:IsLasing() == false ) then
+ if not Recce then
for RecceGroupID, RecceGroup in pairs( self.RecceSet:GetSet() ) do
for UnitID, UnitData in pairs( RecceGroup:GetUnits() or {} ) do
local RecceUnit = UnitData -- Wrapper.Unit#UNIT
@@ -579,14 +602,17 @@ do -- AI_DESIGNATE
if not self.LaserCodesUsed[LaserCode] then
self.LaserCodesUsed[LaserCode] = LaserCodeIndex
local Spot = RecceUnit:LaseUnit( TargetUnit, LaserCode, Duration )
+ local AttackSet = self.AttackSet
function Spot:OnAfterDestroyed( From, Event, To )
self:E( "Destroyed Message" )
- self.Recce:MessageToSetGroup( "Target " .. TargetUnit:GetTypeName() .. " destroyed." .. TargetSetUnit:Count() .. " targets left.", 15, self.AttackSet )
+ self.Recce:MessageToSetGroup( "Target " .. TargetUnit:GetTypeName() .. " destroyed." .. TargetSetUnit:Count() .. " targets left.", 15, AttackSet )
end
self.Recces[TargetUnit] = RecceUnit
- RecceUnit:MessageToSetGroup( "Lasing " .. TargetUnit:GetTypeName() .. " for " .. Duration .. "s, code: " .. RecceUnit:GetSpot().LaserCode, 5, self.AttackSet )
+ RecceUnit:MessageToSetGroup( "Marking " .. TargetUnit:GetTypeName() .. " with laser " .. RecceUnit:GetSpot().LaserCode .. " for " .. Duration .. "s.", 5, self.AttackSet )
break
end
+ else
+ RecceUnit:MessageToSetGroup( "Can't lase " .. TargetUnit:GetTypeName(), 5, self.AttackSet )
end
else
-- The Recce is lasing, but the Target is not detected or within LOS. So stop lasing and send a report.
@@ -601,11 +627,8 @@ do -- AI_DESIGNATE
end
end
else
- local RecceUnit = Recce.Recce
- RecceUnit:MessageToSetGroup( "Lasing " .. TargetUnit:GetTypeName() .. ", code " .. Recce.LaserCode, 5, self.AttackSet )
+ Recce:MessageToSetGroup( "Marking " .. TargetUnit:GetTypeName() .. " with laser " .. Recce.LaserCode .. ".", 5, self.AttackSet )
end
- else
- self.Recces[TargetUnit] = nil
end
end
)
diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua
index 7177cbde8..b925af8a4 100644
--- a/Moose Development/Moose/Core/Spot.lua
+++ b/Moose Development/Moose/Core/Spot.lua
@@ -141,6 +141,8 @@ do
self.LaseScheduler = SCHEDULER:New( self )
self:SetEventPriority( 5 )
+
+ self.Lasing = false
return self
end
@@ -162,6 +164,8 @@ do
self.Target = Target
self.LaserCode = LaserCode
+ self.Lasing = true
+
local RecceDcsUnit = self.Recce:GetDCSObject()
self.SpotIR = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, Target:GetPointVec3():AddY(1):GetVec3() )
@@ -184,7 +188,7 @@ do
if EventData.IniDCSUnitName == self.Target:GetName() then
self:E( {"Target dead ", self.Target:GetName() } )
self:Destroyed()
- self:LaseOff( 0.1 )
+ self:LaseOff()
end
end
end
@@ -198,7 +202,7 @@ do
if self.Target:IsAlive() then
self.SpotIR:setPoint( self.Target:GetPointVec3():AddY(1):AddY(math.random(-100,100)/100):AddX(math.random(-100,100)/100):GetVec3() )
self.SpotLaser:setPoint( self.Target:GetPointVec3():AddY(1):GetVec3() )
- self:__Lasing( -0.05 )
+ self:__Lasing( -0.2 )
else
self:E( { "Target is not alive", self.Target:IsAlive() } )
end
@@ -214,6 +218,8 @@ do
self:E( {"Stopped lasing for ", self.Target:GetName() , SpotIR = self.SportIR, SpotLaser = self.SpotLaser } )
+ self.Lasing = false
+
self.SpotIR:destroy()
self.SpotLaser:destroy()
@@ -234,15 +240,7 @@ do
-- @param #SPOT self
-- @return #boolean true if it is lasing
function SPOT:IsLasing()
- self:F2()
-
- local Lasing = false
-
- if self.SpotIR then
- Lasing = true
- end
-
- return Lasing
+ return self.Lasing
end
end
\ No newline at end of file
diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua
index 3157d8bbc..5b3d2339c 100644
--- a/Moose Development/Moose/Wrapper/Positionable.lua
+++ b/Moose Development/Moose/Wrapper/Positionable.lua
@@ -29,6 +29,8 @@
-- @type POSITIONABLE
-- @extends Wrapper.Identifiable#IDENTIFIABLE
-- @field #string PositionableName The name of the measurable.
+-- @field Core.Spot#SPOT Spot The laser Spot.
+-- @field #number LaserCode The last assigned laser code.
POSITIONABLE = {
ClassName = "POSITIONABLE",
PositionableName = "",
@@ -501,6 +503,7 @@ function POSITIONABLE:LaseUnit( Target, LaserCode, Duration )
self:E("bulding spot")
self.Spot = SPOT:New( self ) -- Core.Spot#SPOT
self.Spot:LaseOn( Target, LaserCode, Duration)
+ self.LaserCode = LaserCode
return self.Spot
@@ -542,3 +545,11 @@ function POSITIONABLE:GetSpot()
return self.Spot
end
+
+--- (R2.1) Get the last assigned laser code
+-- @param #POSITIONABLE self
+-- @return #number The laser code
+function POSITIONABLE:GetLaserCode()
+
+ return self.LaserCode
+end
From 6c018acc79c6511295f2168ab81672737fafc674 Mon Sep 17 00:00:00 2001
From: FlightControl
Date: Sun, 23 Apr 2017 17:09:03 +0200
Subject: [PATCH 24/25] Documentation
---
Moose Development/Moose/AI/AI_Designate.lua | 43 +-
Moose Development/Moose/Core/Cargo.lua | 8 +-
Moose Development/Moose/Core/Point.lua | 4 +-
Moose Development/Moose/Core/SpawnStatic.lua | 16 +-
Moose Development/Moose/Core/Spot.lua | 61 ++-
Moose Development/Moose/Functional/Spawn.lua | 40 --
.../Moose/Wrapper/Positionable.lua | 32 +-
Moose Development/Moose/Wrapper/Unit.lua | 8 +-
docs/Documentation/AI_Designate.html | 369 ++++++++++++------
docs/Documentation/Cargo.html | 8 +-
docs/Documentation/Movement.html | 4 +
docs/Documentation/Point.html | 5 +-
docs/Documentation/Positionable.html | 141 ++++++-
docs/Documentation/Spawn.html | 77 +---
docs/Documentation/SpawnStatic.html | 17 +-
docs/Documentation/Spot.html | 186 +++++----
docs/Documentation/Unit.html | 8 +-
docs/Documentation/index.html | 4 +-
18 files changed, 663 insertions(+), 368 deletions(-)
diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua
index 5d725e623..0feb71078 100644
--- a/Moose Development/Moose/AI/AI_Designate.lua
+++ b/Moose Development/Moose/AI/AI_Designate.lua
@@ -1,9 +1,35 @@
---- **AI (Release 2.1)** -- Management of target designation.
+--- **AI R2.1** -- Management of target **Designation**.
--
-- --
--
-- ===
--
+-- AI_DESIGNATE is orchestrating the designation of potential targets executed by a Recce group,
+-- and communicates these to a dedicated attacking group of players,
+-- so that following a dynamically generated menu system,
+-- each detected set of potential targets can be lased or smoked...
+--
+-- Targets can be:
+--
+-- * **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.
+--
+-- ===
+--
+-- # **AUTHORS and CONTRIBUTIONS**
+--
+-- ### Contributions:
+--
+-- * [**Ciribob**](https://forums.eagle.ru/member.php?u=112175): Showing the way how to lase targets + how laser codes work!!! Explained the autolase script.
+-- * [**EasyEB**](https://forums.eagle.ru/member.php?u=112055): Ideas and Beta Testing
+-- * [**Wingthor**](https://forums.eagle.ru/member.php?u=123698): Beta Testing
+--
+--
+-- ### Authors:
+--
+-- * **FlightControl**: Design & Programming
+--
-- @module AI_Designate
@@ -79,7 +105,7 @@ do -- AI_DESIGNATE
--
-- ## 2. AI_DESIGNATE is a FSM
--
- -- 
+ -- ![Process]()
--
-- ### 2.1 AI_DESIGNATE States
--
@@ -111,7 +137,16 @@ do -- AI_DESIGNATE
--
-- The above sets a collection of possible laser codes that can be assigned. **Note the { } notation!**
--
+ -- ## 4. Autolase to automatically lase detected targets.
--
+ -- _DetectionItems_ can be auto lased once detected by _Recces_. As such, there is almost no action required from the _Players_ using the _Designate Menu_.
+ -- The **auto lase** function can be activated through the Designation Menu.
+ -- Use the method @{#AI_DESIGNATE.SetAutoLase}() to activate or deactivate the auto lase function programmatically.
+ -- Note that autolase will automatically activate lasing for ALL _DetectedItems_. Individual items can be switched-off if required using the _Designation Menu_.
+ --
+ -- AIDesignate:SetAutoLase( true )
+ --
+ -- Activate the auto lasing.
--
-- @field #AI_DESIGNATE
--
@@ -321,7 +356,7 @@ do -- AI_DESIGNATE
-- @param #AI_DESIGNATE self
-- @param #list<#number> LaserCodes
-- @return #AI_DESIGNATE
- function AI_DESIGNATE:SetLaserCodes( LaserCodes )
+ function AI_DESIGNATE:SetLaserCodes( LaserCodes ) --R2.1
self.LaserCodes = ( type( LaserCodes ) == "table" ) and LaserCodes or { LaserCodes }
self:E(self.LaserCodes)
@@ -336,7 +371,7 @@ do -- AI_DESIGNATE
-- @param #AI_DESIGNATE self
-- @param #boolean AutoLase
-- @return #AI_DESIGNATE
- function AI_DESIGNATE:SetAutoLase( AutoLase )
+ function AI_DESIGNATE:SetAutoLase( AutoLase ) --R2.1
self.AutoLase = AutoLase
diff --git a/Moose Development/Moose/Core/Cargo.lua b/Moose Development/Moose/Core/Cargo.lua
index 2199ad032..feb1291b7 100644
--- a/Moose Development/Moose/Core/Cargo.lua
+++ b/Moose Development/Moose/Core/Cargo.lua
@@ -224,14 +224,14 @@ do -- CARGO
-- @map < #string, Wrapper.Positionable#POSITIONABLE > The alive POSITIONABLE objects representing the the cargo.
---- (R2.1) CARGO Constructor. This class is an abstract class and should not be instantiated.
+--- CARGO Constructor. This class is an abstract class and should not be instantiated.
-- @param #CARGO self
-- @param #string Type
-- @param #string Name
-- @param #number Weight
-- @param #number NearRadius (optional)
-- @return #CARGO
-function CARGO:New( Type, Name, Weight )
+function CARGO:New( Type, Name, Weight ) --R2.1
local self = BASE:Inherit( self, FSM:New() ) -- #CARGO
self:F( { Type, Name, Weight } )
@@ -266,10 +266,10 @@ function CARGO:New( Type, Name, Weight )
return self
end
---- (R2.1) Get the name of the Cargo.
+--- Get the name of the Cargo.
-- @param #CARGO self
-- @return #string The name of the Cargo.
-function CARGO:GetName()
+function CARGO:GetName() --R2.1
return self.Name
end
diff --git a/Moose Development/Moose/Core/Point.lua b/Moose Development/Moose/Core/Point.lua
index 0c8e1885c..5055f52f1 100644
--- a/Moose Development/Moose/Core/Point.lua
+++ b/Moose Development/Moose/Core/Point.lua
@@ -789,11 +789,11 @@ 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.
+--- 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 )
+function POINT_VEC3:IsLOS( ToPointVec3 ) --R2.1
-- Measurement of visibility should not be from the ground, so Adding a hypotethical 2 meters to each PointVec3.
local FromVec3 = self:GetVec3()
diff --git a/Moose Development/Moose/Core/SpawnStatic.lua b/Moose Development/Moose/Core/SpawnStatic.lua
index 0ddbe4d12..2655ac08b 100644
--- a/Moose Development/Moose/Core/SpawnStatic.lua
+++ b/Moose Development/Moose/Core/SpawnStatic.lua
@@ -91,11 +91,11 @@ SPAWNSTATIC = {
-- @list SpawnZone
---- (R2.1) Creates the main object to spawn a @{Static} defined in the ME.
+--- 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
-function SPAWNSTATIC:NewFromStatic( SpawnTemplatePrefix, CountryID )
+function SPAWNSTATIC:NewFromStatic( SpawnTemplatePrefix, CountryID ) --R2.1
local self = BASE:Inherit( self, BASE:New() ) -- #SPAWNSTATIC
self:F( { SpawnTemplatePrefix } )
@@ -113,11 +113,11 @@ function SPAWNSTATIC:NewFromStatic( SpawnTemplatePrefix, CountryID )
return self
end
---- (R2.1) Creates the main object to spawn a @{Static} based on a type name.
+--- 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
-function SPAWNSTATIC:NewFromType( SpawnTypeName, SpawnShapeName, SpawnCategory, CountryID )
+function SPAWNSTATIC:NewFromType( SpawnTypeName, SpawnShapeName, SpawnCategory, CountryID ) --R2.1
local self = BASE:Inherit( self, BASE:New() ) -- #SPAWNSTATIC
self:F( { SpawnTypeName } )
@@ -131,13 +131,13 @@ function SPAWNSTATIC:NewFromType( SpawnTypeName, SpawnShapeName, SpawnCategory,
end
---- (R2.1) Creates a new @{Static} from a POINT_VEC2.
+--- 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.
-- @param #string (optional) The name of the new static.
-- @return #SPAWNSTATIC
-function SPAWNSTATIC:SpawnFromPointVec2( PointVec2, Heading, NewName )
+function SPAWNSTATIC:SpawnFromPointVec2( PointVec2, Heading, NewName ) --R2.1
self:F( { PointVec2, Heading, NewName } )
local CountryName = _DATABASE.COUNTRY_NAME[self.CountryID]
@@ -161,13 +161,13 @@ function SPAWNSTATIC:SpawnFromPointVec2( PointVec2, Heading, NewName )
return Static
end
---- (R2.1) Creates a new @{Static} from a @{Zone}.
+--- 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.
-- @param #string (optional) The name of the new static.
-- @return #SPAWNSTATIC
-function SPAWNSTATIC:SpawnFromZone( Zone, Heading, NewName )
+function SPAWNSTATIC:SpawnFromZone( Zone, Heading, NewName ) --R2.1
self:F( { Zone, Heading, NewName } )
local Static = self:SpawnFromPointVec2( Zone:GetPointVec2(), Heading, NewName )
diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua
index b925af8a4..3adccb06f 100644
--- a/Moose Development/Moose/Core/Spot.lua
+++ b/Moose Development/Moose/Core/Spot.lua
@@ -1,10 +1,15 @@
---- **Core (Release 2.1)** -- Management of SPOT logistics, that can be transported from and to transportation carriers.
+--- **Core 2.1** -- Management of SPOT logistics, that can be transported from and to transportation carriers.
--
-- 
--
-- ===
--
--- Spot lases points endlessly or for a duration.
+-- SPOT implements the DCS Spot class functionality, but adds additional luxury to be able to:
+--
+-- * Spot for a defined duration.
+-- * wiggle the spot at the target.
+-- * Provide a @{Unit} as a target, instead of a point.
+-- * Implement a status machine, LaseOn, LaseOff.
--
-- ====
--
@@ -22,9 +27,20 @@
--
-- ### [SPOT YouTube Channel]()
--
--- ====
+-- ===
--
--- This module is still under construction, but is described above works already, and will keep working ...
+-- # **AUTHORS and CONTRIBUTIONS**
+--
+-- ### Contributions:
+--
+-- * [**Ciribob**](https://forums.eagle.ru/member.php?u=112175): Showing the way how to lase targets + how laser codes work!!! Explained the autolase script.
+-- * [**EasyEB**](https://forums.eagle.ru/member.php?u=112055): Ideas and Beta Testing
+-- * [**Wingthor**](https://forums.eagle.ru/member.php?u=123698): Beta Testing
+--
+--
+-- ### Authors:
+--
+-- * **FlightControl**: Design & Programming
--
-- @module Spot
@@ -32,10 +48,43 @@
do
--- @type SPOT
- -- @extends Core.Base#BASE
+ -- @extends Core.Fsm#FSM
- ---
+ --- # SPOT class, extends @{Fsm#FSM}
+ --
+ -- SPOT implements the DCS Spot class functionality, but adds additional luxury to be able to:
+ --
+ -- * Spot for a defined duration.
+ -- * wiggle the spot at the target.
+ -- * Provide a @{Unit} as a target, instead of a point.
+ -- * Implement a status machine, LaseOn, LaseOff.
+ --
+ -- ## 1. SPOT constructor
+ --
+ -- * @{#SPOT.New}(): Creates a new SPOT object.
+ --
+ -- ## 2. SPOT is a FSM
+ --
+ -- ![Process]()
+ --
+ -- ### 2.1 SPOT States
+ --
+ -- * **Off**: Lasing is switched off.
+ -- * **On**: Lasing is switched on.
+ -- * **Destroyed**: Target is destroyed.
+ --
+ -- ### 2.2 SPOT Events
+ --
+ -- * **@{#SPOT.LaseOn}(Target, LaserCode, Duration)**: Lase to a target.
+ -- * **@{#SPOT.LaseOff}()**: Stop lasing the target.
+ -- * **@{#SPOT.Lasing}()**: Target is being lased.
+ -- * **@{#SPOT.Destroyed}()**: Triggered when target is destroyed.
+ --
+ -- ## 3. Check if a Target is being lased
+ --
+ -- The method @{#SPOT.IsLasing}() indicates whether lasing is on or off.
+ --
-- @field #SPOT
SPOT = {
ClassName = "SPOT",
diff --git a/Moose Development/Moose/Functional/Spawn.lua b/Moose Development/Moose/Functional/Spawn.lua
index fc3473d59..c6faf2ee8 100644
--- a/Moose Development/Moose/Functional/Spawn.lua
+++ b/Moose Development/Moose/Functional/Spawn.lua
@@ -22,46 +22,6 @@
--
-- ### [SPAWN YouTube Channel](https://www.youtube.com/playlist?list=PL7ZUrU4zZUl1jirWIo4t4YxqN-HxjqRkL)
--
--- ====
---
--- # **API CHANGE HISTORY**
---
--- The underlying change log documents the API changes. Please read this carefully. The following notation is used:
---
--- * **Added** parts are expressed in bold type face.
--- * _Removed_ parts are expressed in italic type face.
---
--- Hereby the change log:
---
--- 2017-04-08: SPAWN:**InitDelayOnOff( DelayOnOff )** added.
--- 2017-04-08: SPAWN:**InitDelayOn()** added.
--- 2017-04-08: SPAWN:**InitDelayOff()** added.
---
--- 2017-03-14: SPAWN:**InitKeepUnitNames()** added.
--- 2017-03-14: SPAWN:**InitRandomizePosition( RandomizePosition, OuterRadious, InnerRadius )** added.
---
--- 2017-02-04: SPAWN:InitUnControlled( **UnControlled** ) replaces SPAWN:InitUnControlled().
---
--- 2017-01-24: SPAWN:**InitAIOnOff( AIOnOff )** added.
--- 2017-01-24: SPAWN:**InitAIOn()** added.
--- 2017-01-24: SPAWN:**InitAIOff()** added.
---
--- 2016-08-15: SPAWN:**InitCleanUp**( SpawnCleanUpInterval ) replaces SPAWN:_CleanUp_( SpawnCleanUpInterval ).
--- 2016-08-15: SPAWN:**InitRandomizeZones( SpawnZones )** added.
---
--- 2016-08-14: SPAWN:**OnSpawnGroup**( SpawnCallBackFunction, ... ) replaces SPAWN:_SpawnFunction_( SpawnCallBackFunction, ... ).
--- 2016-08-14: SPAWN.SpawnInZone( Zone, __RandomizeGroup__, SpawnIndex ) replaces SpawnInZone( Zone, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ).
--- 2016-08-14: SPAWN.SpawnFromVec3( Vec3, SpawnIndex ) replaces SpawnFromVec3( Vec3, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ).
--- 2016-08-14: SPAWN.SpawnFromVec2( Vec2, SpawnIndex ) replaces SpawnFromVec2( Vec2, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ).
--- 2016-08-14: SPAWN.SpawnFromUnit( SpawnUnit, SpawnIndex ) replaces SpawnFromUnit( SpawnUnit, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ).
--- 2016-08-14: SPAWN.SpawnFromUnit( SpawnUnit, SpawnIndex ) replaces SpawnFromStatic( SpawnStatic, _RandomizeUnits, OuterRadius, InnerRadius,_ SpawnIndex ).
--- 2016-08-14: SPAWN.**InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius )** added.
--- 2016-08-14: SPAWN.**Init**Limit( SpawnMaxUnitsAlive, SpawnMaxGroups ) replaces SPAWN._Limit_( SpawnMaxUnitsAlive, SpawnMaxGroups ).
--- 2016-08-14: SPAWN.**Init**Array( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY ) replaces SPAWN._Array_( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY ).
--- 2016-08-14: SPAWN.**Init**RandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight ) replaces SPAWN._RandomizeRoute_( SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight ).
--- 2016-08-14: SPAWN.**Init**RandomizeTemplate( SpawnTemplatePrefixTable ) replaces SPAWN._RandomizeTemplate_( SpawnTemplatePrefixTable ).
--- 2016-08-14: SPAWN.**Init**UnControlled() replaces SPAWN._UnControlled_().
---
-- ===
--
-- # **AUTHORS and CONTRIBUTIONS**
diff --git a/Moose Development/Moose/Wrapper/Positionable.lua b/Moose Development/Moose/Wrapper/Positionable.lua
index 5b3d2339c..695e2ed44 100644
--- a/Moose Development/Moose/Wrapper/Positionable.lua
+++ b/Moose Development/Moose/Wrapper/Positionable.lua
@@ -428,14 +428,14 @@ function POSITIONABLE:MessageToGroup( Message, Duration, MessageGroup, Name )
return nil
end
---- (R2.1) Send a message to a @{Set#SET_GROUP}.
+--- Send a message to a @{Set#SET_GROUP}.
-- The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
-- @param #POSITIONABLE self
-- @param #string Message The message text
-- @param Dcs.DCSTypes#Duration Duration The duration of the message.
-- @param Core.Set#SET_GROUP MessageSetGroup The SET_GROUP collection receiving the message.
-- @param #string Name (optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
-function POSITIONABLE:MessageToSetGroup( Message, Duration, MessageSetGroup, Name )
+function POSITIONABLE:MessageToSetGroup( Message, Duration, MessageSetGroup, Name ) --R2.1
self:F2( { Message, Duration } )
local DCSObject = self:GetDCSObject()
@@ -469,30 +469,30 @@ function POSITIONABLE:Message( Message, Duration, Name )
return nil
end
---- (R2.1) Create a @{Radio#RADIO}, to allow radio transmission for this POSITIONABLE.
+--- 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
-function POSITIONABLE:GetRadio()
+function POSITIONABLE:GetRadio() --R2.1
self:F2(self)
return RADIO:New(self)
end
---- (R2.1) Create a @{Radio#BEACON}, to allow this POSITIONABLE to broadcast beacon signals
+--- Create a @{Radio#BEACON}, to allow this POSITIONABLE to broadcast beacon signals
-- @param #POSITIONABLE self
-- @return #RADIO Radio
-function POSITIONABLE:GetBeacon()
+function POSITIONABLE:GetBeacon() --R2.1
self:F2(self)
return BEACON:New(self)
end
---- (R2.1) Start Lasing a POSITIONABLE
+--- Start Lasing a POSITIONABLE
-- @param #POSITIONABLE self
-- @param #POSITIONABLE Target
-- @param #number LaserCode
-- @param #number Duration
-- @return Core.Spot#SPOT
-function POSITIONABLE:LaseUnit( Target, LaserCode, Duration )
+function POSITIONABLE:LaseUnit( Target, LaserCode, Duration ) --R2.1
self:F2()
LaserCode = LaserCode or math.random( 1000, 9999 )
@@ -509,10 +509,10 @@ function POSITIONABLE:LaseUnit( Target, LaserCode, Duration )
end
---- (R2.1) Stop Lasing a POSITIONABLE
+--- Stop Lasing a POSITIONABLE
-- @param #POSITIONABLE self
-- @return #POSITIONABLE
-function POSITIONABLE:LaseOff()
+function POSITIONABLE:LaseOff() --R2.1
self:F2()
if self.Spot then
@@ -523,10 +523,10 @@ function POSITIONABLE:LaseOff()
return self
end
---- (R2.1) Check if the POSITIONABLE is lasing a target
+--- Check if the POSITIONABLE is lasing a target
-- @param #POSITIONABLE self
-- @return #boolean true if it is lasing a target
-function POSITIONABLE:IsLasing()
+function POSITIONABLE:IsLasing() --R2.1
self:F2()
local Lasing = false
@@ -538,18 +538,18 @@ function POSITIONABLE:IsLasing()
return Lasing
end
---- (R2.1) Get the Spot
+--- Get the Spot
-- @param #POSITIONABLE self
-- @return Core.Spot#SPOT The Spot
-function POSITIONABLE:GetSpot()
+function POSITIONABLE:GetSpot() --R2.1
return self.Spot
end
---- (R2.1) Get the last assigned laser code
+--- Get the last assigned laser code
-- @param #POSITIONABLE self
-- @return #number The laser code
-function POSITIONABLE:GetLaserCode()
+function POSITIONABLE:GetLaserCode() --R2.1
return self.LaserCode
end
diff --git a/Moose Development/Moose/Wrapper/Unit.lua b/Moose Development/Moose/Wrapper/Unit.lua
index d35ffc175..0107839b5 100644
--- a/Moose Development/Moose/Wrapper/Unit.lua
+++ b/Moose Development/Moose/Wrapper/Unit.lua
@@ -1012,22 +1012,22 @@ end
do -- Detection
- --- (R2.1) Returns if a unit is detecting the TargetUnit.
+ --- 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 )
+ function UNIT:IsDetected( TargetUnit ) --R2.1
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.
+ --- 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 )
+ function UNIT:IsLOS( TargetUnit ) --R2.1
local IsLOS = self:GetPointVec3():IsLOS( TargetUnit:GetPointVec3() )
diff --git a/docs/Documentation/AI_Designate.html b/docs/Documentation/AI_Designate.html
index df67983a0..1afab5d4c 100644
--- a/docs/Documentation/AI_Designate.html
+++ b/docs/Documentation/AI_Designate.html
@@ -95,7 +95,7 @@
Module AI_Designate
-
AI (Release 2.1) -- Management of target designation.
+
AI R2.1 -- Management of target Designation.
@@ -103,6 +103,38 @@
+
AI_DESIGNATE is orchestrating the designation of potential targets executed by a Recce group,
+and communicates these to a dedicated attacking group of players,
+so that following a dynamically generated menu system,
+each detected set of potential targets can be lased or smoked...
+
+
Targets can be:
+
+
+ - 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.
+
+
+
+
+
AUTHORS and CONTRIBUTIONS
+
+
Contributions:
+
+
+ - Ciribob: Showing the way how to lase targets + how laser codes work!!! Explained the autolase script.
+ - EasyEB: Ideas and Beta Testing
+ - Wingthor: Beta Testing
+
+
+
+
Authors:
+
+
+ - FlightControl: Design & Programming
+
+
Global(s)
@@ -121,6 +153,24 @@ each detected set of potential targets can be lased or smoked...
+ | AI_DESIGNATE:ActivateAutoLase() |
+
+ Coordinates the Auto Lase.
+ |
+
+
+ | AI_DESIGNATE.AttackSet |
+
+
+ |
+
+
+ | AI_DESIGNATE.AutoLase |
+
+
+ |
+
+
| AI_DESIGNATE.Designating |
@@ -136,18 +186,18 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE.Detection |
- |
-
-
- | AI_DESIGNATE.GroupSet |
-
-
|
| AI_DESIGNATE:Illuminate() |
Illuminate Trigger for AI_DESIGNATE
+ |
+
+
+ | AI_DESIGNATE.LaseDuration |
+
+
|
@@ -175,31 +225,43 @@ each detected set of potential targets can be lased or smoked...
- | AI_DESIGNATE:MenuIlluminate(AttackGroup, Index) |
+ AI_DESIGNATE:MenuAutoLase(AutoLase) |
|
- | AI_DESIGNATE:MenuLaseOff(AttackGroup, Index, Duration) |
+ AI_DESIGNATE:MenuIlluminate(Index) |
|
- | AI_DESIGNATE:MenuLaseOn(AttackGroup, Index, Duration) |
+ AI_DESIGNATE:MenuLaseOff(Index, Duration) |
|
- | AI_DESIGNATE:MenuSmoke(AttackGroup, Index, Color) |
+ AI_DESIGNATE:MenuLaseOn(Index, Duration) |
|
- | AI_DESIGNATE:New(Detection, GroupSet) |
+ AI_DESIGNATE:MenuSmoke(Index, Color) |
+
+
+ |
+
+
+ | AI_DESIGNATE:MenuStatus(AttackGroup) |
+
+
+ |
+
+
+ | AI_DESIGNATE:New(Detection, AttackSet) |
AI_DESIGNATE Constructor.
|
@@ -280,12 +342,24 @@ each detected set of potential targets can be lased or smoked...
AI_DESIGNATE.RecceSet |
+ |
+
+
+ | AI_DESIGNATE.Recces |
+
+
|
| AI_DESIGNATE:SendStatus() |
Sends the status to the Attack Groups.
+ |
+
+
+ | AI_DESIGNATE:SetAutoLase(AutoLase) |
+
+ Set auto lase.
|
@@ -304,12 +378,6 @@ each detected set of potential targets can be lased or smoked...
| AI_DESIGNATE:Smoke() |
Smoke Trigger for AI_DESIGNATE
- |
-
-
- | AI_DESIGNATE.Spots |
-
-
|
@@ -367,31 +435,31 @@ each detected set of potential targets can be lased or smoked...
- | AI_DESIGNATE:onafterIlluminate(From, Event, To, AttackGroup, Index) |
+ AI_DESIGNATE:onafterIlluminate(From, Event, To, Index) |
Illuminating
|
- | AI_DESIGNATE:onafterLaseOff(From, Event, To, AttackGroup, Index) |
+ AI_DESIGNATE:onafterLaseOff(From, Event, To, Index) |
|
- | AI_DESIGNATE:onafterLaseOn(From, Event, To, AttackGroup, Index, Duration) |
+ AI_DESIGNATE:onafterLaseOn(From, Event, To, Index, Duration) |
|
- | AI_DESIGNATE:onafterLasing(From, Event, To, AttackGroup, Index, Duration) |
+ AI_DESIGNATE:onafterLasing(From, Event, To, Index, Duration) |
|
- | AI_DESIGNATE:onafterSmoke(From, Event, To, AttackGroup, Index, Color) |
+ AI_DESIGNATE:onafterSmoke(From, Event, To, Index, Color) |
|
@@ -490,7 +558,7 @@ Once Targets have been detected, the DesignateObject will trig
2. AI_DESIGNATE is a FSM
-
+![Process]()
2.1 AI_DESIGNATE States
@@ -528,7 +596,17 @@ One laser code can be given or an sequence of laser codes through an table...The above sets a collection of possible laser codes that can be assigned. Note the { } notation!
+4. Autolase to automatically lase detected targets.
+DetectionItems can be auto lased once detected by Recces. As such, there is almost no action required from the Players using the Designate Menu.
+The auto lase function can be activated through the Designation Menu.
+Use the method AI_DESIGNATE.SetAutoLase() to activate or deactivate the auto lase function programmatically.
+Note that autolase will automatically activate lasing for ALL DetectedItems. Individual items can be switched-off if required using the Designation Menu.
+
+AIDesignate:SetAutoLase( true )
+
+
+Activate the auto lasing.
@@ -540,6 +618,52 @@ One laser code can be given or an sequence of laser codes through an table...
-
+
+AI_DESIGNATE:ActivateAutoLase()
+
+
+-
+
+
Coordinates the Auto Lase.
+
+ Return value
+
+#AI_DESIGNATE:
+
+
+
+
+
+-
+
+
+
+AI_DESIGNATE.AttackSet
+
+
+-
+
+
+
+
+
+
+-
+
+
+
+AI_DESIGNATE.AutoLase
+
+
+-
+
+
+
+
+
+
+-
+
AI_DESIGNATE.Designating
@@ -576,20 +700,6 @@ One laser code can be given or an sequence of laser codes through an table...
-
-
--
-
-
-
-AI_DESIGNATE.GroupSet
-
-
--
-
-
-
@@ -603,6 +713,20 @@ One laser code can be given or an sequence of laser codes through an table...Illuminate Trigger for AI_DESIGNATE
+
+
+
+-
+
+ #number
+
+AI_DESIGNATE.LaseDuration
+
+
+-
+
+
+
@@ -661,21 +785,37 @@ One laser code can be given or an sequence of laser codes through an table...
-
-
-
-
Parameters
+ Parameter
-
-
AttackGroup :
+ AutoLase :
+
+
+
+
+-
+
+
+
+-
+
+
+
+
Parameter
+
-
Index :
@@ -688,7 +828,7 @@ One laser code can be given or an sequence of laser codes through an table...
-
@@ -699,11 +839,6 @@ One laser code can be given or an sequence of laser codes through an table...
-
-
AttackGroup :
-
-
- -
-
Index :
@@ -719,7 +854,7 @@ One laser code can be given or an sequence of laser codes through an table...
-
@@ -730,11 +865,6 @@ One laser code can be given or an sequence of laser codes through an table...
-
-
AttackGroup :
-
-
- -
-
Index :
@@ -750,7 +880,7 @@ One laser code can be given or an sequence of laser codes through an table...
-
@@ -761,11 +891,6 @@ One laser code can be given or an sequence of laser codes through an table...
-
-
AttackGroup :
-
-
- -
-
Index :
@@ -780,8 +905,29 @@ One laser code can be given or an sequence of laser codes through an table...
-
+
+
+-
+
+
+
+
Parameter
+
+ -
+
+
AttackGroup :
+
+
+
+
+
+
+-
+
-AI_DESIGNATE:New(Detection, GroupSet)
+AI_DESIGNATE:New(Detection, AttackSet)
-
@@ -800,8 +946,8 @@ One laser code can be given or an sequence of laser codes through an table...
-
-
Core.Set#SET_GROUP GroupSet :
-The set of groups to designate for.
+Core.Set#SET_GROUP AttackSet :
+The Attack collection of GROUP objects to designate and report for.
@@ -1226,6 +1372,20 @@ The set of groups to designate for.
+
+
+
+-
+
+
+
+AI_DESIGNATE.Recces
+
+
+-
+
+
+
@@ -1244,6 +1404,35 @@ The set of groups to designate for.
#AI_DESIGNATE:
+
+
+
+-
+
+
+AI_DESIGNATE:SetAutoLase(AutoLase)
+
+
+-
+
+
Set auto lase.
+
+
+Auto lase will start lasing targets immediately when these are in range.
+
+ Parameter
+
+ -
+
+
#boolean AutoLase :
+
+
+
+ Return value
+
+#AI_DESIGNATE:
+
+
@@ -1310,20 +1499,6 @@ number> LaserCodes
Smoke Trigger for AI_DESIGNATE
-
-
-
--
-
-
-
-AI_DESIGNATE.Spots
-
-
--
-
-
-
@@ -1528,7 +1703,7 @@ number> LaserCodes
-
-AI_DESIGNATE:onafterIlluminate(From, Event, To, AttackGroup, Index)
+AI_DESIGNATE:onafterIlluminate(From, Event, To, Index)
-
@@ -1554,11 +1729,6 @@ number> LaserCodes
-
-
AttackGroup :
-
-
- -
-
Index :
@@ -1574,7 +1744,7 @@ number> LaserCodes
-
-AI_DESIGNATE:onafterLaseOff(From, Event, To, AttackGroup, Index)
+AI_DESIGNATE:onafterLaseOff(From, Event, To, Index)
-
@@ -1600,11 +1770,6 @@ number> LaserCodes
-
-
AttackGroup :
-
-
- -
-
Index :
@@ -1620,7 +1785,7 @@ number> LaserCodes
-
-AI_DESIGNATE:onafterLaseOn(From, Event, To, AttackGroup, Index, Duration)
+AI_DESIGNATE:onafterLaseOn(From, Event, To, Index, Duration)
-
@@ -1646,11 +1811,6 @@ number> LaserCodes
-
-
AttackGroup :
-
-
- -
-
Index :
@@ -1660,18 +1820,13 @@ number> LaserCodes
- Return value
-
-#AI_DESIGNATE:
-
-
-
-AI_DESIGNATE:onafterLasing(From, Event, To, AttackGroup, Index, Duration)
+AI_DESIGNATE:onafterLasing(From, Event, To, Index, Duration)
-
@@ -1697,11 +1852,6 @@ number> LaserCodes
-
-
AttackGroup :
-
-
- -
-
Index :
@@ -1722,7 +1872,7 @@ number> LaserCodes
-
-AI_DESIGNATE:onafterSmoke(From, Event, To, AttackGroup, Index, Color)
+AI_DESIGNATE:onafterSmoke(From, Event, To, Index, Color)
-
@@ -1748,11 +1898,6 @@ number> LaserCodes
-
-
AttackGroup :
-
-
- -
-
Index :
diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html
index c0533186b..950d977d9 100644
--- a/docs/Documentation/Cargo.html
+++ b/docs/Documentation/Cargo.html
@@ -217,7 +217,7 @@
| CARGO:GetName() |
- (R2.1) Get the name of the Cargo.
+Get the name of the Cargo.
|
@@ -283,7 +283,7 @@
| CARGO:New(Type, Name, Weight, NearRadius) |
- (R2.1) CARGO Constructor.
+CARGO Constructor.
|
@@ -970,7 +970,7 @@ The radius when the cargo will board the Carrier (to avoid collision).
-
-
(R2.1) Get the name of the Cargo.
+Get the name of the Cargo.
Return value
@@ -1186,7 +1186,7 @@ The Carrier that will hold the cargo.
-
-
(R2.1) CARGO Constructor.
+CARGO Constructor.
This class is an abstract class and should not be instantiated.
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 3b284b806..a0d189a7f 100644
--- a/docs/Documentation/Point.html
+++ b/docs/Documentation/Point.html
@@ -489,7 +489,7 @@
| POINT_VEC3:IsLOS(ToPointVec3) |
- (R2.1) Returns if a PointVec3 has Line of Sight (LOS) with the ToPointVec3.
+Returns if a PointVec3 has Line of Sight (LOS) with the ToPointVec3.
|
@@ -1451,6 +1451,7 @@ The new calculated POINT_VEC2.
-
+
POINT_VEC2.z
@@ -2151,7 +2152,7 @@ The z coodinate.
-
-
(R2.1) Returns if a PointVec3 has Line of Sight (LOS) with the ToPointVec3.
+Returns if a PointVec3 has Line of Sight (LOS) with the ToPointVec3.
Parameter
diff --git a/docs/Documentation/Positionable.html b/docs/Documentation/Positionable.html
index 66a0b50be..f6c4a9726 100644
--- a/docs/Documentation/Positionable.html
+++ b/docs/Documentation/Positionable.html
@@ -162,13 +162,19 @@
| POSITIONABLE:GetBeacon() |
- (R2.1) Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
+Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
|
| POSITIONABLE:GetHeading() |
Returns the POSITIONABLE heading in degrees.
+ |
+
+
+ | POSITIONABLE:GetLaserCode() |
+
+ Get the last assigned laser code
|
@@ -198,13 +204,19 @@
| POSITIONABLE:GetRadio() |
- (R2.1) Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE.
+Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE.
|
| POSITIONABLE:GetRandomVec3(Radius) |
Returns a random DCSTypes#Vec3 vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.
+ |
+
+
+ | POSITIONABLE:GetSpot() |
+
+ Get the Spot
|
@@ -246,19 +258,25 @@
| POSITIONABLE:IsLasing() |
- (R2.1) Check if the POSITIONABLE is lasing a target
+Check if the POSITIONABLE is lasing a target
|
| POSITIONABLE:LaseOff() |
- (R2.1) Stop Lasing a POSITIONABLE
+Stop Lasing a POSITIONABLE
|
| POSITIONABLE:LaseUnit(Target, LaserCode, Duration) |
- (R2.1) Start Lasing a POSITIONABLE
+Start Lasing a POSITIONABLE
+ |
+
+
+ | POSITIONABLE.LaserCode |
+
+ The last assigned laser code.
|
@@ -301,6 +319,12 @@
| POSITIONABLE:MessageToRed(Message, Duration, Name) |
Send a message to the red coalition.
+ |
+
+
+ | POSITIONABLE:MessageToSetGroup(Message, Duration, MessageSetGroup, Name) |
+
+ Send a message to a Set#SET_GROUP.
|
@@ -318,7 +342,7 @@
| POSITIONABLE.Spot |
-
+ The laser Spot.
|
@@ -415,7 +439,7 @@ The POSITIONABLE is not existing or alive.
-
-
(R2.1) Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
+Create a Radio#BEACON, to allow this POSITIONABLE to broadcast beacon signals
Return value
@@ -455,6 +479,24 @@ The POSITIONABLE is not existing or alive.
-
+
+POSITIONABLE:GetLaserCode()
+
+
+-
+
+
Get the last assigned laser code
+
+ Return value
+
+#number:
+The laser code
+
+
+
+
+-
+
POSITIONABLE:GetMessage(Message, Duration, Name)
@@ -584,7 +626,7 @@ The POSITIONABLE is not existing or alive.
-
-
(R2.1) Create a Radio#RADIO, to allow radio transmission for this POSITIONABLE.
+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
@@ -639,6 +681,24 @@ The POSITIONABLE is not existing or alive.
-
+
+POSITIONABLE:GetSpot()
+
+
+-
+
+
Get the Spot
+
+ Return value
+
+Core.Spot#SPOT:
+The Spot
+
+
+
+
+-
+
POSITIONABLE:GetVec2()
@@ -816,7 +876,7 @@ The POSITIONABLE is not existing or alive.
-
-
(R2.1) Check if the POSITIONABLE is lasing a target
+Check if the POSITIONABLE is lasing a target
Return value
@@ -834,7 +894,7 @@ true if it is lasing a target
-
-
(R2.1) Stop Lasing a POSITIONABLE
+Stop Lasing a POSITIONABLE
Return value
@@ -852,7 +912,7 @@ true if it is lasing a target
-
-
(R2.1) Start Lasing a POSITIONABLE
+Start Lasing a POSITIONABLE
Parameters
+
+
+-
+
+ #number
+
+POSITIONABLE.LaserCode
+
+
+-
+
+
The last assigned laser code.
+
@@ -1159,6 +1233,49 @@ The duration of the message.
-
+
+POSITIONABLE:MessageToSetGroup(Message, Duration, MessageSetGroup, Name)
+
+
+-
+
+
Send a message to a Set#SET_GROUP.
+
+
+The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.
+
+ Parameters
+
+ -
+
+
#string Message :
+The message text
+
+
+ -
+
+
Dcs.DCSTypes#Duration Duration :
+The duration of the message.
+
+
+ -
+
+
Core.Set#SET_GROUP MessageSetGroup :
+The SET_GROUP collection receiving the message.
+
+
+ -
+
+
#string Name :
+(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.
+
+
+
+
+
+
+-
+
POSITIONABLE:New(PositionableName)
@@ -1207,7 +1324,7 @@ self
-
-
+
The laser Spot.
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index 715ca53a1..dc938b7ba 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -123,48 +123,6 @@
-API CHANGE HISTORY
-
-The underlying change log documents the API changes. Please read this carefully. The following notation is used:
-
-
- - Added parts are expressed in bold type face.
- - Removed parts are expressed in italic type face.
-
-
-Hereby the change log:
-
-2017-04-08: SPAWN:InitDelayOnOff( DelayOnOff ) added.
-2017-04-08: SPAWN:InitDelayOn() added.
-2017-04-08: SPAWN:InitDelayOff() added.
-
-2017-03-14: SPAWN:InitKeepUnitNames() added.
-2017-03-14: SPAWN:InitRandomizePosition( RandomizePosition, OuterRadious, InnerRadius ) added.
-
-2017-02-04: SPAWN:InitUnControlled( UnControlled ) replaces SPAWN:InitUnControlled().
-
-2017-01-24: SPAWN:InitAIOnOff( AIOnOff ) added.
-2017-01-24: SPAWN:InitAIOn() added.
-2017-01-24: SPAWN:InitAIOff() added.
-
-2016-08-15: SPAWN:InitCleanUp( SpawnCleanUpInterval ) replaces SPAWN:CleanUp( SpawnCleanUpInterval ).
-2016-08-15: SPAWN:InitRandomizeZones( SpawnZones ) added.
-
-2016-08-14: SPAWN:OnSpawnGroup( SpawnCallBackFunction, ... ) replaces SPAWN:SpawnFunction( SpawnCallBackFunction, ... ).
-2016-08-14: SPAWN.SpawnInZone( Zone, RandomizeGroup, SpawnIndex ) replaces SpawnInZone( Zone, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ).
-2016-08-14: SPAWN.SpawnFromVec3( Vec3, SpawnIndex ) replaces SpawnFromVec3( Vec3, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ).
-2016-08-14: SPAWN.SpawnFromVec2( Vec2, SpawnIndex ) replaces SpawnFromVec2( Vec2, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ).
-2016-08-14: SPAWN.SpawnFromUnit( SpawnUnit, SpawnIndex ) replaces SpawnFromUnit( SpawnUnit, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ).
-2016-08-14: SPAWN.SpawnFromUnit( SpawnUnit, SpawnIndex ) replaces SpawnFromStatic( SpawnStatic, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ).
-2016-08-14: SPAWN.InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius ) added.
-2016-08-14: SPAWN.InitLimit( SpawnMaxUnitsAlive, SpawnMaxGroups ) replaces SPAWN.Limit( SpawnMaxUnitsAlive, SpawnMaxGroups ).
-2016-08-14: SPAWN.InitArray( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY ) replaces SPAWN.Array( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY ).
-2016-08-14: SPAWN.InitRandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight ) replaces SPAWN.RandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight ).
-2016-08-14: SPAWN.InitRandomizeTemplate( SpawnTemplatePrefixTable ) replaces SPAWN.RandomizeTemplate( SpawnTemplatePrefixTable ).
-2016-08-14: SPAWN.InitUnControlled() replaces SPAWN.UnControlled().
-
-
-
AUTHORS and CONTRIBUTIONS
Contributions:
@@ -812,12 +770,6 @@ and any spaces before and after the resulting name are removed.
SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) |
- |
-
-
- | SPAWN.uncontrolled |
-
-
|
@@ -2119,6 +2071,9 @@ The group that was spawned. You can use this group for further actions.
+
+
Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.
+
@@ -2572,6 +2527,9 @@ when nothing was spawned.
+
+ Overwrite unit names by default with group name.
+
@@ -2586,6 +2544,9 @@ when nothing was spawned.
+
+ By default, no InitLimit
+
@@ -2621,7 +2582,7 @@ when nothing was spawned.
-
-
+ #number
SPAWN.SpawnMaxGroups
@@ -2638,7 +2599,7 @@ when nothing was spawned.
-
-
+ #number
SPAWN.SpawnMaxUnitsAlive
@@ -2990,7 +2951,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
When the first Spawn executes, all the Groups need to be made visible before start.
+ Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
@@ -3556,20 +3517,6 @@ True = Continue Scheduler
-
-
-
--
-
-
-
-SPAWN.uncontrolled
-
-
--
-
-
-
diff --git a/docs/Documentation/SpawnStatic.html b/docs/Documentation/SpawnStatic.html
index 7c5843544..d1eef677c 100644
--- a/docs/Documentation/SpawnStatic.html
+++ b/docs/Documentation/SpawnStatic.html
@@ -169,25 +169,25 @@
| SPAWNSTATIC:NewFromStatic(SpawnTemplatePrefix, CountryID) |
- (R2.1) Creates the main object to spawn a Static defined in the ME.
+Creates the main object to spawn a Static defined in the ME.
|
| SPAWNSTATIC:NewFromType(SpawnTypeName, SpawnShapeName, SpawnCategory, CountryID) |
- (R2.1) Creates the main object to spawn a Static based on a type name.
+Creates the main object to spawn a Static based on a type name.
|
| SPAWNSTATIC:SpawnFromPointVec2(PointVec2, Heading, (, NewName) |
- (R2.1) Creates a new Static from a POINT_VEC2.
+Creates a new Static from a POINT_VEC2.
|
| SPAWNSTATIC:SpawnFromZone(Zone, Heading, (, NewName) |
- (R2.1) Creates a new Static from a Zone.
+Creates a new Static from a Zone.
|
@@ -288,7 +288,7 @@ By default, spawned Statics will follow a naming conve
-
-
(R2.1) Creates the main object to spawn a Static defined in the ME.
+Creates the main object to spawn a Static defined in the ME.
Parameters