diff --git a/Moose Development/Moose/Core/Fsm.lua b/Moose Development/Moose/Core/Fsm.lua
index eb3cfe937..ac2aebe86 100644
--- a/Moose Development/Moose/Core/Fsm.lua
+++ b/Moose Development/Moose/Core/Fsm.lua
@@ -420,7 +420,6 @@ do -- FSM
for ProcessID, Process in pairs( self:GetProcesses() ) do
if Process.From == From and Process.Event == Event then
- self:T( Process )
return Process.fsm
end
end
@@ -449,7 +448,7 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScore( State, ScoreText, Score )
- self:F2( { State, ScoreText, Score } )
+ self:F( { State, ScoreText, Score } )
self._Scores[State] = self._Scores[State] or {}
self._Scores[State].ScoreText = ScoreText
@@ -467,14 +466,15 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScoreProcess( From, Event, State, ScoreText, Score )
- self:F2( { Event, State, ScoreText, Score } )
+ self:F( { From, Event, State, ScoreText, Score } )
local Process = self:GetProcess( From, Event )
- self:T( { Process = Process._Name, Scores = Process._Scores, State = State, ScoreText = ScoreText, Score = Score } )
Process._Scores[State] = Process._Scores[State] or {}
Process._Scores[State].ScoreText = ScoreText
Process._Scores[State].Score = Score
+
+ self:T( Process._Scores )
return Process
end
@@ -1047,14 +1047,14 @@ end
-- @param #string Event
-- @param #string From
-- @param #string To
- function FSM_PROCESS:onstatechange( ProcessUnit, From, Event, To, Dummy )
+ function FSM_PROCESS:onstatechange( ProcessUnit, Task, From, Event, To, Dummy )
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
if self:IsTrace() then
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end
- self:T( self._Scores[To] )
+ self:T( { Scores = self._Scores, To = To } )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
if self._Scores[To] then
diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua
index 936a9c373..81783a8a7 100644
--- a/Moose Development/Moose/Core/Set.lua
+++ b/Moose Development/Moose/Core/Set.lua
@@ -1,222 +1,27 @@
---- **Core** - SET classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
+--- **Core** - SET_ classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
+--
+-- 
--
-- ===
--
--- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
--- ==============================================
--- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
--- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
--- In this way, large loops can be done while not blocking the simulator main processing loop.
--- The default **"yield interval"** is after 10 objects processed.
--- The default **"time interval"** is after 0.001 seconds.
+-- SET_ classes group objects of the same type into a collection, which is either:
--
--- 1.1) Add or remove objects from the SET
--- ---------------------------------------
--- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
---
--- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
--- -----------------------------------------------------------------------------
--- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
--- You can set the **"yield interval"**, and the **"time interval"**. (See above).
---
--- ===
---
--- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
--- ==================================================
--- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Starting with certain prefix strings.
---
--- 2.1) SET_GROUP construction method:
--- -----------------------------------
--- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
---
--- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
---
--- 2.2) Add or Remove GROUP(s) from SET_GROUP:
--- -------------------------------------------
--- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
--- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
---
--- 2.3) SET_GROUP filter criteria:
--- -------------------------------
--- You can set filter criteria to define the set of groups within the SET_GROUP.
--- Filter criteria are defined by:
---
--- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
--- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
--- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
--- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
+-- * Manually managed using the **:Add...()** or **:Remove...()** methods. The initial SET can be filtered with the **@{#SET_BASE.FilterOnce}()** method
+-- * Dynamically updated when new objects are created or objects are destroyed using the **@{#SET_BASE.FilterStart}()** method.
--
--- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
+-- Various types of SET_ classes are available:
--
--- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
+-- * @{#SET_UNIT}: Defines a colleciton of @{Unit}s filtered by filter criteria.
+-- * @{#SET_GROUP}: Defines a collection of @{Group}s filtered by filter criteria.
+-- * @{#SET_CLIENT}: Defines a collection of @{Client}s filterd by filter criteria.
+-- * @{#SET_AIRBASE}: Defines a collection of @{Airbase}s filtered by filter criteria.
--
--- Planned filter criteria within development are (so these are not yet available):
+-- These classes are derived from @{#SET_BASE}, which contains the main methods to manage SETs.
--
--- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
+-- A multitude of other methods are available in SET_ classes that allow to:
--
--- 2.4) SET_GROUP iterators:
--- -------------------------
--- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
--- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_GROUP:
---
--- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
--- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
---
--- ====
---
--- 3) @{Set#SET_UNIT} class, extends @{Set#SET_BASE}
--- ===================================================
--- Mission designers can use the @{Set#SET_UNIT} class to build sets of units belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Unit types
--- * Starting with certain prefix strings.
---
--- 3.1) SET_UNIT construction method:
--- ----------------------------------
--- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
---
--- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
---
--- 3.2) Add or Remove UNIT(s) from SET_UNIT:
--- -----------------------------------------
--- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
--- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
---
--- 3.3) SET_UNIT filter criteria:
--- ------------------------------
--- You can set filter criteria to define the set of units within the SET_UNIT.
--- Filter criteria are defined by:
---
--- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
--- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
--- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
--- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
--- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
---
--- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
---
--- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
---
--- Planned filter criteria within development are (so these are not yet available):
---
--- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
---
--- 3.4) SET_UNIT iterators:
--- ------------------------
--- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
--- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_UNIT:
---
--- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
--- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
---
--- Planned iterators methods in development are (so these are not yet available):
---
--- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
--- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
--- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
---
--- ===
---
--- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
--- ===================================================
--- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Client types
--- * Starting with certain prefix strings.
---
--- 4.1) SET_CLIENT construction method:
--- ----------------------------------
--- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
---
--- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
---
--- 4.2) Add or Remove CLIENT(s) from SET_CLIENT:
--- -----------------------------------------
--- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
--- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
---
--- 4.3) SET_CLIENT filter criteria:
--- ------------------------------
--- You can set filter criteria to define the set of clients within the SET_CLIENT.
--- Filter criteria are defined by:
---
--- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
--- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
--- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
--- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
--- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
---
--- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
---
--- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
---
--- Planned filter criteria within development are (so these are not yet available):
---
--- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
---
--- 4.4) SET_CLIENT iterators:
--- ------------------------
--- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
--- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_CLIENT:
---
--- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
---
--- ====
---
--- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
--- ====================================================
--- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
---
--- * Coalitions
---
--- 5.1) SET_AIRBASE construction
--- -----------------------------
--- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
---
--- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
---
--- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
--- --------------------------------------------
--- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
--- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
---
--- 5.3) SET_AIRBASE filter criteria
--- --------------------------------
--- You can set filter criteria to define the set of clients within the SET_AIRBASE.
--- Filter criteria are defined by:
---
--- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
---
--- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
---
--- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
---
--- 5.4) SET_AIRBASE iterators:
--- ---------------------------
--- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
--- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
--- The following iterator methods are currently available within the SET_AIRBASE:
---
--- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
---
--- ====
+-- * Validate the presence of objects in the SET.
+-- * Trigger events when objects in the SET change a zone presence.
--
-- ### Authors:
--
@@ -228,7 +33,22 @@
-- @module Set
---- SET_BASE class
+--- # 1) SET_BASE class, extends @{Base#BASE}
+-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
+-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
+-- In this way, large loops can be done while not blocking the simulator main processing loop.
+-- The default **"yield interval"** is after 10 objects processed.
+-- The default **"time interval"** is after 0.001 seconds.
+--
+-- ## 1.1) Add or remove objects from the SET
+--
+-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
+--
+-- ## 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
+--
+-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
+-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
+--
-- @type SET_BASE
-- @field #table Filter
-- @field #table Set
@@ -442,7 +262,7 @@ end
-- @return #number Count
function SET_BASE:Count()
- return #self.Index
+ return #self.Index or 0
end
@@ -777,7 +597,55 @@ end
-- SET_GROUP
---- SET_GROUP class
+--- # 2) SET_GROUP class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Starting with certain prefix strings.
+--
+-- ## 2.1) SET_GROUP constructor
+--
+-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
+--
+-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
+--
+-- ## 2.2) Add or Remove GROUP(s) from SET_GROUP
+--
+-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
+-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
+--
+-- ## 2.3) SET_GROUP filter criteria
+--
+-- You can set filter criteria to define the set of groups within the SET_GROUP.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
+-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
+-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
+-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
+--
+-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
+--
+-- ## 2.4) SET_GROUP iterators
+--
+-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
+-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_GROUP:
+--
+-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
+-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
+--
-- @type SET_GROUP
-- @extends Core.Set#SET_BASE
SET_GROUP = {
@@ -1145,7 +1013,69 @@ function SET_GROUP:IsIncludeObject( MooseGroup )
return MooseGroupInclude
end
---- SET_UNIT class
+--- # 3) SET_UNIT class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the SET_UNIT class to build sets of units belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Unit types
+-- * Starting with certain prefix strings.
+--
+-- ## 3.1) SET_UNIT constructor
+--
+-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
+--
+-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
+--
+-- ## 3.2) Add or Remove UNIT(s) from SET_UNIT
+--
+-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
+-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
+--
+-- ## 3.3) SET_UNIT filter criteria
+--
+-- You can set filter criteria to define the set of units within the SET_UNIT.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
+-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
+-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
+-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
+-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
+--
+-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
+--
+-- ## 3.4) SET_UNIT iterators
+--
+-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
+-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_UNIT:
+--
+-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
+-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
+--
+-- Planned iterators methods in development are (so these are not yet available):
+--
+-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
+-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
+-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
+--
+-- ## 3.5 ) SET_UNIT atomic methods
+--
+-- Various methods exist for a SET_UNIT to perform actions or calculations and retrieve results from the SET_UNIT:
+--
+-- * @{#SET_UNIT.GetTypeNames}(): Retrieve the type names of the @{Unit}s in the SET, delimited by a comma.
+--
+--
-- @type SET_UNIT
-- @extends Core.Set#SET_BASE
SET_UNIT = {
@@ -1759,9 +1689,81 @@ function SET_UNIT:IsIncludeObject( MUnit )
end
+--- Retrieve the type names of the @{Unit}s in the SET, delimited by an optional delimiter.
+-- @param #SET_UNIT self
+-- @param #string Delimiter (optional) The delimiter, which is default a comma.
+-- @return #string The types of the @{Unit}s delimited.
+function SET_UNIT:GetTypeNames( Delimiter )
+
+ Delimiter = Delimiter or ", "
+ local TypeReport = REPORT:New()
+ local Types = {}
+
+ for UnitName, UnitData in pairs( self:GetSet() ) do
+
+ local Unit = UnitData -- Wrapper.Unit#UNIT
+ local UnitTypeName = Unit:GetTypeName()
+
+ if not Types[UnitTypeName] then
+ Types[UnitTypeName] = UnitTypeName
+ TypeReport:Add( UnitTypeName )
+ end
+ end
+
+ return TypeReport:Text( Delimiter )
+end
+
+
--- SET_CLIENT
---- SET_CLIENT class
+--- # 4) SET_CLIENT class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Client types
+-- * Starting with certain prefix strings.
+--
+-- ## 4.1) SET_CLIENT constructor
+--
+-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
+--
+-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
+--
+-- ## 4.2) Add or Remove CLIENT(s) from SET_CLIENT
+--
+-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
+-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
+--
+-- ## 4.3) SET_CLIENT filter criteria
+--
+-- You can set filter criteria to define the set of clients within the SET_CLIENT.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
+-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
+-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
+-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
+-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
+--
+-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
+--
+-- ## 4.4) SET_CLIENT iterators
+--
+-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
+-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_CLIENT:
+--
+-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
+--
-- @type SET_CLIENT
-- @extends Core.Set#SET_BASE
SET_CLIENT = {
@@ -2118,7 +2120,42 @@ end
--- SET_AIRBASE
---- SET_AIRBASE class
+--- # 5) SET_AIRBASE class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
+--
+-- * Coalitions
+--
+-- ## 5.1) SET_AIRBASE constructor
+--
+-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
+--
+-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
+--
+-- ## 5.2) Add or Remove AIRBASEs from SET_AIRBASE
+--
+-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
+-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
+--
+-- ## 5.3) SET_AIRBASE filter criteria
+--
+-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
+--
+-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
+--
+-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
+--
+-- ## 5.4) SET_AIRBASE iterators
+--
+-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
+-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_AIRBASE:
+--
+-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
+--
-- @type SET_AIRBASE
-- @extends Core.Set#SET_BASE
SET_AIRBASE = {
diff --git a/Moose Development/Moose/Functional/Detection.lua b/Moose Development/Moose/Functional/Detection.lua
index 43196e575..7f91b1d9f 100644
--- a/Moose Development/Moose/Functional/Detection.lua
+++ b/Moose Development/Moose/Functional/Detection.lua
@@ -1073,7 +1073,7 @@ do -- DETECTION_BASE
--- Get a detected item using a given numeric index.
-- @param #DETECTION_BASE self
-- @param #number Index
- -- @return DETECTION_BASE.DetectedItem
+ -- @return #DETECTION_BASE.DetectedItem
function DETECTION_BASE:GetDetectedItem( Index )
local DetectedItem = self.DetectedItems[Index]
@@ -1336,7 +1336,7 @@ do -- DETECTION_UNITS
local DetectedItemUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
- if DetectedItemUnit then
+ if DetectedItemUnit and DetectedItemUnit:IsAlive() then
self:T(DetectedItemUnit)
local UnitCategoryName = DetectedItemUnit:GetCategoryName() or ""
@@ -1354,8 +1354,16 @@ do -- DETECTION_UNITS
UnitDistanceText = string.format( "%.2f", DetectedItem.Distance ) .. " km, visual contact"
end
+ local DetectedItemPointVec3 = DetectedItemUnit:GetPointVec3()
+ local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
+
+ local ThreatLevelA2G = DetectedItemUnit:GetThreatLevel( DetectedItem )
+
ReportSummary = string.format(
- "%s%s",
+ "%s - Threat [%s] (%2d) - %s%s",
+ DetectedItemPointLL,
+ string.rep( "■", ThreatLevelA2G ),
+ ThreatLevelA2G,
UnitCategoryText,
UnitDistanceText
)
@@ -1470,10 +1478,10 @@ do -- DETECTION_TYPES
for DetectedItemID, DetectedItem in pairs( self.DetectedItems ) do
- local DetectedItemSet = DetectedItem:GetSet() -- Core.Set#SET_UNIT
+ local DetectedItemSet = DetectedItem.Set -- Core.Set#SET_UNIT
local DetectedTypeName = DetectedItem.Type
- for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet ) do
+ for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet:GetSet() ) do
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
local DetectedObject = nil
@@ -1541,13 +1549,16 @@ do -- DETECTION_TYPES
self:T( DetectedItem )
if DetectedItem then
- local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
+ local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
+ local DetectedItemsCount = DetectedSet:Count()
+ local DetectedItemType = DetectedItem.Type
local ReportSummary = string.format(
- "Type #%s - Threat Level [%s] (%2d)",
- DetectedItem.Type,
+ "Threat [%s] (%2d) - %2d of %s",
string.rep( "■", ThreatLevelA2G ),
- ThreatLevelA2G
+ ThreatLevelA2G,
+ DetectedItemsCount,
+ DetectedItemType
)
self:T( ReportSummary )
@@ -1651,17 +1662,23 @@ do -- DETECTION_AREAS
local DetectedItem = self:GetDetectedItem( Index )
if DetectedItem then
local DetectedSet = self:GetDetectedSet( Index )
- local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local ReportSummaryItem
local DetectedZone = self:GetDetectedZone( Index )
local DetectedItemPointVec3 = DetectedZone:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
+
+ local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
+ local DetectedItemsCount = DetectedSet:Count()
+ local DetectedItemsTypes = DetectedSet:GetTypeNames()
+
local ReportSummary = string.format(
- "%s - Threat Level [%s] (%2d)",
+ "%s - Threat [%s] (%2d) - %2d of %s",
DetectedItemPointLL,
string.rep( "■", ThreatLevelA2G ),
- ThreatLevelA2G
+ ThreatLevelA2G,
+ DetectedItemsCount,
+ DetectedItemsTypes
)
return ReportSummary
diff --git a/Moose Development/Moose/Tasking/CommandCenter.lua b/Moose Development/Moose/Tasking/CommandCenter.lua
index 705c9b7ab..09ad2ab23 100644
--- a/Moose Development/Moose/Tasking/CommandCenter.lua
+++ b/Moose Development/Moose/Tasking/CommandCenter.lua
@@ -36,8 +36,14 @@ function REPORT:Add( Text )
return self.Report[#self.Report]
end
-function REPORT:Text()
- return table.concat( self.Report, "\n" )
+--- Produces the text of the report, taking into account an optional delimeter, which is \n by default.
+-- @param #REPORT self
+-- @param #string Delimiter (optional) A delimiter text.
+-- @return #string The report text.
+function REPORT:Text( Delimiter )
+ Delimiter = Delimiter or "\n"
+ local ReportText = table.concat( self.Report, Delimiter ) or ""
+ return ReportText
end
--- The COMMANDCENTER class
diff --git a/Moose Development/Moose/Tasking/Task.lua b/Moose Development/Moose/Tasking/Task.lua
index befa29682..0f3931b1c 100644
--- a/Moose Development/Moose/Tasking/Task.lua
+++ b/Moose Development/Moose/Tasking/Task.lua
@@ -983,11 +983,12 @@ end
-- @param #string To
function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
- self:E("Task Assigned")
+ self:E( { "Task Assigned", self.Dispatcher } )
self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." )
if self.Dispatcher then
+ self:E( "Firing Assign event " )
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
end
diff --git a/Moose Development/Moose/Tasking/Task_A2G.lua b/Moose Development/Moose/Tasking/Task_A2G.lua
index fde116f2c..662ab0d2b 100644
--- a/Moose Development/Moose/Tasking/Task_A2G.lua
+++ b/Moose Development/Moose/Tasking/Task_A2G.lua
@@ -308,6 +308,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnDestroy( Text, Score, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@@ -323,6 +324,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnSuccess( Text, Score, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@@ -338,6 +340,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetPenaltyOnFailed( Text, Penalty, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
diff --git a/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua b/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua
index 474b30833..9f16f6342 100644
--- a/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua
+++ b/Moose Development/Moose/Tasking/Task_A2G_Dispatcher.lua
@@ -206,9 +206,9 @@ do -- TASK_A2G_DISPATCHER
local ChangeMsg = {}
local Mission = self.Mission
- local ReportSEAD = REPORT:New( " - SEAD Tasks:")
- local ReportCAS = REPORT:New( " - CAS Tasks:")
- local ReportBAI = REPORT:New( " - BAI Tasks:")
+ local ReportSEAD = REPORT:New( "- SEAD Tasks:")
+ local ReportCAS = REPORT:New( "- CAS Tasks:")
+ local ReportBAI = REPORT:New( "- BAI Tasks:")
local ReportChanges = REPORT:New( " - Changes:" )
--- First we need to the detected targets.
@@ -289,7 +289,7 @@ do -- TASK_A2G_DISPATCHER
Mission:GetCommandCenter():MessageToGroup(
string.format( "HQ Reporting - Planned tasks for mission '%s':\n%s\n",
self.Mission:GetName(),
- string.format( "%s\n%s\n%s\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
+ string.format( "%s\n\n%s\n\n%s\n\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
)
), TaskGroup
)
diff --git a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
index 0d3429f64..ed2803d46 100644
--- a/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
+++ b/Moose Mission Setup/Moose Mission Update/l10n/DEFAULT/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20170319_1459' )
+env.info( 'Moose Generation Timestamp: 20170320_1252' )
local base = _G
Include = {}
@@ -7971,225 +7971,30 @@ end
---- **Core** - SET classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
+--- **Core** - SET_ classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
+--
+-- 
--
-- ===
--
--- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
--- ==============================================
--- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
--- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
--- In this way, large loops can be done while not blocking the simulator main processing loop.
--- The default **"yield interval"** is after 10 objects processed.
--- The default **"time interval"** is after 0.001 seconds.
+-- SET_ classes group objects of the same type into a collection, which is either:
--
--- 1.1) Add or remove objects from the SET
--- ---------------------------------------
--- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
---
--- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
--- -----------------------------------------------------------------------------
--- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
--- You can set the **"yield interval"**, and the **"time interval"**. (See above).
---
--- ===
---
--- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
--- ==================================================
--- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Starting with certain prefix strings.
---
--- 2.1) SET_GROUP construction method:
--- -----------------------------------
--- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
---
--- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
---
--- 2.2) Add or Remove GROUP(s) from SET_GROUP:
--- -------------------------------------------
--- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
--- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
---
--- 2.3) SET_GROUP filter criteria:
--- -------------------------------
--- You can set filter criteria to define the set of groups within the SET_GROUP.
--- Filter criteria are defined by:
---
--- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
--- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
--- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
--- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
+-- * Manually managed using the **:Add...()** or **:Remove...()** methods. The initial SET can be filtered with the **@{#SET_BASE.FilterOnce}()** method
+-- * Dynamically updated when new objects are created or objects are destroyed using the **@{#SET_BASE.FilterStart}()** method.
--
--- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
+-- Various types of SET_ classes are available:
--
--- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
+-- * @{#SET_UNIT}: Defines a colleciton of @{Unit}s filtered by filter criteria.
+-- * @{#SET_GROUP}: Defines a collection of @{Group}s filtered by filter criteria.
+-- * @{#SET_CLIENT}: Defines a collection of @{Client}s filterd by filter criteria.
+-- * @{#SET_AIRBASE}: Defines a collection of @{Airbase}s filtered by filter criteria.
--
--- Planned filter criteria within development are (so these are not yet available):
+-- These classes are derived from @{#SET_BASE}, which contains the main methods to manage SETs.
--
--- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
+-- A multitude of other methods are available in SET_ classes that allow to:
--
--- 2.4) SET_GROUP iterators:
--- -------------------------
--- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
--- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_GROUP:
---
--- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
--- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
---
--- ====
---
--- 3) @{Set#SET_UNIT} class, extends @{Set#SET_BASE}
--- ===================================================
--- Mission designers can use the @{Set#SET_UNIT} class to build sets of units belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Unit types
--- * Starting with certain prefix strings.
---
--- 3.1) SET_UNIT construction method:
--- ----------------------------------
--- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
---
--- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
---
--- 3.2) Add or Remove UNIT(s) from SET_UNIT:
--- -----------------------------------------
--- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
--- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
---
--- 3.3) SET_UNIT filter criteria:
--- ------------------------------
--- You can set filter criteria to define the set of units within the SET_UNIT.
--- Filter criteria are defined by:
---
--- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
--- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
--- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
--- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
--- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
---
--- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
---
--- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
---
--- Planned filter criteria within development are (so these are not yet available):
---
--- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
---
--- 3.4) SET_UNIT iterators:
--- ------------------------
--- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
--- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_UNIT:
---
--- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
--- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
---
--- Planned iterators methods in development are (so these are not yet available):
---
--- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
--- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
--- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
---
--- ===
---
--- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
--- ===================================================
--- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Client types
--- * Starting with certain prefix strings.
---
--- 4.1) SET_CLIENT construction method:
--- ----------------------------------
--- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
---
--- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
---
--- 4.2) Add or Remove CLIENT(s) from SET_CLIENT:
--- -----------------------------------------
--- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
--- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
---
--- 4.3) SET_CLIENT filter criteria:
--- ------------------------------
--- You can set filter criteria to define the set of clients within the SET_CLIENT.
--- Filter criteria are defined by:
---
--- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
--- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
--- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
--- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
--- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
---
--- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
---
--- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
---
--- Planned filter criteria within development are (so these are not yet available):
---
--- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
---
--- 4.4) SET_CLIENT iterators:
--- ------------------------
--- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
--- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_CLIENT:
---
--- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
---
--- ====
---
--- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
--- ====================================================
--- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
---
--- * Coalitions
---
--- 5.1) SET_AIRBASE construction
--- -----------------------------
--- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
---
--- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
---
--- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
--- --------------------------------------------
--- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
--- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
---
--- 5.3) SET_AIRBASE filter criteria
--- --------------------------------
--- You can set filter criteria to define the set of clients within the SET_AIRBASE.
--- Filter criteria are defined by:
---
--- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
---
--- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
---
--- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
---
--- 5.4) SET_AIRBASE iterators:
--- ---------------------------
--- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
--- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
--- The following iterator methods are currently available within the SET_AIRBASE:
---
--- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
---
--- ====
+-- * Validate the presence of objects in the SET.
+-- * Trigger events when objects in the SET change a zone presence.
--
-- ### Authors:
--
@@ -8201,7 +8006,22 @@ end
-- @module Set
---- SET_BASE class
+--- # 1) SET_BASE class, extends @{Base#BASE}
+-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
+-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
+-- In this way, large loops can be done while not blocking the simulator main processing loop.
+-- The default **"yield interval"** is after 10 objects processed.
+-- The default **"time interval"** is after 0.001 seconds.
+--
+-- ## 1.1) Add or remove objects from the SET
+--
+-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
+--
+-- ## 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
+--
+-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
+-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
+--
-- @type SET_BASE
-- @field #table Filter
-- @field #table Set
@@ -8415,7 +8235,7 @@ end
-- @return #number Count
function SET_BASE:Count()
- return #self.Index
+ return #self.Index or 0
end
@@ -8750,7 +8570,55 @@ end
-- SET_GROUP
---- SET_GROUP class
+--- # 2) SET_GROUP class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Starting with certain prefix strings.
+--
+-- ## 2.1) SET_GROUP constructor
+--
+-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
+--
+-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
+--
+-- ## 2.2) Add or Remove GROUP(s) from SET_GROUP
+--
+-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
+-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
+--
+-- ## 2.3) SET_GROUP filter criteria
+--
+-- You can set filter criteria to define the set of groups within the SET_GROUP.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
+-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
+-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
+-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
+--
+-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
+--
+-- ## 2.4) SET_GROUP iterators
+--
+-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
+-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_GROUP:
+--
+-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
+-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
+--
-- @type SET_GROUP
-- @extends Core.Set#SET_BASE
SET_GROUP = {
@@ -9118,7 +8986,69 @@ function SET_GROUP:IsIncludeObject( MooseGroup )
return MooseGroupInclude
end
---- SET_UNIT class
+--- # 3) SET_UNIT class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the SET_UNIT class to build sets of units belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Unit types
+-- * Starting with certain prefix strings.
+--
+-- ## 3.1) SET_UNIT constructor
+--
+-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
+--
+-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
+--
+-- ## 3.2) Add or Remove UNIT(s) from SET_UNIT
+--
+-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
+-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
+--
+-- ## 3.3) SET_UNIT filter criteria
+--
+-- You can set filter criteria to define the set of units within the SET_UNIT.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
+-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
+-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
+-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
+-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
+--
+-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
+--
+-- ## 3.4) SET_UNIT iterators
+--
+-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
+-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_UNIT:
+--
+-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
+-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
+--
+-- Planned iterators methods in development are (so these are not yet available):
+--
+-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
+-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
+-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
+--
+-- ## 3.5 ) SET_UNIT atomic methods
+--
+-- Various methods exist for a SET_UNIT to perform actions or calculations and retrieve results from the SET_UNIT:
+--
+-- * @{#SET_UNIT.GetTypeNames}(): Retrieve the type names of the @{Unit}s in the SET, delimited by a comma.
+--
+--
-- @type SET_UNIT
-- @extends Core.Set#SET_BASE
SET_UNIT = {
@@ -9732,9 +9662,81 @@ function SET_UNIT:IsIncludeObject( MUnit )
end
+--- Retrieve the type names of the @{Unit}s in the SET, delimited by an optional delimiter.
+-- @param #SET_UNIT self
+-- @param #string Delimiter (optional) The delimiter, which is default a comma.
+-- @return #string The types of the @{Unit}s delimited.
+function SET_UNIT:GetTypeNames( Delimiter )
+
+ Delimiter = Delimiter or ", "
+ local TypeReport = REPORT:New()
+ local Types = {}
+
+ for UnitName, UnitData in pairs( self:GetSet() ) do
+
+ local Unit = UnitData -- Wrapper.Unit#UNIT
+ local UnitTypeName = Unit:GetTypeName()
+
+ if not Types[UnitTypeName] then
+ Types[UnitTypeName] = UnitTypeName
+ TypeReport:Add( UnitTypeName )
+ end
+ end
+
+ return TypeReport:Text( Delimiter )
+end
+
+
--- SET_CLIENT
---- SET_CLIENT class
+--- # 4) SET_CLIENT class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Client types
+-- * Starting with certain prefix strings.
+--
+-- ## 4.1) SET_CLIENT constructor
+--
+-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
+--
+-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
+--
+-- ## 4.2) Add or Remove CLIENT(s) from SET_CLIENT
+--
+-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
+-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
+--
+-- ## 4.3) SET_CLIENT filter criteria
+--
+-- You can set filter criteria to define the set of clients within the SET_CLIENT.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
+-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
+-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
+-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
+-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
+--
+-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
+--
+-- ## 4.4) SET_CLIENT iterators
+--
+-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
+-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_CLIENT:
+--
+-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
+--
-- @type SET_CLIENT
-- @extends Core.Set#SET_BASE
SET_CLIENT = {
@@ -10091,7 +10093,42 @@ end
--- SET_AIRBASE
---- SET_AIRBASE class
+--- # 5) SET_AIRBASE class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
+--
+-- * Coalitions
+--
+-- ## 5.1) SET_AIRBASE constructor
+--
+-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
+--
+-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
+--
+-- ## 5.2) Add or Remove AIRBASEs from SET_AIRBASE
+--
+-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
+-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
+--
+-- ## 5.3) SET_AIRBASE filter criteria
+--
+-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
+--
+-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
+--
+-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
+--
+-- ## 5.4) SET_AIRBASE iterators
+--
+-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
+-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_AIRBASE:
+--
+-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
+--
-- @type SET_AIRBASE
-- @extends Core.Set#SET_BASE
SET_AIRBASE = {
@@ -11901,7 +11938,6 @@ do -- FSM
for ProcessID, Process in pairs( self:GetProcesses() ) do
if Process.From == From and Process.Event == Event then
- self:T( Process )
return Process.fsm
end
end
@@ -11930,7 +11966,7 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScore( State, ScoreText, Score )
- self:F2( { State, ScoreText, Score } )
+ self:F( { State, ScoreText, Score } )
self._Scores[State] = self._Scores[State] or {}
self._Scores[State].ScoreText = ScoreText
@@ -11948,14 +11984,15 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScoreProcess( From, Event, State, ScoreText, Score )
- self:F2( { Event, State, ScoreText, Score } )
+ self:F( { From, Event, State, ScoreText, Score } )
local Process = self:GetProcess( From, Event )
- self:T( { Process = Process._Name, Scores = Process._Scores, State = State, ScoreText = ScoreText, Score = Score } )
Process._Scores[State] = Process._Scores[State] or {}
Process._Scores[State].ScoreText = ScoreText
Process._Scores[State].Score = Score
+
+ self:T( Process._Scores )
return Process
end
@@ -12528,14 +12565,14 @@ end
-- @param #string Event
-- @param #string From
-- @param #string To
- function FSM_PROCESS:onstatechange( ProcessUnit, From, Event, To, Dummy )
+ function FSM_PROCESS:onstatechange( ProcessUnit, Task, From, Event, To, Dummy )
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
if self:IsTrace() then
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end
- self:T( self._Scores[To] )
+ self:T( { Scores = self._Scores, To = To } )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
if self._Scores[To] then
@@ -26574,7 +26611,7 @@ do -- DETECTION_BASE
--- Get a detected item using a given numeric index.
-- @param #DETECTION_BASE self
-- @param #number Index
- -- @return DETECTION_BASE.DetectedItem
+ -- @return #DETECTION_BASE.DetectedItem
function DETECTION_BASE:GetDetectedItem( Index )
local DetectedItem = self.DetectedItems[Index]
@@ -26837,7 +26874,7 @@ do -- DETECTION_UNITS
local DetectedItemUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
- if DetectedItemUnit then
+ if DetectedItemUnit and DetectedItemUnit:IsAlive() then
self:T(DetectedItemUnit)
local UnitCategoryName = DetectedItemUnit:GetCategoryName() or ""
@@ -26855,8 +26892,16 @@ do -- DETECTION_UNITS
UnitDistanceText = string.format( "%.2f", DetectedItem.Distance ) .. " km, visual contact"
end
+ local DetectedItemPointVec3 = DetectedItemUnit:GetPointVec3()
+ local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
+
+ local ThreatLevelA2G = DetectedItemUnit:GetThreatLevel( DetectedItem )
+
ReportSummary = string.format(
- "%s%s",
+ "%s - Threat [%s] (%2d) - %s%s",
+ DetectedItemPointLL,
+ string.rep( "■", ThreatLevelA2G ),
+ ThreatLevelA2G,
UnitCategoryText,
UnitDistanceText
)
@@ -26971,10 +27016,10 @@ do -- DETECTION_TYPES
for DetectedItemID, DetectedItem in pairs( self.DetectedItems ) do
- local DetectedItemSet = DetectedItem:GetSet() -- Core.Set#SET_UNIT
+ local DetectedItemSet = DetectedItem.Set -- Core.Set#SET_UNIT
local DetectedTypeName = DetectedItem.Type
- for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet ) do
+ for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet:GetSet() ) do
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
local DetectedObject = nil
@@ -27042,13 +27087,16 @@ do -- DETECTION_TYPES
self:T( DetectedItem )
if DetectedItem then
- local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
+ local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
+ local DetectedItemsCount = DetectedSet:Count()
+ local DetectedItemType = DetectedItem.Type
local ReportSummary = string.format(
- "Type #%s - Threat Level [%s] (%2d)",
- DetectedItem.Type,
+ "Threat [%s] (%2d) - %2d of %s",
string.rep( "■", ThreatLevelA2G ),
- ThreatLevelA2G
+ ThreatLevelA2G,
+ DetectedItemsCount,
+ DetectedItemType
)
self:T( ReportSummary )
@@ -27152,17 +27200,23 @@ do -- DETECTION_AREAS
local DetectedItem = self:GetDetectedItem( Index )
if DetectedItem then
local DetectedSet = self:GetDetectedSet( Index )
- local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local ReportSummaryItem
local DetectedZone = self:GetDetectedZone( Index )
local DetectedItemPointVec3 = DetectedZone:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
+
+ local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
+ local DetectedItemsCount = DetectedSet:Count()
+ local DetectedItemsTypes = DetectedSet:GetTypeNames()
+
local ReportSummary = string.format(
- "%s - Threat Level [%s] (%2d)",
+ "%s - Threat [%s] (%2d) - %2d of %s",
DetectedItemPointLL,
string.rep( "■", ThreatLevelA2G ),
- ThreatLevelA2G
+ ThreatLevelA2G,
+ DetectedItemsCount,
+ DetectedItemsTypes
)
return ReportSummary
@@ -32121,8 +32175,14 @@ function REPORT:Add( Text )
return self.Report[#self.Report]
end
-function REPORT:Text()
- return table.concat( self.Report, "\n" )
+--- Produces the text of the report, taking into account an optional delimeter, which is \n by default.
+-- @param #REPORT self
+-- @param #string Delimiter (optional) A delimiter text.
+-- @return #string The report text.
+function REPORT:Text( Delimiter )
+ Delimiter = Delimiter or "\n"
+ local ReportText = table.concat( self.Report, Delimiter ) or ""
+ return ReportText
end
--- The COMMANDCENTER class
@@ -34007,11 +34067,12 @@ end
-- @param #string To
function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
- self:E("Task Assigned")
+ self:E( { "Task Assigned", self.Dispatcher } )
self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." )
if self.Dispatcher then
+ self:E( "Firing Assign event " )
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
end
@@ -34618,9 +34679,9 @@ do -- TASK_A2G_DISPATCHER
local ChangeMsg = {}
local Mission = self.Mission
- local ReportSEAD = REPORT:New( " - SEAD Tasks:")
- local ReportCAS = REPORT:New( " - CAS Tasks:")
- local ReportBAI = REPORT:New( " - BAI Tasks:")
+ local ReportSEAD = REPORT:New( "- SEAD Tasks:")
+ local ReportCAS = REPORT:New( "- CAS Tasks:")
+ local ReportBAI = REPORT:New( "- BAI Tasks:")
local ReportChanges = REPORT:New( " - Changes:" )
--- First we need to the detected targets.
@@ -34701,7 +34762,7 @@ do -- TASK_A2G_DISPATCHER
Mission:GetCommandCenter():MessageToGroup(
string.format( "HQ Reporting - Planned tasks for mission '%s':\n%s\n",
self.Mission:GetName(),
- string.format( "%s\n%s\n%s\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
+ string.format( "%s\n\n%s\n\n%s\n\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
)
), TaskGroup
)
@@ -35021,6 +35082,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnDestroy( Text, Score, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@@ -35036,6 +35098,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnSuccess( Text, Score, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@@ -35051,6 +35114,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetPenaltyOnFailed( Text, Penalty, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
diff --git a/Moose Mission Setup/Moose.lua b/Moose Mission Setup/Moose.lua
index 0d3429f64..ed2803d46 100644
--- a/Moose Mission Setup/Moose.lua
+++ b/Moose Mission Setup/Moose.lua
@@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
-env.info( 'Moose Generation Timestamp: 20170319_1459' )
+env.info( 'Moose Generation Timestamp: 20170320_1252' )
local base = _G
Include = {}
@@ -7971,225 +7971,30 @@ end
---- **Core** - SET classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
+--- **Core** - SET_ classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
+--
+-- 
--
-- ===
--
--- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
--- ==============================================
--- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
--- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
--- In this way, large loops can be done while not blocking the simulator main processing loop.
--- The default **"yield interval"** is after 10 objects processed.
--- The default **"time interval"** is after 0.001 seconds.
+-- SET_ classes group objects of the same type into a collection, which is either:
--
--- 1.1) Add or remove objects from the SET
--- ---------------------------------------
--- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
---
--- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
--- -----------------------------------------------------------------------------
--- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
--- You can set the **"yield interval"**, and the **"time interval"**. (See above).
---
--- ===
---
--- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
--- ==================================================
--- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Starting with certain prefix strings.
---
--- 2.1) SET_GROUP construction method:
--- -----------------------------------
--- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
---
--- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
---
--- 2.2) Add or Remove GROUP(s) from SET_GROUP:
--- -------------------------------------------
--- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
--- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
---
--- 2.3) SET_GROUP filter criteria:
--- -------------------------------
--- You can set filter criteria to define the set of groups within the SET_GROUP.
--- Filter criteria are defined by:
---
--- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
--- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
--- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
--- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
+-- * Manually managed using the **:Add...()** or **:Remove...()** methods. The initial SET can be filtered with the **@{#SET_BASE.FilterOnce}()** method
+-- * Dynamically updated when new objects are created or objects are destroyed using the **@{#SET_BASE.FilterStart}()** method.
--
--- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
+-- Various types of SET_ classes are available:
--
--- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
+-- * @{#SET_UNIT}: Defines a colleciton of @{Unit}s filtered by filter criteria.
+-- * @{#SET_GROUP}: Defines a collection of @{Group}s filtered by filter criteria.
+-- * @{#SET_CLIENT}: Defines a collection of @{Client}s filterd by filter criteria.
+-- * @{#SET_AIRBASE}: Defines a collection of @{Airbase}s filtered by filter criteria.
--
--- Planned filter criteria within development are (so these are not yet available):
+-- These classes are derived from @{#SET_BASE}, which contains the main methods to manage SETs.
--
--- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
+-- A multitude of other methods are available in SET_ classes that allow to:
--
--- 2.4) SET_GROUP iterators:
--- -------------------------
--- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
--- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_GROUP:
---
--- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
--- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
---
--- ====
---
--- 3) @{Set#SET_UNIT} class, extends @{Set#SET_BASE}
--- ===================================================
--- Mission designers can use the @{Set#SET_UNIT} class to build sets of units belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Unit types
--- * Starting with certain prefix strings.
---
--- 3.1) SET_UNIT construction method:
--- ----------------------------------
--- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
---
--- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
---
--- 3.2) Add or Remove UNIT(s) from SET_UNIT:
--- -----------------------------------------
--- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
--- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
---
--- 3.3) SET_UNIT filter criteria:
--- ------------------------------
--- You can set filter criteria to define the set of units within the SET_UNIT.
--- Filter criteria are defined by:
---
--- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
--- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
--- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
--- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
--- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
---
--- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
---
--- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
---
--- Planned filter criteria within development are (so these are not yet available):
---
--- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
---
--- 3.4) SET_UNIT iterators:
--- ------------------------
--- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
--- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_UNIT:
---
--- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
--- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
--- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
---
--- Planned iterators methods in development are (so these are not yet available):
---
--- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
--- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
--- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
---
--- ===
---
--- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
--- ===================================================
--- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
---
--- * Coalitions
--- * Categories
--- * Countries
--- * Client types
--- * Starting with certain prefix strings.
---
--- 4.1) SET_CLIENT construction method:
--- ----------------------------------
--- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
---
--- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
---
--- 4.2) Add or Remove CLIENT(s) from SET_CLIENT:
--- -----------------------------------------
--- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
--- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
---
--- 4.3) SET_CLIENT filter criteria:
--- ------------------------------
--- You can set filter criteria to define the set of clients within the SET_CLIENT.
--- Filter criteria are defined by:
---
--- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
--- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
--- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
--- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
--- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
---
--- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
---
--- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
---
--- Planned filter criteria within development are (so these are not yet available):
---
--- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
---
--- 4.4) SET_CLIENT iterators:
--- ------------------------
--- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
--- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
--- The following iterator methods are currently available within the SET_CLIENT:
---
--- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
---
--- ====
---
--- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
--- ====================================================
--- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
---
--- * Coalitions
---
--- 5.1) SET_AIRBASE construction
--- -----------------------------
--- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
---
--- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
---
--- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
--- --------------------------------------------
--- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
--- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
---
--- 5.3) SET_AIRBASE filter criteria
--- --------------------------------
--- You can set filter criteria to define the set of clients within the SET_AIRBASE.
--- Filter criteria are defined by:
---
--- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
---
--- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
---
--- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
---
--- 5.4) SET_AIRBASE iterators:
--- ---------------------------
--- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
--- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
--- The following iterator methods are currently available within the SET_AIRBASE:
---
--- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
---
--- ====
+-- * Validate the presence of objects in the SET.
+-- * Trigger events when objects in the SET change a zone presence.
--
-- ### Authors:
--
@@ -8201,7 +8006,22 @@ end
-- @module Set
---- SET_BASE class
+--- # 1) SET_BASE class, extends @{Base#BASE}
+-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
+-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
+-- In this way, large loops can be done while not blocking the simulator main processing loop.
+-- The default **"yield interval"** is after 10 objects processed.
+-- The default **"time interval"** is after 0.001 seconds.
+--
+-- ## 1.1) Add or remove objects from the SET
+--
+-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
+--
+-- ## 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
+--
+-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
+-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
+--
-- @type SET_BASE
-- @field #table Filter
-- @field #table Set
@@ -8415,7 +8235,7 @@ end
-- @return #number Count
function SET_BASE:Count()
- return #self.Index
+ return #self.Index or 0
end
@@ -8750,7 +8570,55 @@ end
-- SET_GROUP
---- SET_GROUP class
+--- # 2) SET_GROUP class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Starting with certain prefix strings.
+--
+-- ## 2.1) SET_GROUP constructor
+--
+-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
+--
+-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
+--
+-- ## 2.2) Add or Remove GROUP(s) from SET_GROUP
+--
+-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
+-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
+--
+-- ## 2.3) SET_GROUP filter criteria
+--
+-- You can set filter criteria to define the set of groups within the SET_GROUP.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
+-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
+-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
+-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
+--
+-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
+--
+-- ## 2.4) SET_GROUP iterators
+--
+-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
+-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_GROUP:
+--
+-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
+-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
+--
-- @type SET_GROUP
-- @extends Core.Set#SET_BASE
SET_GROUP = {
@@ -9118,7 +8986,69 @@ function SET_GROUP:IsIncludeObject( MooseGroup )
return MooseGroupInclude
end
---- SET_UNIT class
+--- # 3) SET_UNIT class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the SET_UNIT class to build sets of units belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Unit types
+-- * Starting with certain prefix strings.
+--
+-- ## 3.1) SET_UNIT constructor
+--
+-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
+--
+-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
+--
+-- ## 3.2) Add or Remove UNIT(s) from SET_UNIT
+--
+-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
+-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
+--
+-- ## 3.3) SET_UNIT filter criteria
+--
+-- You can set filter criteria to define the set of units within the SET_UNIT.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
+-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
+-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
+-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
+-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
+--
+-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
+--
+-- ## 3.4) SET_UNIT iterators
+--
+-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
+-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_UNIT:
+--
+-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
+-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
+-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
+--
+-- Planned iterators methods in development are (so these are not yet available):
+--
+-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
+-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
+-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
+--
+-- ## 3.5 ) SET_UNIT atomic methods
+--
+-- Various methods exist for a SET_UNIT to perform actions or calculations and retrieve results from the SET_UNIT:
+--
+-- * @{#SET_UNIT.GetTypeNames}(): Retrieve the type names of the @{Unit}s in the SET, delimited by a comma.
+--
+--
-- @type SET_UNIT
-- @extends Core.Set#SET_BASE
SET_UNIT = {
@@ -9732,9 +9662,81 @@ function SET_UNIT:IsIncludeObject( MUnit )
end
+--- Retrieve the type names of the @{Unit}s in the SET, delimited by an optional delimiter.
+-- @param #SET_UNIT self
+-- @param #string Delimiter (optional) The delimiter, which is default a comma.
+-- @return #string The types of the @{Unit}s delimited.
+function SET_UNIT:GetTypeNames( Delimiter )
+
+ Delimiter = Delimiter or ", "
+ local TypeReport = REPORT:New()
+ local Types = {}
+
+ for UnitName, UnitData in pairs( self:GetSet() ) do
+
+ local Unit = UnitData -- Wrapper.Unit#UNIT
+ local UnitTypeName = Unit:GetTypeName()
+
+ if not Types[UnitTypeName] then
+ Types[UnitTypeName] = UnitTypeName
+ TypeReport:Add( UnitTypeName )
+ end
+ end
+
+ return TypeReport:Text( Delimiter )
+end
+
+
--- SET_CLIENT
---- SET_CLIENT class
+--- # 4) SET_CLIENT class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
+--
+-- * Coalitions
+-- * Categories
+-- * Countries
+-- * Client types
+-- * Starting with certain prefix strings.
+--
+-- ## 4.1) SET_CLIENT constructor
+--
+-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
+--
+-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
+--
+-- ## 4.2) Add or Remove CLIENT(s) from SET_CLIENT
+--
+-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
+-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
+--
+-- ## 4.3) SET_CLIENT filter criteria
+--
+-- You can set filter criteria to define the set of clients within the SET_CLIENT.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
+-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
+-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
+-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
+-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
+--
+-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
+--
+-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
+--
+-- Planned filter criteria within development are (so these are not yet available):
+--
+-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
+--
+-- ## 4.4) SET_CLIENT iterators
+--
+-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
+-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_CLIENT:
+--
+-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
+--
-- @type SET_CLIENT
-- @extends Core.Set#SET_BASE
SET_CLIENT = {
@@ -10091,7 +10093,42 @@ end
--- SET_AIRBASE
---- SET_AIRBASE class
+--- # 5) SET_AIRBASE class, extends @{Set#SET_BASE}
+--
+-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
+--
+-- * Coalitions
+--
+-- ## 5.1) SET_AIRBASE constructor
+--
+-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
+--
+-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
+--
+-- ## 5.2) Add or Remove AIRBASEs from SET_AIRBASE
+--
+-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
+-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
+--
+-- ## 5.3) SET_AIRBASE filter criteria
+--
+-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
+-- Filter criteria are defined by:
+--
+-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
+--
+-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
+--
+-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
+--
+-- ## 5.4) SET_AIRBASE iterators
+--
+-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
+-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
+-- The following iterator methods are currently available within the SET_AIRBASE:
+--
+-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
+--
-- @type SET_AIRBASE
-- @extends Core.Set#SET_BASE
SET_AIRBASE = {
@@ -11901,7 +11938,6 @@ do -- FSM
for ProcessID, Process in pairs( self:GetProcesses() ) do
if Process.From == From and Process.Event == Event then
- self:T( Process )
return Process.fsm
end
end
@@ -11930,7 +11966,7 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScore( State, ScoreText, Score )
- self:F2( { State, ScoreText, Score } )
+ self:F( { State, ScoreText, Score } )
self._Scores[State] = self._Scores[State] or {}
self._Scores[State].ScoreText = ScoreText
@@ -11948,14 +11984,15 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScoreProcess( From, Event, State, ScoreText, Score )
- self:F2( { Event, State, ScoreText, Score } )
+ self:F( { From, Event, State, ScoreText, Score } )
local Process = self:GetProcess( From, Event )
- self:T( { Process = Process._Name, Scores = Process._Scores, State = State, ScoreText = ScoreText, Score = Score } )
Process._Scores[State] = Process._Scores[State] or {}
Process._Scores[State].ScoreText = ScoreText
Process._Scores[State].Score = Score
+
+ self:T( Process._Scores )
return Process
end
@@ -12528,14 +12565,14 @@ end
-- @param #string Event
-- @param #string From
-- @param #string To
- function FSM_PROCESS:onstatechange( ProcessUnit, From, Event, To, Dummy )
+ function FSM_PROCESS:onstatechange( ProcessUnit, Task, From, Event, To, Dummy )
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
if self:IsTrace() then
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end
- self:T( self._Scores[To] )
+ self:T( { Scores = self._Scores, To = To } )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
if self._Scores[To] then
@@ -26574,7 +26611,7 @@ do -- DETECTION_BASE
--- Get a detected item using a given numeric index.
-- @param #DETECTION_BASE self
-- @param #number Index
- -- @return DETECTION_BASE.DetectedItem
+ -- @return #DETECTION_BASE.DetectedItem
function DETECTION_BASE:GetDetectedItem( Index )
local DetectedItem = self.DetectedItems[Index]
@@ -26837,7 +26874,7 @@ do -- DETECTION_UNITS
local DetectedItemUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
- if DetectedItemUnit then
+ if DetectedItemUnit and DetectedItemUnit:IsAlive() then
self:T(DetectedItemUnit)
local UnitCategoryName = DetectedItemUnit:GetCategoryName() or ""
@@ -26855,8 +26892,16 @@ do -- DETECTION_UNITS
UnitDistanceText = string.format( "%.2f", DetectedItem.Distance ) .. " km, visual contact"
end
+ local DetectedItemPointVec3 = DetectedItemUnit:GetPointVec3()
+ local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
+
+ local ThreatLevelA2G = DetectedItemUnit:GetThreatLevel( DetectedItem )
+
ReportSummary = string.format(
- "%s%s",
+ "%s - Threat [%s] (%2d) - %s%s",
+ DetectedItemPointLL,
+ string.rep( "■", ThreatLevelA2G ),
+ ThreatLevelA2G,
UnitCategoryText,
UnitDistanceText
)
@@ -26971,10 +27016,10 @@ do -- DETECTION_TYPES
for DetectedItemID, DetectedItem in pairs( self.DetectedItems ) do
- local DetectedItemSet = DetectedItem:GetSet() -- Core.Set#SET_UNIT
+ local DetectedItemSet = DetectedItem.Set -- Core.Set#SET_UNIT
local DetectedTypeName = DetectedItem.Type
- for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet ) do
+ for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet:GetSet() ) do
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
local DetectedObject = nil
@@ -27042,13 +27087,16 @@ do -- DETECTION_TYPES
self:T( DetectedItem )
if DetectedItem then
- local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
+ local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
+ local DetectedItemsCount = DetectedSet:Count()
+ local DetectedItemType = DetectedItem.Type
local ReportSummary = string.format(
- "Type #%s - Threat Level [%s] (%2d)",
- DetectedItem.Type,
+ "Threat [%s] (%2d) - %2d of %s",
string.rep( "■", ThreatLevelA2G ),
- ThreatLevelA2G
+ ThreatLevelA2G,
+ DetectedItemsCount,
+ DetectedItemType
)
self:T( ReportSummary )
@@ -27152,17 +27200,23 @@ do -- DETECTION_AREAS
local DetectedItem = self:GetDetectedItem( Index )
if DetectedItem then
local DetectedSet = self:GetDetectedSet( Index )
- local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local ReportSummaryItem
local DetectedZone = self:GetDetectedZone( Index )
local DetectedItemPointVec3 = DetectedZone:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
+
+ local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
+ local DetectedItemsCount = DetectedSet:Count()
+ local DetectedItemsTypes = DetectedSet:GetTypeNames()
+
local ReportSummary = string.format(
- "%s - Threat Level [%s] (%2d)",
+ "%s - Threat [%s] (%2d) - %2d of %s",
DetectedItemPointLL,
string.rep( "■", ThreatLevelA2G ),
- ThreatLevelA2G
+ ThreatLevelA2G,
+ DetectedItemsCount,
+ DetectedItemsTypes
)
return ReportSummary
@@ -32121,8 +32175,14 @@ function REPORT:Add( Text )
return self.Report[#self.Report]
end
-function REPORT:Text()
- return table.concat( self.Report, "\n" )
+--- Produces the text of the report, taking into account an optional delimeter, which is \n by default.
+-- @param #REPORT self
+-- @param #string Delimiter (optional) A delimiter text.
+-- @return #string The report text.
+function REPORT:Text( Delimiter )
+ Delimiter = Delimiter or "\n"
+ local ReportText = table.concat( self.Report, Delimiter ) or ""
+ return ReportText
end
--- The COMMANDCENTER class
@@ -34007,11 +34067,12 @@ end
-- @param #string To
function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
- self:E("Task Assigned")
+ self:E( { "Task Assigned", self.Dispatcher } )
self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." )
if self.Dispatcher then
+ self:E( "Firing Assign event " )
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
end
@@ -34618,9 +34679,9 @@ do -- TASK_A2G_DISPATCHER
local ChangeMsg = {}
local Mission = self.Mission
- local ReportSEAD = REPORT:New( " - SEAD Tasks:")
- local ReportCAS = REPORT:New( " - CAS Tasks:")
- local ReportBAI = REPORT:New( " - BAI Tasks:")
+ local ReportSEAD = REPORT:New( "- SEAD Tasks:")
+ local ReportCAS = REPORT:New( "- CAS Tasks:")
+ local ReportBAI = REPORT:New( "- BAI Tasks:")
local ReportChanges = REPORT:New( " - Changes:" )
--- First we need to the detected targets.
@@ -34701,7 +34762,7 @@ do -- TASK_A2G_DISPATCHER
Mission:GetCommandCenter():MessageToGroup(
string.format( "HQ Reporting - Planned tasks for mission '%s':\n%s\n",
self.Mission:GetName(),
- string.format( "%s\n%s\n%s\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
+ string.format( "%s\n\n%s\n\n%s\n\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
)
), TaskGroup
)
@@ -35021,6 +35082,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnDestroy( Text, Score, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@@ -35036,6 +35098,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnSuccess( Text, Score, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@@ -35051,6 +35114,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetPenaltyOnFailed( Text, Penalty, TaskUnit )
+ self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
diff --git a/Moose Presentations/SET.pptx b/Moose Presentations/SET.pptx
new file mode 100644
index 000000000..a032db2f3
Binary files /dev/null and b/Moose Presentations/SET.pptx differ
diff --git a/Moose Presentations/TASK_DISPATCHER.pptx b/Moose Presentations/TASK_DISPATCHER.pptx
index b3ca1f566..b5a2b7f17 100644
Binary files a/Moose Presentations/TASK_DISPATCHER.pptx and b/Moose Presentations/TASK_DISPATCHER.pptx differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-010 - A2G Task Dispatching Destroy Test/TAD-010 - A2G Task Dispatching Destroy Test.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-010 - A2G Task Dispatching Destroy Test/TAD-010 - A2G Task Dispatching Destroy Test.miz
index 0201f1b4e..305feef0d 100644
Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-010 - A2G Task Dispatching Destroy Test/TAD-010 - A2G Task Dispatching Destroy Test.miz and b/Moose Test Missions/TAD - Task Dispatching/TAD-010 - A2G Task Dispatching Destroy Test/TAD-010 - A2G Task Dispatching Destroy Test.miz differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-100 - A2G Task Dispatching DETECTION_AREAS/TAD-100 - A2G Task Dispatching DETECTION_AREAS.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-100 - A2G Task Dispatching DETECTION_AREAS/TAD-100 - A2G Task Dispatching DETECTION_AREAS.miz
index 359f982d0..0bb8becc6 100644
Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-100 - A2G Task Dispatching DETECTION_AREAS/TAD-100 - A2G Task Dispatching DETECTION_AREAS.miz and b/Moose Test Missions/TAD - Task Dispatching/TAD-100 - A2G Task Dispatching DETECTION_AREAS/TAD-100 - A2G Task Dispatching DETECTION_AREAS.miz differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-105 - A2G Task Dispatching DETECTION_AREAS/TAD-105 - A2G Task Dispatching DETECTION_AREAS.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-105 - A2G Task Dispatching DETECTION_AREAS/TAD-105 - A2G Task Dispatching DETECTION_AREAS.miz
index 9a542f70e..4210bea55 100644
Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-105 - A2G Task Dispatching DETECTION_AREAS/TAD-105 - A2G Task Dispatching DETECTION_AREAS.miz and b/Moose Test Missions/TAD - Task Dispatching/TAD-105 - A2G Task Dispatching DETECTION_AREAS/TAD-105 - A2G Task Dispatching DETECTION_AREAS.miz differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-110 - A2G Task Dispatching DETECTION_TYPES/TAD-110 - A2G Task Dispatching DETECTION_TYPES.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-110 - A2G Task Dispatching DETECTION_TYPES/TAD-110 - A2G Task Dispatching DETECTION_TYPES.miz
index ab10243db..4827922e7 100644
Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-110 - A2G Task Dispatching DETECTION_TYPES/TAD-110 - A2G Task Dispatching DETECTION_TYPES.miz and b/Moose Test Missions/TAD - Task Dispatching/TAD-110 - A2G Task Dispatching DETECTION_TYPES/TAD-110 - A2G Task Dispatching DETECTION_TYPES.miz differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.miz
index 4c1cf726a..fb98865fc 100644
Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.miz and b/Moose Test Missions/TAD - Task Dispatching/TAD-120 - A2G Task Dispatching DETECTION_UNITS/TAD-120 - A2G Task Dispatching DETECTION_UNITS.miz differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-200 - A2G Task Dispatching with SCORING/TAD-200 - A2G Task Dispatching with SCORING.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-200 - A2G Task Dispatching with SCORING/TAD-200 - A2G Task Dispatching with SCORING.miz
index e1cb135f3..c17d5e8df 100644
Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-200 - A2G Task Dispatching with SCORING/TAD-200 - A2G Task Dispatching with SCORING.miz and b/Moose Test Missions/TAD - Task Dispatching/TAD-200 - A2G Task Dispatching with SCORING/TAD-200 - A2G Task Dispatching with SCORING.miz differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.miz
deleted file mode 100644
index c239fdfc0..000000000
Binary files a/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.miz and /dev/null differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua b/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching per AREAS and SCORING/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua
similarity index 97%
rename from Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua
rename to Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching per AREAS and SCORING/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua
index bda9ccf60..2a5427bcc 100644
--- a/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING/TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING.lua
+++ b/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching per AREAS and SCORING/TAD-210 - A2G Task Dispatching per AREAS and SCORING.lua
@@ -1,5 +1,5 @@
---
--- Name: TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING
+-- Name: TAD-210 - A2G Task Dispatching for AREAS and SCORING
-- Author: FlightControl
-- Date Created: 19 Mar 2017
--
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching per AREAS and SCORING/TAD-210 - A2G Task Dispatching per AREAS and SCORING.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching per AREAS and SCORING/TAD-210 - A2G Task Dispatching per AREAS and SCORING.miz
new file mode 100644
index 000000000..b82f55eca
Binary files /dev/null and b/Moose Test Missions/TAD - Task Dispatching/TAD-210 - A2G Task Dispatching per AREAS and SCORING/TAD-210 - A2G Task Dispatching per AREAS and SCORING.miz differ
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-220 - A2G Task Dispatching per TYPE and SCORING/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua b/Moose Test Missions/TAD - Task Dispatching/TAD-220 - A2G Task Dispatching per TYPE and SCORING/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua
new file mode 100644
index 000000000..556fd25e8
--- /dev/null
+++ b/Moose Test Missions/TAD - Task Dispatching/TAD-220 - A2G Task Dispatching per TYPE and SCORING/TAD-220 - A2G Task Dispatching per TYPE and SCORING.lua
@@ -0,0 +1,64 @@
+---
+-- Name: TAD-220 - A2G Task Dispatching per TYPE and SCORING
+-- Author: FlightControl
+-- Date Created: 20 Mar 2017
+--
+-- # Situation:
+--
+-- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations.
+--
+-- # Test cases:
+--
+-- 1. Observe the FAC(A)'s detecting targets and grouping them.
+-- 2. Check that the HQ provides menus to engage on a task set by the FACs.
+-- 3. Engage on a task and destroy a target. Check if scoring is given for that target.
+-- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given.
+-- 5. Restart the mission, and crash into the ground, check if you can get penalties.
+--
+local HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
+
+local CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
+
+local Scoring = SCORING:New( "Detect Demo" )
+
+local Mission = MISSION
+ :New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED )
+ :AddScoring( Scoring )
+
+local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart()
+
+local FACAreas = DETECTION_TYPES:New( FACSet )
+
+local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart()
+
+TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas )
+
+--- @param #TaskDispatcher self
+-- @param From
+-- @param Event
+-- @param To
+-- @param Tasking.Task_A2G#TASK_A2G Task
+-- @param Wrapper.Unit#UNIT TaskUnit
+-- @param #string PlayerName
+function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName )
+ self:E( "I am in assigned ... " )
+ Task:SetScoreOnDestroy( "Player " .. PlayerName .. " destroyed a target", 50, TaskUnit )
+ Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit )
+ Task:SetPenaltyOnFailed( "The task has failed completion!", -100, TaskUnit )
+end
+
+-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004.
+-- This is just an example, but many more examples can follow...
+
+-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission.
+-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion
+-- too early!
+
+function Mission:OnBeforeComplete( From, Event, To )
+ local Group004 = GROUP:FindByName( "Target #004" )
+ if Group004:IsAlive() == false then
+ Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" )
+ return true
+ end
+ return false
+end
\ No newline at end of file
diff --git a/Moose Test Missions/TAD - Task Dispatching/TAD-220 - A2G Task Dispatching per TYPE and SCORING/TAD-220 - A2G Task Dispatching per TYPE and SCORING.miz b/Moose Test Missions/TAD - Task Dispatching/TAD-220 - A2G Task Dispatching per TYPE and SCORING/TAD-220 - A2G Task Dispatching per TYPE and SCORING.miz
new file mode 100644
index 000000000..41d6059f9
Binary files /dev/null and b/Moose Test Missions/TAD - Task Dispatching/TAD-220 - A2G Task Dispatching per TYPE and SCORING/TAD-220 - A2G Task Dispatching per TYPE and SCORING.miz differ
diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html
index dfe052794..720a93bd9 100644
--- a/docs/Documentation/AI_Patrol.html
+++ b/docs/Documentation/AI_Patrol.html
@@ -919,6 +919,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 057ed8705..f3bcbd277 100644
--- a/docs/Documentation/Cargo.html
+++ b/docs/Documentation/Cargo.html
@@ -2425,6 +2425,7 @@ The UNIT carrying the package.
-
+
AI_CARGO_UNIT.CargoCarrier
diff --git a/docs/Documentation/CommandCenter.html b/docs/Documentation/CommandCenter.html
index fba8e0fc0..66094f398 100644
--- a/docs/Documentation/CommandCenter.html
+++ b/docs/Documentation/CommandCenter.html
@@ -243,9 +243,9 @@
- | REPORT:Text() |
+ REPORT:Text(Delimiter) |
-
+ Produces the text of the report, taking into account an optional delimeter, which is \n by default.
|
@@ -788,12 +788,26 @@ Group#GROUP
-
-REPORT:Text()
+REPORT:Text(Delimiter)
-
+
Produces the text of the report, taking into account an optional delimeter, which is \n by default.
+ Parameter
+
+ Return value
+
+#string:
+The report text.
diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html
index d0329b678..6c9841f92 100644
--- a/docs/Documentation/Detection.html
+++ b/docs/Documentation/Detection.html
@@ -2105,6 +2105,7 @@ self
-
+ #number
DETECTION_BASE.DetectedItemCount
@@ -2118,6 +2119,7 @@ self
-
+ #number
DETECTION_BASE.DetectedItemMax
@@ -2333,8 +2335,8 @@ self
Return value
+#DETECTION_BASE.DetectedItem:
-DETECTION_BASE.DetectedItem
diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html
index a809388d5..92c994f6b 100644
--- a/docs/Documentation/Fsm.html
+++ b/docs/Documentation/Fsm.html
@@ -877,7 +877,7 @@ YYYY-MM-DD: CLASS:NewFunction( Params ) added
- | FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Dummy) |
+ FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Task, Dummy) |
StateMachine callback function for a FSM_PROCESS
|
@@ -1554,7 +1554,7 @@ A string defining the start state.
-
- #string
+
FSM._StartState
@@ -1853,6 +1853,7 @@ A string defining the start state.
-
+
FSM.current
@@ -2637,7 +2638,7 @@ self
-
-FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Dummy)
+FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Task, Dummy)
-
@@ -2668,6 +2669,11 @@ self
-
+
Task :
+
+
+ -
+
Dummy :
diff --git a/docs/Documentation/Point.html b/docs/Documentation/Point.html
index d62614444..63ef7724d 100644
--- a/docs/Documentation/Point.html
+++ b/docs/Documentation/Point.html
@@ -1346,7 +1346,6 @@ The new calculated POINT_VEC2.
-
-
POINT_VEC2.z
diff --git a/docs/Documentation/Set.html b/docs/Documentation/Set.html
index 11ff450fd..0f35628fd 100644
--- a/docs/Documentation/Set.html
+++ b/docs/Documentation/Set.html
@@ -72,253 +72,39 @@
Module Set
-
Core - SET classes define collections of objects to perform bulk actions and logically group objects.
+
Core - SET_ classes define collections of objects to perform bulk actions and logically group objects.
-
-
-
-
The Set#SET_BASE class defines the core functions that define a collection of objects.
-A SET provides iterators to iterate the SET, but will temporarily yield the ForEach interator loop at defined "intervals" to the mail simulator loop.
-In this way, large loops can be done while not blocking the simulator main processing loop.
-The default "yield interval" is after 10 objects processed.
-The default "time interval" is after 0.001 seconds.
-
-
1.1) Add or remove objects from the SET
-
Some key core functions are Set#SET_BASE.Add and Set#SET_BASE.Remove to add or remove objects from the SET in your logic.
-
-
1.2) Define the SET iterator "yield interval" and the "time interval"
-
Modify the iterator intervals with the Set#SET_BASE.SetInteratorIntervals method.
-You can set the "yield interval", and the "time interval". (See above).
+

-
-
Mission designers can use the Set#SET_GROUP class to build sets of groups belonging to certain:
+
SET_ classes group objects of the same type into a collection, which is either:
- - Coalitions
- - Categories
- - Countries
- - Starting with certain prefix strings.
+ - Manually managed using the :Add...() or :Remove...() methods. The initial SET can be filtered with the **SET_BASE.FilterOnce()** method
+ - Dynamically updated when new objects are created or objects are destroyed using the **SET_BASE.FilterStart()** method.
-
2.1) SET_GROUP construction method:
-
Create a new SET_GROUP object with the SET_GROUP.New method:
+
Various types of SET_ classes are available:
-
2.2) Add or Remove GROUP(s) from SET_GROUP:
-
GROUPS can be added and removed using the Set#SET_GROUP.AddGroupsByName and Set#SET_GROUP.RemoveGroupsByName respectively.
-These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
+
These classes are derived from #SET_BASE, which contains the main methods to manage SETs.
-
2.3) SET_GROUP filter criteria:
-
You can set filter criteria to define the set of groups within the SET_GROUP.
-Filter criteria are defined by:
+
A multitude of other methods are available in SET_ classes that allow to:
- - SET_GROUP.FilterCoalitions: Builds the SET_GROUP with the groups belonging to the coalition(s).
- - SET_GROUP.FilterCategories: Builds the SET_GROUP with the groups belonging to the category(ies).
- - SET_GROUP.FilterCountries: Builds the SET_GROUP with the gruops belonging to the country(ies).
- - SET_GROUP.FilterPrefixes: Builds the SET_GROUP with the groups starting with the same prefix string(s).
+ - Validate the presence of objects in the SET.
+ - Trigger events when objects in the SET change a zone presence.
-
Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
-
-
- - SET_GROUP.FilterStart: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects dynamically.
-
-
-
Planned filter criteria within development are (so these are not yet available):
-
-
-
-
2.4) SET_GROUP iterators:
-
Once the filters have been defined and the SETGROUP has been built, you can iterate the SETGROUP with the available iterator methods.
-The iterator methods will walk the SETGROUP set, and call for each element within the set a function that you provide.
-The following iterator methods are currently available within the SETGROUP:
-
-
- - SET_GROUP.ForEachGroup: Calls a function for each alive group it finds within the SET_GROUP.
- - SET_GROUP.ForEachGroupCompletelyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence completely in a Zone, providing the GROUP and optional parameters to the called function.
- - SET_GROUP.ForEachGroupPartlyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence partly in a Zone, providing the GROUP and optional parameters to the called function.
- - SET_GROUP.ForEachGroupNotInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence not in a Zone, providing the GROUP and optional parameters to the called function.
-
-
-
-
-
-
Mission designers can use the Set#SET_UNIT class to build sets of units belonging to certain:
-
-
- - Coalitions
- - Categories
- - Countries
- - Unit types
- - Starting with certain prefix strings.
-
-
-
3.1) SET_UNIT construction method:
-
Create a new SET_UNIT object with the SET_UNIT.New method:
-
-
-
-
3.2) Add or Remove UNIT(s) from SET_UNIT:
-
UNITs can be added and removed using the Set#SET_UNIT.AddUnitsByName and Set#SET_UNIT.RemoveUnitsByName respectively.
-These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
-
-
3.3) SET_UNIT filter criteria:
-
You can set filter criteria to define the set of units within the SET_UNIT.
-Filter criteria are defined by:
-
-
-
-
Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
-
-
-
-
Planned filter criteria within development are (so these are not yet available):
-
-
-
-
3.4) SET_UNIT iterators:
-
Once the filters have been defined and the SETUNIT has been built, you can iterate the SETUNIT with the available iterator methods.
-The iterator methods will walk the SETUNIT set, and call for each element within the set a function that you provide.
-The following iterator methods are currently available within the SETUNIT:
-
-
- - SET_UNIT.ForEachUnit: Calls a function for each alive unit it finds within the SET_UNIT.
- - SET_GROUP.ForEachGroupCompletelyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence completely in a Zone, providing the GROUP and optional parameters to the called function.
- - SET_GROUP.ForEachGroupNotInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence not in a Zone, providing the GROUP and optional parameters to the called function.
-
-
-
Planned iterators methods in development are (so these are not yet available):
-
-
-
-
-
-
-
Mission designers can use the Set#SET_CLIENT class to build sets of units belonging to certain:
-
-
- - Coalitions
- - Categories
- - Countries
- - Client types
- - Starting with certain prefix strings.
-
-
-
4.1) SET_CLIENT construction method:
-
Create a new SET_CLIENT object with the SET_CLIENT.New method:
-
-
-
-
4.2) Add or Remove CLIENT(s) from SET_CLIENT:
-
CLIENTs can be added and removed using the Set#SET_CLIENT.AddClientsByName and Set#SET_CLIENT.RemoveClientsByName respectively.
-These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
-
-
4.3) SET_CLIENT filter criteria:
-
You can set filter criteria to define the set of clients within the SET_CLIENT.
-Filter criteria are defined by:
-
-
-
-
Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
-
-
-
-
Planned filter criteria within development are (so these are not yet available):
-
-
-
-
4.4) SET_CLIENT iterators:
-
Once the filters have been defined and the SETCLIENT has been built, you can iterate the SETCLIENT with the available iterator methods.
-The iterator methods will walk the SETCLIENT set, and call for each element within the set a function that you provide.
-The following iterator methods are currently available within the SETCLIENT:
-
-
-
-
-
-
-
Mission designers can use the Set#SET_AIRBASE class to build sets of airbases optionally belonging to certain:
-
-
-
-
5.1) SET_AIRBASE construction
-
Create a new SET_AIRBASE object with the SET_AIRBASE.New method:
-
-
-
-
5.2) Add or Remove AIRBASEs from SET_AIRBASE
-
AIRBASEs can be added and removed using the Set#SET_AIRBASE.AddAirbasesByName and Set#SET_AIRBASE.RemoveAirbasesByName respectively.
-These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
-
-
5.3) SET_AIRBASE filter criteria
-
You can set filter criteria to define the set of clients within the SET_AIRBASE.
-Filter criteria are defined by:
-
-
-
-
Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
-
-
-
-
5.4) SET_AIRBASE iterators:
-
Once the filters have been defined and the SETAIRBASE has been built, you can iterate the SETAIRBASE with the available iterator methods.
-The iterator methods will walk the SETAIRBASE set, and call for each airbase within the set a function that you provide.
-The following iterator methods are currently available within the SETAIRBASE:
-
-
-
-
-
Authors:
+
+ | SET_UNIT:GetTypeNames(Delimiter) |
+
+ Retrieve the type names of the Units in the SET, delimited by an optional delimiter.
|
@@ -1171,7 +963,54 @@ The following iterator methods are currently available within the SETAIRBAS
-SET_AIRBASE class
+5) SET_AIRBASE class, extends Set#SET_BASE
+
+Mission designers can use the Set#SET_AIRBASE class to build sets of airbases optionally belonging to certain:
+
+
+
+5.1) SET_AIRBASE constructor
+
+Create a new SET_AIRBASE object with the SET_AIRBASE.New method:
+
+
+
+
+
+5.2) Add or Remove AIRBASEs from SET_AIRBASE
+
+AIRBASEs can be added and removed using the Set#SET_AIRBASE.AddAirbasesByName and Set#SET_AIRBASE.RemoveAirbasesByName respectively.
+These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
+
+5.3) SET_AIRBASE filter criteria
+
+You can set filter criteria to define the set of clients within the SET_AIRBASE.
+Filter criteria are defined by:
+
+
+
+Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
+
+
+
+5.4) SET_AIRBASE iterators
+
+Once the filters have been defined and the SETAIRBASE has been built, you can iterate the SETAIRBASE with the available iterator methods.
+The iterator methods will walk the SETAIRBASE set, and call for each airbase within the set a function that you provide.
+The following iterator methods are currently available within the SETAIRBASE:
+
+
+
Field(s)
@@ -1576,7 +1415,24 @@ A single name or an array of AIRBASE names.
-SET_BASE class
+1) SET_BASE class, extends Base#BASE
+The Set#SET_BASE class defines the core functions that define a collection of objects.
+
+
+A SET provides iterators to iterate the SET, but will temporarily yield the ForEach interator loop at defined "intervals" to the mail simulator loop.
+In this way, large loops can be done while not blocking the simulator main processing loop.
+The default "yield interval" is after 10 objects processed.
+The default "time interval" is after 0.001 seconds.
+
+1.1) Add or remove objects from the SET
+
+Some key core functions are Set#SET_BASE.Add and Set#SET_BASE.Remove to add or remove objects from the SET in your logic.
+
+1.2) Define the SET iterator "yield interval" and the "time interval"
+
+Modify the iterator intervals with the Set#SET_BASE.SetInteratorIntervals method.
+You can set the "yield interval", and the "time interval". (See above).
+
Field(s)
@@ -2279,7 +2135,68 @@ The Object found.
-SET_CLIENT class
+4) SET_CLIENT class, extends Set#SET_BASE
+
+Mission designers can use the Set#SET_CLIENT class to build sets of units belonging to certain:
+
+
+ - Coalitions
+ - Categories
+ - Countries
+ - Client types
+ - Starting with certain prefix strings.
+
+
+
+
+4.1) SET_CLIENT constructor
+
+Create a new SET_CLIENT object with the SET_CLIENT.New method:
+
+
+
+4.2) Add or Remove CLIENT(s) from SET_CLIENT
+
+CLIENTs can be added and removed using the Set#SET_CLIENT.AddClientsByName and Set#SET_CLIENT.RemoveClientsByName respectively.
+These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
+
+4.3) SET_CLIENT filter criteria
+
+You can set filter criteria to define the set of clients within the SET_CLIENT.
+Filter criteria are defined by:
+
+
+
+Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
+
+
+
+Planned filter criteria within development are (so these are not yet available):
+
+
+
+4.4) SET_CLIENT iterators
+
+Once the filters have been defined and the SETCLIENT has been built, you can iterate the SETCLIENT with the available iterator methods.
+The iterator methods will walk the SETCLIENT set, and call for each element within the set a function that you provide.
+The following iterator methods are currently available within the SETCLIENT:
+
+
+
Field(s)
@@ -2823,7 +2740,69 @@ A single name or an array of CLIENT names.
-SET_GROUP class
+2) SET_GROUP class, extends Set#SET_BASE
+
+Mission designers can use the Set#SET_GROUP class to build sets of groups belonging to certain:
+
+
+ - Coalitions
+ - Categories
+ - Countries
+ - Starting with certain prefix strings.
+
+
+
+
+2.1) SET_GROUP constructor
+
+Create a new SET_GROUP object with the SET_GROUP.New method:
+
+
+
+2.2) Add or Remove GROUP(s) from SET_GROUP
+
+GROUPS can be added and removed using the Set#SET_GROUP.AddGroupsByName and Set#SET_GROUP.RemoveGroupsByName respectively.
+These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
+
+2.3) SET_GROUP filter criteria
+
+You can set filter criteria to define the set of groups within the SET_GROUP.
+Filter criteria are defined by:
+
+
+
+Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
+
+
+ - SET_GROUP.FilterStart: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects dynamically.
+
+
+Planned filter criteria within development are (so these are not yet available):
+
+
+
+2.4) SET_GROUP iterators
+
+Once the filters have been defined and the SETGROUP has been built, you can iterate the SETGROUP with the available iterator methods.
+The iterator methods will walk the SETGROUP set, and call for each element within the set a function that you provide.
+The following iterator methods are currently available within the SETGROUP:
+
+
+ - SET_GROUP.ForEachGroup: Calls a function for each alive group it finds within the SET_GROUP.
+ - SET_GROUP.ForEachGroupCompletelyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence completely in a Zone, providing the GROUP and optional parameters to the called function.
+ - SET_GROUP.ForEachGroupPartlyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence partly in a Zone, providing the GROUP and optional parameters to the called function.
+ - SET_GROUP.ForEachGroupNotInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence not in a Zone, providing the GROUP and optional parameters to the called function.
+
+
Field(s)
@@ -3361,7 +3340,87 @@ A single name or an array of GROUP names.
-SET_UNIT class
+3) SET_UNIT class, extends Set#SET_BASE
+
+Mission designers can use the SET_UNIT class to build sets of units belonging to certain:
+
+
+ - Coalitions
+ - Categories
+ - Countries
+ - Unit types
+ - Starting with certain prefix strings.
+
+
+
+
+3.1) SET_UNIT constructor
+
+Create a new SET_UNIT object with the SET_UNIT.New method:
+
+
+
+3.2) Add or Remove UNIT(s) from SET_UNIT
+
+UNITs can be added and removed using the Set#SET_UNIT.AddUnitsByName and Set#SET_UNIT.RemoveUnitsByName respectively.
+These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
+
+3.3) SET_UNIT filter criteria
+
+You can set filter criteria to define the set of units within the SET_UNIT.
+Filter criteria are defined by:
+
+
+
+Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
+
+
+
+Planned filter criteria within development are (so these are not yet available):
+
+
+
+3.4) SET_UNIT iterators
+
+Once the filters have been defined and the SETUNIT has been built, you can iterate the SETUNIT with the available iterator methods.
+The iterator methods will walk the SETUNIT set, and call for each element within the set a function that you provide.
+The following iterator methods are currently available within the SETUNIT:
+
+
+ - SET_UNIT.ForEachUnit: Calls a function for each alive unit it finds within the SET_UNIT.
+ - SET_GROUP.ForEachGroupCompletelyInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence completely in a Zone, providing the GROUP and optional parameters to the called function.
+ - SET_GROUP.ForEachGroupNotInZone: Iterate the SET_GROUP and call an iterator function for each alive GROUP presence not in a Zone, providing the GROUP and optional parameters to the called function.
+
+
+Planned iterators methods in development are (so these are not yet available):
+
+
+
+3.5 ) SET_UNIT atomic methods
+
+Various methods exist for a SETUNIT to perform actions or calculations and retrieve results from the SETUNIT:
+
+
+
+
Field(s)
@@ -3904,6 +3963,33 @@ self
-
+
+SET_UNIT:GetTypeNames(Delimiter)
+
+
+-
+
+
Retrieve the type names of the Units in the SET, delimited by an optional delimiter.
+
+ Parameter
+
+ Return value
+
+#string:
+The types of the Units delimited.
+
+
+
+
+-
+
SET_UNIT:GetUnitThreatLevels()
diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html
index 5ec635661..b9f9cb7db 100644
--- a/docs/Documentation/Spawn.html
+++ b/docs/Documentation/Spawn.html
@@ -2326,6 +2326,9 @@ when nothing was spawned.
+
+
Overwrite unit names by default with group name.
+
@@ -2340,6 +2343,9 @@ when nothing was spawned.
+
+ By default, no InitLimit
+
@@ -2375,7 +2381,7 @@ when nothing was spawned.
-
-
+ #number
SPAWN.SpawnMaxGroups
@@ -2392,7 +2398,7 @@ when nothing was spawned.
-
-
+ #number
SPAWN.SpawnMaxUnitsAlive
@@ -2710,7 +2716,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
-
-
+ #boolean
SPAWN.SpawnUnControlled
diff --git a/docs/Documentation/index.html b/docs/Documentation/index.html
index 7a0b14173..76cf0ddb4 100644
--- a/docs/Documentation/index.html
+++ b/docs/Documentation/index.html
@@ -361,7 +361,7 @@ and creates a CSV file logging the scoring events and results for use at team or
| Set |
- Core - SET classes define collections of objects to perform bulk actions and logically group objects.
+Core - SET_ classes define collections of objects to perform bulk actions and logically group objects.
|
diff --git a/docs/Presentations/SET/Dia1.JPG b/docs/Presentations/SET/Dia1.JPG
new file mode 100644
index 000000000..dd975a856
Binary files /dev/null and b/docs/Presentations/SET/Dia1.JPG differ