From 6126ec94501cfe9ac8d6557c76bec81c6f1bc964 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Fri, 23 Jun 2017 08:14:02 +0200 Subject: [PATCH] Fixes bug in SET_GROUP Was unable to filter on category "ground". Fixed now. --- Moose Development/Moose/Core/Set.lua | 63 ++++++++++-- docs/Documentation/AI_Patrol.html | 3 + docs/Documentation/Cargo.html | 1 - docs/Documentation/Detection.html | 2 - docs/Documentation/Set.html | 143 +++++++++++++++++++++++++-- docs/Documentation/Spawn.html | 32 ++++-- docs/Documentation/SpawnStatic.html | 1 + docs/Documentation/Task_Cargo.html | 3 +- 8 files changed, 226 insertions(+), 22 deletions(-) diff --git a/Moose Development/Moose/Core/Set.lua b/Moose Development/Moose/Core/Set.lua index d171e104d..eed59c0bc 100644 --- a/Moose Development/Moose/Core/Set.lua +++ b/Moose Development/Moose/Core/Set.lua @@ -584,7 +584,7 @@ end --- @type SET_GROUP -- @extends Core.Set#SET_BASE ---- # 2) SET_GROUP class, extends @{Set#SET_BASE} +--- # SET_GROUP class, extends @{Set#SET_BASE} -- -- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain: -- @@ -593,18 +593,18 @@ end -- * Countries -- * Starting with certain prefix strings. -- --- ## 2.1) SET_GROUP constructor +-- ## 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 +-- ## 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 +-- ## 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: @@ -613,6 +613,15 @@ end -- * @{#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). +-- +-- For the Category Filter, extra methods have been added: +-- +-- * @{#SET_GROUP.FilterCategoryAirplane}: Builds the SET_GROUP from airplanes. +-- * @{#SET_GROUP.FilterCategoryHelicopter}: Builds the SET_GROUP from helicopters. +-- * @{#SET_GROUP.FilterCategoryGround}: Builds the SET_GROUP from ground vehicles or infantry. +-- * @{#SET_GROUP.FilterCategoryShip}: Builds the SET_GROUP from ships. +-- * @{#SET_GROUP.FilterCategoryStructure}: Builds the SET_GROUP from structures. +-- -- -- Once the filter criteria have been set for the SET_GROUP, you can start filtering using: -- @@ -622,7 +631,7 @@ end -- -- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}. -- --- ## 2.4) SET_GROUP iterators +-- ## 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. @@ -652,7 +661,7 @@ SET_GROUP = { Categories = { plane = Group.Category.AIRPLANE, helicopter = Group.Category.HELICOPTER, - ground = Group.Category.GROUND_UNIT, + ground = Group.Category.GROUND, -- R2.2 ship = Group.Category.SHIP, structure = Group.Category.STRUCTURE, }, @@ -781,6 +790,48 @@ function SET_GROUP:FilterCategories( Categories ) return self end +--- Builds a set of groups out of ground category. +-- @param #SET_GROUP self +-- @return #SET_GROUP self +function SET_GROUP:FilterCategoryGround() + self:FilterCategories( "ground" ) + return self +end + +--- Builds a set of groups out of airplane category. +-- @param #SET_GROUP self +-- @return #SET_GROUP self +function SET_GROUP:FilterCategoryAirplane() + self:FilterCategories( "airplane" ) + return self +end + +--- Builds a set of groups out of helicopter category. +-- @param #SET_GROUP self +-- @return #SET_GROUP self +function SET_GROUP:FilterCategoryHelicopter() + self:FilterCategories( "helicopter" ) + return self +end + +--- Builds a set of groups out of ship category. +-- @param #SET_GROUP self +-- @return #SET_GROUP self +function SET_GROUP:FilterCategoryShip() + self:FilterCategories( "ship" ) + return self +end + +--- Builds a set of groups out of structure category. +-- @param #SET_GROUP self +-- @return #SET_GROUP self +function SET_GROUP:FilterCategoryStructure() + self:FilterCategories( "structure" ) + return self +end + + + --- Builds a set of groups of defined countries. -- Possible current countries are those known within DCS world. -- @param #SET_GROUP self diff --git a/docs/Documentation/AI_Patrol.html b/docs/Documentation/AI_Patrol.html index 93a9f8ce6..43392b308 100644 --- a/docs/Documentation/AI_Patrol.html +++ b/docs/Documentation/AI_Patrol.html @@ -926,6 +926,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 d774a472f..262969991 100644 --- a/docs/Documentation/Cargo.html +++ b/docs/Documentation/Cargo.html @@ -3059,7 +3059,6 @@ The range till cargo will board.

- #number CARGO_UNIT.RunCount diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html index 141b7d951..1754d0aa0 100644 --- a/docs/Documentation/Detection.html +++ b/docs/Documentation/Detection.html @@ -2393,7 +2393,6 @@ The index of the DetectedItem.

- #number DETECTION_BASE.DetectedItemCount @@ -2407,7 +2406,6 @@ The index of the DetectedItem.

- #number DETECTION_BASE.DetectedItemMax diff --git a/docs/Documentation/Set.html b/docs/Documentation/Set.html index 7376db505..cde3e33b5 100644 --- a/docs/Documentation/Set.html +++ b/docs/Documentation/Set.html @@ -216,7 +216,7 @@ SET_GROUP -

2) SET_GROUP class, extends Set#SET_BASE

+

SET_GROUP class, extends Set#SET_BASE

Mission designers can use the Set#SET_GROUP class to build sets of groups belonging to certain:

@@ -785,6 +785,36 @@ provides an easy to use shortcut...

SET_GROUP:FilterCategories(Categories)

Builds a set of groups out of categories.

+ + + + SET_GROUP:FilterCategoryAirplane() + +

Builds a set of groups out of airplane category.

+ + + + SET_GROUP:FilterCategoryGround() + +

Builds a set of groups out of ground category.

+ + + + SET_GROUP:FilterCategoryHelicopter() + +

Builds a set of groups out of helicopter category.

+ + + + SET_GROUP:FilterCategoryShip() + +

Builds a set of groups out of ship category.

+ + + + SET_GROUP:FilterCategoryStructure() + +

Builds a set of groups out of structure category.

@@ -1312,7 +1342,7 @@ The following iterator methods are currently available within the SETCLIENT
-

2) SET_GROUP class, extends Set#SET_BASE

+

SET_GROUP class, extends Set#SET_BASE

Mission designers can use the Set#SET_GROUP class to build sets of groups belonging to certain:

@@ -1325,7 +1355,7 @@ The following iterator methods are currently available within the SETCLIENT

-

2.1) SET_GROUP constructor

+

1. SET_GROUP constructor

Create a new SET_GROUP object with the SET_GROUP.New method:

@@ -1333,12 +1363,12 @@ The following iterator methods are currently available within the SETCLIENT
  • SET_GROUP.New: Creates a new SET_GROUP object.
  • -

    2.2) Add or Remove GROUP(s) from SET_GROUP

    +

    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

    +

    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:

    @@ -1350,6 +1380,17 @@ Filter criteria are defined by:

  • SET_GROUP.FilterPrefixes: Builds the SET_GROUP with the groups starting with the same prefix string(s).
  • +

    For the Category Filter, extra methods have been added:

    + + + +

    Once the filter criteria have been set for the SET_GROUP, you can start filtering using:

    -

    2.4) SET_GROUP iterators

    +

    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. @@ -3836,6 +3877,96 @@ self

    + +SET_GROUP:FilterCategoryAirplane() + +
    +
    + +

    Builds a set of groups out of airplane category.

    + +

    Return value

    + +

    #SET_GROUP: +self

    + +
    +
    +
    +
    + + +SET_GROUP:FilterCategoryGround() + +
    +
    + +

    Builds a set of groups out of ground category.

    + +

    Return value

    + +

    #SET_GROUP: +self

    + +
    +
    +
    +
    + + +SET_GROUP:FilterCategoryHelicopter() + +
    +
    + +

    Builds a set of groups out of helicopter category.

    + +

    Return value

    + +

    #SET_GROUP: +self

    + +
    +
    +
    +
    + + +SET_GROUP:FilterCategoryShip() + +
    +
    + +

    Builds a set of groups out of ship category.

    + +

    Return value

    + +

    #SET_GROUP: +self

    + +
    +
    +
    +
    + + +SET_GROUP:FilterCategoryStructure() + +
    +
    + +

    Builds a set of groups out of structure category.

    + +

    Return value

    + +

    #SET_GROUP: +self

    + +
    +
    +
    +
    + SET_GROUP:FilterCoalitions(Coalitions) diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html index 2540b5685..84f7c4122 100644 --- a/docs/Documentation/Spawn.html +++ b/docs/Documentation/Spawn.html @@ -822,6 +822,12 @@ and any spaces before and after the resulting name are removed.

    SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) + + + + SPAWN.uncontrolled + + @@ -2194,6 +2200,9 @@ The group that was spawned. You can use this group for further actions.

    + +

    Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.

    +
    @@ -2740,9 +2749,6 @@ when nothing was spawned.

    - -

    By default, no InitLimit

    -
    @@ -2778,7 +2784,7 @@ when nothing was spawned.

    - #number + SPAWN.SpawnMaxGroups @@ -2795,7 +2801,7 @@ when nothing was spawned.

    - #number + SPAWN.SpawnMaxUnitsAlive @@ -3123,7 +3129,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
    - + #boolean SPAWN.SpawnUnControlled @@ -3727,6 +3733,20 @@ True = Continue Scheduler

    + +
    +
    +
    + + + +SPAWN.uncontrolled + +
    +
    + + +
    diff --git a/docs/Documentation/SpawnStatic.html b/docs/Documentation/SpawnStatic.html index bc91b9624..d8aa5e633 100644 --- a/docs/Documentation/SpawnStatic.html +++ b/docs/Documentation/SpawnStatic.html @@ -436,6 +436,7 @@ ptional) The name of the new static.

    + #number SPAWNSTATIC.SpawnIndex diff --git a/docs/Documentation/Task_Cargo.html b/docs/Documentation/Task_Cargo.html index 34472761b..686daa411 100644 --- a/docs/Documentation/Task_Cargo.html +++ b/docs/Documentation/Task_Cargo.html @@ -510,7 +510,7 @@ based on the tasking capabilities defined in Task#TA
    - + Core.Cargo#CARGO_GROUP FSM_PROCESS.Cargo @@ -524,6 +524,7 @@ based on the tasking capabilities defined in Task#TA
    + FSM_PROCESS.DeployZone