Module Set

This module contains the SET classes.


1) Set#SET_BASE class, extending Base#BASE

The Set#SET_BASE class defines the core functions that define a collection of objects.


2) Set#SET_GROUP class, extending 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 methods:

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

2.2) 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:

Planned filter criteria within development are (so these are not yet available):

2.3) 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:


3) Set#SET_UNIT class, extending 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 methods:

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

3.2) 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.3) 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:

Planned iterators methods in development are (so these are not yet available):


Global(s)

SET_BASE
SET_GROUP
SET_UNIT

Type SET_BASE

SET_BASE.ClassName
SET_BASE.Database
SET_BASE:Flush()

Flushes the current SET_BASE contents in the log ...

SET_BASE:ForEach(IteratorFunction, arg, Set, Function, FunctionArguments)

Interate the SET_BASE and call an interator function for the given set, providing the Object for each element within the set and optional parameters.

SET_BASE:IsIncludeObject(Object)

Decides whether to include the Object

SET_BASE:New(Database)

Creates a new SET_BASE object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.

SET_BASE.Set
SET_BASE:_Add(ObjectName, Object)

Adds a Object based on the Object Name.

SET_BASE:_EventOnBirth(Event)

Handles the OnBirth event for the Set.

SET_BASE:_EventOnDeadOrCrash(Event)

Handles the OnDead or OnCrash event for alive units set.

SET_BASE:_FilterStart()

Starts the filtering for the defined collection.

SET_BASE:_Find(ObjectName)

Finds an Object based on the Object Name.

Type SET_GROUP

SET_GROUP:AddInDatabase(Event)

Handles the Database to check on an event (birth) that the Object was added in the Database.

SET_GROUP.ClassName
SET_GROUP.Filter
SET_GROUP:FilterCategories(Categories)

Builds a set of groups out of categories.

SET_GROUP:FilterCoalitions(Coalitions)

Builds a set of groups of coalitions.

SET_GROUP:FilterCountries(Countries)

Builds a set of groups of defined countries.

SET_GROUP.FilterMeta
SET_GROUP:FilterPrefixes(Prefixes)

Builds a set of groups of defined GROUP prefixes.

SET_GROUP:FilterStart()

Starts the filtering.

SET_GROUP:FindGroup(GroupName)

Finds a Group based on the Group Name.

SET_GROUP:FindInDatabase(Event)

Handles the Database to check on any event that Object exists in the Database.

SET_GROUP:ForEachGroup(IteratorFunction, ...)

Iterate the SET_GROUP and call an iterator function for each alive GROUP, providing the GROUP and optional parameters.

SET_GROUP:ForEachGroupCompletelyInZone(ZoneObject, IteratorFunction, ...)

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(ZoneObject, IteratorFunction, ...)

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.

SET_GROUP:ForEachGroupPartlyInZone(ZoneObject, IteratorFunction, ...)

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:IsIncludeObject(MooseGroup)
SET_GROUP:New()

Creates a new SET_GROUP object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.

Type SET_UNIT

SET_UNIT:AddInDatabase(Event)

Handles the Database to check on an event (birth) that the Object was added in the Database.

SET_UNIT.ClassName
SET_UNIT.Filter
SET_UNIT:FilterCategories(Categories)

Builds a set of units out of categories.

SET_UNIT:FilterCoalitions(Coalitions)

Builds a set of units of coalitions.

SET_UNIT:FilterCountries(Countries)

Builds a set of units of defined countries.

SET_UNIT.FilterMeta
SET_UNIT:FilterPrefixes(Prefixes)

Builds a set of units of defined unit prefixes.

SET_UNIT:FilterStart()

Starts the filtering.

SET_UNIT:FilterTypes(Types)

Builds a set of units of defined unit types.

SET_UNIT:FindInDatabase(Event)

Handles the Database to check on any event that Object exists in the Database.

SET_UNIT:FindUnit(UnitName)

Finds a Unit based on the Unit Name.

SET_UNIT:ForEachUnit(IteratorFunction, ...)

Interate the SET_UNIT and call an interator function for each alive UNIT, providing the UNIT and optional parameters.

SET_UNIT:IsIncludeObject(MUnit)
SET_UNIT:New()

Creates a new SET_UNIT object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.

SET_UNIT.Units

Global(s)

#SET_BASE SET_BASE
#SET_GROUP SET_GROUP
#SET_UNIT SET_UNIT

Type Set

Type SET_BASE

SET_BASE class

Field(s)

#string SET_BASE.ClassName
SET_BASE.Database
SET_BASE:Flush()

Flushes the current SET_BASE contents in the log ...

(for debug reasons).

Return value

#string: A string with the names of the objects.

SET_BASE:ForEach(IteratorFunction, arg, Set, Function, FunctionArguments)

Interate the SET_BASE and call an interator function for the given set, providing the Object for each element within the set and optional parameters.

Parameters

  • #function IteratorFunction : The function that will be called when there is an alive player in the SET_BASE.

  • arg :

  • Set :

  • Function :

  • FunctionArguments :

Return value

#SET_BASE: self

SET_BASE:IsIncludeObject(Object)

Decides whether to include the Object

Parameter

  • #table Object :

Return value

#SET_BASE: self

SET_BASE:New(Database)

Creates a new SET_BASE object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.

Parameter

  • Database :

Return value

#SET_BASE:

Usage:

-- Define a new SET_BASE Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
DBObject = SET_BASE:New()
SET_BASE.Set
SET_BASE:_Add(ObjectName, Object)

Adds a Object based on the Object Name.

Parameters

  • #string ObjectName :

  • #table Object :

Return value

#table: The added Object.

SET_BASE:_EventOnBirth(Event)

Handles the OnBirth event for the Set.

Parameter

SET_BASE:_EventOnDeadOrCrash(Event)

Handles the OnDead or OnCrash event for alive units set.

Parameter

SET_BASE:_FilterStart()

Starts the filtering for the defined collection.

Return value

#SET_BASE: self

SET_BASE:_Find(ObjectName)

Finds an Object based on the Object Name.

Parameter

  • #string ObjectName :

Return value

#table: The Object found.

Type SET_GROUP

SET_GROUP class

Field(s)

SET_GROUP:AddInDatabase(Event)

Handles the Database to check on an event (birth) that the Object was added in the Database.

This is required, because sometimes the DATABASE birth event gets called later than the SETBASE birth event!

Parameter

Return values

  1. #string: The name of the GROUP

  2. #table: The GROUP

#string SET_GROUP.ClassName
SET_GROUP.Filter
SET_GROUP:FilterCategories(Categories)

Builds a set of groups out of categories.

Possible current categories are plane, helicopter, ground, ship.

Parameter

  • #string Categories : Can take the following values: "plane", "helicopter", "ground", "ship".

Return value

#SET_GROUP: self

SET_GROUP:FilterCoalitions(Coalitions)

Builds a set of groups of coalitions.

Possible current coalitions are red, blue and neutral.

Parameter

  • #string Coalitions : Can take the following values: "red", "blue", "neutral".

Return value

#SET_GROUP: self

SET_GROUP:FilterCountries(Countries)

Builds a set of groups of defined countries.

Possible current countries are those known within DCS world.

Parameter

  • #string Countries : Can take those country strings known within DCS world.

Return value

#SET_GROUP: self

SET_GROUP.FilterMeta
SET_GROUP:FilterPrefixes(Prefixes)

Builds a set of groups of defined GROUP prefixes.

All the groups starting with the given prefixes will be included within the set.

Parameter

  • #string Prefixes : The prefix of which the group name starts with.

Return value

#SET_GROUP: self

SET_GROUP:FilterStart()

Starts the filtering.

Return value

#SET_GROUP: self

SET_GROUP:FindGroup(GroupName)

Finds a Group based on the Group Name.

Parameter

  • #string GroupName :

Return value

Group#GROUP: The found Group.

SET_GROUP:FindInDatabase(Event)

Handles the Database to check on any event that Object exists in the Database.

This is required, because sometimes the DATABASE event gets called later than the SETBASE event or vise versa!

Parameter

Return values

  1. #string: The name of the GROUP

  2. #table: The GROUP

SET_GROUP:ForEachGroup(IteratorFunction, ...)

Iterate the SET_GROUP and call an iterator function for each alive GROUP, providing the GROUP and optional parameters.

Parameters

  • #function IteratorFunction : The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.

  • ... :

Return value

#SET_GROUP: self

SET_GROUP:ForEachGroupCompletelyInZone(ZoneObject, IteratorFunction, ...)

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.

Parameters

  • Zone#ZONE ZoneObject : The Zone to be tested for.

  • #function IteratorFunction : The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.

  • ... :

Return value

#SET_GROUP: self

SET_GROUP:ForEachGroupNotInZone(ZoneObject, IteratorFunction, ...)

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.

Parameters

  • Zone#ZONE ZoneObject : The Zone to be tested for.

  • #function IteratorFunction : The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.

  • ... :

Return value

#SET_GROUP: self

SET_GROUP:ForEachGroupPartlyInZone(ZoneObject, IteratorFunction, ...)

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.

Parameters

  • Zone#ZONE ZoneObject : The Zone to be tested for.

  • #function IteratorFunction : The function that will be called when there is an alive GROUP in the SET_GROUP. The function needs to accept a GROUP parameter.

  • ... :

Return value

#SET_GROUP: self

SET_GROUP:IsIncludeObject(MooseGroup)

Parameter

Return value

#SET_GROUP: self

SET_GROUP:New()

Creates a new SET_GROUP object, building a set of groups belonging to a coalitions, categories, countries, types or with defined prefix names.

Return value

#SET_GROUP:

Usage:

-- Define a new SET_GROUP Object. This DBObject will contain a reference to all alive GROUPS.
DBObject = SET_GROUP:New()

Type SET_UNIT

SET_UNIT class

Field(s)

SET_UNIT:AddInDatabase(Event)

Handles the Database to check on an event (birth) that the Object was added in the Database.

This is required, because sometimes the DATABASE birth event gets called later than the SETBASE birth event!

Parameter

Return values

  1. #string: The name of the UNIT

  2. #table: The UNIT

#string SET_UNIT.ClassName
SET_UNIT.Filter
SET_UNIT:FilterCategories(Categories)

Builds a set of units out of categories.

Possible current categories are plane, helicopter, ground, ship.

Parameter

  • #string Categories : Can take the following values: "plane", "helicopter", "ground", "ship".

Return value

#SET_UNIT: self

SET_UNIT:FilterCoalitions(Coalitions)

Builds a set of units of coalitions.

Possible current coalitions are red, blue and neutral.

Parameter

  • #string Coalitions : Can take the following values: "red", "blue", "neutral".

Return value

#SET_UNIT: self

SET_UNIT:FilterCountries(Countries)

Builds a set of units of defined countries.

Possible current countries are those known within DCS world.

Parameter

  • #string Countries : Can take those country strings known within DCS world.

Return value

#SET_UNIT: self

SET_UNIT.FilterMeta
SET_UNIT:FilterPrefixes(Prefixes)

Builds a set of units of defined unit prefixes.

All the units starting with the given prefixes will be included within the set.

Parameter

  • #string Prefixes : The prefix of which the unit name starts with.

Return value

#SET_UNIT: self

SET_UNIT:FilterStart()

Starts the filtering.

Return value

#SET_UNIT: self

SET_UNIT:FilterTypes(Types)

Builds a set of units of defined unit types.

Possible current types are those types known within DCS world.

Parameter

  • #string Types : Can take those type strings known within DCS world.

Return value

#SET_UNIT: self

SET_UNIT:FindInDatabase(Event)

Handles the Database to check on any event that Object exists in the Database.

This is required, because sometimes the DATABASE event gets called later than the SETBASE event or vise versa!

Parameter

Return values

  1. #string: The name of the UNIT

  2. #table: The UNIT

SET_UNIT:FindUnit(UnitName)

Finds a Unit based on the Unit Name.

Parameter

  • #string UnitName :

Return value

Unit#UNIT: The found Unit.

SET_UNIT:ForEachUnit(IteratorFunction, ...)

Interate the SET_UNIT and call an interator function for each alive UNIT, providing the UNIT and optional parameters.

Parameters

  • #function IteratorFunction : The function that will be called when there is an alive UNIT in the SET_UNIT. The function needs to accept a UNIT parameter.

  • ... :

Return value

#SET_UNIT: self

SET_UNIT:IsIncludeObject(MUnit)

Parameter

Return value

#SET_UNIT: self

SET_UNIT:New()

Creates a new SET_UNIT object, building a set of units belonging to a coalitions, categories, countries, types or with defined prefix names.

Return value

#SET_UNIT:

Usage:

-- Define a new SET_UNIT Object. This DBObject will contain a reference to all alive Units.
DBObject = SET_UNIT:New()
SET_UNIT.Units