From b1c7e044226438f5d464048bb1e22f956261a837 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Wed, 19 Apr 2017 19:13:23 +0200 Subject: [PATCH] Progress --- Moose Development/Moose/AI/AI_Designate.lua | 34 ++++++++++++++++--- Moose Development/Moose/Core/Spot.lua | 4 +-- .../Moose/Functional/Detection.lua | 12 +++---- .../Moose/Wrapper/Controllable.lua | 1 + Moose Mission Setup/Moose.lua | 2 +- 5 files changed, 39 insertions(+), 14 deletions(-) diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua index 8c4335b4c..78f66446f 100644 --- a/Moose Development/Moose/AI/AI_Designate.lua +++ b/Moose Development/Moose/AI/AI_Designate.lua @@ -12,9 +12,32 @@ do -- AI_DESIGNATE --- @type AI_DESIGNATE -- @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 = { ClassName = "AI_DESIGNATE", @@ -176,9 +199,10 @@ do -- AI_DESIGNATE --if math.random( 1, ( 100 * TargetSetUnit:Count() ) / 100 ) <= 100 then if SmokeUnit:IsAlive() then local NearestRecceGroup = self.RecceSet:FindNearestGroupFromPointVec2(SmokeUnit:GetPointVec2()) - local NearestRecceUnit = NearestRecceGroup:GetUnit(1) - self:E( { NearestRecceUnit = NearestRecceUnit } ) - self.Spots[Index] = NearestRecceUnit:LaseUnitOn( SmokeUnit, nil, Duration ) + if NearestRecceGroup then + local NearestRecceUnit = NearestRecceGroup:GetUnit(1) + self.Spots[Index] = NearestRecceUnit:LaseUnitOn( SmokeUnit, nil, Duration ) + end end --end end diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua index 9b4d9e12c..292ed5346 100644 --- a/Moose Development/Moose/Core/Spot.lua +++ b/Moose Development/Moose/Core/Spot.lua @@ -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) -- @@ -76,7 +76,7 @@ do local RecceDcsUnit = self.Recce:GetDCSObject() local TargetVec3 = PointVec3:GetVec3() 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 self.ScheduleID = self.LaseScheduler:Schedule( self, StopLase, {self}, Duration ) end diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua index cfb9c02f4..4469a640e 100644 --- a/Moose Development/Moose/Functional/Detection.lua +++ b/Moose Development/Moose/Functional/Detection.lua @@ -309,12 +309,12 @@ do -- DETECTION_BASE self.DetectionInterval = 30 - self:InitDetectVisual( true ) - self:InitDetectOptical( true ) - self:InitDetectRadar( true ) - self:InitDetectRWR( true ) - self:InitDetectIRST( true ) - self:InitDetectDLINK( true ) + self:InitDetectVisual( false ) + self:InitDetectOptical( false ) + self:InitDetectRadar( false ) + self:InitDetectRWR( false ) + self:InitDetectIRST( false ) + self:InitDetectDLINK( false ) self:FilterCategories( { Unit.Category.AIRPLANE, diff --git a/Moose Development/Moose/Wrapper/Controllable.lua b/Moose Development/Moose/Wrapper/Controllable.lua index b81cda295..df7f17c85 100644 --- a/Moose Development/Moose/Wrapper/Controllable.lua +++ b/Moose Development/Moose/Wrapper/Controllable.lua @@ -1774,6 +1774,7 @@ function CONTROLLABLE:GetDetectedTargets( DetectVisual, DetectOptical, DetectRad local DetectionRWR = ( DetectRWR and DetectRWR == true ) and Controller.Detection.RWR 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 ) end diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index e52e6aada..57c707caf 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_1613' ) +env.info( 'Moose Generation Timestamp: 20170419_1913' ) local base = _G