From d1b8eda700a9957026fba77aa3a7ad0825ddc179 Mon Sep 17 00:00:00 2001 From: svenvandevelde Date: Mon, 23 May 2016 11:56:40 +0200 Subject: [PATCH] Documentation --- Documentation/Base.html | 1 + Documentation/CARGO.html | 1 + Documentation/CLEANUP.html | 1 + Documentation/Client.html | 238 +-- Documentation/DEPLOYTASK.html | 1 + Documentation/DESTROYBASETASK.html | 1 + Documentation/DESTROYGROUPSTASK.html | 1 + Documentation/DESTROYRADARSTASK.html | 1 + Documentation/DESTROYUNITTYPESTASK.html | 1 + Documentation/Database.html | 365 ++--- Documentation/Escort.html | 2 +- Documentation/Event.html | 1 + Documentation/GOHOMETASK.html | 1 + Documentation/Group.html | 7 +- Documentation/MISSION.html | 1 + Documentation/MOVEMENT.html | 1 + Documentation/Menu.html | 1 + Documentation/Message.html | 1 + Documentation/MissileTrainer.html | 1 + Documentation/NOTASK.html | 1 + Documentation/PICKUPTASK.html | 1 + Documentation/ROUTETASK.html | 1 + Documentation/STAGE.html | 1 + Documentation/Scheduler.html | 1 + Documentation/Scoring.html | 1 + Documentation/Sead.html | 1 + Documentation/Set.html | 1318 +++++++++++++++++ Documentation/Spawn.html | 1 + Documentation/TASK.html | 1 + Documentation/Unit.html | 618 ++++++-- Documentation/Zone.html | 1 + Documentation/index.html | 16 +- Documentation/routines.html | 1 + Moose/Unit.lua | 159 +- ...BASE - UNIT - CLIENT - GROUP - ZONE, .pptx | Bin 807274 -> 807332 bytes 35 files changed, 2151 insertions(+), 598 deletions(-) create mode 100644 Documentation/Set.html diff --git a/Documentation/Base.html b/Documentation/Base.html index c691d7457..cec5967a3 100644 --- a/Documentation/Base.html +++ b/Documentation/Base.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/CARGO.html b/Documentation/CARGO.html index dbce3e8d9..3927ac107 100644 --- a/Documentation/CARGO.html +++ b/Documentation/CARGO.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/CLEANUP.html b/Documentation/CLEANUP.html index 6946d1aa9..4e3e55cb0 100644 --- a/Documentation/CLEANUP.html +++ b/Documentation/CLEANUP.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Client.html b/Documentation/Client.html index f19da4d0b..b45d4be53 100644 --- a/Documentation/Client.html +++ b/Documentation/Client.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • @@ -164,24 +165,12 @@ Note that clients are NOT the same as Units, they are NOT necessarily alive.

    CLIENT.ClientParameters - - - - CLIENT:ClientPosition() - -

    Returns the position of the CLIENT in DCSTypes#Vec3 format.

    CLIENT.ClientTransport - - - - CLIENT:GetAltitude() - -

    Returns the altitude of the CLIENT.

    @@ -212,48 +201,6 @@ Note that clients are NOT the same as Units, they are NOT necessarily alive.

    CLIENT:GetDCSGroup()

    Return the DCSGroup of a Client.

    - - - - CLIENT:GetID() - - - - - - CLIENT:GetName() - - - - - - CLIENT:GetPointVec2() - -

    Returns the position of the CLIENT in DCSTypes#Vec2 format..

    - - - - CLIENT:GetPositionVec3() - - - - - - CLIENT:GetTypeName() - - - - - - CLIENT:GetUnit() - - - - - - CLIENT:IsAlive() - -

    Checks if client is alive and returns true or false.

    @@ -290,6 +237,12 @@ Note that clients are NOT the same as Units, they are NOT necessarily alive.

    CLIENT:Message(Message, MessageDuration, MessageId, MessageCategory, MessageInterval)

    The main message driver for the CLIENT.

    + + + + CLIENT.MessageSwitch + + @@ -308,6 +261,12 @@ Note that clients are NOT the same as Units, they are NOT necessarily alive.

    CLIENT.ONBOARDSIDE + + + + CLIENT:Register(ClientName) + + @@ -577,6 +536,7 @@ Function.

    + CLIENT.ClientName @@ -599,24 +559,6 @@ Function.

    - -
    -
    -
    - - -CLIENT:ClientPosition() - -
    -
    - -

    Returns the position of the CLIENT in DCSTypes#Vec3 format.

    - -

    Return value

    - -

    DCSTypes#Vec3:

    - -
    @@ -631,24 +573,6 @@ Function.

    - -
    -
    -
    - - -CLIENT:GetAltitude() - -
    -
    - -

    Returns the altitude of the CLIENT.

    - -

    Return value

    - -

    DCSTypes#Distance:

    - -
    @@ -743,105 +667,6 @@ Function.

    DCSGroup#Group:

    - -
    -
    -
    - - -CLIENT:GetID() - -
    -
    - - - -
    -
    -
    -
    - - -CLIENT:GetName() - -
    -
    - - - -
    -
    -
    -
    - - -CLIENT:GetPointVec2() - -
    -
    - -

    Returns the position of the CLIENT in DCSTypes#Vec2 format..

    - -

    Return value

    - -

    DCSTypes#Vec2:

    - - -
    -
    -
    -
    - - -CLIENT:GetPositionVec3() - -
    -
    - - - -
    -
    -
    -
    - - -CLIENT:GetTypeName() - -
    -
    - - - -
    -
    -
    -
    - - -CLIENT:GetUnit() - -
    -
    - - - - -

    TODO what is this??? check. possible double function.

    - -
    -
    -
    -
    - - -CLIENT:IsAlive() - -
    -
    - -

    Checks if client is alive and returns true or false.

    -
    @@ -969,6 +794,20 @@ is the interval in seconds between the display of the +
    + + #boolean + +CLIENT.MessageSwitch + +
    +
    + + +
    @@ -1040,6 +879,27 @@ Text that describes the briefing of the mission when a Player logs into the Clie + +
    +
    +
    + + +CLIENT:Register(ClientName) + +
    +
    + + + +

    Parameter

    +
      +
    • + +

      ClientName :

      + +
    • +
    diff --git a/Documentation/DEPLOYTASK.html b/Documentation/DEPLOYTASK.html index 2d68b6cfa..8f8bebbc4 100644 --- a/Documentation/DEPLOYTASK.html +++ b/Documentation/DEPLOYTASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/DESTROYBASETASK.html b/Documentation/DESTROYBASETASK.html index 32d486ea6..2fdf173df 100644 --- a/Documentation/DESTROYBASETASK.html +++ b/Documentation/DESTROYBASETASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/DESTROYGROUPSTASK.html b/Documentation/DESTROYGROUPSTASK.html index 01411a4f9..88cb8aba6 100644 --- a/Documentation/DESTROYGROUPSTASK.html +++ b/Documentation/DESTROYGROUPSTASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/DESTROYRADARSTASK.html b/Documentation/DESTROYRADARSTASK.html index 6cb878888..e7de3a904 100644 --- a/Documentation/DESTROYRADARSTASK.html +++ b/Documentation/DESTROYRADARSTASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/DESTROYUNITTYPESTASK.html b/Documentation/DESTROYUNITTYPESTASK.html index 9890c4507..cb581bed7 100644 --- a/Documentation/DESTROYUNITTYPESTASK.html +++ b/Documentation/DESTROYUNITTYPESTASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Database.html b/Documentation/Database.html index 8192f0de6..07554c5b7 100644 --- a/Documentation/Database.html +++ b/Documentation/Database.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • @@ -139,6 +140,18 @@ The following iterator methods are currently available within the DATABASE:

    Type DATABASE

    + + + + + + + + - - - - @@ -175,39 +182,15 @@ The following iterator methods are currently available within the DATABASE:

    - + - - - - - - - - - - - - - - - - @@ -217,21 +200,15 @@ The following iterator methods are currently available within the DATABASE:

    - + - + - - - - @@ -247,7 +224,7 @@ The following iterator methods are currently available within the DATABASE:

    - + @@ -268,12 +245,6 @@ The following iterator methods are currently available within the DATABASE:

    - - - - @@ -340,12 +311,6 @@ The following iterator methods are currently available within the DATABASE:

    - - - - @@ -435,6 +400,53 @@ The following iterator methods are currently available within the DATABASE:

    + +DATABASE:AddClient(ClientName) + +
    +
    + +

    Adds a CLIENT based on the ClientName in the DATABASE.

    + +

    Parameter

    +
      +
    • + +

      ClientName :

      + +
    • +
    +
    +
    +
    +
    + + +DATABASE:AddUnit(DCSUnit, DCSUnitName) + +
    +
    + +

    Adds a Unit based on the Unit Name in the DATABASE.

    + +

    Parameters

    +
      +
    • + +

      DCSUnit :

      + +
    • +
    • + +

      DCSUnitName :

      + +
    • +
    +
    +
    +
    +
    + #string DATABASE.ClassName @@ -486,20 +498,6 @@ The following iterator methods are currently available within the DATABASE:

    - -
    -
    -
    - - - -DATABASE.DCSGroupsAlive - -
    -
    - - -
    @@ -519,15 +517,22 @@ The following iterator methods are currently available within the DATABASE:

    - - -DATABASE.DCSUnitsAlive + +DATABASE:DeleteUnit(DCSUnitName)
    +

    Deletes a Unit from the DATABASE based on the Unit Name.

    +

    Parameter

    +
      +
    • + +

      DCSUnitName :

      +
    • +
    @@ -542,126 +547,6 @@ The following iterator methods are currently available within the DATABASE:

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

    - -

    #DATABASE: -self

    - -
    -
    -
    -
    - - -DATABASE:FilterCoalitions(Coalitions) - -
    -
    - -

    Builds a set of units of coalitons.

    - - -

    Possible current coalitions are red, blue and neutral.

    - -

    Parameter

    -
      -
    • - -

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

      - -
    • -
    -

    Return value

    - -

    #DATABASE: -self

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

    - -

    #DATABASE: -self

    - -
    -
    -
    -
    - - -DATABASE:FilterGroupPrefixes(Prefixes) - -
    -
    - -

    Builds a set of units of defined group prefixes.

    - - -

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

    - -

    Parameter

    -
      -
    • - -

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

      - -
    • -
    -

    Return value

    - -

    #DATABASE: -self

    -
    @@ -681,78 +566,52 @@ self

    - -DATABASE:FilterStart() + +DATABASE:FindClient(ClientName)
    -

    Starts the filtering.

    +

    Finds a CLIENT based on the ClientName.

    +

    Parameter

    +
      +
    • + +

      #string ClientName :

      + +
    • +

    Return value

    -

    #DATABASE: -self

    +

    Client#CLIENT: +The found CLIENT.

    - -DATABASE:FilterTypes(Types) + +DATABASE:FindUnit(UnitName)
    -

    Builds a set of units of defined unit types.

    - - -

    Possible current types are those types known within DCS world.

    +

    Finds a Unit based on the Unit Name.

    Parameter

    • -

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

      +

      #string UnitName :

    Return value

    -

    #DATABASE: -self

    - -
    -
    -
    -
    - - -DATABASE:FilterUnitPrefixes(Prefixes) - -
    -
    - -

    Builds a set of units of defined unit prefixes.

    - - -

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

    - -

    Parameter

    -
      -
    • - -

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

      - -
    • -
    -

    Return value

    - -

    #DATABASE: -self

    +

    Unit#UNIT: +The found Unit.

    @@ -828,8 +687,8 @@ self

    - -DATABASE:ForEachDCSUnitAlive(IteratorFunction, ...) + +DATABASE:ForEachDCSUnit(IteratorFunction, ...)
    @@ -922,20 +781,6 @@ self

    -
    -
    -
    -
    - - - -DATABASE.GroupsAlive - -
    -
    - - -
    @@ -1133,20 +978,6 @@ self

    - -
    -
    -
    - - - -DATABASE.UnitsAlive - -
    -
    - - -
    diff --git a/Documentation/Escort.html b/Documentation/Escort.html index b1fe8f549..5c70cc46c 100644 --- a/Documentation/Escort.html +++ b/Documentation/Escort.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • @@ -1835,7 +1836,6 @@ self

    - ESCORT.ReportTargetsScheduler diff --git a/Documentation/Event.html b/Documentation/Event.html index b05cb6788..ce93521fd 100644 --- a/Documentation/Event.html +++ b/Documentation/Event.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/GOHOMETASK.html b/Documentation/GOHOMETASK.html index 4b63dc32e..a2aedee46 100644 --- a/Documentation/GOHOMETASK.html +++ b/Documentation/GOHOMETASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Group.html b/Documentation/Group.html index be3012b46..eccd41bc8 100644 --- a/Documentation/Group.html +++ b/Documentation/Group.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • @@ -213,7 +214,7 @@ Note that this destroy method also raises a destroy event at run-time.

    - + @@ -1147,8 +1148,8 @@ Current x,y and z position of the group.

    - -GROUP:GetPositionVec3() + +GROUP:GetPointVec3()
    diff --git a/Documentation/MISSION.html b/Documentation/MISSION.html index 9de091e4d..d20297316 100644 --- a/Documentation/MISSION.html +++ b/Documentation/MISSION.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/MOVEMENT.html b/Documentation/MOVEMENT.html index 98df22b0c..2e1825e50 100644 --- a/Documentation/MOVEMENT.html +++ b/Documentation/MOVEMENT.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Menu.html b/Documentation/Menu.html index 58ccee4f5..c2e778b76 100644 --- a/Documentation/Menu.html +++ b/Documentation/Menu.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Message.html b/Documentation/Message.html index dd4087bf7..ecaa029d9 100644 --- a/Documentation/Message.html +++ b/Documentation/Message.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/MissileTrainer.html b/Documentation/MissileTrainer.html index e97906500..54a295ba7 100644 --- a/Documentation/MissileTrainer.html +++ b/Documentation/MissileTrainer.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/NOTASK.html b/Documentation/NOTASK.html index d49ebedf5..d56be9578 100644 --- a/Documentation/NOTASK.html +++ b/Documentation/NOTASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/PICKUPTASK.html b/Documentation/PICKUPTASK.html index d888999c0..3b5c01584 100644 --- a/Documentation/PICKUPTASK.html +++ b/Documentation/PICKUPTASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/ROUTETASK.html b/Documentation/ROUTETASK.html index c95432e3e..9ab3852b2 100644 --- a/Documentation/ROUTETASK.html +++ b/Documentation/ROUTETASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/STAGE.html b/Documentation/STAGE.html index fd2ceedc0..985997808 100644 --- a/Documentation/STAGE.html +++ b/Documentation/STAGE.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Scheduler.html b/Documentation/Scheduler.html index 10a410720..cb5845838 100644 --- a/Documentation/Scheduler.html +++ b/Documentation/Scheduler.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Scoring.html b/Documentation/Scoring.html index 34d058056..ad5556374 100644 --- a/Documentation/Scoring.html +++ b/Documentation/Scoring.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Sead.html b/Documentation/Sead.html index d4631a922..55b652c23 100644 --- a/Documentation/Sead.html +++ b/Documentation/Sead.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Set.html b/Documentation/Set.html new file mode 100644 index 000000000..078f9d754 --- /dev/null +++ b/Documentation/Set.html @@ -0,0 +1,1318 @@ + + + + + + +
    +
    + +
    +
    +
    +
    + +
    +

    Module Set

    + +

    Manage sets of units and groups.

    + + + +

    #Set class

    +

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

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

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

    + +

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

    + +

    SET construction methods:

    +

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

    + +
      +
    • SET.New: Creates a new SET object.
    • +
    + + +

    SET filter criteria:

    +

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

    + + + +

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

    + + + +

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

    + + + + +

    SET iterators:

    +

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

    + + + +

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

    + +
      +
    • SET.ForEachUnit: Calls a function for each unit contained within the SET.
    • +
    • SET.ForEachGroup: Calls a function for each group contained within the SET.
    • +
    • SET.ForEachUnitInZone: Calls a function for each unit within a certain zone contained within the SET.
    • +
    + +
    + +

    Global(s)

    +
    DATABASE:AddClient(ClientName) +

    Adds a CLIENT based on the ClientName in the DATABASE.

    +
    DATABASE:AddUnit(DCSUnit, DCSUnitName) +

    Adds a Unit based on the Unit Name in the DATABASE.

    +
    DATABASE.ClassName @@ -160,12 +173,6 @@ The following iterator methods are currently available within the DATABASE:

    DATABASE.DCSGroups -
    DATABASE.DCSGroupsAlive -
    DATABASE.DCSUnitsAliveDATABASE:DeleteUnit(DCSUnitName) - +

    Deletes a Unit from the DATABASE based on the Unit Name.

    DATABASE.Filter -
    DATABASE:FilterCategories(Categories) -

    Builds a set of units out of categories.

    -
    DATABASE:FilterCoalitions(Coalitions) -

    Builds a set of units of coalitons.

    -
    DATABASE:FilterCountries(Countries) -

    Builds a set of units of defined countries.

    -
    DATABASE:FilterGroupPrefixes(Prefixes) -

    Builds a set of units of defined group prefixes.

    DATABASE:FilterStart()DATABASE:FindClient(ClientName) -

    Starts the filtering.

    +

    Finds a CLIENT based on the ClientName.

    DATABASE:FilterTypes(Types)DATABASE:FindUnit(UnitName) -

    Builds a set of units of defined unit types.

    -
    DATABASE:FilterUnitPrefixes(Prefixes) -

    Builds a set of units of defined unit prefixes.

    +

    Finds a Unit based on the Unit Name.

    DATABASE:ForEachDCSUnitAlive(IteratorFunction, ...)DATABASE:ForEachDCSUnit(IteratorFunction, ...)

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

    DATABASE.Groups -
    DATABASE.GroupsAlive -
    DATABASE.Units -
    DATABASE.UnitsAlive -
    GROUP:GetPositionVec3()GROUP:GetPointVec3()

    Gets the current Point of the GROUP in VEC3 format.

    + + + + +
    SET + +
    +

    Type SET

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    SET:AddUnit(UnitToAdd) +

    Finds a Unit based on the Unit Name.

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

    Builds a set of units out of categories.

    +
    SET:FilterCoalitions(Coalitions) +

    Builds a set of units of coalitons.

    +
    SET:FilterCountries(Countries) +

    Builds a set of units of defined countries.

    +
    SET:FilterGroupPrefixes(Prefixes) +

    Builds a set of units of defined group prefixes.

    +
    SET.FilterMeta + +
    SET:FilterStart() +

    Starts the filtering.

    +
    SET:FilterTypes(Types) +

    Builds a set of units of defined unit types.

    +
    SET:FilterUnitPrefixes(Prefixes) +

    Builds a set of units of defined unit prefixes.

    +
    SET:FindUnit(UnitName) +

    Finds a Unit based on the Unit Name.

    +
    SET:ForEach(IteratorFunction, arg, Set) +

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

    +
    SET:ForEachClient(IteratorFunction, ...) +

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

    +
    SET:ForEachDCSUnitAlive(IteratorFunction, ...) +

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

    +
    SET:ForEachPlayer(IteratorFunction, ...) +

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

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

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

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

    Traces the current SET contents in the log ...

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

    Handles the OnBirth event for the alive units set.

    +
    SET:_EventOnDeadOrCrash(Event) +

    Handles the OnDead or OnCrash event for alive units set.

    +
    SET:_EventOnPlayerEnterUnit(Event) +

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

    +
    SET:_EventOnPlayerLeaveUnit(Event) +

    Handles the OnPlayerLeaveUnit event to clean the active players table.

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

    Private method that registers all datapoints within in the mission.

    +
    SET:_RegisterPlayers() +

    Private method that registers all alive players in the mission.

    +
    + +

    Global(s)

    +
    +
    + + #SET + +SET + +
    +
    + + + +
    +
    +

    Type Set

    + +

    Type SET

    + +

    SET class

    + +

    Field(s)

    +
    +
    + + +SET:AddUnit(UnitToAdd) + +
    +
    + +

    Finds a Unit based on the Unit Name.

    + +

    Parameter

    + +

    Return value

    + +

    Unit#UNIT: +The added Unit.

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

    Builds a set of units out of categories.

    + + +

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

    + +

    Parameter

    +
      +
    • + +

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

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:FilterCoalitions(Coalitions) + +
    +
    + +

    Builds a set of units of coalitons.

    + + +

    Possible current coalitions are red, blue and neutral.

    + +

    Parameter

    +
      +
    • + +

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

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:FilterCountries(Countries) + +
    +
    + +

    Builds a set of units of defined countries.

    + + +

    Possible current countries are those known within DCS world.

    + +

    Parameter

    +
      +
    • + +

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

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:FilterGroupPrefixes(Prefixes) + +
    +
    + +

    Builds a set of units of defined group prefixes.

    + + +

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

    + +

    Parameter

    +
      +
    • + +

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

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + + +SET.FilterMeta + +
    +
    + + + +
    +
    +
    +
    + + +SET:FilterStart() + +
    +
    + +

    Starts the filtering.

    + +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:FilterTypes(Types) + +
    +
    + +

    Builds a set of units of defined unit types.

    + + +

    Possible current types are those types known within DCS world.

    + +

    Parameter

    +
      +
    • + +

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

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:FilterUnitPrefixes(Prefixes) + +
    +
    + +

    Builds a set of units of defined unit prefixes.

    + + +

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

    + +

    Parameter

    +
      +
    • + +

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

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:FindUnit(UnitName) + +
    +
    + +

    Finds a Unit based on the Unit Name.

    + +

    Parameter

    +
      +
    • + +

      #string UnitName :

      + +
    • +
    +

    Return value

    + +

    Unit#UNIT: +The found Unit.

    + +
    +
    +
    +
    + + +SET:ForEach(IteratorFunction, arg, Set) + +
    +
    + +

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

    + +

    Parameters

    +
      +
    • + +

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

      + +
    • +
    • + +

      arg :

      + +
    • +
    • + +

      Set :

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:ForEachClient(IteratorFunction, ...) + +
    +
    + +

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

    + +

    Parameters

    +
      +
    • + +

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

      + +
    • +
    • + +

      ... :

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:ForEachDCSUnitAlive(IteratorFunction, ...) + +
    +
    + +

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

    + +

    Parameters

    +
      +
    • + +

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

      + +
    • +
    • + +

      ... :

      + +
    • +
    +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:ForEachPlayer(IteratorFunction, ...) + +
    +
    + +

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

    + +

    Parameters

    +
      +
    • + +

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

      + +
    • +
    • + +

      ... :

      + +
    • +
    +

    Return value

    + +

    #SET: +self

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

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

    + +

    Return value

    + +

    #SET:

    + + +

    Usage:

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

    Traces the current SET contents in the log ...

    + + +

    (for debug reasons).

    + +

    Return value

    + +

    #SET: +self

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

    Handles the OnBirth event for the alive units set.

    + +

    Parameter

    + +
    +
    +
    +
    + + +SET:_EventOnDeadOrCrash(Event) + +
    +
    + +

    Handles the OnDead or OnCrash event for alive units set.

    + +

    Parameter

    + +
    +
    +
    +
    + + +SET:_EventOnPlayerEnterUnit(Event) + +
    +
    + +

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

    + +

    Parameter

    + +
    +
    +
    +
    + + +SET:_EventOnPlayerLeaveUnit(Event) + +
    +
    + +

    Handles the OnPlayerLeaveUnit event to clean the active players table.

    + +

    Parameter

    + +
    +
    +
    +
    + + +SET:_IsAliveDCSGroup(DCSGroup) + +
    +
    + + + +

    Parameter

    + +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:_IsAliveDCSUnit(DCSUnit) + +
    +
    + + + +

    Parameter

    + +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:_IsIncludeDCSUnit(DCSUnit) + +
    +
    + + + +

    Parameter

    + +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:_RegisterDatabase() + +
    +
    + +

    Private method that registers all datapoints within in the mission.

    + +

    Return value

    + +

    #SET: +self

    + +
    +
    +
    +
    + + +SET:_RegisterPlayers() + +
    +
    + +

    Private method that registers all alive players in the mission.

    + +

    Return value

    + +

    #SET: +self

    + +
    +
    + + + + + + diff --git a/Documentation/Spawn.html b/Documentation/Spawn.html index 2f5ba12ef..b0c92b062 100644 --- a/Documentation/Spawn.html +++ b/Documentation/Spawn.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/TASK.html b/Documentation/TASK.html index d18c673ff..fee28dd8f 100644 --- a/Documentation/TASK.html +++ b/Documentation/TASK.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Documentation/Unit.html b/Documentation/Unit.html index f08c9006c..c55741f7e 100644 --- a/Documentation/Unit.html +++ b/Documentation/Unit.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • @@ -53,7 +54,43 @@

    Module Unit

    -

    UNIT Classes

    +

    UNIT Class

    + +

    UNIT class

    +

    The UNIT class is a wrapper class to handle the DCS Unit objects:

    + +
      +
    • Support all DCS Unit APIs.
    • +
    + + +
      +
    • Enhance with Unit specific APIs not in the DCS Unit API set.
    • +
    • Handle local Unit Controller.
    • +
    • Manage the "state" of the objects.
    • +
    + + +

    UNIT reference methods

    +

    For each DCS Unit object alive within a running mission, a UNIT wrapper object (instance) will be created within the _DATABASE object. +This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Unit objects are spawned (using the SPAWN class).

    + +

    The UNIT class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference +using the DCS Unit or the DCS UnitName.

    + +

    Another thing to know is that UNIT objects do not "contain" the DCS Unit object. +The UNIT methods will reference the DCS Unit object by name when it is needed during API execution. +If the DCS Unit object does not exist or is nil, the UNIT methods will return nil and log an exception in the DCS.log file.

    + +

    The UNIT class provides the following functions to retrieve quickly the relevant UNIT instance:

    + +
      +
    • UNIT.Find(): Find a UNIT instance from the _DATABASE object using a DCS Unit object.
    • +
    • UNIT.FindByName(): Find a UNIT instance from the _DATABASE object using a DCS Unit object.
    • +
    + +

    IMPORTANT: ONE SHOULD NEVER SANATIZE these UNIT OBJECT REFERENCES! (make the UNIT object references nil).

    +

    Global(s)

    @@ -76,6 +113,18 @@ + + + + + + + + @@ -112,6 +161,12 @@ + + + + @@ -129,7 +184,7 @@ @@ -189,7 +244,7 @@ @@ -207,19 +262,25 @@ + + + + @@ -241,19 +302,19 @@ @@ -272,24 +333,18 @@ - - - - - - - - + + + + @@ -446,6 +501,60 @@ + + +
    +
    + + +UNIT:Find(DCSUnit) + +
    +
    + +

    Finds a UNIT from the _DATABASE using a DCSUnit object.

    + +

    Parameter

    +
      +
    • + +

      DCSUnit#Unit DCSUnit : +An existing DCS Unit object reference.

      + +
    • +
    +

    Return value

    + +

    Unit#UNIT: +self

    + +
    +
    +
    +
    + + +UNIT:FindByName(UnitName) + +
    +
    + +

    Find a UNIT in the _DATABASE using the name of an existing DCS Unit.

    + +

    Parameter

    +
      +
    • + +

      #string UnitName : +The Unit Name.

      + +
    • +
    +

    Return value

    + +

    Unit#UNIT: +self

    +
    @@ -538,6 +647,34 @@
    + +UNIT:GetAltitude() + +
    +
    + +

    Returns the altitude of the DCS Unit.

    + +

    Return values

    +
      +
    1. + +

      DCSTypes#Distance: +The altitude of the DCS Unit.

      + +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    +
    +
    +
    +
    + UNIT:GetAmmo() @@ -546,11 +683,21 @@

    Returns the Unit's ammunition.

    -

    Return value

    +

    Return values

    +
      +
    1. DCSUnit#Unit.Ammo:

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -564,11 +711,21 @@

    Returns the unit's callsign - the localized string.

    -

    Return value

    +

    Return values

    +
      +
    1. #string: The Callsign of the Unit.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -580,12 +737,12 @@ The Callsign of the Unit.

    -

    Returns the Unit's Category Name as defined within the Unit's Descriptor.

    +

    Returns the DCS Unit category name as defined within the DCS Unit Descriptor.

    Return value

    #string: -Unit's Category Name

    +The DCS Unit Category Name

    @@ -600,11 +757,21 @@ Unit's Category Name

    Returns coalition of the Unit.

    -

    Return value

    +

    Return values

    +
      +
    1. -

      DCSCoalitionObject#coalition.side:

      +

      DCSCoalitionObject#coalition.side: +The side of the coalition.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      +
    4. +
    @@ -618,11 +785,21 @@ Unit's Category Name

    Returns country of the Unit.

    -

    Return value

    +

    Return values

    +
      +
    1. DCScountry#country.id: -The country identifyer.

      +The country identifier.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -652,11 +829,21 @@ The country identifyer.

    Descriptor type depends on unit category.

    -

    Return value

    +

    Return values

    +
      +
    1. DCSUnit#Unit.Desc: The Unit descriptor.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -673,11 +860,21 @@ The Unit descriptor.

    If there are additional fuel tanks the value may be greater than 1.0.

    -

    Return value

    +

    Return values

    +
      +
    1. #number: The relative amount of fuel (from 0.0 to 1.0).

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -691,11 +888,21 @@ The relative amount of fuel (from 0.0 to 1.0).

    Returns the unit's group if it exist and nil otherwise.

    -

    Return value

    +

    Return values

    +
      +
    1. Group#GROUP: The Group of the Unit.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -709,11 +916,21 @@ The Group of the Unit.

    Returns the unit's unique identifier.

    -

    Return value

    +

    Return values

    +
      +
    1. DCSUnit#Unit.ID: Unit ID

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -730,11 +947,21 @@ Unit ID

    Dead units has health <= 1.0.

    -

    Return value

    +

    Return values

    +
      +
    1. #number: The Unit's health value.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -748,11 +975,21 @@ The Unit's health value.

    Returns the Unit's initial health.

    -

    Return value

    +

    Return values

    +
      +
    1. #number: The Unit's initial health value.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -764,13 +1001,26 @@ The Unit's initial health value.

    -

    Returns unit object by the name assigned to the unit in Mission Editor.

    +

    Returns DCS Unit object name.

    -

    If there is unit with such name or the unit is destroyed the function will return nil. -The function provides access to non-activated units too. -

    +

    The function provides access to non-activated units too.

    +

    Return values

    +
      +
    1. + +

      #string: +The name of the DCS Unit.

      + +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -789,11 +1039,21 @@ The function provides access to non-activated units too. It may not be changed during the mission. If any unit in the group is destroyed, the numbers of another units will not be changed.

    -

    Return value

    +

    Return values

    +
      +
    1. #number: The Unit number.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -807,11 +1067,21 @@ The Unit number.

    Returns name of the player that control the unit or nil if the unit is controlled by A.I.

    -

    Return value

    +

    Return values

    +
      +
    1. #string: Player Name

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -823,8 +1093,51 @@ Player Name

    +

    Returns the DCSTypes#Vec2 vector indicating the point in 2D of the DCS Unit within the mission.

    +

    Return values

    +
      +
    1. + +

      DCSTypes#Vec2: +The 2D point vector of the DCS Unit.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    +
    +
    +
    +
    + + +UNIT:GetPointVec3() + +
    +
    + +

    Returns the DCSTypes#Vec3 vector indicating the point in 3D of the DCS Unit within the mission.

    + +

    Return values

    +
      +
    1. + +

      DCSTypes#Vec3: +The 3D point vector of the DCS Unit.

      + +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -836,8 +1149,23 @@ Player Name

    +

    Returns the DCSTypes#Position3 position vectors indicating the point and direction vectors in 3D of the DCS Unit within the mission.

    +

    Return values

    +
      +
    1. + +

      DCSTypes#Position: +The 3D position vectors of the DCS Unit.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -849,8 +1177,28 @@ Player Name

    +

    Returns the prefix name of the DCS Unit.

    + +

    A prefix name is a part of the name before a '#'-sign. +DCS Units spawned with the SPAWN class contain a '#'-sign to indicate the end of the (base) DCS Unit name. +The spawn sequence number and unit number are contained within the name after the '#' sign.

    +

    Return values

    +
      +
    1. + +

      #string: +The name of the DCS Unit.

      + +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -886,6 +1234,12 @@ Player Name

    DCSObject#Object: The object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.

    + +
  • + +

    #nil: +The DCS Unit is not existing or alive.

    +
  • @@ -901,11 +1255,21 @@ The object of the radar's interest. Not nil only if at least one radar of the un

    Returns the unit sensors.

    -

    Return value

    +

    Return values

    +
      +
    1. DCSUnit#Unit.Sensors:

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -917,8 +1281,23 @@ The object of the radar's interest. Not nil only if at least one radar of the un
    +

    Returns the type name of the DCS Unit.

    +

    Return values

    +
      +
    1. + +

      #string: +The type name of the DCS Unit.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -930,13 +1309,23 @@ The object of the radar's interest. Not nil only if at least one radar of the un
    -

    Returns the unit's velocity vector.

    +

    Returns the DCS Unit velocity vector.

    -

    Return value

    +

    Return values

    +
      +
    1. DCSTypes#Vec3: -Velocity Vector

      +The velocity vector

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -948,13 +1337,23 @@ Velocity Vector

    -

    Returns true if the Unit is in air.

    +

    Returns true if the DCS Unit is in the air.

    -

    Return value

    +

    Return values

    +
      +
    1. #boolean: true if in the air.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -968,11 +1367,21 @@ true if in the air.

    Returns if the unit is activated.

    -

    Return value

    +

    Return values

    +
      +
    1. #boolean: true if Unit is activated.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    @@ -1007,56 +1416,87 @@ Air category evaluation result.

    Returns if the unit is alive.

    -

    Return value

    +

    Return values

    +
      +
    1. #boolean: true if Unit is alive.

      +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    - -UNIT:New(DCSUnit) + +UNIT:OtherUnitInRadius(AwaitUnit, Radius) + +
    +
    + +

    Returns true if there is an other DCS Unit within a radius of the current 2D point of the DCS Unit.

    + +

    Parameters

    +
      +
    • + +

      Unit#UNIT AwaitUnit : +The other UNIT wrapper object.

      + +
    • +
    • + +

      Radius : +The radius in meters with the DCS Unit in the centre.

      + +
    • +
    +

    Return values

    +
      +
    1. + + +

      true If the other DCS Unit is within the radius of the 2D point of the DCS Unit.

      + +
    2. +
    3. + +

      #nil: +The DCS Unit is not existing or alive.

      + +
    4. +
    +
    +
    +
    +
    + + +UNIT:Register(DCSUnit, Database, UnitName)

    Create a new UNIT from DCSUnit.

    -

    Parameter

    +

    Parameters

    -

    Return value

    - -

    Unit#UNIT:

    - - -
    -
    -
    -
    - - -UNIT:NewFromName(Unit, UnitName) - -
    -
    - -

    Create a new UNIT from a Unit Name.

    - -

    Parameters

    -
    + + + + @@ -224,7 +231,14 @@ diff --git a/Documentation/routines.html b/Documentation/routines.html index 806bd57e3..6dd92ef95 100644 --- a/Documentation/routines.html +++ b/Documentation/routines.html @@ -43,6 +43,7 @@
  • Scheduler
  • Scoring
  • Sead
  • +
  • Set
  • Spawn
  • TASK
  • Unit
  • diff --git a/Moose/Unit.lua b/Moose/Unit.lua index 16e585f5e..99d13daf2 100644 --- a/Moose/Unit.lua +++ b/Moose/Unit.lua @@ -1,5 +1,36 @@ ---- UNIT Classes +--- UNIT Class +-- +-- @{UNIT} class +-- ============== +-- The @{UNIT} class is a wrapper class to handle the DCS Unit objects: +-- +-- * Support all DCS Unit APIs. +-- * Enhance with Unit specific APIs not in the DCS Unit API set. +-- * Handle local Unit Controller. +-- * Manage the "state" of the objects. +-- +-- +-- UNIT reference methods +-- ====================== +-- For each DCS Unit object alive within a running mission, a UNIT wrapper object (instance) will be created within the _@{DATABASE} object. +-- This is done at the beginning of the mission (when the mission starts), and dynamically when new DCS Unit objects are spawned (using the @{SPAWN} class). +-- +-- The UNIT class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference +-- using the DCS Unit or the DCS UnitName. +-- +-- Another thing to know is that UNIT objects do not "contain" the DCS Unit object. +-- The UNIT methods will reference the DCS Unit object by name when it is needed during API execution. +-- If the DCS Unit object does not exist or is nil, the UNIT methods will return nil and log an exception in the DCS.log file. +-- +-- The UNIT class provides the following functions to retrieve quickly the relevant UNIT instance: +-- +-- * @{#UNIT.Find}(): Find a UNIT instance from the _DATABASE object using a DCS Unit object. +-- * @{#UNIT.FindByName}(): Find a UNIT instance from the _DATABASE object using a DCS Unit object. +-- +-- IMPORTANT: ONE SHOULD NEVER SANATIZE these UNIT OBJECT REFERENCES! (make the UNIT object references nil). +-- -- @module Unit +-- @author FlightControl Include.File( "Routines" ) Include.File( "Base" ) @@ -65,8 +96,8 @@ end --- Finds a UNIT from the _DATABASE using a DCSUnit object. -- @param #UNIT self --- @param DCSUnit#Unit DCSUnit --- @return Unit#UNIT +-- @param DCSUnit#Unit DCSUnit An existing DCS Unit object reference. +-- @return Unit#UNIT self function UNIT:Find( DCSUnit ) local UnitName = DCSUnit:getName() @@ -74,10 +105,10 @@ function UNIT:Find( DCSUnit ) return UnitFound end ---- Find a UNIT in the _DATABASE using the name of the UNIT. +--- Find a UNIT in the _DATABASE using the name of an existing DCS Unit. -- @param #UNIT self --- @param #string Unit Name --- @return Unit#UNIT +-- @param #string UnitName The Unit Name. +-- @return Unit#UNIT self function UNIT:FindByName( UnitName ) -- self:F( UnitName ) @@ -97,7 +128,8 @@ end --- Returns coalition of the Unit. -- @param Unit#UNIT self --- @return DCSCoalitionObject#coalition.side +-- @return DCSCoalitionObject#coalition.side The side of the coalition. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetCoalition() self:F( self.UnitName ) @@ -114,7 +146,8 @@ end --- Returns country of the Unit. -- @param Unit#UNIT self --- @return DCScountry#country.id The country identifyer. +-- @return DCScountry#country.id The country identifier. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetCountry() self:F( self.UnitName ) @@ -130,10 +163,11 @@ function UNIT:GetCountry() end ---- Returns unit object by the name assigned to the unit in Mission Editor. --- If there is unit with such name or the unit is destroyed the function will return nil. +--- Returns DCS Unit object name. -- The function provides access to non-activated units too. --- +-- @param Unit#UNIT self +-- @return #string The name of the DCS Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetName() self:F( self.UnitName ) @@ -151,6 +185,7 @@ end --- Returns if the unit is alive. -- @param Unit#UNIT self -- @return #boolean true if Unit is alive. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:IsAlive() self:F( self.UnitName ) @@ -167,6 +202,7 @@ end --- Returns if the unit is activated. -- @param Unit#UNIT self -- @return #boolean true if Unit is activated. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:IsActive() self:F( self.UnitName ) @@ -184,6 +220,7 @@ end --- Returns name of the player that control the unit or nil if the unit is controlled by A.I. -- @param Unit#UNIT self -- @return #string Player Name +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetPlayerName() self:F( self.UnitName ) @@ -204,6 +241,7 @@ end --- Returns the unit's unique identifier. -- @param Unit#UNIT self -- @return DCSUnit#Unit.ID Unit ID +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetID() self:F( self.UnitName ) @@ -223,6 +261,7 @@ end -- If any unit in the group is destroyed, the numbers of another units will not be changed. -- @param Unit#UNIT self -- @return #number The Unit number. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetNumber() self:F( self.UnitName ) @@ -239,6 +278,7 @@ end --- Returns the unit's group if it exist and nil otherwise. -- @param Unit#UNIT self -- @return Group#GROUP The Group of the Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetGroup() self:F( self.UnitName ) @@ -256,6 +296,7 @@ end --- Returns the unit's callsign - the localized string. -- @param Unit#UNIT self -- @return #string The Callsign of the Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetCallSign() self:F( self.UnitName ) @@ -272,6 +313,7 @@ end --- Returns the unit's health. Dead units has health <= 1.0. -- @param Unit#UNIT self -- @return #number The Unit's health value. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetLife() self:F( self.UnitName ) @@ -288,6 +330,7 @@ end --- Returns the Unit's initial health. -- @param Unit#UNIT self -- @return #number The Unit's initial health value. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetLife0() self:F( self.UnitName ) @@ -304,6 +347,7 @@ end --- Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks. If there are additional fuel tanks the value may be greater than 1.0. -- @param Unit#UNIT self -- @return #number The relative amount of fuel (from 0.0 to 1.0). +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetFuel() self:F( self.UnitName ) @@ -320,6 +364,7 @@ end --- Returns the Unit's ammunition. -- @param Unit#UNIT self -- @return DCSUnit#Unit.Ammo +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetAmmo() self:F( self.UnitName ) @@ -336,6 +381,7 @@ end --- Returns the unit sensors. -- @param Unit#UNIT self -- @return DCSUnit#Unit.Sensors +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetSensors() self:F( self.UnitName ) @@ -359,6 +405,7 @@ end -- @param Unit#UNIT self -- @return #boolean Indicates if at least one of the unit's radar(s) is on. -- @return DCSObject#Object The object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetRadar() self:F( self.UnitName ) @@ -377,6 +424,7 @@ end --- Returns unit descriptor. Descriptor type depends on unit category. -- @param Unit#UNIT self -- @return DCSUnit#Unit.Desc The Unit descriptor. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetDesc() self:F( self.UnitName ) @@ -391,7 +439,10 @@ function UNIT:GetDesc() end - +--- Returns the type name of the DCS Unit. +-- @param Unit#UNIT self +-- @return #string The type name of the DCS Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetTypeName() self:F( self.UnitName ) @@ -406,16 +457,34 @@ function UNIT:GetTypeName() return nil end + + +--- Returns the prefix name of the DCS Unit. A prefix name is a part of the name before a '#'-sign. +-- DCS Units spawned with the @{SPAWN} class contain a '#'-sign to indicate the end of the (base) DCS Unit name. +-- The spawn sequence number and unit number are contained within the name after the '#' sign. +-- @param Unit#UNIT self +-- @return #string The name of the DCS Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetPrefix() self:F( self.UnitName ) + + local DCSUnit = self:GetDCSUnit() - local UnitPrefix = string.match( self.UnitName, ".*#" ):sub( 1, -2 ) - self:T( UnitPrefix ) - return UnitPrefix + if DCSUnit then + local UnitPrefix = string.match( self.UnitName, ".*#" ):sub( 1, -2 ) + self:T( UnitPrefix ) + return UnitPrefix + end + + return nil end +--- Returns the @{DCSTypes#Vec2} vector indicating the point in 2D of the DCS Unit within the mission. +-- @param Unit#UNIT self +-- @return DCSTypes#Vec2 The 2D point vector of the DCS Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetPointVec2() self:F( self.UnitName ) @@ -436,6 +505,10 @@ function UNIT:GetPointVec2() end +--- Returns the @{DCSTypes#Vec3} vector indicating the point in 3D of the DCS Unit within the mission. +-- @param Unit#UNIT self +-- @return DCSTypes#Vec3 The 3D point vector of the DCS Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetPointVec3() self:F( self.UnitName ) @@ -450,6 +523,10 @@ function UNIT:GetPointVec3() return nil end +--- Returns the @{DCSTypes#Position3} position vectors indicating the point and direction vectors in 3D of the DCS Unit within the mission. +-- @param Unit#UNIT self +-- @return DCSTypes#Position The 3D position vectors of the DCS Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetPositionVec3() self:F( self.UnitName ) @@ -464,9 +541,10 @@ function UNIT:GetPositionVec3() return nil end ---- Returns the unit's velocity vector. +--- Returns the DCS Unit velocity vector. -- @param Unit#UNIT self --- @return DCSTypes#Vec3 Velocity Vector +-- @return DCSTypes#Vec3 The velocity vector +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetVelocity() self:F( self.UnitName ) @@ -481,9 +559,10 @@ function UNIT:GetVelocity() return nil end ---- Returns true if the Unit is in air. +--- Returns true if the DCS Unit is in the air. -- @param Unit#UNIT self -- @return #boolean true if in the air. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:InAir() self:F( self.UnitName ) @@ -498,9 +577,10 @@ function UNIT:InAir() return nil end ---- Returns the altitude of the UNIT. --- @param #UNIT self --- @return DCSTypes#Distance +--- Returns the altitude of the DCS Unit. +-- @param Unit#UNIT self +-- @return DCSTypes#Distance The altitude of the DCS Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:GetAltitude() self:F() @@ -514,27 +594,36 @@ function UNIT:GetAltitude() return nil end +--- Returns true if there is an **other** DCS Unit within a radius of the current 2D point of the DCS Unit. +-- @param Unit#UNIT self +-- @param Unit#UNIT AwaitUnit The other UNIT wrapper object. +-- @param Radius The radius in meters with the DCS Unit in the centre. +-- @return true If the other DCS Unit is within the radius of the 2D point of the DCS Unit. +-- @return #nil The DCS Unit is not existing or alive. function UNIT:OtherUnitInRadius( AwaitUnit, Radius ) self:F( { self.UnitName, AwaitUnit.UnitName, Radius } ) - local UnitPos = self:GetPointVec3() - local AwaitUnitPos = AwaitUnit:GetPointVec3() + local DCSUnit = self:GetDCSUnit() + + if DCSUnit then + local UnitPos = self:GetPointVec3() + local AwaitUnitPos = AwaitUnit:GetPointVec3() + + if (((UnitPos.x - AwaitUnitPos.x)^2 + (UnitPos.z - AwaitUnitPos.z)^2)^0.5 <= Radius) then + self:T( "true" ) + return true + else + self:T( "false" ) + return false + end + end - if (((UnitPos.x - AwaitUnitPos.x)^2 + (UnitPos.z - AwaitUnitPos.z)^2)^0.5 <= Radius) then - self:T( "true" ) - return true - else - self:T( "false" ) - return false - end - - self:T( "false" ) - return false + return nil end ---- Returns the Unit's Category Name as defined within the Unit's Descriptor. +--- Returns the DCS Unit category name as defined within the DCS Unit Descriptor. -- @param Unit#UNIT self --- @return #string Unit's Category Name +-- @return #string The DCS Unit Category Name function UNIT:GetCategoryName() local DCSUnit = self:GetDCSUnit() diff --git a/Presentations/DCS World - MOOSE - Development - Part 3 - The DATABASE - UNIT - CLIENT - GROUP - ZONE, .pptx b/Presentations/DCS World - MOOSE - Development - Part 3 - The DATABASE - UNIT - CLIENT - GROUP - ZONE, .pptx index 26c9e4bc1d3d63e300a9b0401242f16bb79d40aa..fbb0df74138120c098de897fe730b293b2b0f3be 100644 GIT binary patch delta 3434 zcmZ9Pbx_ppx4?ISU1ax52#B;GD8qqKBNmmpnB zBOTK2W#0R{bMM?U^EvaJIdlFy&u8Xr9!BtIE38nH87 zbWL|RFf6{@I6Jlw?fW4)SI9Fe9o3NdUbM2wGk`yeoZq=v%Q4YTD(5F7ug`%#Zrx8mWsT7?GHGOy8 zY4?pQgOulub(0BM>tBs)(D`zmtkp6=Tg%f4l>=jgObQ#}bruvfZOwX4vR#MwZkv#D z^GoUZTSBtf?dVf7Psc(l#-&^P>p{M_u=f||b5b?+q@YOWS#|vLS{NoSGt9WwLRvOW zlL1X1)G6vhQ)r&2Mc87+YC4%Ibql&=uWf0}@^khVnpPu(zj~kN`r7##6(9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*>W=}4lliakZ@X^-|9|hJQSyc$F6O_Tc$<7i Y3;^8y_pQID5h~me#7QKl0J;tT12?BKg8%>k
    UNIT.ClassName +
    UNIT:Find(DCSUnit) +

    Finds a UNIT from the _DATABASE using a DCSUnit object.

    +
    UNIT:FindByName(UnitName) +

    Find a UNIT in the _DATABASE using the name of an existing DCS Unit.

    UNIT:FlareYellow()

    Signal a yellow flare at the position of the UNIT.

    +
    UNIT:GetAltitude() +

    Returns the altitude of the DCS Unit.

    UNIT:GetCategoryName() -

    Returns the Unit's Category Name as defined within the Unit's Descriptor.

    +

    Returns the DCS Unit category name as defined within the DCS Unit Descriptor.

    UNIT:GetName() -

    Returns unit object by the name assigned to the unit in Mission Editor.

    +

    Returns DCS Unit object name.

    UNIT:GetPointVec2() - +

    Returns the DCSTypes#Vec2 vector indicating the point in 2D of the DCS Unit within the mission.

    +
    UNIT:GetPointVec3() +

    Returns the DCSTypes#Vec3 vector indicating the point in 3D of the DCS Unit within the mission.

    UNIT:GetPositionVec3() - +

    Returns the DCSTypes#Position3 position vectors indicating the point and direction vectors in 3D of the DCS Unit within the mission.

    UNIT:GetPrefix() - +

    Returns the prefix name of the DCS Unit.

    UNIT:GetTypeName() - +

    Returns the type name of the DCS Unit.

    UNIT:GetVelocity() -

    Returns the unit's velocity vector.

    +

    Returns the DCS Unit velocity vector.

    UNIT:InAir() -

    Returns true if the Unit is in air.

    +

    Returns true if the DCS Unit is in the air.

    UNIT:IsAlive()

    Returns if the unit is alive.

    -
    UNIT:New(DCSUnit) -

    Create a new UNIT from DCSUnit.

    -
    UNIT:NewFromName(Unit, UnitName) -

    Create a new UNIT from a Unit Name.

    UNIT:OtherUnitInRadius(AwaitUnit, Radius) - +

    Returns true if there is an other DCS Unit within a radius of the current 2D point of the DCS Unit.

    +
    UNIT:Register(DCSUnit, Database, UnitName) +

    Create a new UNIT from DCSUnit.

    Sead

    Provides defensive behaviour to a set of SAM sites within a running Mission.

    +
    Set +

    Manage sets of units and groups.

    Unit -

    UNIT Classes

    +

    UNIT Class

    + +

    UNIT class

    +

    The UNIT class is a wrapper class to handle the DCS Unit objects:

    + +
      +
    • Support all DCS Unit APIs.
    • +