diff --git a/Moose Development/Moose/AI/AI_Designate.lua b/Moose Development/Moose/AI/AI_Designate.lua index 8ff898987..663fe47fb 100644 --- a/Moose Development/Moose/AI/AI_Designate.lua +++ b/Moose Development/Moose/AI/AI_Designate.lua @@ -105,7 +105,7 @@ do -- AI_DESIGNATE -- -- ## 2. AI_DESIGNATE is a FSM -- - -- ![Process]() + --  -- -- ### 2.1 AI_DESIGNATE States -- @@ -141,7 +141,7 @@ do -- AI_DESIGNATE -- -- ### 3.2 Auto generate laser codes -- - -- WIP + -- Use the method @{#AI_DESIGNATE.GenerateLaserCodes}() to generate all possible laser codes. Logic implemented and advised by Ciribob! -- -- ## 4. Autolase to automatically lase detected targets. -- @@ -372,6 +372,59 @@ do -- AI_DESIGNATE return self end + --- Generate an array of possible laser codes. + -- Each new lase will select a code from this table. + -- The entered value can range from 1111 - 1788, + -- -- but the first digit of the series must be a 1 or 2 + -- -- and the last three digits must be between 1 and 8. + -- The range used to be bugged so its not 1 - 8 but 0 - 7. + -- function below will use the range 1-7 just in case + -- @param #AI_DESIGNATE self + -- @return #AI_DESIGNATE + function AI_DESIGNATE:GenerateLaserCodes() --R2.1 + + self.LaserCodes = {} + + local function containsDigit(_number, _numberToFind) + + local _thisNumber = _number + local _thisDigit = 0 + + while _thisNumber ~= 0 do + _thisDigit = _thisNumber % 10 + _thisNumber = math.floor(_thisNumber / 10) + if _thisDigit == _numberToFind then + return true + end + end + + return false + end + + -- generate list of laser codes + local _code = 1111 + local _count = 1 + while _code < 1777 and _count < 30 do + while true do + _code = _code + 1 + if not containsDigit(_code, 8) + and not containsDigit(_code, 9) + and not containsDigit(_code, 0) then + self:T(_code) + table.insert( self.LaserCodes, _code ) + break + end + end + _count = _count + 1 + end + + self.LaserCodesUsed = {} + + return self + end + + + --- Set auto lase. -- Auto lase will start lasing targets immediately when these are in range. -- @param #AI_DESIGNATE self @@ -780,4 +833,5 @@ do -- AI_DESIGNATE end +-- Help from Ciribob diff --git a/Moose Development/Moose/Core/Spot.lua b/Moose Development/Moose/Core/Spot.lua index 3adccb06f..e1f7f4e99 100644 --- a/Moose Development/Moose/Core/Spot.lua +++ b/Moose Development/Moose/Core/Spot.lua @@ -55,14 +55,14 @@ do -- -- SPOT implements the DCS Spot class functionality, but adds additional luxury to be able to: -- - -- * Spot for a defined duration. + -- * Mark targets 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. + -- * @{#SPOT.New}(..\Presentations\SPOT\Dia2.JPG): Creates a new SPOT object. -- -- ## 2. SPOT is a FSM -- diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua index 3fb8251c1..54a1d5a34 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: 20170423_0705' ) +env.info( 'Moose Generation Timestamp: 20170423_1757' ) local base = _G diff --git a/docs/Documentation/AI_Designate.html b/docs/Documentation/AI_Designate.html index 1afab5d4c..590d48988 100644 --- a/docs/Documentation/AI_Designate.html +++ b/docs/Documentation/AI_Designate.html @@ -186,6 +186,12 @@ each detected set of potential targets can be lased or smoked...
Generate an array of possible laser codes.
An array of laser codes can be provided, that will be used by the AI_DESIGNATE when lasing. The laser code is communicated by the Recce when it is lasing a larget. @@ -596,6 +604,10 @@ 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! +Use the method AI_DESIGNATE.GenerateLaserCodes() to generate all possible laser codes. Logic implemented and advised by Ciribob!
+DetectionItems can be auto lased once detected by Recces. As such, there is almost no action required from the Players using the Designate Menu.
@@ -700,6 +712,32 @@ Note that autolase will automatically activate lasing for ALL DetectedItems<
+
+
+ Generate an array of possible laser codes. Each new lase will select a code from this table.
+The entered value can range from 1111 - 1788,
+-- but the first digit of the series must be a 1 or 2
+-- and the last three digits must be between 1 and 8.
+ The range used to be bugged so its not 1 - 8 but 0 - 7.
+function below will use the range 1-7 just in case
+
Return value
+
+
+
+
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index dc938b7ba..6b3dd2a7a 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -770,6 +770,12 @@ and any spaces before and after the resulting name are removed.
Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.
-Overwrite unit names by default with group name.
-By default, no InitLimit
-Flag that indicates if all the Groups of the SpawnGroup need to be visible when Spawned.
+When the first Spawn executes, all the Groups need to be made visible before start.
SPOT implements the DCS Spot class functionality, but adds additional luxury to be able to:
SPOT implements the DCS Spot class functionality, but adds additional luxury to be able to: