Module Set

Manage sets of units and groups.

#Set class

Mission designers can use the SET class to build sets of units belonging to certain:

  • Coalitions
  • Categories
  • Countries
  • Unit types
  • Starting with certain prefix strings.

This list will grow over time. Planned developments are to include filters and iterators. Additional filters will be added around Zone#ZONEs, Radiuses, Active players, ... More iterators will be implemented in the near future ...

Administers the Initial Sets of the Mission Templates as defined within the Mission Editor.

SET construction methods:

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

  • SET.New: Creates a new SET object.

SET filter criteria:

You can set filter criteria to define the set of units within the SET. Filter criteria are defined by:

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

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

SET iterators:

Once the filters have been defined and the SET has been built, you can iterate the SET with the available iterator methods. The iterator methods will walk the SET set, and call for each element within the set a function that you provide. The following iterator methods are currently available within the SET:

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


Global(s)

SET

Type SET

SET:AddUnit(UnitToAdd)

Finds a Unit based on the Unit Name.

SET.ClassName
SET.Clients
SET.ClientsAlive
SET.DCSGroups
SET.DCSGroupsAlive
SET.DCSUnits
SET.DCSUnitsAlive
SET.Filter
SET:FilterCategories(Categories)

Builds a set of units out of categories.

SET:FilterCoalitions(Coalitions)

Builds a set of units of coalitons.

SET:FilterCountries(Countries)

Builds a set of units of defined countries.

SET:FilterGroupPrefixes(Prefixes)

Builds a set of units of defined group prefixes.

SET.FilterMeta
SET:FilterStart()

Starts the filtering.

SET:FilterTypes(Types)

Builds a set of units of defined unit types.

SET:FilterUnitPrefixes(Prefixes)

Builds a set of units of defined unit prefixes.

SET:FindUnit(UnitName)

Finds a Unit based on the Unit Name.

SET:ForEach(IteratorFunction, arg, Set)

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

SET:ForEachClient(IteratorFunction, ...)

Interate the SET and call an interator function for each client, providing the Client to the function and optional parameters.

SET:ForEachDCSUnitAlive(IteratorFunction, ...)

Interate the SET and call an interator function for each alive unit, providing the Unit and optional parameters.

SET:ForEachPlayer(IteratorFunction, ...)

Interate the SET and call an interator function for each alive player, providing the Unit of the player and optional parameters.

SET.Groups
SET.GroupsAlive
SET.NavPoints
SET:New()

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

SET.Players
SET.PlayersAlive
SET:ScanEnvironment()
SET.Statics
SET.Templates
SET:TraceDatabase()

Traces the current SET contents in the log ...

SET.Units
SET.UnitsAlive
SET:_EventOnBirth(Event)

Handles the OnBirth event for the alive units set.

SET:_EventOnDeadOrCrash(Event)

Handles the OnDead or OnCrash event for alive units set.

SET:_EventOnPlayerEnterUnit(Event)

Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).

SET:_EventOnPlayerLeaveUnit(Event)

Handles the OnPlayerLeaveUnit event to clean the active players table.

SET:_IsAliveDCSGroup(DCSGroup)
SET:_IsAliveDCSUnit(DCSUnit)
SET:_IsIncludeDCSUnit(DCSUnit)
SET:_RegisterDatabase()

Private method that registers all datapoints within in the mission.

SET:_RegisterPlayers()

Private method that registers all alive players in the mission.

Global(s)

#SET SET

Type Set

Type SET

SET class

Field(s)

SET:AddUnit(UnitToAdd)

Finds a Unit based on the Unit Name.

Parameter

Return value

Unit#UNIT: The added Unit.

#string SET.ClassName
SET.Clients
SET.ClientsAlive
SET.DCSGroups
SET.DCSGroupsAlive
SET.DCSUnits
SET.DCSUnitsAlive
SET.Filter
SET: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: self

SET:FilterCoalitions(Coalitions)

Builds a set of units of coalitons.

Possible current coalitions are red, blue and neutral.

Parameter

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

Return value

#SET: self

SET: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: self

SET:FilterGroupPrefixes(Prefixes)

Builds a set of units of defined group prefixes.

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

Parameter

  • #string Prefixes : The prefix of which the group name where the unit belongs to starts with.

Return value

#SET: self

SET.FilterMeta
SET:FilterStart()

Starts the filtering.

Return value

#SET: self

SET: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: self

SET:FilterUnitPrefixes(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: self

SET:FindUnit(UnitName)

Finds a Unit based on the Unit Name.

Parameter

  • #string UnitName :

Return value

Unit#UNIT: The found Unit.

SET:ForEach(IteratorFunction, arg, Set)

Interate the SET 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.

  • arg :

  • Set :

Return value

#SET: self

SET:ForEachClient(IteratorFunction, ...)

Interate the SET and call an interator function for each client, providing the Client to the function and optional parameters.

Parameters

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

  • ... :

Return value

#SET: self

SET:ForEachDCSUnitAlive(IteratorFunction, ...)

Interate the SET 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. The function needs to accept a UNIT parameter.

  • ... :

Return value

#SET: self

SET:ForEachPlayer(IteratorFunction, ...)

Interate the SET and call an interator function for each alive player, providing the Unit of the player and optional parameters.

Parameters

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

  • ... :

Return value

#SET: self

SET.Groups
SET.GroupsAlive
SET.NavPoints
SET:New()

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

Return value

#SET:

Usage:

-- Define a new SET Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
DBObject = SET:New()
SET.Players
SET.PlayersAlive
SET:ScanEnvironment()
SET.Statics
SET.Templates
SET:TraceDatabase()

Traces the current SET contents in the log ...

(for debug reasons).

Return value

#SET: self

SET.Units
SET.UnitsAlive
SET:_EventOnBirth(Event)

Handles the OnBirth event for the alive units set.

Parameter

SET:_EventOnDeadOrCrash(Event)

Handles the OnDead or OnCrash event for alive units set.

Parameter

SET:_EventOnPlayerEnterUnit(Event)

Handles the OnPlayerEnterUnit event to fill the active players table (with the unit filter applied).

Parameter

SET:_EventOnPlayerLeaveUnit(Event)

Handles the OnPlayerLeaveUnit event to clean the active players table.

Parameter

SET:_IsAliveDCSGroup(DCSGroup)

Parameter

Return value

#SET: self

SET:_IsAliveDCSUnit(DCSUnit)

Parameter

Return value

#SET: self

SET:_IsIncludeDCSUnit(DCSUnit)

Parameter

Return value

#SET: self

SET:_RegisterDatabase()

Private method that registers all datapoints within in the mission.

Return value

#SET: self

SET:_RegisterPlayers()

Private method that registers all alive players in the mission.

Return value

#SET: self