From daef3e415f264892f7205ee454854346cc78e4f8 Mon Sep 17 00:00:00 2001 From: Sven Van de Velde Date: Fri, 29 Jul 2016 08:22:57 +0200 Subject: [PATCH] Added documentation in SPAWN -- Added documentation for methods GetFirstAliveGroup, GetNextAliveGroup, GetLastAliveGroup. -- Added code snippets to the documentation for the methods GetFirstAliveGroup, GetNextAliveGroup, GetLastAliveGroup. --- Moose Development/Moose/Spawn.lua | 79 +- Moose Training/Document.bat | 1 + Moose Training/Documentation/Fac.html | 692 ------------------ Moose Training/Documentation/Menu.html | 2 - .../Documentation/MissileTrainer.html | 2 +- Moose Training/Documentation/Process_CAS.html | 547 -------------- .../Documentation/Process_SEAD.html | 547 -------------- Moose Training/Documentation/Scheduler.html | 56 +- Moose Training/Documentation/Spawn.html | 101 ++- 9 files changed, 184 insertions(+), 1843 deletions(-) create mode 100644 Moose Training/Document.bat delete mode 100644 Moose Training/Documentation/Fac.html delete mode 100644 Moose Training/Documentation/Process_CAS.html delete mode 100644 Moose Training/Documentation/Process_SEAD.html diff --git a/Moose Development/Moose/Spawn.lua b/Moose Development/Moose/Spawn.lua index 170bff907..33b6602d0 100644 --- a/Moose Development/Moose/Spawn.lua +++ b/Moose Development/Moose/Spawn.lua @@ -7,7 +7,7 @@ -- A reference to this Spawn Template needs to be provided when constructing the SPAWN object, by indicating the name of the group within the mission editor in the constructor methods. -- -- Within the SPAWN object, there is an internal index that keeps track of which group from the internal group list was spawned. --- When new groups get spawned by using the SPAWN functions (see below), it will be validated whether the Limits (@{#SPAWN.Limit}) of the SPAWN object are not reached. +-- When new groups get spawned by using the SPAWN methods (see below), it will be validated whether the Limits (@{#SPAWN.Limit}) of the SPAWN object are not reached. -- When all is valid, a new group will be created by the spawning methods, and the internal index will be increased with 1. -- -- Regarding the name of new spawned groups, a _SpawnPrefix_ will be assigned for each new group created. @@ -28,10 +28,10 @@ -- ------------------------------- -- Create a new SPAWN object with the @{#SPAWN.New} or the @{#SPAWN.NewWithAlias} methods: -- --- * @{#SPAWN.New}: Creates a new SPAWN object taking the name of the group that functions as the Template. +-- * @{#SPAWN.New}: Creates a new SPAWN object taking the name of the group that represents the GROUP Template (definition). -- -- It is important to understand how the SPAWN class works internally. The SPAWN object created will contain internally a list of groups that will be spawned and that are already spawned. --- The initialization functions will modify this list of groups so that when a group gets spawned, ALL information is already prepared when spawning. This is done for performance reasons. +-- The initialization methods will modify this list of groups so that when a group gets spawned, ALL information is already prepared when spawning. This is done for performance reasons. -- So in principle, the group list will contain all parameters and configurations after initialization, and when groups get actually spawned, this spawning can be done quickly and efficient. -- -- 1.2) SPAWN initialization methods @@ -43,7 +43,7 @@ -- * @{#SPAWN.RandomizeTemplate}: Randomize the group templates so that when a new group is spawned, a random group template is selected from one of the templates defined. -- * @{#SPAWN.Uncontrolled}: Spawn plane groups uncontrolled. -- * @{#SPAWN.Array}: Make groups visible before they are actually activated, and order these groups like a batallion in an array. --- * @{#SPAWN.InitRepeat}: Re-spawn groups when they land at the home base. Similar functions are @{#SPAWN.InitRepeatOnLanding} and @{#SPAWN.InitRepeatOnEngineShutDown}. +-- * @{#SPAWN.InitRepeat}: Re-spawn groups when they land at the home base. Similar methods are @{#SPAWN.InitRepeatOnLanding} and @{#SPAWN.InitRepeatOnEngineShutDown}. -- -- 1.3) SPAWN spawning methods -- --------------------------- @@ -61,7 +61,20 @@ -- Note that @{#SPAWN.Spawn} and @{#SPAWN.ReSpawn} return a @{GROUP#GROUP.New} object, that contains a reference to the DCSGroup object. -- You can use the @{GROUP} object to do further actions with the DCSGroup. -- --- 1.4) SPAWN object cleaning +-- 1.4) Retrieve alive GROUPs spawned by the SPAWN object +-- ------------------------------------------------------ +-- The SPAWN class administers which GROUPS it has reserved (in stock) or has created during mission execution. +-- Every time a SPAWN object spawns a new GROUP object, a reference to the GROUP object is added to an internal table of GROUPS. +-- SPAWN provides methods to iterate through that internal GROUP object reference table: +-- +-- * @{#SPAWN.GetFirstAliveGroup}: Will find the first alive GROUP it has spawned, and return the alive GROUP object and the first Index where the first alive GROUP object has been found. +-- * @{#SPAWN.GetNextAliveGroup}: Will find the next alive GROUP object from a given Index, and return a reference to the alive GROUP object and the next Index where the alive GROUP has been found. +-- * @{#SPAWN.GetLastAliveGroup}: Will find the last alive GROUP object, and will return a reference to the last live GROUP object and the last Index where the last alive GROUP object has been found. +-- +-- You can use the methods @{#SPAWN.GetFirstAliveGroup} and sequently @{#SPAWN.GetNextAliveGroup} to iterate through the alive GROUPS within the SPAWN object, and to actions... See the respective methods for an example. +-- The method @{#SPAWN.GetGroupFromIndex} will return the GROUP object reference from the given Index, dead or alive... +-- +-- 1.5) SPAWN object cleaning -- -------------------------- -- Sometimes, it will occur during a mission run-time, that ground or especially air objects get damaged, and will while being damged stop their activities, while remaining alive. -- In such cases, the SPAWN object will just sit there and wait until that group gets destroyed, but most of the time it won't, @@ -727,19 +740,24 @@ function SPAWN:SpawnGroupName( SpawnIndex ) end ---- Find the first alive group. +--- Will find the first alive GROUP it has spawned, and return the alive GROUP object and the first Index where the first alive GROUP object has been found. -- @param #SPAWN self --- @param #number SpawnCursor A number holding the index from where to find the first group from. --- @return Group#GROUP, #number The group found, the new index where the group was found. +-- @return Group#GROUP, #number The GROUP object found, the new Index where the group was found. -- @return #nil, #nil When no group is found, #nil is returned. -function SPAWN:GetFirstAliveGroup( SpawnCursor ) - self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnCursor } ) +-- @usage +-- -- Find the first alive GROUP object of the SpawnPlanes SPAWN object GROUP collection that it has spawned during the mission. +-- local GroupPlane, Index = SpawnPlanes:GetFirstAliveGroup() +-- while GroupPlane ~= nil do +-- -- Do actions with the GroupPlane object. +-- GroupPlane, Index = SpawnPlanes:GetNextAliveGroup( Index ) +-- end +function SPAWN:GetFirstAliveGroup() + self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix } ) for SpawnIndex = 1, self.SpawnCount do local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) if SpawnGroup and SpawnGroup:IsAlive() then - SpawnCursor = SpawnIndex - return SpawnGroup, SpawnCursor + return SpawnGroup, SpawnIndex end end @@ -747,27 +765,42 @@ function SPAWN:GetFirstAliveGroup( SpawnCursor ) end ---- Find the next alive group. +--- Will find the next alive GROUP object from a given Index, and return a reference to the alive GROUP object and the next Index where the alive GROUP has been found. -- @param #SPAWN self --- @param #number SpawnCursor A number holding the last found previous index. --- @return Group#GROUP, #number The group found, the new index where the group was found. --- @return #nil, #nil When no group is found, #nil is returned. -function SPAWN:GetNextAliveGroup( SpawnCursor ) - self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnCursor } ) +-- @param #number SpawnIndexStart A Index holding the start position to search from. This function can also be used to find the first alive GROUP object from the given Index. +-- @return Group#GROUP, #number The next alive GROUP object found, the next Index where the next alive GROUP object was found. +-- @return #nil, #nil When no alive GROUP object is found from the start Index position, #nil is returned. +-- @usage +-- -- Find the first alive GROUP object of the SpawnPlanes SPAWN object GROUP collection that it has spawned during the mission. +-- local GroupPlane, Index = SpawnPlanes:GetFirstAliveGroup() +-- while GroupPlane ~= nil do +-- -- Do actions with the GroupPlane object. +-- GroupPlane, Index = SpawnPlanes:GetNextAliveGroup( Index ) +-- end +function SPAWN:GetNextAliveGroup( SpawnIndexStart ) + self:F( { self.SpawnTemplatePrefix, self.SpawnAliasPrefix, SpawnIndexStart } ) - SpawnCursor = SpawnCursor + 1 - for SpawnIndex = SpawnCursor, self.SpawnCount do + SpawnIndexStart = SpawnIndexStart + 1 + for SpawnIndex = SpawnIndexStart, self.SpawnCount do local SpawnGroup = self:GetGroupFromIndex( SpawnIndex ) if SpawnGroup and SpawnGroup:IsAlive() then - SpawnCursor = SpawnIndex - return SpawnGroup, SpawnCursor + return SpawnGroup, SpawnIndex end end return nil, nil end ---- Find the last alive group during runtime. +--- Will find the last alive GROUP object, and will return a reference to the last live GROUP object and the last Index where the last alive GROUP object has been found. +-- @param #SPAWN self +-- @return Group#GROUP, #number The last alive GROUP object found, the last Index where the last alive GROUP object was found. +-- @return #nil, #nil When no alive GROUP object is found, #nil is returned. +-- @usage +-- -- Find the last alive GROUP object of the SpawnPlanes SPAWN object GROUP collection that it has spawned during the mission. +-- local GroupPlane, Index = SpawnPlanes:GetLastAliveGroup() +-- if GroupPlane then -- GroupPlane can be nil!!! +-- -- Do actions with the GroupPlane object. +-- end function SPAWN:GetLastAliveGroup() self:F( { self.SpawnTemplatePrefixself.SpawnAliasPrefix } ) diff --git a/Moose Training/Document.bat b/Moose Training/Document.bat new file mode 100644 index 000000000..63ec378b2 --- /dev/null +++ b/Moose Training/Document.bat @@ -0,0 +1 @@ +luadocumentor --d "Documentation" --s "%1\Moose Training\Stylesheet\stylesheet.css" "%1\Moose Development\Moose" "%1\Moose Development\dcs" diff --git a/Moose Training/Documentation/Fac.html b/Moose Training/Documentation/Fac.html deleted file mode 100644 index 9fbb3c811..000000000 --- a/Moose Training/Documentation/Fac.html +++ /dev/null @@ -1,692 +0,0 @@ - - - - - - -
-
- -
-
-
-
- -
-

Module Fac

- -

This module contains the FAC classes.

- - - -
- -

1) Fac#FAC_BASE class, extends Base#BASE

-

The Fac#FAC_BASE class defines the core functions to report detected objects to clients. -Reportings can be done in several manners, and it is up to the derived classes if FAC_BASE to model the reporting behaviour.

- -

1.1) FAC_BASE constructor:

-

* Fac#FAC_BASE.New(): Create a new FAC_BASE instance.

- -

1.2) FAC_BASE reporting:

-

Derived FAC_BASE classes will reports detected units using the method Fac#FAC_BASE.ReportDetected(). This method implements polymorphic behaviour.

- -

The time interval in seconds of the reporting can be changed using the methods Fac#FAC_BASE.SetReportInterval(). -To control how long a reporting message is displayed, use Fac#FAC_BASE.SetReportDisplayTime(). -Derived classes need to implement the method Fac#FAC_BASE.GetReportDisplayTime() to use the correct display time for displayed messages during a report.

- -

Reporting can be started and stopped using the methods Fac#FAC_BASE.StartReporting() and Fac#FAC_BASE.StopReporting() respectively. -If an ad-hoc report is requested, use the method Fac#FAC_BASE().

- -

The default reporting interval is every 60 seconds. The reporting messages are displayed 15 seconds.

- -
- -

2) Fac#FAC_REPORTING class, extends Fac#FAC_BASE

-

The Fac#FAC_REPORTING class implements detected units reporting. Reporting can be controlled using the reporting methods available in the Fac#FAC_BASE class.

- -

2.1) FAC_REPORTING constructor:

-

The Fac#FAC_REPORTING.New() method creates a new FAC_REPORTING instance.

- -
- - -

Global(s)

- - - - - - - - - -
FAC_BASE - -
FAC_REPORTING - -
-

Type FAC_BASE

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FAC_BASE.ClassName - -
FAC_BASE.ClientSet -

The clients to which the FAC will report to.

-
FAC_BASE.Detection -

The DETECTION_BASE object that is used to report the detected objects.

-
FAC_BASE.FacScheduler - -
FAC_BASE:GetReportDisplayTime() -

Get the reporting message display time.

-
FAC_BASE:New(ClientSet, Detection) -

FAC constructor.

-
FAC_BASE:ReportDetected(DetectedSets) -

Reports the detected items to the Set#SET_CLIENT.

-
FAC_BASE:Schedule(DelayTime, ReportInterval) -

Schedule the FAC reporting.

-
FAC_BASE:SetReportDisplayTime(ReportDisplayTime) -

Set the reporting message display time.

-
FAC_BASE:SetReportInterval(ReportInterval) -

Set the reporting time interval.

-
FAC_BASE:_FacScheduler(SchedulerName) -

Report the detected Unit#UNITs detected within the DetectION#DETECTION_BASE object to the Set#SET_CLIENTs.

-
FAC_BASE._ReportDisplayTime - -
FAC_BASE._ReportInterval - -
FAC_BASE._ScheduleDelayTime - -
- -

Type FAC_REPORTING

- - - - - - - - - - - - - - - - - - - - - -
FAC_REPORTING.ClassName - -
FAC_REPORTING.ClientSet -

The clients to which the FAC will report to.

-
FAC_REPORTING.Detection -

The DETECTION_BASE object that is used to report the detected objects.

-
FAC_REPORTING:New(ClientSet, Detection) -

FAC_REPORTING constructor.

-
FAC_REPORTING:ReportDetected(Client, DetectedSets) -

Reports the detected items to the Set#SET_CLIENT.

-
- -

Global(s)

-
-
- - #FAC_BASE - -FAC_BASE - -
-
- - - -
-
-
-
- - #FAC_REPORTING - -FAC_REPORTING - -
-
- - - -
-
-

Type Fac

- -

Type FAC_BASE

- -

FAC_BASE class.

- -

Field(s)

-
-
- - #string - -FAC_BASE.ClassName - -
-
- - - -
-
-
-
- - Set#SET_CLIENT - -FAC_BASE.ClientSet - -
-
- -

The clients to which the FAC will report to.

- -
-
-
-
- - Detection#DETECTION_BASE - -FAC_BASE.Detection - -
-
- -

The DETECTION_BASE object that is used to report the detected objects.

- -
-
-
-
- - - -FAC_BASE.FacScheduler - -
-
- - - -
-
-
-
- - -FAC_BASE:GetReportDisplayTime() - -
-
- -

Get the reporting message display time.

- -

Return value

- -

#number: -ReportDisplayTime The display time in seconds when a report needs to be done.

- -
-
-
-
- - -FAC_BASE:New(ClientSet, Detection) - -
-
- -

FAC constructor.

- -

Parameters

- -

Return value

- -

#FAC_BASE: -self

- -
-
-
-
- - -FAC_BASE:ReportDetected(DetectedSets) - -
-
- -

Reports the detected items to the Set#SET_CLIENT.

- -

Parameter

- -

Return value

- -

#FAC_BASE: -self

- -
-
-
-
- - -FAC_BASE:Schedule(DelayTime, ReportInterval) - -
-
- -

Schedule the FAC reporting.

- -

Parameters

-
    -
  • - -

    #number DelayTime : -The delay in seconds to wait the reporting.

    - -
  • -
  • - -

    #number ReportInterval : -The repeat interval in seconds for the reporting to happen repeatedly.

    - -
  • -
-

Return value

- -

#FAC_BASE: -self

- -
-
-
-
- - -FAC_BASE:SetReportDisplayTime(ReportDisplayTime) - -
-
- -

Set the reporting message display time.

- -

Parameter

-
    -
  • - -

    #number ReportDisplayTime : -The display time in seconds when a report needs to be done.

    - -
  • -
-

Return value

- -

#FAC_BASE: -self

- -
-
-
-
- - -FAC_BASE:SetReportInterval(ReportInterval) - -
-
- -

Set the reporting time interval.

- -

Parameter

-
    -
  • - -

    #number ReportInterval : -The interval in seconds when a report needs to be done.

    - -
  • -
-

Return value

- -

#FAC_BASE: -self

- -
-
-
-
- - -FAC_BASE:_FacScheduler(SchedulerName) - -
-
- -

Report the detected Unit#UNITs detected within the DetectION#DETECTION_BASE object to the Set#SET_CLIENTs.

- -

Parameter

-
    -
  • - -

    SchedulerName :

    - -
  • -
-
-
-
-
- - - -FAC_BASE._ReportDisplayTime - -
-
- - - -
-
-
-
- - - -FAC_BASE._ReportInterval - -
-
- - - -
-
-
-
- - - -FAC_BASE._ScheduleDelayTime - -
-
- - - -
-
- -

Type FAC_REPORTING

- -

FAC_REPORTING class.

- -

Field(s)

-
-
- - #string - -FAC_REPORTING.ClassName - -
-
- - - -
-
-
-
- - Set#SET_CLIENT - -FAC_REPORTING.ClientSet - -
-
- -

The clients to which the FAC will report to.

- -
-
-
-
- - Detection#DETECTION_BASE - -FAC_REPORTING.Detection - -
-
- -

The DETECTION_BASE object that is used to report the detected objects.

- -
-
-
-
- - -FAC_REPORTING:New(ClientSet, Detection) - -
-
- -

FAC_REPORTING constructor.

- -

Parameters

- -

Return value

- -

#FAC_REPORTING: -self

- -
-
-
-
- - -FAC_REPORTING:ReportDetected(Client, DetectedSets) - -
-
- -

Reports the detected items to the Set#SET_CLIENT.

- -

Parameters

- -

Return value

- -

#boolean: -Return true if you want the reporting to continue... false will cancel the reporting loop.

- -
-
- -
- -
- - diff --git a/Moose Training/Documentation/Menu.html b/Moose Training/Documentation/Menu.html index ec4a345d6..106781eb9 100644 --- a/Moose Training/Documentation/Menu.html +++ b/Moose Training/Documentation/Menu.html @@ -801,7 +801,6 @@ Using this object reference, you can then remove ALL the menus and submenus unde --- @param Client#CLIENT MenuClient local function AddStatusMenu( MenuClient ) - env.info(MenuClient.ClientName) local MenuClientName = MenuClient:GetName() -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. MenuStatus[MenuClientName] = MENU_CLIENT:New( MenuClient, "Status for Planes" ) @@ -1383,7 +1382,6 @@ self

--- @param Group#GROUP MenuGroup local function AddStatusMenu( MenuGroup ) - env.info(MenuGroup.GroupName) local MenuGroupName = MenuGroup:GetName() -- This would create a menu for the red coalition under the MenuCoalitionRed menu object. MenuStatus[MenuGroupName] = MENU_GROUP:New( MenuGroup, "Status for Planes" ) diff --git a/Moose Training/Documentation/MissileTrainer.html b/Moose Training/Documentation/MissileTrainer.html index 56eb760b3..ec2503338 100644 --- a/Moose Training/Documentation/MissileTrainer.html +++ b/Moose Training/Documentation/MissileTrainer.html @@ -105,7 +105,7 @@ It suports the following functionality:

1.3) SPAWN spawning methods

@@ -163,7 +163,21 @@ So in principle, the group list will contain all parameters and configurations a

Note that SPAWN.Spawn and SPAWN.ReSpawn return a GROUP#GROUP.New object, that contains a reference to the DCSGroup object. You can use the GROUP object to do further actions with the DCSGroup.

-

1.4) SPAWN object cleaning

+

1.4) Retrieve alive GROUPs spawned by the SPAWN object

+

The SPAWN class administers which GROUPS it has reserved (in stock) or has created during mission execution. +Every time a SPAWN object spawns a new GROUP object, a reference to the GROUP object is added to an internal table of GROUPS. +SPAWN provides methods to iterate through that internal GROUP object reference table:

+ + + +

You can use the methods SPAWN.GetFirstAliveGroup and sequently SPAWN.GetNextAliveGroup to iterate through the alive GROUPS within the SPAWN object, and to actions... See the respective methods for an example. +The method SPAWN.GetGroupFromIndex will return the GROUP object reference from the given Index, dead or alive...

+ +

1.5) SPAWN object cleaning

Sometimes, it will occur during a mission run-time, that ground or especially air objects get damaged, and will while being damged stop their activities, while remaining alive. In such cases, the SPAWN object will just sit there and wait until that group gets destroyed, but most of the time it won't, and it may occur that no new groups are or can be spawned as limits are reached. @@ -218,9 +232,9 @@ Check the SPAWN.CleanUp for further info.

- SPAWN:GetFirstAliveGroup(SpawnCursor) + SPAWN:GetFirstAliveGroup() -

Find the first alive group.

+

Will find the first alive GROUP it has spawned, and return the alive GROUP object and the first Index where the first alive GROUP object has been found.

@@ -232,13 +246,13 @@ Check the SPAWN.CleanUp for further info.

SPAWN:GetLastAliveGroup() -

Find the last alive group during runtime.

+

Will find the last alive GROUP object, and will return a reference to the last live GROUP object and the last Index where the last alive GROUP object has been found.

- SPAWN:GetNextAliveGroup(SpawnCursor) + SPAWN:GetNextAliveGroup(SpawnIndexStart) -

Find the next alive group.

+

Will find the next alive GROUP object from a given Index, and return a reference to the alive GROUP object and the next Index where the alive GROUP has been found.

@@ -798,28 +812,19 @@ self

-SPAWN:GetFirstAliveGroup(SpawnCursor) +SPAWN:GetFirstAliveGroup()
-

Find the first alive group.

+

Will find the first alive GROUP it has spawned, and return the alive GROUP object and the first Index where the first alive GROUP object has been found.

-

Parameter

-
    -
  • - -

    #number SpawnCursor : -A number holding the index from where to find the first group from.

    - -
  • -

Return values

  1. Group#GROUP, #number: -The group found, the new index where the group was found.

    +The GROUP object found, the new Index where the group was found.

  2. @@ -829,6 +834,14 @@ When no group is found, #nil is returned.

+

Usage:

+
-- Find the first alive GROUP object of the SpawnPlanes SPAWN object GROUP collection that it has spawned during the mission.
+local GroupPlane, Index = SpawnPlanes:GetFirstAliveGroup()
+while GroupPlane ~= nil do
+  -- Do actions with the GroupPlane object.
+  GroupPlane, Index = SpawnPlanes:GetNextAliveGroup( Index )
+end
+
@@ -871,7 +884,29 @@ self

-

Find the last alive group during runtime.

+

Will find the last alive GROUP object, and will return a reference to the last live GROUP object and the last Index where the last alive GROUP object has been found.

+ +

Return values

+
    +
  1. + +

    Group#GROUP, #number: +The last alive GROUP object found, the last Index where the last alive GROUP object was found.

    + +
  2. +
  3. + +

    #nil, #nil: +When no alive GROUP object is found, #nil is returned.

    + +
  4. +
+

Usage:

+
-- Find the last alive GROUP object of the SpawnPlanes SPAWN object GROUP collection that it has spawned during the mission.
+local GroupPlane, Index = SpawnPlanes:GetLastAliveGroup()
+if GroupPlane then -- GroupPlane can be nil!!!
+  -- Do actions with the GroupPlane object.
+end
@@ -879,19 +914,19 @@ self

-SPAWN:GetNextAliveGroup(SpawnCursor) +SPAWN:GetNextAliveGroup(SpawnIndexStart)
-

Find the next alive group.

+

Will find the next alive GROUP object from a given Index, and return a reference to the alive GROUP object and the next Index where the alive GROUP has been found.

Parameter

  • -

    #number SpawnCursor : -A number holding the last found previous index.

    +

    #number SpawnIndexStart : +A Index holding the start position to search from. This function can also be used to find the first alive GROUP object from the given Index.

@@ -900,16 +935,24 @@ A number holding the last found previous index.

  • Group#GROUP, #number: -The group found, the new index where the group was found.

    +The next alive GROUP object found, the next Index where the next alive GROUP object was found.

  • #nil, #nil: -When no group is found, #nil is returned.

    +When no alive GROUP object is found from the start Index position, #nil is returned.

  • +

    Usage:

    +
    -- Find the first alive GROUP object of the SpawnPlanes SPAWN object GROUP collection that it has spawned during the mission.
    +local GroupPlane, Index = SpawnPlanes:GetFirstAliveGroup()
    +while GroupPlane ~= nil do
    +  -- Do actions with the GroupPlane object.
    +  GroupPlane, Index = SpawnPlanes:GetNextAliveGroup( Index )
    +end
    +