This commit is contained in:
FlightControl
2017-04-19 19:13:23 +02:00
parent 3a3869e095
commit b1c7e04422
5 changed files with 39 additions and 14 deletions

View File

@@ -12,9 +12,32 @@ do -- AI_DESIGNATE
--- @type AI_DESIGNATE --- @type AI_DESIGNATE
-- @extends Core.Fsm#FSM_PROCESS -- @extends Core.Fsm#FSM_PROCESS
--- --- # AI_DESIGNATE class, extends @{Fsm#FSM}
-- --
-- @field #AI_DESIGNATE AI_DESIGNATE -- AI_DESIGNATE is orchestrating the designation of potential targets, and communicate 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...
--
-- ## 1. AI_DESIGNATE constructor
--
-- * @{#AI_DESIGNATE.New}(): Creates a new AI_DESIGNATE object.
--
-- ## 2. AI_DESIGNATE is a FSM
--
-- ![Process](µ)
--
-- ### 2.1 AI_DESIGNATE States
--
-- * **Designating** ( Group ): The process is not started yet.
--
-- ### 2.2 AI_DESIGNATE Events
--
-- * **@{#AI_DESIGNATE.Detect}**: Detect targets.
-- * **@{#AI_DESIGNATE.LaseOn}**: Lase the targets with the specified Index.
-- * **@{#AI_DESIGNATE.LaseOff}**: Stop lasing the targets with the specified Index.
-- * **@{#AI_DESIGNATE.Smoke}**: Smoke the targets with the specified Index.
-- * **@{#AI_DESIGNATE.}Status**: Report designation status.
--
-- @field #AI_DESIGNATE
-- --
AI_DESIGNATE = { AI_DESIGNATE = {
ClassName = "AI_DESIGNATE", ClassName = "AI_DESIGNATE",
@@ -176,9 +199,10 @@ do -- AI_DESIGNATE
--if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then --if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then
if SmokeUnit:IsAlive() then if SmokeUnit:IsAlive() then
local NearestRecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2()) local NearestRecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2())
local NearestRecceUnit = NearestRecceGroup:GetUnit(1) if NearestRecceGroup then
self:E( { NearestRecceUnit = NearestRecceUnit } ) local NearestRecceUnit = NearestRecceGroup:GetUnit(1)
self.Spots[Index] = NearestRecceUnit:LaseUnitOn( SmokeUnit, nil, Duration ) self.Spots[Index] = NearestRecceUnit:LaseUnitOn( SmokeUnit, nil, Duration )
end
end end
--end --end
end end

View File

@@ -1,4 +1,4 @@
--- **Core** -- Management of SPOT logistics, that can be transported from and to transportation carriers. --- **Core (Release 2.1)** -- Management of SPOT logistics, that can be transported from and to transportation carriers.
-- --
-- ![Banner Image](..\Presentations\SPOT\Dia1.JPG) -- ![Banner Image](..\Presentations\SPOT\Dia1.JPG)
-- --
@@ -76,7 +76,7 @@ do
local RecceDcsUnit = self.Recce:GetDCSObject() local RecceDcsUnit = self.Recce:GetDCSObject()
local TargetVec3 = PointVec3:GetVec3() local TargetVec3 = PointVec3:GetVec3()
self:E("lasing") self:E("lasing")
self.Spot = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 1, z = 0 }, TargetVec3, LaserCode ) self.Spot = Spot.createInfraRed( RecceDcsUnit, { x = 0, y = 2, z = 0 }, TargetVec3, LaserCode )
if Duration then if Duration then
self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration ) self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration )
end end

View File

@@ -309,12 +309,12 @@ do -- DETECTION_BASE
self.DetectionInterval = 30 self.DetectionInterval = 30
self:InitDetectVisual( true ) self:InitDetectVisual( false )
self:InitDetectOptical( true ) self:InitDetectOptical( false )
self:InitDetectRadar( true ) self:InitDetectRadar( false )
self:InitDetectRWR( true ) self:InitDetectRWR( false )
self:InitDetectIRST( true ) self:InitDetectIRST( false )
self:InitDetectDLINK( true ) self:InitDetectDLINK( false )
self:FilterCategories( { self:FilterCategories( {
Unit.Category.AIRPLANE, Unit.Category.AIRPLANE,

View File

@@ -1774,6 +1774,7 @@ function CONTROLLABLE:GetDetectedTargets( DetectVisual, DetectOptical, DetectRad
local DetectionRWR = ( DetectRWR and DetectRWR == true ) and Controller.Detection.RWR 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 DetectionDLINK = ( DetectDLINK and DetectDLINK == true ) and Controller.Detection.DLINK or nil
self:T( { DetectionVisual, DetectionOptical, DetectionRadar, DetectionIRST, DetectionRWR, DetectionDLINK } )
return self:_GetController():getDetectedTargets( DetectionVisual, DetectionOptical, DetectionRadar, DetectionIRST, DetectionRWR, DetectionDLINK ) return self:_GetController():getDetectedTargets( DetectionVisual, DetectionOptical, DetectionRadar, DetectionIRST, DetectionRWR, DetectionDLINK )
end end

View File

@@ -1,5 +1,5 @@
env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' ) env.info( '*** MOOSE DYNAMIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170419_1613' ) env.info( 'Moose Generation Timestamp: 20170419_1913' )
local base = _G local base = _G