Module Set

Core -- SET_ classes define collections of objects to perform bulk actions and logically group objects.

Banner Image


SET_ classes group objects of the same type into a collection, which is either:

  • 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.

Various types of SET_ classes are available:

These classes are derived from #SET_BASE, which contains the main methods to manage SETs.

A multitude of other methods are available in SET_ classes that allow to:

  • Validate the presence of objects in the SET.
  • Trigger events when objects in the SET change a zone presence.

Author: FlightControl

Contributions:


Global(s)

SET_AIRBASE

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_BASE

1) SET_BASE class, extends Base#BASE

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

SET_CARGO

(R2.1) SET_CARGO class, extends Set#SET_BASE

Mission designers can use the Set#SET_CARGO class to build sets of cargos optionally belonging to certain:

  • Coalitions
  • Types
  • Name or Prefix

SET_CARGO constructor

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

SET_CLIENT

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.
SET_GROUP

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.
SET_PLAYER

4) SET_PLAYER class, extends Set#SET_BASE

Mission designers can use the Set#SET_PLAYER class to build sets of units belonging to alive players:

4.1) SET_PLAYER constructor

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

SET_STATIC

3) SET_STATIC class, extends Set#SET_BASE

Mission designers can use the SET_STATIC class to build sets of Statics belonging to certain:

  • Coalitions
  • Categories
  • Countries
  • Static types
  • Starting with certain prefix strings.
SET_UNIT

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.
SET_ZONE

SET_ZONE class, extends Set#SET_BASE

Mission designers can use the Set#SET_ZONE class to build sets of zones of various types.

Type SET_AIRBASE

SET_AIRBASE:AddAirbasesByName(AddAirbaseNames)

Add AIRBASEs to SET_AIRBASE.

SET_AIRBASE:AddInDatabase(Event)

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

SET_AIRBASE:FilterCategories(Categories)

Builds a set of airbases out of categories.

SET_AIRBASE:FilterCoalitions(Coalitions)

Builds a set of airbases of coalitions.

SET_AIRBASE:FilterStart()

Starts the filtering.

SET_AIRBASE:FindAirbase(AirbaseName)

Finds a Airbase based on the Airbase Name.

SET_AIRBASE:FindInDatabase(Event)

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

SET_AIRBASE:FindNearestAirbaseFromPointVec2(PointVec2)

Iterate the SET_AIRBASE while identifying the nearest Airbase#AIRBASE from a Point#POINT_VEC2.

SET_AIRBASE:ForEachAirbase(IteratorFunction, ...)

Iterate the SET_AIRBASE and call an interator function for each AIRBASE, providing the AIRBASE and optional parameters.

SET_AIRBASE:IsIncludeObject(MAirbase)
SET_AIRBASE:New()

Creates a new SET_AIRBASE object, building a set of airbases belonging to a coalitions and categories.

SET_AIRBASE:OnEventBaseCaptured(EventData)

Starts the filtering.

SET_AIRBASE:RemoveAirbasesByName(RemoveAirbaseNames)

Remove AIRBASEs from SET_AIRBASE.

Type SET_BASE

SET_BASE:Add(ObjectName, Object)

Adds a Base#BASE object in the Set#SET_BASE, using a given ObjectName as the index.

SET_BASE:AddObject(Object)

Adds a Base#BASE object in the Set#SET_BASE, using the Object Name as the index.

SET_BASE.CallScheduler
SET_BASE:Count()

Retrieves the amount of objects in the Set#SET_BASE and derived classes.

SET_BASE.Database
SET_BASE.Filter
SET_BASE:FilterCrashes()

Starts the filtering of the Crash events for the collection.

SET_BASE:FilterDeads()

Starts the filtering of the Dead events for the collection.

SET_BASE:FilterOnce()

Filters for the defined collection.

SET_BASE:FilterStop()

Stops the filtering for the defined collection.

SET_BASE:FindNearestObjectFromPointVec2(PointVec2)

Iterate the SET_BASE while identifying the nearest object from a Point#POINT_VEC2.

SET_BASE:Flush(MasterObject)

Flushes the current SET_BASE contents in the log ...

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

Iterate the SETBASE and derived classes and call an iterator function for the given SETBASE, providing the Object for each element within the set and optional parameters.

SET_BASE:Get(ObjectName)

Gets a Base#BASE object from the Set#SET_BASE and derived classes, based on the Object Name.

SET_BASE:GetFirst()

Gets the first object from the Set#SET_BASE and derived classes.

SET_BASE:GetLast()

Gets the last object from the Set#SET_BASE and derived classes.

SET_BASE:GetObjectNames()

Gets a string with all the object names.

SET_BASE:GetRandom()

Gets a random object from the Set#SET_BASE and derived classes.

SET_BASE:GetSet()

Gets the Set.

SET_BASE:GetSetNames()

Gets a list of the Names of the Objects in the Set.

SET_BASE:GetSetObjects()

Gets a list of the Objects in the Set.

SET_BASE:IsIncludeObject(Object)

Decides whether to include the Object

SET_BASE.List
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:OnAfterAdded(From, Event, To, ObjectName, Object)

Added Handler OnAfter for SET_BASE

SET_BASE:OnAfterRemoved(From, Event, To, ObjectName, Object)

Removed Handler OnAfter for SET_BASE

SET_BASE:Remove(ObjectName, NoTriggerEvent)

Removes a Base#BASE object from the Set#SET_BASE and derived classes, based on the Object Name.

SET_BASE.Set
SET_BASE:SetDatabase(BaseSet)

Copies the Filter criteria from a given Set (for rebuilding a new Set based on an existing Set).

SET_BASE:SetIteratorIntervals(YieldInterval, TimeInterval)

Define the SET iterator "yield interval" and the "time interval".

SET_BASE.TimeInterval
SET_BASE.YieldInterval
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 Base#BASE object based on the object Name.

Type SET_CARGO

SET_CARGO:AddCargo(Cargo)

(R2.1) Add CARGO to SET_CARGO.

SET_CARGO:AddCargosByName(AddCargoNames)

(R2.1) Add CARGOs to SET_CARGO.

SET_CARGO:AddInDatabase(Event)

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

SET_CARGO:FilterCoalitions(Coalitions)

(R2.1) Builds a set of cargos of coalitions.

SET_CARGO:FilterCountries(Countries)

(R2.1) Builds a set of cargos of defined countries.

SET_CARGO:FilterPrefixes(Prefixes)

(R2.1) Builds a set of cargos of defined cargo prefixes.

SET_CARGO:FilterStart()

(R2.1) Starts the filtering.

SET_CARGO:FilterTypes(Types)

(R2.1) Builds a set of cargos of defined cargo types.

SET_CARGO:FindCargo(CargoName)

(R2.1) Finds a Cargo based on the Cargo Name.

SET_CARGO:FindInDatabase(Event)

(R2.1) Handles the Database to check on any event that Object exists in the Database.

SET_CARGO:FindNearestCargoFromPointVec2(PointVec2)

(R2.1) Iterate the SET_CARGO while identifying the nearest Cargo#CARGO from a Point#POINT_VEC2.

SET_CARGO:FirstCargoDeployed()

Iterate the SET_CARGO while identifying the first Cargo#CARGO that is Deployed.

SET_CARGO:FirstCargoLoaded()

Iterate the SET_CARGO while identifying the first Cargo#CARGO that is Loaded.

SET_CARGO:FirstCargoUnLoaded()

Iterate the SET_CARGO while identifying the first Cargo#CARGO that is UnLoaded.

SET_CARGO:FirstCargoUnLoadedAndNotDeployed()

Iterate the SET_CARGO while identifying the first Cargo#CARGO that is UnLoaded and not Deployed.

SET_CARGO:FirstCargoWithState(State)
SET_CARGO:FirstCargoWithStateAndNotDeployed(State)
SET_CARGO:ForEachCargo(IteratorFunction, ...)

(R2.1) Iterate the SET_CARGO and call an interator function for each CARGO, providing the CARGO and optional parameters.

SET_CARGO:IsIncludeObject(MCargo)

(R2.1)

SET_CARGO:New()

(R2.1) Creates a new SET_CARGO object, building a set of cargos belonging to a coalitions and categories.

SET_CARGO:OnEventDeleteCargo(EventData)

(R2.1) Handles the OnDead or OnCrash event for alive units set.

SET_CARGO:OnEventNewCargo(EventData)

(R2.1) Handles the OnEventNewCargo event for the Set.

SET_CARGO:RemoveCargosByName(RemoveCargoNames)

(R2.1) Remove CARGOs from SET_CARGO.

Type SET_CLIENT

SET_CLIENT:AddClientsByName(AddClientNames)

Add CLIENT(s) to SET_CLIENT.

SET_CLIENT:AddInDatabase(Event)

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

SET_CLIENT:FilterCategories(Categories)

Builds a set of clients out of categories.

SET_CLIENT:FilterCoalitions(Coalitions)

Builds a set of clients of coalitions.

SET_CLIENT:FilterCountries(Countries)

Builds a set of clients of defined countries.

SET_CLIENT:FilterPrefixes(Prefixes)

Builds a set of clients of defined client prefixes.

SET_CLIENT:FilterStart()

Starts the filtering.

SET_CLIENT:FilterTypes(Types)

Builds a set of clients of defined client types.

SET_CLIENT:FindClient(ClientName)

Finds a Client based on the Client Name.

SET_CLIENT:FindInDatabase(Event)

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

SET_CLIENT:ForEachClient(IteratorFunction, ...)

Iterate the SET_CLIENT and call an interator function for each alive CLIENT, providing the CLIENT and optional parameters.

SET_CLIENT:ForEachClientInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_CLIENT and call an iterator function for each alive CLIENT presence completely in a Zone, providing the CLIENT and optional parameters to the called function.

SET_CLIENT:ForEachClientNotInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_CLIENT and call an iterator function for each alive CLIENT presence not in a Zone, providing the CLIENT and optional parameters to the called function.

SET_CLIENT:IsIncludeObject(MClient)
SET_CLIENT:New()

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

SET_CLIENT:RemoveClientsByName(RemoveClientNames)

Remove CLIENT(s) from SET_CLIENT.

Type SET_GROUP

SET_GROUP:AddGroupsByName(AddGroupNames)

Add GROUP(s) to 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:AllCompletelyInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if all the Wrapper.Group#GROUP are completely in the Core.Zone#ZONE

SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if at least one of the Wrapper.Group#GROUP is completely inside the Core.Zone#ZONE

SET_GROUP:AnyInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE

SET_GROUP:AnyPartlyInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if at least one GROUP of the SET_GROUP is partly in ZONE.

SET_GROUP:CountInZone(ZoneObject, Zone)

Iterate the SETGROUP and count how many GROUPs are completely in the Zone That could easily be done with SETGROUP:ForEachGroupCompletelyInZone(), but this function provides an easy to use shortcut...

SET_GROUP:CountUnitInZone(ZoneObject, Zone)

Iterate the SET_GROUP and count how many UNITs are completely in the Zone

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.

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: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:FindNearestGroupFromPointVec2(PointVec2)

Iterate the SET_GROUP while identifying the nearest object from a Point#POINT_VEC2.

SET_GROUP:ForEachGroup(IteratorFunction, ...)

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

SET_GROUP:ForEachGroupAlive(IteratorFunction, ...)

Iterate the SET_GROUP and call an iterator function for each alive GROUP object, 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:GetAliveSet()

Gets the Set.

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.

SET_GROUP:NoneInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if no GROUP of the SET_GROUP is in ZONE This could also be achieved with not SET_GROUP:AnyPartlyInZone(Zone), but it's easier for the mission designer to add a dedicated method

SET_GROUP:RemoveGroupsByName(RemoveGroupNames)

Remove GROUP(s) from SET_GROUP.

SET_GROUP:_EventOnDeadOrCrash(Event)

Handles the OnDead or OnCrash event for alive groups set.

Type SET_PLAYER

SET_PLAYER:AddClientsByName(AddClientNames)

Add CLIENT(s) to SET_PLAYER.

SET_PLAYER:AddInDatabase(Event)

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

SET_PLAYER:FilterCategories(Categories)

Builds a set of clients out of categories joined by players.

SET_PLAYER:FilterCoalitions(Coalitions)

Builds a set of clients of coalitions joined by specific players.

SET_PLAYER:FilterCountries(Countries)

Builds a set of clients of defined countries.

SET_PLAYER:FilterPrefixes(Prefixes)

Builds a set of clients of defined client prefixes.

SET_PLAYER:FilterStart()

Starts the filtering.

SET_PLAYER:FilterTypes(Types)

Builds a set of clients of defined client types joined by players.

SET_PLAYER:FindClient(PlayerName)

Finds a Client based on the Player Name.

SET_PLAYER:FindInDatabase(Event)

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

SET_PLAYER:ForEachPlayer(IteratorFunction, ...)

Iterate the SET_PLAYER and call an interator function for each alive CLIENT, providing the CLIENT and optional parameters.

SET_PLAYER:ForEachPlayerInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_PLAYER and call an iterator function for each alive CLIENT presence completely in a Zone, providing the CLIENT and optional parameters to the called function.

SET_PLAYER:ForEachPlayerNotInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_PLAYER and call an iterator function for each alive CLIENT presence not in a Zone, providing the CLIENT and optional parameters to the called function.

SET_PLAYER:IsIncludeObject(MClient)
SET_PLAYER:New()

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

SET_PLAYER:RemoveClientsByName(RemoveClientNames)

Remove CLIENT(s) from SET_PLAYER.

Type SET_STATIC

SET_STATIC:AddInDatabase(Event)

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

SET_STATIC:AddStatic(AddStatic)

Add STATIC(s) to SET_STATIC.

SET_STATIC:AddStaticsByName(AddStaticNames)

Add STATIC(s) to SET_STATIC.

SET_STATIC:FilterCategories(Categories)

Builds a set of units out of categories.

SET_STATIC:FilterCoalitions(Coalitions)

Builds a set of units of coalitions.

SET_STATIC:FilterCountries(Countries)

Builds a set of units of defined countries.

SET_STATIC:FilterPrefixes(Prefixes)

Builds a set of units of defined unit prefixes.

SET_STATIC:FilterStart()

Starts the filtering.

SET_STATIC:FilterTypes(Types)

Builds a set of units of defined unit types.

SET_STATIC:FindInDatabase(Event)

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

SET_STATIC:FindStatic(StaticName)

Finds a Static based on the Static Name.

SET_STATIC:ForEachStatic(IteratorFunction, ...)

Iterate the SET_STATIC and call an interator function for each alive STATIC, providing the STATIC and optional parameters.

SET_STATIC:ForEachStaticCompletelyInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_STATIC and call an iterator function for each alive STATIC presence completely in a Zone, providing the STATIC and optional parameters to the called function.

SET_STATIC:ForEachStaticInZone(IteratorFunction, ...)

Check if minimal one element of the SET_STATIC is in the Zone.

SET_STATIC:ForEachStaticNotInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_STATIC and call an iterator function for each alive STATIC presence not in a Zone, providing the STATIC and optional parameters to the called function.

SET_STATIC:GetCoordinate()

Get the center coordinate of the SET_STATIC.

SET_STATIC:GetFirst()

Get the first unit from the set.

SET_STATIC:GetHeading()

Get the average heading of the SET_STATIC.

SET_STATIC:GetStaticTypes()

Returns map of unit types.

SET_STATIC:GetStaticTypesText()

Returns a comma separated string of the unit types with a count in the Set.

SET_STATIC:GetTypeNames(Delimiter)

Retrieve the type names of the Statics in the SET, delimited by an optional delimiter.

SET_STATIC:GetVelocity()

Get the maximum velocity of the SET_STATIC.

SET_STATIC:IsIncludeObject(MStatic)
SET_STATIC:IsNotInZone(ZoneObject, Zone)

Check if no element of the SET_STATIC is in the Zone.

SET_STATIC:IsPatriallyInZone(Zone)

Check if minimal one element of the SET_STATIC is in the Zone.

SET_STATIC:New()

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

SET_STATIC:RemoveStaticsByName(RemoveStaticNames)

Remove STATIC(s) from SET_STATIC.

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:AddUnit(AddUnit)

Add UNIT(s) to SET_UNIT.

SET_UNIT:AddUnitsByName(AddUnitNames)

Add UNIT(s) to SET_UNIT.

SET_UNIT:CalculateThreatLevelA2G()

Calculate the maxium A2G threat level of the SET_UNIT.

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:FilterHasRadar(RadarTypes)

Builds a set of units having a radar of give types.

SET_UNIT:FilterHasSEAD()

Builds a set of SEADable units.

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, ...)

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

SET_UNIT:ForEachUnitCompletelyInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_UNIT 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:ForEachUnitInZone(IteratorFunction, ...)

Check if minimal one element of the SET_UNIT is in the Zone.

SET_UNIT:ForEachUnitNotInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_UNIT and call an iterator function for each alive UNIT presence not in a Zone, providing the UNIT and optional parameters to the called function.

SET_UNIT:ForEachUnitPerThreatLevel(FromThreatLevel, ToThreatLevel, IteratorFunction, ...)

Iterate the SET_UNIT sorted *per Threat Level and call an interator function for each alive UNIT, providing the UNIT and optional parameters.

SET_UNIT:GetCoordinate()

Get the center coordinate of the SET_UNIT.

SET_UNIT:GetFirst()

Get the first unit from the set.

SET_UNIT:GetHeading()

Get the average heading of the SET_UNIT.

SET_UNIT:GetTypeNames(Delimiter)

Retrieve the type names of the Units in the SET, delimited by an optional delimiter.

SET_UNIT:GetUnitThreatLevels()

Returns map of unit threat levels.

SET_UNIT:GetUnitTypes()

Returns map of unit types.

SET_UNIT:GetUnitTypesText()

Returns a comma separated string of the unit types with a count in the Set.

SET_UNIT:GetVelocity()

Get the maximum velocity of the SET_UNIT.

SET_UNIT:HasFriendlyUnits(FriendlyCoalition)

Returns if the Set has friendly ground units.

SET_UNIT:HasGroundUnits()

Returns if the Set has ground targets.

SET_UNIT:HasRadar(RadarType)

Returns if the Set has targets having a radar (of a given type).

SET_UNIT:HasSEAD()

Returns if the Set has targets that can be SEADed.

SET_UNIT:IsIncludeObject(MUnit)
SET_UNIT:IsNotInZone(ZoneObject, Zone)

Check if no element of the SET_UNIT is in the Zone.

SET_UNIT:IsPartiallyInZone(ZoneTest)

Check if minimal one element of the SET_UNIT is in the Zone.

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:RemoveUnitsByName(RemoveUnitNames)

Remove UNIT(s) from SET_UNIT.

Type SET_ZONE

SET_ZONE:AddInDatabase(Event)

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

SET_ZONE:AddZonesByName(AddZoneNames)

Add ZONEs to SET_ZONE.

SET_ZONE:FilterPrefixes(Prefixes)

Builds a set of zones of defined zone prefixes.

SET_ZONE:FilterStart()

Starts the filtering.

SET_ZONE:FindInDatabase(Event)

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

SET_ZONE:FindZone(ZoneName)

Finds a Zone based on the Zone Name.

SET_ZONE:ForEachZone(IteratorFunction, ...)

Iterate the SET_ZONE and call an interator function for each ZONE, providing the ZONE and optional parameters.

SET_ZONE:GetRandomZone()

Get a random zone from the set.

SET_ZONE:IsIncludeObject(MZone)
SET_ZONE:New()

Creates a new SET_ZONE object, building a set of zones.

SET_ZONE:OnEventDeleteZone(EventData)

Handles the OnDead or OnCrash event for alive units set.

SET_ZONE:OnEventNewZone(EventData)

Handles the OnEventNewZone event for the Set.

SET_ZONE:RemoveZonesByName(RemoveZoneNames)

Remove ZONEs from SET_ZONE.

SET_ZONE:SetZoneProbability(ZoneName, ZoneProbability)

Set a zone probability.

Global(s)

#SET_AIRBASE SET_AIRBASE

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:

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:


#SET_BASE SET_BASE

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).

#SET_CARGO SET_CARGO

(R2.1) SET_CARGO class, extends Set#SET_BASE

Mission designers can use the Set#SET_CARGO class to build sets of cargos optionally belonging to certain:

  • Coalitions
  • Types
  • Name or Prefix

SET_CARGO constructor

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

Add or Remove CARGOs from SET_CARGO

CARGOs can be added and removed using the Set#SET_CARGO.AddCargosByName and Set#SET_CARGO.RemoveCargosByName respectively. These methods take a single CARGO name or an array of CARGO names to be added or removed from SET_CARGO.

SET_CARGO filter criteria

You can set filter criteria to automatically maintain the SET_CARGO contents. Filter criteria are defined by:

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

SET_CARGO iterators

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

#SET_CLIENT SET_CLIENT

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:


#SET_GROUP SET_GROUP

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.

1. SET_GROUP constructor

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

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.

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:

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:

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

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.

5. SET_GROUP trigger events on the GROUP objects.

The SET is derived from the FSM class, which provides extra capabilities to track the contents of the GROUP objects in the SET_GROUP.

5.1. When a GROUP object crashes or is dead, the SET_GROUP will trigger a Dead event.

You can handle the event using the OnBefore and OnAfter event handlers. The event handlers need to have the paramters From, Event, To, GroupObject. The GroupObject is the GROUP object that is dead and within the SET_GROUP, and is passed as a parameter to the event handler. See the following example:

   -- Create the SetCarrier SET_GROUP collection.

   local SetHelicopter = SET_GROUP:New():FilterPrefixes( "Helicopter" ):FilterStart()

   -- Put a Dead event handler on SetCarrier, to ensure that when a carrier is destroyed, that all internal parameters are reset.

   function SetHelicopter:OnAfterDead( From, Event, To, GroupObject )
     self:F( { GroupObject = GroupObject:GetName() } )
   end

While this is a good example, there is a catch. Imageine you want to execute the code above, the the self would need to be from the object declared outside (above) the OnAfterDead method. So, the self would need to contain another object. Fortunately, this can be done, but you must use then the . notation for the method. See the modified example:

   -- Now we have a constructor of the class AI_CARGO_DISPATCHER, that receives the SetHelicopter as a parameter.
   -- Within that constructor, we want to set an enclosed event handler OnAfterDead for SetHelicopter.
   -- But within the OnAfterDead method, we want to refer to the self variable of the AI_CARGO_DISPATCHER.

   function AI_CARGO_DISPATCHER:New( SetCarrier, SetCargo, SetDeployZones )

     local self = BASE:Inherit( self, FSM:New() ) -- #AI_CARGO_DISPATCHER

     -- Put a Dead event handler on SetCarrier, to ensure that when a carrier is destroyed, that all internal parameters are reset.
     -- Note the "." notation, and the explicit declaration of SetHelicopter, which would be using the ":" notation the implicit self variable declaration.

     function SetHelicopter.OnAfterDead( SetHelicopter, From, Event, To, GroupObject )
       SetHelicopter:F( { GroupObject = GroupObject:GetName() } )
       self.PickupCargo[GroupObject] = nil  -- So here I clear the PickupCargo table entry of the self object AI_CARGO_DISPATCHER.
       self.CarrierHome[GroupObject] = nil
     end

   end

#SET_PLAYER SET_PLAYER

4) SET_PLAYER class, extends Set#SET_BASE

Mission designers can use the Set#SET_PLAYER class to build sets of units belonging to alive players:

4.1) SET_PLAYER constructor

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

4.3) SET_PLAYER filter criteria

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

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

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

4.4) SET_PLAYER iterators

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


#SET_STATIC SET_STATIC

3) SET_STATIC class, extends Set#SET_BASE

Mission designers can use the SET_STATIC class to build sets of Statics belonging to certain:

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

3.1) SET_STATIC constructor

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

3.2) Add or Remove STATIC(s) from SET_STATIC

STATICs can be added and removed using the Set#SET_STATIC.AddStaticsByName and Set#SET_STATIC.RemoveStaticsByName respectively. These methods take a single STATIC name or an array of STATIC names to be added or removed from SET_STATIC.

3.3) SET_STATIC filter criteria

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

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

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

3.4) SET_STATIC iterators

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

  • SET_STATIC.ForEachStatic: Calls a function for each alive unit it finds within the SET_STATIC.
  • 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_STATIC atomic methods

Various methods exist for a SETSTATIC to perform actions or calculations and retrieve results from the SETSTATIC:


#SET_UNIT SET_UNIT

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:

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 group it finds within the SET_UNIT.
  • SET_UNIT.ForEachUnitInZone: Iterate the SET_UNIT and call an iterator function for each alive UNIT object presence completely in a Zone, providing the UNIT object and optional parameters to the called function.
  • SET_UNIT.ForEachUnitNotInZone: Iterate the SET_UNIT and call an iterator function for each alive UNIT object presence not in a Zone, providing the UNIT object and optional parameters to the called function.

5. SET_UNIT trigger events on the UNIT objects.

The SET is derived from the FSM class, which provides extra capabilities to track the contents of the UNIT objects in the SET_UNIT.

5.1. When a UNIT object crashes or is dead, the SET_UNIT will trigger a Dead event.

You can handle the event using the OnBefore and OnAfter event handlers. The event handlers need to have the paramters From, Event, To, GroupObject. The GroupObject is the UNIT object that is dead and within the SET_UNIT, and is passed as a parameter to the event handler. See the following example:

   -- Create the SetCarrier SET_UNIT collection.

   local SetHelicopter = SET_UNIT:New():FilterPrefixes( "Helicopter" ):FilterStart()

   -- Put a Dead event handler on SetCarrier, to ensure that when a carrier unit is destroyed, that all internal parameters are reset.

   function SetHelicopter:OnAfterDead( From, Event, To, UnitObject )
     self:F( { UnitObject = UnitObject:GetName() } )
   end

While this is a good example, there is a catch. Imageine you want to execute the code above, the the self would need to be from the object declared outside (above) the OnAfterDead method. So, the self would need to contain another object. Fortunately, this can be done, but you must use then the . notation for the method. See the modified example:

   -- Now we have a constructor of the class AI_CARGO_DISPATCHER, that receives the SetHelicopter as a parameter.
   -- Within that constructor, we want to set an enclosed event handler OnAfterDead for SetHelicopter.
   -- But within the OnAfterDead method, we want to refer to the self variable of the AI_CARGO_DISPATCHER.

   function ACLASS:New( SetCarrier, SetCargo, SetDeployZones )

     local self = BASE:Inherit( self, FSM:New() ) -- #AI_CARGO_DISPATCHER

     -- Put a Dead event handler on SetCarrier, to ensure that when a carrier is destroyed, that all internal parameters are reset.
     -- Note the "." notation, and the explicit declaration of SetHelicopter, which would be using the ":" notation the implicit self variable declaration.

     function SetHelicopter.OnAfterDead( SetHelicopter, From, Event, To, UnitObject )
       SetHelicopter:F( { UnitObject = UnitObject:GetName() } )
       self.array[UnitObject] = nil  -- So here I clear the array table entry of the self object ACLASS.
     end

   end

#SET_ZONE SET_ZONE

SET_ZONE class, extends Set#SET_BASE

Mission designers can use the Set#SET_ZONE class to build sets of zones of various types.

SET_ZONE constructor

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

Add or Remove ZONEs from SET_ZONE

ZONEs can be added and removed using the Set#SET_ZONE.AddZonesByName and Set#SET_ZONE.RemoveZonesByName respectively. These methods take a single ZONE name or an array of ZONE names to be added or removed from SET_ZONE.

5.3) SET_ZONE filter criteria

You can set filter criteria to build the collection of zones in SET_ZONE. Filter criteria are defined by:

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

5.4) SET_ZONE iterators

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


Type Set

Type SET_AIRBASE

Field(s)

SET_AIRBASE:AddAirbasesByName(AddAirbaseNames)

Add AIRBASEs to SET_AIRBASE.

Parameter

  • #string AddAirbaseNames : A single name or an array of AIRBASE names.

Return value

self

SET_AIRBASE: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 AIRBASE

  2. #table: The AIRBASE

SET_AIRBASE:FilterCategories(Categories)

Builds a set of airbases out of categories.

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

Parameter

  • #string Categories : Can take the following values: "airdrome", "helipad", "ship".

Return value

#SET_AIRBASE: self

SET_AIRBASE:FilterCoalitions(Coalitions)

Builds a set of airbases of coalitions.

Possible current coalitions are red, blue and neutral.

Parameter

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

Return value

#SET_AIRBASE: self

SET_AIRBASE:FilterStart()

Starts the filtering.

Return value

#SET_AIRBASE: self

SET_AIRBASE:FindAirbase(AirbaseName)

Finds a Airbase based on the Airbase Name.

Parameter

  • #string AirbaseName :

Return value

Wrapper.Airbase#AIRBASE: The found Airbase.

SET_AIRBASE: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 AIRBASE

  2. #table: The AIRBASE

SET_AIRBASE:FindNearestAirbaseFromPointVec2(PointVec2)

Iterate the SET_AIRBASE while identifying the nearest Airbase#AIRBASE from a Point#POINT_VEC2.

Parameter

Return value

Wrapper.Airbase#AIRBASE: The closest Airbase#AIRBASE.

SET_AIRBASE:ForEachAirbase(IteratorFunction, ...)

Iterate the SET_AIRBASE and call an interator function for each AIRBASE, providing the AIRBASE and optional parameters.

Parameters

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

  • ... :

Return value

#SET_AIRBASE: self

SET_AIRBASE:IsIncludeObject(MAirbase)

Parameter

Return value

#SET_AIRBASE: self

SET_AIRBASE:New()

Creates a new SET_AIRBASE object, building a set of airbases belonging to a coalitions and categories.

Return value

#SET_AIRBASE: self

Usage:

-- Define a new SET_AIRBASE Object. The DatabaseSet will contain a reference to all Airbases.
DatabaseSet = SET_AIRBASE:New()
SET_AIRBASE:OnEventBaseCaptured(EventData)

Starts the filtering.

Parameter

Return value

#SET_AIRBASE: self

SET_AIRBASE:RemoveAirbasesByName(RemoveAirbaseNames)

Remove AIRBASEs from SET_AIRBASE.

Parameter

Return value

self

Type SET_BASE

Field(s)

SET_BASE:Add(ObjectName, Object)

Adds a Base#BASE object in the Set#SET_BASE, using a given ObjectName as the index.

Parameters

Return value

Core.Base#BASE: The added BASE Object.

SET_BASE:AddObject(Object)

Adds a Base#BASE object in the Set#SET_BASE, using the Object Name as the index.

Parameter

Return value

Core.Base#BASE: The added BASE Object.

Core.Scheduler#SCHEDULER SET_BASE.CallScheduler
SET_BASE:Count()

Retrieves the amount of objects in the Set#SET_BASE and derived classes.

Return value

#number: Count

SET_BASE.Database

Now base the new Set on the BaseSet

#table SET_BASE.Filter
SET_BASE:FilterCrashes()

Starts the filtering of the Crash events for the collection.

Return value

#SET_BASE: self

SET_BASE:FilterDeads()

Starts the filtering of the Dead events for the collection.

Return value

#SET_BASE: self

SET_BASE:FilterOnce()

Filters for the defined collection.

Return value

#SET_BASE: self

SET_BASE:FilterStop()

Stops the filtering for the defined collection.

Return value

#SET_BASE: self

SET_BASE:FindNearestObjectFromPointVec2(PointVec2)

Iterate the SET_BASE while identifying the nearest object from a Point#POINT_VEC2.

Parameter

Return value

Core.Base#BASE: The closest object.

SET_BASE:Flush(MasterObject)

Flushes the current SET_BASE contents in the log ...

(for debugging reasons).

Parameter

  • Core.Base#BASE MasterObject : (optional) The master object as a reference.

Return value

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

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

Iterate the SETBASE and derived classes and call an iterator function for the given SETBASE, providing the Object for each element within the set and optional parameters.

Parameters

  • #function IteratorFunction : The function that will be called.

  • arg :

  • Set :

  • Function :

  • FunctionArguments :

Return value

#SET_BASE: self

SET_BASE:Get(ObjectName)

Gets a Base#BASE object from the Set#SET_BASE and derived classes, based on the Object Name.

Parameter

  • #string ObjectName :

Return value

Core.Base#BASE:

SET_BASE:GetFirst()

Gets the first object from the Set#SET_BASE and derived classes.

Return value

Core.Base#BASE:

SET_BASE:GetLast()

Gets the last object from the Set#SET_BASE and derived classes.

Return value

Core.Base#BASE:

SET_BASE:GetObjectNames()

Gets a string with all the object names.

Return value

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

SET_BASE:GetRandom()

Gets a random object from the Set#SET_BASE and derived classes.

Return value

Core.Base#BASE:

SET_BASE:GetSet()

Gets the Set.

Return value

#SET_BASE: self

SET_BASE:GetSetNames()

Gets a list of the Names of the Objects in the Set.

Return value

#SET_BASE: self

SET_BASE:GetSetObjects()

Gets a list of the Objects in the Set.

Return value

#SET_BASE: self

SET_BASE:IsIncludeObject(Object)

Decides whether to include the Object

Parameter

  • #table Object :

Return value

#SET_BASE: self

#table SET_BASE.List
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:OnAfterAdded(From, Event, To, ObjectName, Object)

Added Handler OnAfter for SET_BASE

Parameters

  • #string From :

  • #string Event :

  • #string To :

  • #string ObjectName : The name of the object.

  • Object : The object.

SET_BASE:OnAfterRemoved(From, Event, To, ObjectName, Object)

Removed Handler OnAfter for SET_BASE

Parameters

  • #string From :

  • #string Event :

  • #string To :

  • #string ObjectName : The name of the object.

  • Object : The object.

SET_BASE:Remove(ObjectName, NoTriggerEvent)

Removes a Base#BASE object from the Set#SET_BASE and derived classes, based on the Object Name.

Parameters

  • #string ObjectName :

  • NoTriggerEvent : (optional) When true, the :Remove() method will not trigger a Removed event.

#table SET_BASE.Set
SET_BASE:SetDatabase(BaseSet)

Copies the Filter criteria from a given Set (for rebuilding a new Set based on an existing Set).

Parameter

Return value

#SET_BASE:

SET_BASE:SetIteratorIntervals(YieldInterval, TimeInterval)

Define the SET iterator "yield interval" and the "time interval".

Parameters

  • #number YieldInterval : Sets the frequency when the iterator loop will yield after the number of objects processed. The default frequency is 10 objects processed.

  • #number TimeInterval : Sets the time in seconds when the main logic will resume the iterator loop. The default time is 0.001 seconds.

Return value

#SET_BASE: self

SET_BASE.TimeInterval
SET_BASE.YieldInterval
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 Base#BASE object based on the object Name.

Parameter

  • #string ObjectName :

Return value

Core.Base#BASE: The Object found.

Type SET_CARGO

Field(s)

SET_CARGO:AddCargo(Cargo)

(R2.1) Add CARGO to SET_CARGO.

Parameter

Return value

self

SET_CARGO:AddCargosByName(AddCargoNames)

(R2.1) Add CARGOs to SET_CARGO.

Parameter

  • #string AddCargoNames : A single name or an array of CARGO names.

Return value

self

SET_CARGO:AddInDatabase(Event)

(R2.1) 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 CARGO

  2. #table: The CARGO

SET_CARGO:FilterCoalitions(Coalitions)

(R2.1) Builds a set of cargos of coalitions.

Possible current coalitions are red, blue and neutral.

Parameter

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

Return value

#SET_CARGO: self

SET_CARGO:FilterCountries(Countries)

(R2.1) Builds a set of cargos 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_CARGO: self

SET_CARGO:FilterPrefixes(Prefixes)

(R2.1) Builds a set of cargos of defined cargo prefixes.

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

Parameter

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

Return value

#SET_CARGO: self

SET_CARGO:FilterStart()

(R2.1) Starts the filtering.

Return value

#SET_CARGO: self

SET_CARGO:FilterTypes(Types)

(R2.1) Builds a set of cargos of defined cargo 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_CARGO: self

SET_CARGO:FindCargo(CargoName)

(R2.1) Finds a Cargo based on the Cargo Name.

Parameter

  • #string CargoName :

Return value

Wrapper.Cargo#CARGO: The found Cargo.

SET_CARGO:FindInDatabase(Event)

(R2.1) 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 CARGO

  2. #table: The CARGO

SET_CARGO:FindNearestCargoFromPointVec2(PointVec2)

(R2.1) Iterate the SET_CARGO while identifying the nearest Cargo#CARGO from a Point#POINT_VEC2.

Parameter

Return value

Wrapper.Cargo#CARGO: The closest Cargo#CARGO.

SET_CARGO:FirstCargoDeployed()

Iterate the SET_CARGO while identifying the first Cargo#CARGO that is Deployed.

Return value

Cargo.Cargo#CARGO: The first Cargo#CARGO.

SET_CARGO:FirstCargoLoaded()

Iterate the SET_CARGO while identifying the first Cargo#CARGO that is Loaded.

Return value

Cargo.Cargo#CARGO: The first Cargo#CARGO.

SET_CARGO:FirstCargoUnLoaded()

Iterate the SET_CARGO while identifying the first Cargo#CARGO that is UnLoaded.

Return value

Cargo.Cargo#CARGO: The first Cargo#CARGO.

SET_CARGO:FirstCargoUnLoadedAndNotDeployed()

Iterate the SET_CARGO while identifying the first Cargo#CARGO that is UnLoaded and not Deployed.

Return value

Cargo.Cargo#CARGO: The first Cargo#CARGO.

SET_CARGO:FirstCargoWithState(State)

Parameter

  • State :

SET_CARGO:FirstCargoWithStateAndNotDeployed(State)

Parameter

  • State :

SET_CARGO:ForEachCargo(IteratorFunction, ...)

(R2.1) Iterate the SET_CARGO and call an interator function for each CARGO, providing the CARGO and optional parameters.

Parameters

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

  • ... :

Return value

#SET_CARGO: self

SET_CARGO:IsIncludeObject(MCargo)

(R2.1)

Parameter

Return value

#SET_CARGO: self

SET_CARGO:New()

(R2.1) Creates a new SET_CARGO object, building a set of cargos belonging to a coalitions and categories.

Return value

#SET_CARGO:

Usage:

-- Define a new SET_CARGO Object. The DatabaseSet will contain a reference to all Cargos.
DatabaseSet = SET_CARGO:New()
SET_CARGO:OnEventDeleteCargo(EventData)

(R2.1) Handles the OnDead or OnCrash event for alive units set.

Parameter

SET_CARGO:OnEventNewCargo(EventData)

(R2.1) Handles the OnEventNewCargo event for the Set.

Parameter

SET_CARGO:RemoveCargosByName(RemoveCargoNames)

(R2.1) Remove CARGOs from SET_CARGO.

Parameter

Return value

self

Type SET_CLIENT

Field(s)

SET_CLIENT:AddClientsByName(AddClientNames)

Add CLIENT(s) to SET_CLIENT.

Parameter

  • #string AddClientNames : A single name or an array of CLIENT names.

Return value

self

SET_CLIENT: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 CLIENT

  2. #table: The CLIENT

SET_CLIENT:FilterCategories(Categories)

Builds a set of clients 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_CLIENT: self

SET_CLIENT:FilterCoalitions(Coalitions)

Builds a set of clients of coalitions.

Possible current coalitions are red, blue and neutral.

Parameter

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

Return value

#SET_CLIENT: self

SET_CLIENT:FilterCountries(Countries)

Builds a set of clients 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_CLIENT: self

SET_CLIENT:FilterPrefixes(Prefixes)

Builds a set of clients of defined client prefixes.

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

Parameter

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

Return value

#SET_CLIENT: self

SET_CLIENT:FilterStart()

Starts the filtering.

Return value

#SET_CLIENT: self

SET_CLIENT:FilterTypes(Types)

Builds a set of clients of defined client 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_CLIENT: self

SET_CLIENT:FindClient(ClientName)

Finds a Client based on the Client Name.

Parameter

  • #string ClientName :

Return value

Wrapper.Client#CLIENT: The found Client.

SET_CLIENT: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 CLIENT

  2. #table: The CLIENT

SET_CLIENT:ForEachClient(IteratorFunction, ...)

Iterate the SET_CLIENT and call an interator function for each alive CLIENT, providing the CLIENT and optional parameters.

Parameters

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

  • ... :

Return value

#SET_CLIENT: self

SET_CLIENT:ForEachClientInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_CLIENT and call an iterator function for each alive CLIENT presence completely in a Zone, providing the CLIENT and optional parameters to the called function.

Parameters

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

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

  • ... :

Return value

#SET_CLIENT: self

SET_CLIENT:ForEachClientNotInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_CLIENT and call an iterator function for each alive CLIENT presence not in a Zone, providing the CLIENT and optional parameters to the called function.

Parameters

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

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

  • ... :

Return value

#SET_CLIENT: self

SET_CLIENT:IsIncludeObject(MClient)

Parameter

Return value

#SET_CLIENT: self

SET_CLIENT:New()

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

Return value

#SET_CLIENT:

Usage:

-- Define a new SET_CLIENT Object. This DBObject will contain a reference to all Clients.
DBObject = SET_CLIENT:New()
SET_CLIENT:RemoveClientsByName(RemoveClientNames)

Remove CLIENT(s) from SET_CLIENT.

Parameter

Return value

self

Type SET_GROUP

Field(s)

SET_GROUP:AddGroupsByName(AddGroupNames)

Add GROUP(s) to SET_GROUP.

Parameter

  • #string AddGroupNames : A single name or an array of GROUP names.

Return value

self

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

SET_GROUP:AllCompletelyInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if all the Wrapper.Group#GROUP are completely in the Core.Zone#ZONE

Parameters

Return value

#boolean: true if all the Wrapper.Group#GROUP are completly in the Core.Zone#ZONE, false otherwise

Usage:

local MyZone = ZONE:New("Zone1")
local MySetGroup = SET_GROUP:New()
MySetGroup:AddGroupsByName({"Group1", "Group2"})

if MySetGroup:AllCompletelyInZone(MyZone) then
  MESSAGE:New("All the SET's GROUP are in zone !", 10):ToAll()
else
  MESSAGE:New("Some or all SET's GROUP are outside zone !", 10):ToAll()
end
SET_GROUP:AnyCompletelyInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if at least one of the Wrapper.Group#GROUP is completely inside the Core.Zone#ZONE

Parameters

Return value

#boolean: true if at least one of the Wrapper.Group#GROUP is completly inside the Core.Zone#ZONE, false otherwise.

Usage:

local MyZone = ZONE:New("Zone1")
local MySetGroup = SET_GROUP:New()
MySetGroup:AddGroupsByName({"Group1", "Group2"})

if MySetGroup:AnyCompletelyInZone(MyZone) then
  MESSAGE:New("At least one GROUP is completely in zone !", 10):ToAll()
else
  MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
end
SET_GROUP:AnyInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if at least one #UNIT of one GROUP of the SET_GROUP is in ZONE

Parameters

Return value

#boolean: true if at least one of the Wrapper.Group#GROUP is partly or completly inside the Core.Zone#ZONE, false otherwise.

Usage:

local MyZone = ZONE:New("Zone1")
local MySetGroup = SET_GROUP:New()
MySetGroup:AddGroupsByName({"Group1", "Group2"})

if MySetGroup:AnyPartlyInZone(MyZone) then
  MESSAGE:New("At least one GROUP has at least one UNIT in zone !", 10):ToAll()
else
  MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
end
SET_GROUP:AnyPartlyInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if at least one GROUP of the SET_GROUP is partly in ZONE.

Will return false if a GROUP is fully in the ZONE

Parameters

Return value

#boolean: true if at least one of the Wrapper.Group#GROUP is partly or completly inside the Core.Zone#ZONE, false otherwise.

Usage:

local MyZone = ZONE:New("Zone1")
local MySetGroup = SET_GROUP:New()
MySetGroup:AddGroupsByName({"Group1", "Group2"})

if MySetGroup:AnyPartlyInZone(MyZone) then
  MESSAGE:New("At least one GROUP is partially in the zone, but none are fully in it !", 10):ToAll()
else
  MESSAGE:New("No GROUP are in zone, or one (or more) GROUP is completely in it !", 10):ToAll()
end
SET_GROUP:CountInZone(ZoneObject, Zone)

Iterate the SETGROUP and count how many GROUPs are completely in the Zone That could easily be done with SETGROUP:ForEachGroupCompletelyInZone(), but this function provides an easy to use shortcut...

Parameters

Return value

#number: the number of GROUPs completely in the Zone

Usage:

local MyZone = ZONE:New("Zone1")
local MySetGroup = SET_GROUP:New()
MySetGroup:AddGroupsByName({"Group1", "Group2"})

MESSAGE:New("There are " .. MySetGroup:CountInZone(MyZone) .. " GROUPs in the Zone !", 10):ToAll()
SET_GROUP:CountUnitInZone(ZoneObject, Zone)

Iterate the SET_GROUP and count how many UNITs are completely in the Zone

Parameters

Return value

#number: the number of GROUPs completely in the Zone

Usage:

local MyZone = ZONE:New("Zone1")
local MySetGroup = SET_GROUP:New()
MySetGroup:AddGroupsByName({"Group1", "Group2"})

MESSAGE:New("There are " .. MySetGroup:CountUnitInZone(MyZone) .. " UNITs in the Zone !", 10):ToAll()
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: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)

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

Wrapper.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:FindNearestGroupFromPointVec2(PointVec2)

Iterate the SET_GROUP while identifying the nearest object from a Point#POINT_VEC2.

Parameter

Return value

Wrapper.Group#GROUP: The closest group.

SET_GROUP:ForEachGroup(IteratorFunction, ...)

Iterate the SET_GROUP and call an iterator function for each GROUP object, 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:ForEachGroupAlive(IteratorFunction, ...)

Iterate the SET_GROUP and call an iterator function for each alive GROUP object, 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

  • Core.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

  • Core.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

  • Core.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:GetAliveSet()

Gets the Set.

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()
SET_GROUP:NoneInZone(ZoneObject, Zone)

Iterate the SET_GROUP and return true if no GROUP of the SET_GROUP is in ZONE This could also be achieved with not SET_GROUP:AnyPartlyInZone(Zone), but it's easier for the mission designer to add a dedicated method

Parameters

Return value

#boolean: true if no Wrapper.Group#GROUP is inside the Core.Zone#ZONE in any way, false otherwise.

Usage:

local MyZone = ZONE:New("Zone1")
local MySetGroup = SET_GROUP:New()
MySetGroup:AddGroupsByName({"Group1", "Group2"})

if MySetGroup:NoneInZone(MyZone) then
  MESSAGE:New("No GROUP is completely in zone !", 10):ToAll()
else
  MESSAGE:New("No UNIT of any GROUP is in zone !", 10):ToAll()
end
SET_GROUP:RemoveGroupsByName(RemoveGroupNames)

Remove GROUP(s) from SET_GROUP.

Parameter

Return value

self

SET_GROUP:_EventOnDeadOrCrash(Event)

Handles the OnDead or OnCrash event for alive groups set.

Note: The GROUP object in the SET_GROUP collection will only be removed if the last unit is destroyed of the GROUP.

Parameter

Type SET_PLAYER

Field(s)

SET_PLAYER:AddClientsByName(AddClientNames)

Add CLIENT(s) to SET_PLAYER.

Parameter

  • #string AddClientNames : A single name or an array of CLIENT names.

Return value

self

SET_PLAYER: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 CLIENT

  2. #table: The CLIENT

SET_PLAYER:FilterCategories(Categories)

Builds a set of clients out of categories joined by players.

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

Parameter

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

Return value

#SET_PLAYER: self

SET_PLAYER:FilterCoalitions(Coalitions)

Builds a set of clients of coalitions joined by specific players.

Possible current coalitions are red, blue and neutral.

Parameter

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

Return value

#SET_PLAYER: self

SET_PLAYER:FilterCountries(Countries)

Builds a set of clients 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_PLAYER: self

SET_PLAYER:FilterPrefixes(Prefixes)

Builds a set of clients of defined client prefixes.

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

Parameter

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

Return value

#SET_PLAYER: self

SET_PLAYER:FilterStart()

Starts the filtering.

Return value

#SET_PLAYER: self

SET_PLAYER:FilterTypes(Types)

Builds a set of clients of defined client types joined by players.

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

SET_PLAYER:FindClient(PlayerName)

Finds a Client based on the Player Name.

Parameter

  • #string PlayerName :

Return value

Wrapper.Client#CLIENT: The found Client.

SET_PLAYER: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 CLIENT

  2. #table: The CLIENT

SET_PLAYER:ForEachPlayer(IteratorFunction, ...)

Iterate the SET_PLAYER and call an interator function for each alive CLIENT, providing the CLIENT and optional parameters.

Parameters

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

  • ... :

Return value

#SET_PLAYER: self

SET_PLAYER:ForEachPlayerInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_PLAYER and call an iterator function for each alive CLIENT presence completely in a Zone, providing the CLIENT and optional parameters to the called function.

Parameters

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

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

  • ... :

Return value

#SET_PLAYER: self

SET_PLAYER:ForEachPlayerNotInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_PLAYER and call an iterator function for each alive CLIENT presence not in a Zone, providing the CLIENT and optional parameters to the called function.

Parameters

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

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

  • ... :

Return value

#SET_PLAYER: self

SET_PLAYER:IsIncludeObject(MClient)

Parameter

Return value

#SET_PLAYER: self

SET_PLAYER:New()

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

Return value

#SET_PLAYER:

Usage:

-- Define a new SET_PLAYER Object. This DBObject will contain a reference to all Clients.
DBObject = SET_PLAYER:New()
SET_PLAYER:RemoveClientsByName(RemoveClientNames)

Remove CLIENT(s) from SET_PLAYER.

Parameter

Return value

self

Type SET_STATIC

Field(s)

SET_STATIC: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 STATIC

  2. #table: The STATIC

SET_STATIC:AddStatic(AddStatic)

Add STATIC(s) to SET_STATIC.

Parameter

  • #string AddStatic : A single STATIC.

Return value

#SET_STATIC: self

SET_STATIC:AddStaticsByName(AddStaticNames)

Add STATIC(s) to SET_STATIC.

Parameter

  • #string AddStaticNames : A single name or an array of STATIC names.

Return value

#SET_STATIC: self

SET_STATIC: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_STATIC: self

SET_STATIC: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_STATIC: self

SET_STATIC: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_STATIC: self

SET_STATIC: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_STATIC: self

SET_STATIC:FilterStart()

Starts the filtering.

Return value

#SET_STATIC: self

SET_STATIC: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_STATIC: self

SET_STATIC: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 STATIC

  2. #table: The STATIC

SET_STATIC:FindStatic(StaticName)

Finds a Static based on the Static Name.

Parameter

  • #string StaticName :

Return value

Wrapper.Static#STATIC: The found Static.

SET_STATIC:ForEachStatic(IteratorFunction, ...)

Iterate the SET_STATIC and call an interator function for each alive STATIC, providing the STATIC and optional parameters.

Parameters

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

  • ... :

Return value

#SET_STATIC: self

SET_STATIC:ForEachStaticCompletelyInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_STATIC and call an iterator function for each alive STATIC presence completely in a Zone, providing the STATIC and optional parameters to the called function.

Parameters

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

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

  • ... :

Return value

#SET_STATIC: self

SET_STATIC:ForEachStaticInZone(IteratorFunction, ...)

Check if minimal one element of the SET_STATIC is in the Zone.

Parameters

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

  • ... :

Return value

#SET_STATIC: self

SET_STATIC:ForEachStaticNotInZone(ZoneObject, IteratorFunction, ...)

Iterate the SET_STATIC and call an iterator function for each alive STATIC presence not in a Zone, providing the STATIC and optional parameters to the called function.

Parameters

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

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

  • ... :

Return value

#SET_STATIC: self

SET_STATIC:GetCoordinate()

Get the center coordinate of the SET_STATIC.

Return value

Core.Point#COORDINATE: The center coordinate of all the units in the set, including heading in degrees and speed in mps in case of moving units.

SET_STATIC:GetFirst()

Get the first unit from the set.

Return value

Wrapper.Static#STATIC: The STATIC object.

SET_STATIC:GetHeading()

Get the average heading of the SET_STATIC.

Return value

#number: Heading Heading in degrees and speed in mps in case of moving units.

SET_STATIC:GetStaticTypes()

Returns map of unit types.

Return value

#map:

string,#number> A map of the unit types found. The key is the StaticTypeName and the value is the amount of unit types found.

SET_STATIC:GetStaticTypesText()

Returns a comma separated string of the unit types with a count in the Set.

Return value

#string: The unit types string

SET_STATIC:GetTypeNames(Delimiter)

Retrieve the type names of the Statics in the SET, delimited by an optional delimiter.

Parameter

  • #string Delimiter : (optional) The delimiter, which is default a comma.

Return value

#string: The types of the Statics delimited.

SET_STATIC:GetVelocity()

Get the maximum velocity of the SET_STATIC.

Return value

#number: The speed in mps in case of moving units.

SET_STATIC:IsIncludeObject(MStatic)

Parameter

Return value

#SET_STATIC: self

SET_STATIC:IsNotInZone(ZoneObject, Zone)

Check if no element of the SET_STATIC is in the Zone.

Parameters

Return value

#boolean:

SET_STATIC:IsPatriallyInZone(Zone)

Check if minimal one element of the SET_STATIC is in the Zone.

Parameter

Return value

#boolean:

SET_STATIC:New()

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

Return value

#SET_STATIC:

Usage:

-- Define a new SET_STATIC Object. This DBObject will contain a reference to all alive Statics.
DBObject = SET_STATIC:New()
SET_STATIC:RemoveStaticsByName(RemoveStaticNames)

Remove STATIC(s) from SET_STATIC.

Parameter

Return value

self

Type SET_UNIT

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

SET_UNIT:AddUnit(AddUnit)

Add UNIT(s) to SET_UNIT.

Parameter

  • #string AddUnit : A single UNIT.

Return value

#SET_UNIT: self

SET_UNIT:AddUnitsByName(AddUnitNames)

Add UNIT(s) to SET_UNIT.

Parameter

  • #string AddUnitNames : A single name or an array of UNIT names.

Return value

#SET_UNIT: self

SET_UNIT:CalculateThreatLevelA2G()

Calculate the maxium A2G threat level of the SET_UNIT.

Return value

#number: The maximum threatlevel

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:FilterHasRadar(RadarTypes)

Builds a set of units having a radar of give types.

All the units having a radar of a given type will be included within the set.

Parameter

  • #table RadarTypes : The radar types.

Return value

#SET_UNIT: self

SET_UNIT:FilterHasSEAD()

Builds a set of SEADable units.

Return value

#SET_UNIT: self

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

Wrapper.Unit#UNIT: The found Unit.

SET_UNIT:ForEachUnit(IteratorFunction, ...)

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

Iterate the SET_UNIT and call an iterator function for each alive UNIT presence completely in a Zone, providing the UNIT and optional parameters to the called function.

Parameters

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

  • #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:ForEachUnitInZone(IteratorFunction, ...)

Check if minimal one element of the SET_UNIT is in the Zone.

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

Iterate the SET_UNIT and call an iterator function for each alive UNIT presence not in a Zone, providing the UNIT and optional parameters to the called function.

Parameters

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

  • #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:ForEachUnitPerThreatLevel(FromThreatLevel, ToThreatLevel, IteratorFunction, ...)

Iterate the SET_UNIT sorted *per Threat Level and call an interator function for each alive UNIT, providing the UNIT and optional parameters.

Parameters

  • #number FromThreatLevel : The TreatLevel to start the evaluation From (this must be a value between 0 and 10).

  • #number ToThreatLevel : The TreatLevel to stop the evaluation To (this must be a value between 0 and 10).

  • #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

Usage:


    UnitSet:ForEachUnitPerThreatLevel( 10, 0,
      -- @param Wrapper.Unit#UNIT UnitObject The UNIT object in the UnitSet, that will be passed to the local function for evaluation.
      function( UnitObject )
        .. logic ..
      end
    )
SET_UNIT:GetCoordinate()

Get the center coordinate of the SET_UNIT.

Return value

Core.Point#COORDINATE: The center coordinate of all the units in the set, including heading in degrees and speed in mps in case of moving units.

SET_UNIT:GetFirst()

Get the first unit from the set.

Return value

Wrapper.Unit#UNIT: The UNIT object.

SET_UNIT:GetHeading()

Get the average heading of the SET_UNIT.

Return value

#number: Heading Heading in degrees and speed in mps in case of moving units.

SET_UNIT:GetTypeNames(Delimiter)

Retrieve the type names of the Units in the SET, delimited by an optional delimiter.

Parameter

  • #string Delimiter : (optional) The delimiter, which is default a comma.

Return value

#string: The types of the Units delimited.

SET_UNIT:GetUnitThreatLevels()

Returns map of unit threat levels.

Return value

#table:

SET_UNIT:GetUnitTypes()

Returns map of unit types.

Return value

#map:

string,#number> A map of the unit types found. The key is the UnitTypeName and the value is the amount of unit types found.

SET_UNIT:GetUnitTypesText()

Returns a comma separated string of the unit types with a count in the Set.

Return value

#string: The unit types string

SET_UNIT:GetVelocity()

Get the maximum velocity of the SET_UNIT.

Return value

#number: The speed in mps in case of moving units.

SET_UNIT:HasFriendlyUnits(FriendlyCoalition)

Returns if the Set has friendly ground units.

Parameter

  • FriendlyCoalition :

Return value

#number: The amount of ground targets in the Set.

SET_UNIT:HasGroundUnits()

Returns if the Set has ground targets.

Return value

#number: The amount of ground targets in the Set.

SET_UNIT:HasRadar(RadarType)

Returns if the Set has targets having a radar (of a given type).

Parameter

Return value

#number: The amount of radars in the Set with the given type

SET_UNIT:HasSEAD()

Returns if the Set has targets that can be SEADed.

Return value

#number: The amount of SEADable units in the Set

SET_UNIT:IsIncludeObject(MUnit)

Parameter

Return value

#SET_UNIT: self

SET_UNIT:IsNotInZone(ZoneObject, Zone)

Check if no element of the SET_UNIT is in the Zone.

Parameters

Return value

#boolean:

SET_UNIT:IsPartiallyInZone(ZoneTest)

Check if minimal one element of the SET_UNIT is in the Zone.

Parameter

Return value

#boolean:

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:RemoveUnitsByName(RemoveUnitNames)

Remove UNIT(s) from SET_UNIT.

Parameter

Return value

self

Type SET_ZONE

Field(s)

SET_ZONE: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 AIRBASE

  2. #table: The AIRBASE

SET_ZONE:AddZonesByName(AddZoneNames)

Add ZONEs to SET_ZONE.

Parameter

  • #string AddZoneNames : A single name or an array of ZONE_BASE names.

Return value

self

SET_ZONE:FilterPrefixes(Prefixes)

Builds a set of zones of defined zone prefixes.

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

Parameter

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

Return value

#SET_ZONE: self

SET_ZONE:FilterStart()

Starts the filtering.

Return value

#SET_ZONE: self

SET_ZONE: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 AIRBASE

  2. #table: The AIRBASE

SET_ZONE:FindZone(ZoneName)

Finds a Zone based on the Zone Name.

Parameter

  • #string ZoneName :

Return value

Core.Zone#ZONE_BASE: The found Zone.

SET_ZONE:ForEachZone(IteratorFunction, ...)

Iterate the SET_ZONE and call an interator function for each ZONE, providing the ZONE and optional parameters.

Parameters

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

  • ... :

Return value

#SET_ZONE: self

SET_ZONE:GetRandomZone()

Get a random zone from the set.

Return values

  1. Core.Zone#ZONE_BASE: The random Zone.

  2. #nil: if no zone in the collection.

SET_ZONE:IsIncludeObject(MZone)

Parameter

Return value

#SET_ZONE: self

SET_ZONE:New()

Creates a new SET_ZONE object, building a set of zones.

Return value

#SET_ZONE: self

Usage:

-- Define a new SET_ZONE Object. The DatabaseSet will contain a reference to all Zones.
DatabaseSet = SET_ZONE:New()
SET_ZONE:OnEventDeleteZone(EventData)

Handles the OnDead or OnCrash event for alive units set.

Parameter

SET_ZONE:OnEventNewZone(EventData)

Handles the OnEventNewZone event for the Set.

Parameter

SET_ZONE:RemoveZonesByName(RemoveZoneNames)

Remove ZONEs from SET_ZONE.

Parameter

Return value

self

SET_ZONE:SetZoneProbability(ZoneName, ZoneProbability)

Set a zone probability.

Parameters

  • #string ZoneName : The name of the zone.

  • ZoneProbability :

Type map