From 8af0b052c6a05a761e7f6c5ce037faddc02fc4e8 Mon Sep 17 00:00:00 2001 From: FlightControl Date: Sun, 18 Dec 2016 14:21:07 +0100 Subject: [PATCH] doc --- docs/Documentation/AI_Balancer.html | 640 ++++ docs/Documentation/Account.html | 857 +++++ docs/Documentation/Airbase.html | 330 ++ docs/Documentation/AirbasePolice.html | 369 ++ docs/Documentation/Assign.html | 1036 +++++ docs/Documentation/Base.html | 2129 +++++++++++ docs/Documentation/Cargo.html | 2847 ++++++++++++++ docs/Documentation/CleanUp.html | 563 +++ docs/Documentation/Client.html | 1119 ++++++ docs/Documentation/CommandCenter.html | 772 ++++ docs/Documentation/Controllable.html | 3120 +++++++++++++++ docs/Documentation/DCSAirbase.html | 466 +++ docs/Documentation/DCSCoalitionObject.html | 287 ++ docs/Documentation/DCSCommand.html | 144 + docs/Documentation/DCSController.html | 741 ++++ docs/Documentation/DCSGroup.html | 573 +++ docs/Documentation/DCSObject.html | 594 +++ docs/Documentation/DCSTask.html | 152 + docs/Documentation/DCSTypes.html | 2509 ++++++++++++ docs/Documentation/DCSUnit.html | 2071 ++++++++++ docs/Documentation/DCSWorld.html | 628 +++ docs/Documentation/DCScountry.html | 514 +++ docs/Documentation/DCStimer.html | 320 ++ docs/Documentation/DCStrigger.html | 121 + docs/Documentation/Database.html | 1669 ++++++++ docs/Documentation/Detection.html | 2175 +++++++++++ docs/Documentation/Escort.html | 2385 ++++++++++++ docs/Documentation/Event.html | 2310 +++++++++++ docs/Documentation/Fsm.html | 2035 ++++++++++ docs/Documentation/Group.html | 1537 ++++++++ docs/Documentation/Identifiable.html | 518 +++ docs/Documentation/MOVEMENT.html | 296 ++ docs/Documentation/Menu.html | 2042 ++++++++++ docs/Documentation/Message.html | 495 +++ docs/Documentation/MissileTrainer.html | 1029 +++++ docs/Documentation/Mission.html | 2346 ++++++++++++ docs/Documentation/Object.html | 317 ++ docs/Documentation/Patrol.html | 787 ++++ docs/Documentation/Point.html | 2169 +++++++++++ docs/Documentation/Positionable.html | 995 +++++ docs/Documentation/Process_JTAC.html | 602 +++ docs/Documentation/Process_Pickup.html | 693 ++++ docs/Documentation/Route.html | 780 ++++ docs/Documentation/ScheduleDispatcher.html | 448 +++ docs/Documentation/Scheduler.html | 497 +++ docs/Documentation/Scoring.html | 825 ++++ docs/Documentation/Sead.html | 271 ++ docs/Documentation/Set.html | 4042 ++++++++++++++++++++ docs/Documentation/Smoke.html | 648 ++++ docs/Documentation/Spawn.html | 3150 +++++++++++++++ docs/Documentation/Static.html | 284 ++ docs/Documentation/StaticObject.html | 263 ++ docs/Documentation/Task.html | 2485 ++++++++++++ docs/Documentation/Task_A2G.html | 258 ++ docs/Documentation/Task_PICKUP.html | 409 ++ docs/Documentation/Task_SEAD.html | 267 ++ docs/Documentation/Unit.html | 1528 ++++++++ docs/Documentation/Utils.html | 865 +++++ docs/Documentation/Zone.html | 2019 ++++++++++ docs/Documentation/env.html | 119 + docs/Documentation/index.html | 465 +++ docs/Documentation/land.html | 314 ++ docs/Documentation/routines.html | 1223 ++++++ docs/Documentation/stylesheet.css | 1035 +++++ 64 files changed, 69497 insertions(+) create mode 100644 docs/Documentation/AI_Balancer.html create mode 100644 docs/Documentation/Account.html create mode 100644 docs/Documentation/Airbase.html create mode 100644 docs/Documentation/AirbasePolice.html create mode 100644 docs/Documentation/Assign.html create mode 100644 docs/Documentation/Base.html create mode 100644 docs/Documentation/Cargo.html create mode 100644 docs/Documentation/CleanUp.html create mode 100644 docs/Documentation/Client.html create mode 100644 docs/Documentation/CommandCenter.html create mode 100644 docs/Documentation/Controllable.html create mode 100644 docs/Documentation/DCSAirbase.html create mode 100644 docs/Documentation/DCSCoalitionObject.html create mode 100644 docs/Documentation/DCSCommand.html create mode 100644 docs/Documentation/DCSController.html create mode 100644 docs/Documentation/DCSGroup.html create mode 100644 docs/Documentation/DCSObject.html create mode 100644 docs/Documentation/DCSTask.html create mode 100644 docs/Documentation/DCSTypes.html create mode 100644 docs/Documentation/DCSUnit.html create mode 100644 docs/Documentation/DCSWorld.html create mode 100644 docs/Documentation/DCScountry.html create mode 100644 docs/Documentation/DCStimer.html create mode 100644 docs/Documentation/DCStrigger.html create mode 100644 docs/Documentation/Database.html create mode 100644 docs/Documentation/Detection.html create mode 100644 docs/Documentation/Escort.html create mode 100644 docs/Documentation/Event.html create mode 100644 docs/Documentation/Fsm.html create mode 100644 docs/Documentation/Group.html create mode 100644 docs/Documentation/Identifiable.html create mode 100644 docs/Documentation/MOVEMENT.html create mode 100644 docs/Documentation/Menu.html create mode 100644 docs/Documentation/Message.html create mode 100644 docs/Documentation/MissileTrainer.html create mode 100644 docs/Documentation/Mission.html create mode 100644 docs/Documentation/Object.html create mode 100644 docs/Documentation/Patrol.html create mode 100644 docs/Documentation/Point.html create mode 100644 docs/Documentation/Positionable.html create mode 100644 docs/Documentation/Process_JTAC.html create mode 100644 docs/Documentation/Process_Pickup.html create mode 100644 docs/Documentation/Route.html create mode 100644 docs/Documentation/ScheduleDispatcher.html create mode 100644 docs/Documentation/Scheduler.html create mode 100644 docs/Documentation/Scoring.html create mode 100644 docs/Documentation/Sead.html create mode 100644 docs/Documentation/Set.html create mode 100644 docs/Documentation/Smoke.html create mode 100644 docs/Documentation/Spawn.html create mode 100644 docs/Documentation/Static.html create mode 100644 docs/Documentation/StaticObject.html create mode 100644 docs/Documentation/Task.html create mode 100644 docs/Documentation/Task_A2G.html create mode 100644 docs/Documentation/Task_PICKUP.html create mode 100644 docs/Documentation/Task_SEAD.html create mode 100644 docs/Documentation/Unit.html create mode 100644 docs/Documentation/Utils.html create mode 100644 docs/Documentation/Zone.html create mode 100644 docs/Documentation/env.html create mode 100644 docs/Documentation/index.html create mode 100644 docs/Documentation/land.html create mode 100644 docs/Documentation/routines.html create mode 100644 docs/Documentation/stylesheet.css diff --git a/docs/Documentation/AI_Balancer.html b/docs/Documentation/AI_Balancer.html new file mode 100644 index 000000000..100b89b58 --- /dev/null +++ b/docs/Documentation/AI_Balancer.html @@ -0,0 +1,640 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module AI_Balancer

+ +

This module contains the AI_BALANCER class.

+ + + +
+ +

1) AI.AIBalancer#AIBALANCER class, extends Core.Fsm#FSM_SET

+

The AI.AIBalancer#AIBALANCER class monitors and manages as many AI GROUPS as there are +CLIENTS in a SETCLIENT collection not occupied by players. +The AIBALANCER class manages internally a collection of AI management objects, which govern the behaviour +of the underlying AI GROUPS.

+ +

The parent class Core.Fsm#FSM_SET manages the functionality to control the Finite State Machine (FSM) +and calls for each event the state transition methods providing the internal Core.Fsm#FSM_SET.Set object containing the +SET_GROUP and additional event parameters provided during the event.

+ +

1.1) AI_BALANCER construction method

+

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

+ + + +

1.2)

+

* Add + * Remove

+ +

1.2) AI_BALANCER returns AI to Airbases

+

You can configure to have the AI to return to:

+ + + +

API CHANGE HISTORY

+ +

The underlying change log documents the API changes. Please read this carefully. The following notation is used:

+ +
    +
  • Added parts are expressed in bold type face.
  • +
  • Removed parts are expressed in italic type face.
  • +
+ +

Hereby the change log:

+ +

2016-08-17: SPAWN:InitCleanUp( SpawnCleanUpInterval ) replaces SPAWN:CleanUp( SpawnCleanUpInterval )

+ +
    +
  • Want to ensure that the methods starting with Init are the first called methods before any Spawn method is called!
  • +
  • This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
  • +
+ +
+ +

AUTHORS and CONTRIBUTIONS

+ +

Contributions:

+ +
    +
  • Dutch_Baron (James): Who you can search on the Eagle Dynamics Forums.
    + Working together with James has resulted in the creation of the AI_BALANCER class.
    + James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)

  • +
  • SNAFU: + Had a couple of mails with the guys to validate, if the same concept in the GCI/CAP script could be reworked within MOOSE. + None of the script code has been used however within the new AI_BALANCER moose class.

  • +
+ +

Authors:

+ +
    +
  • FlightControl: Framework Design & Programming
  • +
+ + +

Global(s)

+ + + + + +
AI_BALANCER + +
+

Type AI_BALANCER

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_BALANCER.AIGroups + +
AI_BALANCER.ClassName + +
AI_BALANCER:New(SetClient, SpawnAI) +

Creates a new AI_BALANCER object

+
AI_BALANCER.PatrolZones + +
AI_BALANCER.ReturnAirbaseSet + +
AI_BALANCER:ReturnToHomeAirbase(ReturnTresholdRange) +

Returns the AI to the home Wrapper.Airbase#AIRBASE.

+
AI_BALANCER:ReturnToNearestAirbases(ReturnTresholdRange, ReturnAirbaseSet) +

Returns the AI to the nearest friendly Wrapper.Airbase#AIRBASE.

+
AI_BALANCER.ReturnTresholdRange + +
AI_BALANCER.SetClient + +
AI_BALANCER.ToHomeAirbase + +
AI_BALANCER.ToNearestAirbase + +
AI_BALANCER:onenterDestroying(SetGroup, AIGroup, Event, From, To) + +
AI_BALANCER:onenterMonitoring(SetGroup) + +
AI_BALANCER:onenterReturning(SetGroup, AIGroup, Event, From, To) + +
AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, Event, From, To) + +
+ +

Global(s)

+
+
+ + #AI_BALANCER + +AI_BALANCER + +
+
+ + + +
+
+

Type AI_Balancer

+ +

Type AI_BALANCER

+ +

AI_BALANCER class

+ +

Field(s)

+
+
+ + + +AI_BALANCER.AIGroups + +
+
+ + + +
+
+
+
+ + #string + +AI_BALANCER.ClassName + +
+
+ + + +
+
+
+
+ + +AI_BALANCER:New(SetClient, SpawnAI) + +
+
+ +

Creates a new AI_BALANCER object

+ +

Parameters

+
    +
  • + +

    Core.Set#SET_CLIENT SetClient : +A SET_CLIENT object that will contain the CLIENT objects to be monitored if they are alive or not (joined by a player).

    + +
  • +
  • + +

    Functional.Spawn#SPAWN SpawnAI : +The default Spawn object to spawn new AI Groups when needed.

    + +
  • +
+

Return value

+ +

#AI_BALANCER:

+ + +

Usage:

+
-- Define a new AI_BALANCER Object.
+ +
+
+
+
+ + + +AI_BALANCER.PatrolZones + +
+
+ + + +
+
+
+
+ + + +AI_BALANCER.ReturnAirbaseSet + +
+
+ + + +
+
+
+
+ + +AI_BALANCER:ReturnToHomeAirbase(ReturnTresholdRange) + +
+
+ +

Returns the AI to the home Wrapper.Airbase#AIRBASE.

+ +

Parameter

+ +
+
+
+
+ + +AI_BALANCER:ReturnToNearestAirbases(ReturnTresholdRange, ReturnAirbaseSet) + +
+
+ +

Returns the AI to the nearest friendly Wrapper.Airbase#AIRBASE.

+ +

Parameters

+ +
+
+
+
+ + + +AI_BALANCER.ReturnTresholdRange + +
+
+ + + +
+
+
+
+ + Core.Set#SET_CLIENT + +AI_BALANCER.SetClient + +
+
+ + + +
+
+
+
+ + #boolean + +AI_BALANCER.ToHomeAirbase + +
+
+ + + +
+
+
+
+ + #boolean + +AI_BALANCER.ToNearestAirbase + +
+
+ + + +
+
+
+
+ + +AI_BALANCER:onenterDestroying(SetGroup, AIGroup, Event, From, To) + +
+
+ + + +

Parameters

+ +
+
+
+
+ + +AI_BALANCER:onenterMonitoring(SetGroup) + +
+
+ + + +

Parameter

+
    +
  • + +

    SetGroup :

    + +
  • +
+
+
+
+
+ + +AI_BALANCER:onenterReturning(SetGroup, AIGroup, Event, From, To) + +
+
+ + + +

Parameters

+ +
+
+
+
+ + +AI_BALANCER:onenterSpawning(SetGroup, ClientName, AIGroup, Event, From, To) + +
+
+ + + +

Parameters

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Account.html b/docs/Documentation/Account.html new file mode 100644 index 000000000..d4f25f391 --- /dev/null +++ b/docs/Documentation/Account.html @@ -0,0 +1,857 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Account

+ +

(SP) (MP) (FSM) Account for (Detect, count and report) DCS events occuring on DCS objects (units).

+ + + +
+ +

#ACT_ACCOUNT FSM class, extends Core.Fsm#FSM_PROCESS

+ +

ACT_ACCOUNT state machine:

+ +

This class is a state machine: it manages a process that is triggered by events causing state transitions to occur. +All derived classes from this class will start with the class name, followed by a _. See the relevant derived class descriptions below. +Each derived class follows exactly the same process, using the same events and following the same state transitions, +but will have different implementation behaviour upon each event or state transition.

+ +

ACT_ACCOUNT Events:

+ +

These are the events defined in this class:

+ +
    +
  • Start: The process is started. The process will go into the Report state.
  • +
  • Event: A relevant event has occured that needs to be accounted for. The process will go into the Account state.
  • +
  • Report: The process is reporting to the player the accounting status of the DCS events.
  • +
  • More: There are more DCS events that need to be accounted for. The process will go back into the Report state.
  • +
  • NoMore: There are no more DCS events that need to be accounted for. The process will go into the Success state.
  • +
+ +

ACT_ACCOUNT Event methods:

+ +

Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process. +There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:

+ +
    +
  • Immediate: The event method has exactly the name of the event.
  • +
  • Delayed: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed.
  • +
+ +

ACT_ACCOUNT States:

+ +
    +
  • Assigned: The player is assigned to the task. This is the initialization state for the process.
  • +
  • Waiting: the process is waiting for a DCS event to occur within the simulator. This state is set automatically.
  • +
  • Report: The process is Reporting to the players in the group of the unit. This state is set automatically every 30 seconds.
  • +
  • Account: The relevant DCS event has occurred, and is accounted for.
  • +
  • Success (*): All DCS events were accounted for.
  • +
  • Failed (*): The process has failed.
  • +
+ +

(*) End states of the process.

+ +

ACT_ACCOUNT state transition methods:

+ +

State transition functions can be set by the mission designer customizing or improving the behaviour of the state. +There are 2 moments when state transition methods will be called by the state machine:

+ +
    +
  • Before the state transition. + The state transition method needs to start with the name OnBefore + the name of the state. + If the state transition method returns false, then the processing of the state transition will not be done! + If you want to change the behaviour of the AIControllable at this event, return false, + but then you'll need to specify your own logic using the AIControllable!

  • +
  • After the state transition. + The state transition method needs to start with the name OnAfter + the name of the state. + These state transition methods need to provide a return value, which is specified at the function description.

  • +
+ +

1) #ACTACCOUNTDEADS FSM class, extends Fsm.Account#ACT_ACCOUNT

+ +

The ACTACCOUNTDEADS class accounts (detects, counts and reports) successful kills of DCS units. +The process is given a Set of units that will be tracked upon successful destruction. +The process will end after each target has been successfully destroyed. +Each successful dead will trigger an Account state transition that can be scored, modified or administered.

+ + +

ACTACCOUNTDEADS constructor:

+ + + +
+ + +

Global(s)

+ + + + + + + + + +
ACT_ACCOUNT + +
ACT_ACCOUNT_DEADS + +
+

Type ACT_ACCOUNT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ACT_ACCOUNT.ClassName + +
ACT_ACCOUNT.DisplayCount + +
ACT_ACCOUNT:New() +

Creates a new DESTROY process.

+
ACT_ACCOUNT.TargetSetUnit + +
ACT_ACCOUNT:onafterEvent(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ACCOUNT:onafterStart(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ACCOUNT:onenterWaiting(ProcessUnit, Event, From, To) +

StateMachine callback function

+
+ +

Type ACT_ACCOUNT_DEADS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ACT_ACCOUNT_DEADS.ClassName + +
ACT_ACCOUNT_DEADS.DisplayCategory + +
ACT_ACCOUNT_DEADS.DisplayCount + +
ACT_ACCOUNT_DEADS.DisplayInterval + +
ACT_ACCOUNT_DEADS.DisplayMessage + +
ACT_ACCOUNT_DEADS.DisplayTime + +
ACT_ACCOUNT_DEADS:Init(FsmAccount) + +
ACT_ACCOUNT_DEADS:New(TargetSetUnit, TaskName) +

Creates a new DESTROY process.

+
ACT_ACCOUNT_DEADS.TargetSetUnit + +
ACT_ACCOUNT_DEADS.TaskName + +
ACT_ACCOUNT_DEADS:_Destructor() + +
ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To, EventData) +

StateMachine callback function

+
ACT_ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To, EventData) +

StateMachine callback function

+
ACT_ACCOUNT_DEADS:onenterReport(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ACCOUNT_DEADS:onfuncEventDead(EventData) + +
+ +

Global(s)

+
+
+ + #ACT_ACCOUNT + +ACT_ACCOUNT + +
+
+ + + +
+
+
+
+ + #ACT_ACCOUNT_DEADS + +ACT_ACCOUNT_DEADS + +
+
+ + + +
+
+

Type Account

+ +

Type ACT_ACCOUNT

+ +

ACT_ACCOUNT class

+ +

Field(s)

+
+
+ + #string + +ACT_ACCOUNT.ClassName + +
+
+ + + +
+
+
+
+ + #number + +ACT_ACCOUNT.DisplayCount + +
+
+ + + +
+
+
+
+ + +ACT_ACCOUNT:New() + +
+
+ +

Creates a new DESTROY process.

+ +

Return value

+ +

#ACT_ACCOUNT:

+ + +
+
+
+
+ + Set#SET_UNIT + +ACT_ACCOUNT.TargetSetUnit + +
+
+ + + +
+
+
+
+ + +ACT_ACCOUNT:onafterEvent(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ACCOUNT:onafterStart(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ACCOUNT:onenterWaiting(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+ +

Type ACT_ACCOUNT_DEADS

+ +

ACTACCOUNTDEADS class

+ +

Field(s)

+
+
+ + #string + +ACT_ACCOUNT_DEADS.ClassName + +
+
+ + + +
+
+
+
+ + #string + +ACT_ACCOUNT_DEADS.DisplayCategory + +
+
+ + + + +

Targets is the default display category

+ +
+
+
+
+ + #number + +ACT_ACCOUNT_DEADS.DisplayCount + +
+
+ + + +
+
+
+
+ + #number + +ACT_ACCOUNT_DEADS.DisplayInterval + +
+
+ + + +
+
+
+
+ + #boolean + +ACT_ACCOUNT_DEADS.DisplayMessage + +
+
+ + + +
+
+
+
+ + #number + +ACT_ACCOUNT_DEADS.DisplayTime + +
+
+ + + + +

10 seconds is the default

+ +
+
+
+
+ + +ACT_ACCOUNT_DEADS:Init(FsmAccount) + +
+
+ + + +

Parameter

+
    +
  • + +

    FsmAccount :

    + +
  • +
+
+
+
+
+ + +ACT_ACCOUNT_DEADS:New(TargetSetUnit, TaskName) + +
+
+ +

Creates a new DESTROY process.

+ +

Parameters

+
    +
  • + +

    Set#SET_UNIT TargetSetUnit :

    + +
  • +
  • + +

    #string TaskName :

    + +
  • +
+
+
+
+
+ + Set#SET_UNIT + +ACT_ACCOUNT_DEADS.TargetSetUnit + +
+
+ + + +
+
+
+
+ + + +ACT_ACCOUNT_DEADS.TaskName + +
+
+ + + +
+
+
+
+ + +ACT_ACCOUNT_DEADS:_Destructor() + +
+
+ + + +
+
+
+
+ + +ACT_ACCOUNT_DEADS:onafterEvent(ProcessUnit, Event, From, To, EventData) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ACCOUNT_DEADS:onenterAccount(ProcessUnit, Event, From, To, EventData) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ACCOUNT_DEADS:onenterReport(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ACCOUNT_DEADS:onfuncEventDead(EventData) + +
+
+ + + +

Parameter

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Airbase.html b/docs/Documentation/Airbase.html new file mode 100644 index 000000000..67972f788 --- /dev/null +++ b/docs/Documentation/Airbase.html @@ -0,0 +1,330 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Airbase

+ +

This module contains the AIRBASE classes.

+ + + +
+ +

1) Wrapper.Airbase#AIRBASE class, extends Wrapper.Positionable#POSITIONABLE

+

The AIRBASE class is a wrapper class to handle the DCS Airbase objects:

+ +
    +
  • Support all DCS Airbase APIs.
  • +
  • Enhance with Airbase specific APIs not in the DCS Airbase API set.
  • +
+ + +

1.1) AIRBASE reference methods

+

For each DCS Airbase object alive within a running mission, a AIRBASE wrapper object (instance) will be created within the _DATABASE object. +This is done at the beginning of the mission (when the mission starts).

+ +

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

+ +

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

+ +

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

+ +
    +
  • AIRBASE.Find(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase object.
  • +
  • AIRBASE.FindByName(): Find a AIRBASE instance from the _DATABASE object using a DCS Airbase name.
  • +
+ +

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

+ +

1.2) DCS AIRBASE APIs

+

The DCS Airbase APIs are used extensively within MOOSE. The AIRBASE class has for each DCS Airbase API a corresponding method. +To be able to distinguish easily in your code the difference between a AIRBASE API call and a DCS Airbase API call, +the first letter of the method is also capitalized. So, by example, the DCS Airbase method Dcs.DCSWrapper.Airbase#Airbase.getName() +is implemented in the AIRBASE class as AIRBASE.GetName().

+ +

More functions will be added

+

During the MOOSE development, more functions will be added.

+ + +

Global(s)

+ + + + + +
AIRBASE + +
+

Type AIRBASE

+ + + + + + + + + + + + + + + + + + + + + + + + + +
AIRBASE.CategoryName + +
AIRBASE.ClassName + +
AIRBASE:Find(DCSAirbase) +

Finds a AIRBASE from the _DATABASE using a DCSAirbase object.

+
AIRBASE:FindByName(AirbaseName) +

Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.

+
AIRBASE:GetDCSObject() + +
AIRBASE:Register(AirbaseName) +

Create a new AIRBASE from DCSAirbase.

+
+ +

Global(s)

+
+
+ + #AIRBASE + +AIRBASE + +
+
+ + + +
+
+

Type Airbase

+ +

Type AIRBASE

+ +

The AIRBASE class

+ +

Field(s)

+
+
+ + + +AIRBASE.CategoryName + +
+
+ + + +
+
+
+
+ + #string + +AIRBASE.ClassName + +
+
+ + + +
+
+
+
+ + +AIRBASE:Find(DCSAirbase) + +
+
+ +

Finds a AIRBASE from the _DATABASE using a DCSAirbase object.

+ +

Parameter

+ +

Return value

+ +

Wrapper.Airbase#AIRBASE: +self

+ +
+
+
+
+ + +AIRBASE:FindByName(AirbaseName) + +
+
+ +

Find a AIRBASE in the _DATABASE using the name of an existing DCS Airbase.

+ +

Parameter

+
    +
  • + +

    #string AirbaseName : +The Airbase Name.

    + +
  • +
+

Return value

+ +

Wrapper.Airbase#AIRBASE: +self

+ +
+
+
+
+ + +AIRBASE:GetDCSObject() + +
+
+ + + +
+
+
+
+ + +AIRBASE:Register(AirbaseName) + +
+
+ +

Create a new AIRBASE from DCSAirbase.

+ +

Parameter

+
    +
  • + +

    #string AirbaseName : +The name of the airbase.

    + +
  • +
+

Return value

+ +

Wrapper.Airbase#AIRBASE:

+ + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/AirbasePolice.html b/docs/Documentation/AirbasePolice.html new file mode 100644 index 000000000..3ba45883b --- /dev/null +++ b/docs/Documentation/AirbasePolice.html @@ -0,0 +1,369 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module AirbasePolice

+ +

This module contains the AIRBASEPOLICE classes.

+ + + +
+ +

1) Functional.AirbasePolice#AIRBASEPOLICE_BASE class, extends Core.Base#BASE

+

The Functional.AirbasePolice#AIRBASEPOLICE_BASE class provides the main methods to monitor CLIENT behaviour at airbases. +CLIENTS should not be allowed to:

+ +
    +
  • Don't taxi faster than 40 km/h.
  • +
  • Don't take-off on taxiways.
  • +
  • Avoid to hit other planes on the airbase.
  • +
  • Obey ground control orders.
  • +
+ +

2) Functional.AirbasePolice#AIRBASEPOLICE_CAUCASUS class, extends Functional.AirbasePolice#AIRBASEPOLICE_BASE

+

All the airbases on the caucasus map can be monitored using this class. +If you want to monitor specific airbases, you need to use the AIRBASEPOLICE_BASE.Monitor() method, which takes a table or airbase names. +The following names can be given: + * AnapaVityazevo + * Batumi + * Beslan + * Gelendzhik + * Gudauta + * Kobuleti + * KrasnodarCenter + * KrasnodarPashkovsky + * Krymsk + * Kutaisi + * MaykopKhanskaya + * MineralnyeVody + * Mozdok + * Nalchik + * Novorossiysk + * SenakiKolkhi + * SochiAdler + * Soganlug + * SukhumiBabushara + * TbilisiLochini + * Vaziani

+ +

3) Functional.AirbasePolice#AIRBASEPOLICE_NEVADA class, extends Functional.AirbasePolice#AIRBASEPOLICE_BASE

+

All the airbases on the NEVADA map can be monitored using this class. +If you want to monitor specific airbases, you need to use the AIRBASEPOLICE_BASE.Monitor() method, which takes a table or airbase names. +The following names can be given: + * Nellis + * McCarran + * Creech + * Groom Lake

+ +

Contributions: Dutch Baron - Concept & Testing

+

Author: FlightControl - Framework Design & Programming

+ + +

Global(s)

+ + + + + + + + + + + + + +
AIRBASEPOLICE_BASE + +
AIRBASEPOLICE_CAUCASUS + +
AIRBASEPOLICE_NEVADA + +
+

Type AIRBASEPOLICE_BASE

+ + + + + + + + + +
AIRBASEPOLICE_BASE.AirbaseNames + +
AIRBASEPOLICE_BASE.SetClient + +
+ +

Type AIRBASEPOLICE_CAUCASUS

+ + + + + +
AIRBASEPOLICE_CAUCASUS.SetClient + +
+ +

Type AIRBASEPOLICE_NEVADA

+ + + + + + + + + + + + + +
AIRBASEPOLICE_NEVADA.Airbases + +
AIRBASEPOLICE_NEVADA.ClassName + +
AIRBASEPOLICE_NEVADA:New(SetClient) +

Creates a new AIRBASEPOLICE_NEVADA object.

+
+ +

Global(s)

+
+
+ + + +AIRBASEPOLICE_BASE + +
+
+ + + +
+
+
+
+ + + +AIRBASEPOLICE_CAUCASUS + +
+
+ + + +
+
+
+
+ + #AIRBASEPOLICE_NEVADA + +AIRBASEPOLICE_NEVADA + +
+
+ + + +
+
+

Type AirbasePolice

+ +

Type AIRBASEPOLICE_BASE

+

Field(s)

+
+
+ + + +AIRBASEPOLICE_BASE.AirbaseNames + +
+
+ + + +
+
+
+
+ + Core.Set#SET_CLIENT + +AIRBASEPOLICE_BASE.SetClient + +
+
+ + + +
+
+ +

Type AIRBASEPOLICE_BASE.AirbaseNames

+ +

Type AIRBASEPOLICE_CAUCASUS

+

Field(s)

+
+
+ + Core.Set#SET_CLIENT + +AIRBASEPOLICE_CAUCASUS.SetClient + +
+
+ + + +
+
+ +

Type AIRBASEPOLICE_NEVADA

+

Field(s)

+
+
+ + + +AIRBASEPOLICE_NEVADA.Airbases + +
+
+ + + +
+
+
+
+ + #string + +AIRBASEPOLICE_NEVADA.ClassName + +
+
+ + + +
+
+
+
+ + +AIRBASEPOLICE_NEVADA:New(SetClient) + +
+
+ +

Creates a new AIRBASEPOLICE_NEVADA object.

+ +

Parameter

+
    +
  • + +

    SetClient : +A SET_CLIENT object that will contain the CLIENT objects to be monitored if they follow the rules of the airbase.

    + +
  • +
+

Return value

+ +

#AIRBASEPOLICE_NEVADA: +self

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Assign.html b/docs/Documentation/Assign.html new file mode 100644 index 000000000..d8fe72d3e --- /dev/null +++ b/docs/Documentation/Assign.html @@ -0,0 +1,1036 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Assign

+ +

(SP) (MP) (FSM) Accept or reject process for player (task) assignments.

+ + + +
+ +

#ACT_ASSIGN FSM template class, extends Core.Fsm#FSM_PROCESS

+ +

ACT_ASSIGN state machine:

+ +

This class is a state machine: it manages a process that is triggered by events causing state transitions to occur. +All derived classes from this class will start with the class name, followed by a _. See the relevant derived class descriptions below. +Each derived class follows exactly the same process, using the same events and following the same state transitions, +but will have different implementation behaviour upon each event or state transition.

+ +

ACT_ASSIGN Events:

+ +

These are the events defined in this class:

+ +
    +
  • Start: Start the tasking acceptance process.
  • +
  • Assign: Assign the task.
  • +
  • Reject: Reject the task..
  • +
+ +

ACT_ASSIGN Event methods:

+ +

Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process. +There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:

+ +
    +
  • Immediate: The event method has exactly the name of the event.
  • +
  • Delayed: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed.
  • +
+ +

ACT_ASSIGN States:

+ +
    +
  • UnAssigned: The player has not accepted the task.
  • +
  • Assigned (*): The player has accepted the task.
  • +
  • Rejected (*): The player has not accepted the task.
  • +
  • Waiting: The process is awaiting player feedback.
  • +
  • Failed (*): The process has failed.
  • +
+ +

(*) End states of the process.

+ +

ACT_ASSIGN state transition methods:

+ +

State transition functions can be set by the mission designer customizing or improving the behaviour of the state. +There are 2 moments when state transition methods will be called by the state machine:

+ +
    +
  • Before the state transition. + The state transition method needs to start with the name OnBefore + the name of the state. + If the state transition method returns false, then the processing of the state transition will not be done! + If you want to change the behaviour of the AIControllable at this event, return false, + but then you'll need to specify your own logic using the AIControllable!

  • +
  • After the state transition. + The state transition method needs to start with the name OnAfter + the name of the state. + These state transition methods need to provide a return value, which is specified at the function description.

  • +
+ +
+ +

1) #ACTASSIGNACCEPT class, extends Fsm.Assign#ACT_ASSIGN

+ +

The ACTASSIGNACCEPT class accepts by default a task for a player. No player intervention is allowed to reject the task.

+ +

1.1) ACTASSIGNACCEPT constructor:

+ + + +
+ +

2) #ACTASSIGNMENU_ACCEPT class, extends Fsm.Assign#ACT_ASSIGN

+ +

The ACTASSIGNMENU_ACCEPT class accepts a task when the player accepts the task through an added menu option. +This assignment type is useful to conditionally allow the player to choose whether or not he would accept the task. +The assignment type also allows to reject the task.

+ +

2.1) ACTASSIGNMENU_ACCEPT constructor:

+
+ + + +
+ + +

Global(s)

+ + + + + + + + + + + + + +
ACT_ASSIGN + +
ACT_ASSIGN_ACCEPT + +
ACT_ASSIGN_MENU_ACCEPT + +
+

Type ACT_ASSIGN

+ + + + + + + + + + + + + + + + + + + + + +
ACT_ASSIGN.ClassName + +
ACT_ASSIGN:New() +

Creates a new task assignment state machine.

+
ACT_ASSIGN.ProcessUnit + +
ACT_ASSIGN.TargetZone + +
ACT_ASSIGN.Task + +
+ +

Type ACT_ASSIGN_ACCEPT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ACT_ASSIGN_ACCEPT.ClassName + +
ACT_ASSIGN_ACCEPT:Init(FsmAssign) + +
ACT_ASSIGN_ACCEPT:New(TaskBriefing) +

Creates a new task assignment state machine.

+
ACT_ASSIGN_ACCEPT.ProcessUnit + +
ACT_ASSIGN_ACCEPT.TargetZone + +
ACT_ASSIGN_ACCEPT.Task + +
ACT_ASSIGN_ACCEPT.TaskBriefing + +
ACT_ASSIGN_ACCEPT:onafterStart(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ASSIGN_ACCEPT:onenterAssigned(ProcessUnit, Event, From, To) +

StateMachine callback function

+
+ +

Type ACT_ASSIGN_MENU_ACCEPT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ACT_ASSIGN_MENU_ACCEPT.ClassName + +
ACT_ASSIGN_MENU_ACCEPT:Init(FsmAssign) + +
ACT_ASSIGN_MENU_ACCEPT.Menu + +
ACT_ASSIGN_MENU_ACCEPT.MenuAcceptTask + +
ACT_ASSIGN_MENU_ACCEPT:MenuAssign() +

Menu function.

+
ACT_ASSIGN_MENU_ACCEPT:MenuReject() +

Menu function.

+
ACT_ASSIGN_MENU_ACCEPT.MenuRejectTask + +
ACT_ASSIGN_MENU_ACCEPT:New(TaskName, TaskBriefing) +

Init.

+
ACT_ASSIGN_MENU_ACCEPT.ProcessUnit + +
ACT_ASSIGN_MENU_ACCEPT.TargetZone + +
ACT_ASSIGN_MENU_ACCEPT.Task + +
ACT_ASSIGN_MENU_ACCEPT.TaskBriefing + +
ACT_ASSIGN_MENU_ACCEPT.TaskName + +
ACT_ASSIGN_MENU_ACCEPT:onafterAssign(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ASSIGN_MENU_ACCEPT:onafterReject(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ASSIGN_MENU_ACCEPT:onafterStart(ProcessUnit, Event, From, To) +

StateMachine callback function

+
+ +

Global(s)

+
+
+ + #ACT_ASSIGN + +ACT_ASSIGN + +
+
+ + + +
+
+
+
+ + #ACT_ASSIGN_ACCEPT + +ACT_ASSIGN_ACCEPT + +
+
+ + + +
+
+
+
+ + #ACT_ASSIGN_MENU_ACCEPT + +ACT_ASSIGN_MENU_ACCEPT + +
+
+ + + +
+
+

Type Assign

+ +

Type ACT_ASSIGN

+ +

ACT_ASSIGN class

+ +

Field(s)

+
+
+ + #string + +ACT_ASSIGN.ClassName + +
+
+ + + +
+
+
+
+ + +ACT_ASSIGN:New() + +
+
+ +

Creates a new task assignment state machine.

+ + +

The process will accept the task by default, no player intervention accepted.

+ +

Return value

+ +

#ACT_ASSIGN: +The task acceptance process.

+ +
+
+
+
+ + Wrapper.Unit#UNIT + +ACT_ASSIGN.ProcessUnit + +
+
+ + + +
+
+
+
+ + Core.Zone#ZONE_BASE + +ACT_ASSIGN.TargetZone + +
+
+ + + +
+
+
+
+ + Tasking.Task#TASK + +ACT_ASSIGN.Task + +
+
+ + + +
+
+ +

Type ACT_ASSIGN_ACCEPT

+ +

ACTASSIGNACCEPT class

+ +

Field(s)

+
+
+ + #string + +ACT_ASSIGN_ACCEPT.ClassName + +
+
+ + + +
+
+
+
+ + +ACT_ASSIGN_ACCEPT:Init(FsmAssign) + +
+
+ + + +

Parameter

+
    +
  • + +

    FsmAssign :

    + +
  • +
+
+
+
+
+ + +ACT_ASSIGN_ACCEPT:New(TaskBriefing) + +
+
+ +

Creates a new task assignment state machine.

+ + +

The process will accept the task by default, no player intervention accepted.

+ +

Parameter

+
    +
  • + +

    #string TaskBriefing :

    + +
  • +
+
+
+
+
+ + Wrapper.Unit#UNIT + +ACT_ASSIGN_ACCEPT.ProcessUnit + +
+
+ + + +
+
+
+
+ + Core.Zone#ZONE_BASE + +ACT_ASSIGN_ACCEPT.TargetZone + +
+
+ + + +
+
+
+
+ + Tasking.Task#TASK + +ACT_ASSIGN_ACCEPT.Task + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIGN_ACCEPT.TaskBriefing + +
+
+ + + +
+
+
+
+ + +ACT_ASSIGN_ACCEPT:onafterStart(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT ProcessUnit :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +ACT_ASSIGN_ACCEPT:onenterAssigned(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT ProcessUnit :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+ +

Type ACT_ASSIGN_MENU_ACCEPT

+ +

ACTASSIGNMENU_ACCEPT class

+ +

Field(s)

+
+
+ + #string + +ACT_ASSIGN_MENU_ACCEPT.ClassName + +
+
+ + + +
+
+
+
+ + +ACT_ASSIGN_MENU_ACCEPT:Init(FsmAssign) + +
+
+ + + +

Parameter

+
    +
  • + +

    FsmAssign :

    + +
  • +
+
+
+
+
+ + + +ACT_ASSIGN_MENU_ACCEPT.Menu + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIGN_MENU_ACCEPT.MenuAcceptTask + +
+
+ + + +
+
+
+
+ + +ACT_ASSIGN_MENU_ACCEPT:MenuAssign() + +
+
+ +

Menu function.

+ +
+
+
+
+ + +ACT_ASSIGN_MENU_ACCEPT:MenuReject() + +
+
+ +

Menu function.

+ +
+
+
+
+ + + +ACT_ASSIGN_MENU_ACCEPT.MenuRejectTask + +
+
+ + + +
+
+
+
+ + +ACT_ASSIGN_MENU_ACCEPT:New(TaskName, TaskBriefing) + +
+
+ +

Init.

+ +

Parameters

+
    +
  • + +

    #string TaskName :

    + +
  • +
  • + +

    #string TaskBriefing :

    + +
  • +
+

Return value

+ +

#ACTASSIGNMENU_ACCEPT: +self

+ +
+
+
+
+ + Wrapper.Unit#UNIT + +ACT_ASSIGN_MENU_ACCEPT.ProcessUnit + +
+
+ + + +
+
+
+
+ + Core.Zone#ZONE_BASE + +ACT_ASSIGN_MENU_ACCEPT.TargetZone + +
+
+ + + +
+
+
+
+ + Tasking.Task#TASK + +ACT_ASSIGN_MENU_ACCEPT.Task + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIGN_MENU_ACCEPT.TaskBriefing + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIGN_MENU_ACCEPT.TaskName + +
+
+ + + +
+
+
+
+ + +ACT_ASSIGN_MENU_ACCEPT:onafterAssign(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ASSIGN_MENU_ACCEPT:onafterReject(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ASSIGN_MENU_ACCEPT:onafterStart(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Base.html b/docs/Documentation/Base.html new file mode 100644 index 000000000..762c164fd --- /dev/null +++ b/docs/Documentation/Base.html @@ -0,0 +1,2129 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Base

+ +

This module contains the BASE class.

+ + + +

1) #BASE class

+

The #BASE class is the super class for all the classes defined within MOOSE.

+ +

It handles:

+ +
    +
  • The construction and inheritance of child classes.
  • +
  • The tracing of objects during mission execution within the DCS.log file, under the "Saved Games\DCS\Logs" folder.
  • +
+ +

Note: Normally you would not use the BASE class unless you are extending the MOOSE framework with new classes.

+ +

1.1) BASE constructor

+

Any class derived from BASE, must use the Core.Base#BASE.New method how this is done.

+ +

1.2) BASE Trace functionality

+

The BASE class contains trace methods to trace progress within a mission execution of a certain object. +Note that these trace methods are inherited by each MOOSE class interiting BASE. +As such, each object created from derived class from BASE can use the tracing functions to trace its execution.

+ +

1.2.1) Tracing functions

+

There are basically 3 types of tracing methods available within BASE:

+ +
    +
  • BASE.F: Trace the beginning of a function and its given parameters. An F is indicated at column 44 in the DCS.log file.
  • +
  • BASE.T: Trace further logic within a function giving optional variables or parameters. A T is indicated at column 44 in the DCS.log file.
  • +
  • BASE.E: Trace an exception within a function giving optional variables or parameters. An E is indicated at column 44 in the DCS.log file. An exception will always be traced.
  • +
+ +

1.2.2) Tracing levels

+

There are 3 tracing levels within MOOSE.
+These tracing levels were defined to avoid bulks of tracing to be generated by lots of objects.

+ +

As such, the F and T methods have additional variants to trace level 2 and 3 respectively:

+ +
    +
  • BASE.F2: Trace the beginning of a function and its given parameters with tracing level 2.
  • +
  • BASE.F3: Trace the beginning of a function and its given parameters with tracing level 3.
  • +
  • BASE.T2: Trace further logic within a function giving optional variables or parameters with tracing level 2.
  • +
  • BASE.T3: Trace further logic within a function giving optional variables or parameters with tracing level 3.
  • +
+ +

1.3) BASE Inheritance support

+

The following methods are available to support inheritance:

+ + + +

Future

+

Further methods may be added to BASE whenever there is a need to make "overall" functions available within MOOSE.

+ +
+ +

Author: FlightControl

+ + +

Global(s)

+ + + + + + + + + +
BASE + +
FORMATION + +
+

Type BASE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BASE:AddEvent(Event, EventFunction) +

Set a new listener for the class.

+
BASE.ClassID +

The ID number of the class.

+
BASE.ClassName +

The name of the class.

+
BASE.ClassNameAndID +

The name of the class concatenated with the ID number of the class.

+
BASE:ClearState(Object, StateName) + +
BASE:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) +

Creation of a Birth Event.

+
BASE:CreateEventCrash(EventTime, Initiator) +

Creation of a Crash Event.

+
BASE:DisableEvents() +

Disable the event listeners for the class.

+
BASE:E(Arguments) +

Log an exception which will be traced always.

+
BASE:EnableEvents() +

Enable the event listeners for the class.

+
BASE:Event() +

Returns the event dispatcher

+
BASE:EventOnBaseCaptured(EventFunction) +

Subscribe to a SEVENTBASE_CAPTURED event.

+
BASE:EventOnBirth(EventFunction) +

Subscribe to a SEVENTBIRTH event.

+
BASE:EventOnCrash(EventFunction) +

Subscribe to a SEVENTCRASH event.

+
BASE:EventOnDead(EventFunction) +

Subscribe to a SEVENTDEAD event.

+
BASE:EventOnEjection(EventFunction) +

Subscribe to a SEVENTEJECTION event.

+
BASE:EventOnEngineShutdown(EventFunction) +

Subscribe to a SEVENTENGINE_SHUTDOWN event.

+
BASE:EventOnEngineStartup(EventFunction) +

Subscribe to a SEVENTENGINE_STARTUP event.

+
BASE:EventOnHit(EventFunction) +

Subscribe to a SEVENTHIT event.

+
BASE:EventOnHumanFailure(EventFunction) +

Subscribe to a SEVENTHUMAN_FAILURE event.

+
BASE:EventOnLand(EventFunction) +

Subscribe to a SEVENTLAND event.

+
BASE:EventOnMissionStart(EventFunction) +

Subscribe to a SEVENTMISSION_START event.

+
BASE:EventOnPilotDead(EventFunction) +

Subscribe to a SEVENTPILOT_DEAD event.

+
BASE:EventOnPlayerComment(EventFunction) +

Subscribe to a SEVENTPLAYER_COMMENT event.

+
BASE:EventOnPlayerEnterUnit(EventFunction) +

Subscribe to a SEVENTPLAYERENTERUNIT event.

+
BASE:EventOnPlayerLeaveUnit(EventFunction) +

Subscribe to a SEVENTPLAYERLEAVEUNIT event.

+
BASE:EventOnPlayerMissionEnd(EventFunction) +

Subscribe to a SEVENTMISSION_END event.

+
BASE:EventOnRefueling(EventFunction) +

Subscribe to a SEVENTREFUELING event.

+
BASE:EventOnRefuelingStop(EventFunction) +

Subscribe to a SEVENTREFUELING_STOP event.

+
BASE:EventOnShootingEnd(EventFunction) +

Subscribe to a SEVENTSHOOTING_END event.

+
BASE:EventOnShootingStart(EventFunction) +

Subscribe to a SEVENTSHOOTING_START event.

+
BASE:EventOnShot(EventFunction) +

Subscribe to a SEVENTSHOT event.

+
BASE:EventOnTakeOff(EventFunction) +

Subscribe to a SEVENTTAKEOFF event.

+
BASE:EventOnTookControl(EventFunction) +

Subscribe to a SEVENTTOOK_CONTROL event.

+
BASE:EventRemoveAll() +

Remove all subscribed events

+
BASE.Events + +
BASE:F(Arguments) +

Trace a function call.

+
BASE:F2(Arguments) +

Trace a function call level 2.

+
BASE:F3(Arguments) +

Trace a function call level 3.

+
BASE:GetClassID() +

Get the ClassID of the class instance.

+
BASE:GetClassName() +

Get the ClassName of the class instance.

+
BASE:GetClassNameAndID() +

Get the ClassName + ClassID of the class instance.

+
BASE:GetParent(Child) +

This is the worker method to retrieve the Parent class.

+
BASE:GetState(Object, StateName) + +
BASE:Inherit(Child, Parent) +

This is the worker method to inherit from a parent class.

+
BASE:IsTrace() +

Enquires if tracing is on (for the class).

+
BASE:New() + +
BASE:SetState(Object, StateName, State) + +
BASE.States + +
BASE:T(Arguments) +

Trace a function logic level 1.

+
BASE:T2(Arguments) +

Trace a function logic level 2.

+
BASE:T3(Arguments) +

Trace a function logic level 3.

+
BASE:TraceAll(TraceAll) +

Trace all methods in MOOSE

+
BASE:TraceClass(Class) +

Set tracing for a class

+
BASE:TraceClassMethod(Class, Method) +

Set tracing for a specific method of class

+
BASE:TraceLevel(Level) +

Set trace level

+
BASE:TraceOnOff(TraceOnOff) +

Set trace on or off +Note that when trace is off, no debug statement is performed, increasing performance! +When Moose is loaded statically, (as one file), tracing is switched off by default.

+
BASE:_Destructor() + +
BASE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) +

Trace a function call.

+
BASE:_SetDestructor() + +
BASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) +

Trace a function logic.

+
BASE:onEvent(event) + +
+ +

Type FORMATION

+ + + + + +
FORMATION.Cone +

A cone formation.

+
+ +

Global(s)

+
+
+ + #BASE + +BASE + +
+
+ + + +
+
+
+
+ + #FORMATION + +FORMATION + +
+
+ + + +
+
+

Type Base

+ +

Type BASE

+ +

The BASE Class

+ +

Field(s)

+
+
+ + +BASE:AddEvent(Event, EventFunction) + +
+
+ +

Set a new listener for the class.

+ +

Parameters

+ +

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE.ClassID + +
+
+ +

The ID number of the class.

+ +
+
+
+
+ + +BASE.ClassName + +
+
+ +

The name of the class.

+ +
+
+
+
+ + +BASE.ClassNameAndID + +
+
+ +

The name of the class concatenated with the ID number of the class.

+ +
+
+
+
+ + +BASE:ClearState(Object, StateName) + +
+
+ + + +

Parameters

+
    +
  • + +

    Object :

    + +
  • +
  • + +

    StateName :

    + +
  • +
+
+
+
+
+ + +BASE:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) + +
+
+ +

Creation of a Birth Event.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Time EventTime : +The time stamp of the event.

    + +
  • +
  • + +

    Dcs.DCSWrapper.Object#Object Initiator : +The initiating object of the event.

    + +
  • +
  • + +

    #string IniUnitName : +The initiating unit name.

    + +
  • +
  • + +

    place :

    + +
  • +
  • + +

    subplace :

    + +
  • +
+
+
+
+
+ + +BASE:CreateEventCrash(EventTime, Initiator) + +
+
+ +

Creation of a Crash Event.

+ +

Parameters

+ +
+
+
+
+ + +BASE:DisableEvents() + +
+
+ +

Disable the event listeners for the class.

+ +

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:E(Arguments) + +
+
+ +

Log an exception which will be traced always.

+ + +

Can be anywhere within the function logic.

+ +

Parameter

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
+
+
+
+
+ + +BASE:EnableEvents() + +
+
+ +

Enable the event listeners for the class.

+ +

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:Event() + +
+
+ +

Returns the event dispatcher

+ +

Return value

+ +

Core.Event#EVENT:

+ + +
+
+
+
+ + +BASE:EventOnBaseCaptured(EventFunction) + +
+
+ +

Subscribe to a SEVENTBASE_CAPTURED event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnBirth(EventFunction) + +
+
+ +

Subscribe to a SEVENTBIRTH event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnCrash(EventFunction) + +
+
+ +

Subscribe to a SEVENTCRASH event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnDead(EventFunction) + +
+
+ +

Subscribe to a SEVENTDEAD event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnEjection(EventFunction) + +
+
+ +

Subscribe to a SEVENTEJECTION event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnEngineShutdown(EventFunction) + +
+
+ +

Subscribe to a SEVENTENGINE_SHUTDOWN event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnEngineStartup(EventFunction) + +
+
+ +

Subscribe to a SEVENTENGINE_STARTUP event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnHit(EventFunction) + +
+
+ +

Subscribe to a SEVENTHIT event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnHumanFailure(EventFunction) + +
+
+ +

Subscribe to a SEVENTHUMAN_FAILURE event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnLand(EventFunction) + +
+
+ +

Subscribe to a SEVENTLAND event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnMissionStart(EventFunction) + +
+
+ +

Subscribe to a SEVENTMISSION_START event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnPilotDead(EventFunction) + +
+
+ +

Subscribe to a SEVENTPILOT_DEAD event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnPlayerComment(EventFunction) + +
+
+ +

Subscribe to a SEVENTPLAYER_COMMENT event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnPlayerEnterUnit(EventFunction) + +
+
+ +

Subscribe to a SEVENTPLAYERENTERUNIT event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnPlayerLeaveUnit(EventFunction) + +
+
+ +

Subscribe to a SEVENTPLAYERLEAVEUNIT event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnPlayerMissionEnd(EventFunction) + +
+
+ +

Subscribe to a SEVENTMISSION_END event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnRefueling(EventFunction) + +
+
+ +

Subscribe to a SEVENTREFUELING event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnRefuelingStop(EventFunction) + +
+
+ +

Subscribe to a SEVENTREFUELING_STOP event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnShootingEnd(EventFunction) + +
+
+ +

Subscribe to a SEVENTSHOOTING_END event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnShootingStart(EventFunction) + +
+
+ +

Subscribe to a SEVENTSHOOTING_START event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnShot(EventFunction) + +
+
+ +

Subscribe to a SEVENTSHOT event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnTakeOff(EventFunction) + +
+
+ +

Subscribe to a SEVENTTAKEOFF event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventOnTookControl(EventFunction) + +
+
+ +

Subscribe to a SEVENTTOOK_CONTROL event.

+ +

Parameter

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:EventRemoveAll() + +
+
+ +

Remove all subscribed events

+ +

Return value

+ +

#BASE:

+ + +
+
+
+
+ + + +BASE.Events + +
+
+ + + +
+
+
+
+ + +BASE:F(Arguments) + +
+
+ +

Trace a function call.

+ + +

Must be at the beginning of the function logic.

+ +

Parameter

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
+
+
+
+
+ + +BASE:F2(Arguments) + +
+
+ +

Trace a function call level 2.

+ + +

Must be at the beginning of the function logic.

+ +

Parameter

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
+
+
+
+
+ + +BASE:F3(Arguments) + +
+
+ +

Trace a function call level 3.

+ + +

Must be at the beginning of the function logic.

+ +

Parameter

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
+
+
+
+
+ + +BASE:GetClassID() + +
+
+ +

Get the ClassID of the class instance.

+ +

Return value

+ +

#string: +The ClassID of the class instance.

+ +
+
+
+
+ + +BASE:GetClassName() + +
+
+ +

Get the ClassName of the class instance.

+ +

Return value

+ +

#string: +The ClassName of the class instance.

+ +
+
+
+
+ + +BASE:GetClassNameAndID() + +
+
+ +

Get the ClassName + ClassID of the class instance.

+ + +

The ClassName + ClassID is formatted as '%s#%09d'.

+ +

Return value

+ +

#string: +The ClassName + ClassID of the class instance.

+ +
+
+
+
+ + +BASE:GetParent(Child) + +
+
+ +

This is the worker method to retrieve the Parent class.

+ +

Parameter

+
    +
  • + +

    #BASE Child : +is the Child class from which the Parent class needs to be retrieved.

    + +
  • +
+

Return value

+ +

#BASE:

+ + +
+
+
+
+ + +BASE:GetState(Object, StateName) + +
+
+ + + +

Parameters

+
    +
  • + +

    Object :

    + +
  • +
  • + +

    StateName :

    + +
  • +
+
+
+
+
+ + +BASE:Inherit(Child, Parent) + +
+
+ +

This is the worker method to inherit from a parent class.

+ +

Parameters

+
    +
  • + +

    Child : +is the Child class that inherits.

    + +
  • +
  • + +

    #BASE Parent : +is the Parent class that the Child inherits from.

    + +
  • +
+

Return value

+ +

#BASE: +Child

+ +
+
+
+
+ + +BASE:IsTrace() + +
+
+ +

Enquires if tracing is on (for the class).

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +BASE:New() + +
+
+ + + + +

@todo need to investigate if the deepCopy is really needed... Don't think so.

+ +
+
+
+
+ + +BASE:SetState(Object, StateName, State) + +
+
+ + + +

Parameters

+
    +
  • + +

    Object :

    + +
  • +
  • + +

    StateName :

    + +
  • +
  • + +

    State :

    + +
  • +
+
+
+
+
+ + + +BASE.States + +
+
+ + + +
+
+
+
+ + +BASE:T(Arguments) + +
+
+ +

Trace a function logic level 1.

+ + +

Can be anywhere within the function logic.

+ +

Parameter

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
+
+
+
+
+ + +BASE:T2(Arguments) + +
+
+ +

Trace a function logic level 2.

+ + +

Can be anywhere within the function logic.

+ +

Parameter

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
+
+
+
+
+ + +BASE:T3(Arguments) + +
+
+ +

Trace a function logic level 3.

+ + +

Can be anywhere within the function logic.

+ +

Parameter

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
+
+
+
+
+ + +BASE:TraceAll(TraceAll) + +
+
+ +

Trace all methods in MOOSE

+ +

Parameter

+
    +
  • + +

    #boolean TraceAll : +true = trace all methods in MOOSE.

    + +
  • +
+
+
+
+
+ + +BASE:TraceClass(Class) + +
+
+ +

Set tracing for a class

+ +

Parameter

+
    +
  • + +

    #string Class :

    + +
  • +
+
+
+
+
+ + +BASE:TraceClassMethod(Class, Method) + +
+
+ +

Set tracing for a specific method of class

+ +

Parameters

+
    +
  • + +

    #string Class :

    + +
  • +
  • + +

    #string Method :

    + +
  • +
+
+
+
+
+ + +BASE:TraceLevel(Level) + +
+
+ +

Set trace level

+ +

Parameter

+
    +
  • + +

    #number Level :

    + +
  • +
+
+
+
+
+ + +BASE:TraceOnOff(TraceOnOff) + +
+
+ +

Set trace on or off +Note that when trace is off, no debug statement is performed, increasing performance! +When Moose is loaded statically, (as one file), tracing is switched off by default.

+ + +

So tracing must be switched on manually in your mission if you are using Moose statically. +When moose is loading dynamically (for moose class development), tracing is switched on by default.

+ +

Parameter

+
    +
  • + +

    #boolean TraceOnOff : +Switch the tracing on or off.

    + +
  • +
+

Usage:

+
-- Switch the tracing On
+BASE:TraceOn( true )
+
+-- Switch the tracing Off
+BASE:TraceOn( false )
+ +
+
+
+
+ + +BASE:_Destructor() + +
+
+ + + +
+
+
+
+ + +BASE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) + +
+
+ +

Trace a function call.

+ + +

This function is private.

+ +

Parameters

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
  • + +

    DebugInfoCurrentParam :

    + +
  • +
  • + +

    DebugInfoFromParam :

    + +
  • +
+
+
+
+
+ + +BASE:_SetDestructor() + +
+
+ + + +
+
+
+
+ + +BASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) + +
+
+ +

Trace a function logic.

+ +

Parameters

+
    +
  • + +

    Arguments : +A #table or any field.

    + +
  • +
  • + +

    DebugInfoCurrentParam :

    + +
  • +
  • + +

    DebugInfoFromParam :

    + +
  • +
+
+
+
+
+ + +BASE:onEvent(event) + +
+
+ + + + +

TODO: Complete Dcs.DCSTypes#Event structure.
+- The main event handling function... This function captures all events generated for the class. + @param #BASE self + @param Dcs.DCSTypes#Event event

+ +

Parameter

+
    +
  • + +

    event :

    + +
  • +
+
+
+ +

Type FORMATION

+ +

The Formation Class

+ +

Field(s)

+
+
+ + +FORMATION.Cone + +
+
+ +

A cone formation.

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Cargo.html b/docs/Documentation/Cargo.html new file mode 100644 index 000000000..90fca6bc1 --- /dev/null +++ b/docs/Documentation/Cargo.html @@ -0,0 +1,2847 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Cargo

+ +

Management of logical cargo objects, that can be transported from and to transportation carriers.

+ + + +
+ +

Cargo can be of various forms, always are composed out of ONE object ( one unit or one static or one slingload crate ):

+ +
    +
  • AICARGOUNIT, represented by a Unit in a Group: Cargo can be represented by a Unit in a Group. Destruction of the Unit will mean that the cargo is lost.

  • +
  • CARGO_STATIC, represented by a Static: Cargo can be represented by a Static. Destruction of the Static will mean that the cargo is lost.

  • +
  • AICARGOPACKAGE, contained in a Unit of a Group: Cargo can be contained within a Unit of a Group. The cargo can be delivered by the Unit. If the Unit is destroyed, the cargo will be destroyed also.

  • +
  • AICARGOPACKAGE, Contained in a Static: Cargo can be contained within a Static. The cargo can be collected from the @Static. If the Static is destroyed, the cargo will be destroyed.

  • +
  • CARGO_SLINGLOAD, represented by a Cargo that is transportable: Cargo can be represented by a Cargo object that is transportable. Destruction of the Cargo will mean that the cargo is lost.

  • +
  • AICARGOGROUPED, represented by a Group of CARGO_UNITs.

  • +
+ +

1) AI.AICargo#AICARGO class, extends Core.Fsm#FSM_PROCESS

+

The #AI_CARGO class defines the core functions that defines a cargo object within MOOSE. +A cargo is a logical object defined that is available for transport, and has a life status within a simulation.

+ +

The AICARGO is a state machine: it manages the different events and states of the cargo. +All derived classes from AICARGO follow the same state machine, expose the same cargo event functions, and provide the same cargo states.

+ +

1.2.1) AI_CARGO Events:

+ +
    +
  • AI_CARGO.Board( ToCarrier ): Boards the cargo to a carrier.
  • +
  • AI_CARGO.Load( ToCarrier ): Loads the cargo into a carrier, regardless of its position.
  • +
  • AI_CARGO.UnBoard( ToPointVec2 ): UnBoard the cargo from a carrier. This will trigger a movement of the cargo to the option ToPointVec2.
  • +
  • AI_CARGO.UnLoad( ToPointVec2 ): UnLoads the cargo from a carrier.
  • +
  • AI_CARGO.Dead( Controllable ): The cargo is dead. The cargo process will be ended.
  • +
+ +

1.2.2) AI_CARGO States:

+ +
    +
  • UnLoaded: The cargo is unloaded from a carrier.
  • +
  • Boarding: The cargo is currently boarding (= running) into a carrier.
  • +
  • Loaded: The cargo is loaded into a carrier.
  • +
  • UnBoarding: The cargo is currently unboarding (=running) from a carrier.
  • +
  • Dead: The cargo is dead ...
  • +
  • End: The process has come to an end.
  • +
+ +

1.2.3) AI_CARGO state transition methods:

+ +

State transition functions can be set by the mission designer customizing or improving the behaviour of the state. +There are 2 moments when state transition methods will be called by the state machine:

+ +
    +
  • Before the state transition. + The state transition method needs to start with the name OnBefore + the name of the state. + If the state transition method returns false, then the processing of the state transition will not be done! + If you want to change the behaviour of the AIControllable at this event, return false, + but then you'll need to specify your own logic using the AIControllable!

  • +
  • After the state transition. + The state transition method needs to start with the name OnAfter + the name of the state. + These state transition methods need to provide a return value, which is specified at the function description.

  • +
+ +

2) #AICARGOUNIT class

+

The AICARGOUNIT class defines a cargo that is represented by a UNIT object within the simulator, and can be transported by a carrier. +Use the event functions as described above to Load, UnLoad, Board, UnBoard the AICARGOUNIT objects to and from carriers.

+ +

5) #AICARGOGROUPED class

+

The AICARGOGROUPED class defines a cargo that is represented by a group of UNIT objects within the simulator, and can be transported by a carrier. +Use the event functions as described above to Load, UnLoad, Board, UnBoard the AICARGOUNIT objects to and from carriers.

+ +

This module is still under construction, but is described above works already, and will keep working ...

+ + +

Global(s)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_CARGO + +
AI_CARGO_GROUP + +
AI_CARGO_GROUPED + +
AI_CARGO_PACKAGE + +
AI_CARGO_REPRESENTABLE + +
AI_CARGO_UNIT + +
CARGOS + +
+

Type AI_CARGO

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_CARGO:Board(ToCarrier) +

Boards the cargo to a Carrier.

+
AI_CARGO.CargoCarrier +

The alive DCS object carrying the cargo. This value can be nil, meaning, that the cargo is not contained anywhere...

+
AI_CARGO.CargoObject +

The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...

+
AI_CARGO.ClassName + +
AI_CARGO.Containable +

This flag defines if the cargo can be contained within a DCS Unit.

+
AI_CARGO:IsNear(PointVec2) +

Check if CargoCarrier is near the Cargo to be Loaded.

+
AI_CARGO:Load(ToCarrier) +

Loads the cargo to a Carrier.

+
AI_CARGO.Moveable +

This flag defines if the cargo is moveable.

+
AI_CARGO.Name +

A string defining the name of the cargo. The name is the unique identifier of the cargo.

+
AI_CARGO.NearRadius +

(optional) A number defining the radius in meters when the cargo is near to a Carrier, so that it can be loaded.

+
AI_CARGO:New(Type, Name, Weight, ReportRadius, NearRadius) +

AI_CARGO Constructor.

+
AI_CARGO:OnAfterBoarding(Controllable) + +
AI_CARGO:OnAfterLoaded(Controllable) + +
AI_CARGO:OnAfterUnBoarding(Controllable) + +
AI_CARGO:OnAfterUnLoaded(Controllable) + +
AI_CARGO:OnBeforeBoarding(Controllable) + +
AI_CARGO:OnBeforeLoaded(Controllable) + +
AI_CARGO:OnBeforeUnBoarding(Controllable) + +
AI_CARGO:OnBeforeUnLoaded(Controllable) + +
AI_CARGO.ReportRadius +

(optional) A number defining the radius in meters when the cargo is signalling or reporting to a Carrier.

+
AI_CARGO.Representable +

This flag defines if the cargo can be represented by a DCS Unit.

+
AI_CARGO.Slingloadable +

This flag defines if the cargo can be slingloaded.

+
AI_CARGO:Spawn(PointVec2) +

Template method to spawn a new representation of the AI_CARGO in the simulator.

+
AI_CARGO.Type +

A string defining the type of the cargo. eg. Engineers, Equipment, Screwdrivers.

+
AI_CARGO:UnBoard(ToPointVec2) +

UnBoards the cargo to a Carrier.

+
AI_CARGO:UnLoad(ToPointVec2) +

UnLoads the cargo to a Carrier.

+
AI_CARGO.Weight +

A number defining the weight of the cargo. The weight is expressed in kg.

+
AI_CARGO:__Board(DelaySeconds, ToCarrier) +

Boards the cargo to a Carrier.

+
AI_CARGO:__Load(DelaySeconds, ToCarrier) +

Loads the cargo to a Carrier.

+
AI_CARGO:__UnBoard(DelaySeconds, ToPointVec2) +

UnBoards the cargo to a Carrier.

+
AI_CARGO:__UnLoad(DelaySeconds, ToPointVec2) +

UnLoads the cargo to a Carrier.

+
+ +

Type AI_CARGO_GROUP

+ + + + + + + + + + + + + + + + + +
AI_CARGO_GROUP.CargoSet +

A set of cargo objects.

+
AI_CARGO_GROUP.ClassName + +
AI_CARGO_GROUP.Name +

A string defining the name of the cargo group. The name is the unique identifier of the cargo.

+
AI_CARGO_GROUP:New(CargoSet, Type, Name, Weight, ReportRadius, NearRadius) +

AICARGOGROUP constructor.

+
+ +

Type AI_CARGO_GROUPED

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_CARGO_GROUPED.ClassName + +
AI_CARGO_GROUPED:New(CargoSet, Type, Name, Weight, ReportRadius, NearRadius) +

AICARGOGROUPED constructor.

+
AI_CARGO_GROUPED:onafterUnBoarding(ToPointVec2, Event, From, To) +

UnBoard Event.

+
AI_CARGO_GROUPED:onenterBoarding(CargoCarrier, Event, From, To) +

Enter Boarding State.

+
AI_CARGO_GROUPED:onenterLoaded(CargoCarrier, Event, From, To) +

Enter Loaded State.

+
AI_CARGO_GROUPED:onenterUnBoarding(ToPointVec2, Event, From, To) +

Enter UnBoarding State.

+
AI_CARGO_GROUPED:onenterUnLoaded(Core, Event, From, To, ToPointVec2) +

Enter UnLoaded State.

+
AI_CARGO_GROUPED:onleaveBoarding(CargoCarrier, Event, From, To) +

Leave Boarding State.

+
AI_CARGO_GROUPED:onleaveUnBoarding(ToPointVec2, Event, From, To) +

Leave UnBoarding State.

+
+ +

Type AI_CARGO_PACKAGE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_CARGO_PACKAGE.CargoCarrier + +
AI_CARGO_PACKAGE.CargoInAir + +
AI_CARGO_PACKAGE.ClassName + +
AI_CARGO_PACKAGE:IsNear(CargoCarrier) +

Check if CargoCarrier is near the Cargo to be Loaded.

+
AI_CARGO_PACKAGE:New(CargoCarrier, Type, Name, Weight, ReportRadius, NearRadius) +

AICARGOPACKAGE Constructor.

+
AI_CARGO_PACKAGE:onafterLoad(Event, From, To, CargoCarrier, Speed, LoadDistance, Angle) +

Load Event.

+
AI_CARGO_PACKAGE:onafterOnBoard(Event, From, To, CargoCarrier, Speed, BoardDistance, Angle, LoadDistance) +

Board Event.

+
AI_CARGO_PACKAGE:onafterOnBoarded(Event, From, To, CargoCarrier, Speed, BoardDistance, LoadDistance, Angle) +

Boarded Event.

+
AI_CARGO_PACKAGE:onafterUnBoard(Event, From, To, Speed, UnLoadDistance, UnBoardDistance, Radius, Angle, CargoCarrier) +

UnBoard Event.

+
AI_CARGO_PACKAGE:onafterUnBoarded(Event, From, To, CargoCarrier, Speed) +

UnBoarded Event.

+
AI_CARGO_PACKAGE:onafterUnLoad(Event, From, To, Distance, Angle, CargoCarrier, Speed) +

UnLoad Event.

+
+ +

Type AI_CARGO_REPRESENTABLE

+ + + + + + + + + + + + + +
AI_CARGO_REPRESENTABLE.ClassName + +
AI_CARGO_REPRESENTABLE:New(CargoObject, Type, Name, Weight, ReportRadius, NearRadius) +

AICARGOREPRESENTABLE Constructor.

+
AI_CARGO_REPRESENTABLE:RouteTo(ToPointVec2, Speed) +

Route a cargo unit to a PointVec2.

+
+ +

Type AI_CARGO_UNIT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_CARGO_UNIT.CargoCarrier + +
AI_CARGO_UNIT.CargoInAir + +
AI_CARGO_UNIT.CargoObject + +
AI_CARGO_UNIT.ClassName + +
AI_CARGO_UNIT:New(CargoUnit, Type, Name, Weight, ReportRadius, NearRadius) +

AICARGOUNIT Constructor.

+
AI_CARGO_UNIT.OnUnLoadedCallBack + +
AI_CARGO_UNIT:onafterBoard(Event, From, To, CargoCarrier) +

Board Event.

+
AI_CARGO_UNIT:onafterUnBoarding(Event, From, To, ToPointVec2) +

UnBoard Event.

+
AI_CARGO_UNIT:onenterBoarding(Event, From, To, CargoCarrier) +

Enter Boarding State.

+
AI_CARGO_UNIT:onenterLoaded(Event, From, To, CargoCarrier) +

Loaded State.

+
AI_CARGO_UNIT:onenterUnBoarding(Event, From, To, ToPointVec2) +

Enter UnBoarding State.

+
AI_CARGO_UNIT:onenterUnLoaded(Event, From, To, Core, ToPointVec2) +

Enter UnLoaded State.

+
AI_CARGO_UNIT:onleaveBoarding(Event, From, To, CargoCarrier) +

Leave Boarding State.

+
AI_CARGO_UNIT:onleaveUnBoarding(Event, From, To, ToPointVec2) +

Leave UnBoarding State.

+
+ +

Global(s)

+
+
+ + #AI_CARGO + +AI_CARGO + +
+
+ + + +
+
+
+
+ + #AI_CARGO_GROUP + +AI_CARGO_GROUP + +
+
+ + + +
+
+
+
+ + #AI_CARGO_GROUPED + +AI_CARGO_GROUPED + +
+
+ + + +
+
+
+
+ + #AI_CARGO_PACKAGE + +AI_CARGO_PACKAGE + +
+
+ + + +
+
+
+
+ + #AI_CARGO_REPRESENTABLE + +AI_CARGO_REPRESENTABLE + +
+
+ + + +
+
+
+
+ + #AI_CARGO_UNIT + +AI_CARGO_UNIT + +
+
+ + + +
+
+
+
+ + + +CARGOS + +
+
+ + + +
+
+

Type Cargo

+ +

Type AI_CARGO

+

Field(s)

+
+
+ + +AI_CARGO:Board(ToCarrier) + +
+
+ +

Boards the cargo to a Carrier.

+ + +

The event will create a movement (= running or driving) of the cargo to the Carrier. +The cargo must be in the UnLoaded state.

+ +

Parameter

+ +
+
+
+
+ + Wrapper.Controllable#CONTROLLABLE + +AI_CARGO.CargoCarrier + +
+
+ +

The alive DCS object carrying the cargo. This value can be nil, meaning, that the cargo is not contained anywhere...

+ +
+
+
+
+ + Wrapper.Controllable#CONTROLLABLE + +AI_CARGO.CargoObject + +
+
+ +

The alive DCS object representing the cargo. This value can be nil, meaning, that the cargo is not represented anywhere...

+ +
+
+
+
+ + #string + +AI_CARGO.ClassName + +
+
+ + + +
+
+
+
+ + #boolean + +AI_CARGO.Containable + +
+
+ +

This flag defines if the cargo can be contained within a DCS Unit.

+ +
+
+
+
+ + +AI_CARGO:IsNear(PointVec2) + +
+
+ +

Check if CargoCarrier is near the Cargo to be Loaded.

+ +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +AI_CARGO:Load(ToCarrier) + +
+
+ +

Loads the cargo to a Carrier.

+ + +

The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading. +The cargo must be in the UnLoaded state.

+ +

Parameter

+ +
+
+
+
+ + #boolean + +AI_CARGO.Moveable + +
+
+ +

This flag defines if the cargo is moveable.

+ +
+
+
+
+ + #string + +AI_CARGO.Name + +
+
+ +

A string defining the name of the cargo. The name is the unique identifier of the cargo.

+ +
+
+
+
+ + #number + +AI_CARGO.NearRadius + +
+
+ +

(optional) A number defining the radius in meters when the cargo is near to a Carrier, so that it can be loaded.

+ +
+
+
+
+ + +AI_CARGO:New(Type, Name, Weight, ReportRadius, NearRadius) + +
+
+ +

AI_CARGO Constructor.

+ + +

This class is an abstract class and should not be instantiated.

+ +

Parameters

+
    +
  • + +

    #string Type :

    + +
  • +
  • + +

    #string Name :

    + +
  • +
  • + +

    #number Weight :

    + +
  • +
  • + +

    #number ReportRadius : +(optional)

    + +
  • +
  • + +

    #number NearRadius : +(optional)

    + +
  • +
+

Return value

+ +

#AI_CARGO:

+ + +
+
+
+
+ + +AI_CARGO:OnAfterBoarding(Controllable) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +AI_CARGO:OnAfterLoaded(Controllable) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +AI_CARGO:OnAfterUnBoarding(Controllable) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +AI_CARGO:OnAfterUnLoaded(Controllable) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +AI_CARGO:OnBeforeBoarding(Controllable) + +
+
+ + + +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +AI_CARGO:OnBeforeLoaded(Controllable) + +
+
+ + + +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +AI_CARGO:OnBeforeUnBoarding(Controllable) + +
+
+ + + +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +AI_CARGO:OnBeforeUnLoaded(Controllable) + +
+
+ + + +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + #number + +AI_CARGO.ReportRadius + +
+
+ +

(optional) A number defining the radius in meters when the cargo is signalling or reporting to a Carrier.

+ +
+
+
+
+ + #boolean + +AI_CARGO.Representable + +
+
+ +

This flag defines if the cargo can be represented by a DCS Unit.

+ +
+
+
+
+ + #boolean + +AI_CARGO.Slingloadable + +
+
+ +

This flag defines if the cargo can be slingloaded.

+ +
+
+
+
+ + +AI_CARGO:Spawn(PointVec2) + +
+
+ +

Template method to spawn a new representation of the AI_CARGO in the simulator.

+ +

Parameter

+
    +
  • + +

    PointVec2 :

    + +
  • +
+

Return value

+ +

#AI_CARGO:

+ + +
+
+
+
+ + #string + +AI_CARGO.Type + +
+
+ +

A string defining the type of the cargo. eg. Engineers, Equipment, Screwdrivers.

+ +
+
+
+
+ + +AI_CARGO:UnBoard(ToPointVec2) + +
+
+ +

UnBoards the cargo to a Carrier.

+ + +

The event will create a movement (= running or driving) of the cargo from the Carrier. +The cargo must be in the Loaded state.

+ +

Parameter

+
    +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 : +(optional) @{Core.Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.

    + +
  • +
+
+
+
+
+ + +AI_CARGO:UnLoad(ToPointVec2) + +
+
+ +

UnLoads the cargo to a Carrier.

+ + +

The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading. +The cargo must be in the Loaded state.

+ +

Parameter

+
    +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 : +(optional) @{Core.Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.

    + +
  • +
+
+
+
+
+ + #number + +AI_CARGO.Weight + +
+
+ +

A number defining the weight of the cargo. The weight is expressed in kg.

+ +
+
+
+
+ + +AI_CARGO:__Board(DelaySeconds, ToCarrier) + +
+
+ +

Boards the cargo to a Carrier.

+ + +

The event will create a movement (= running or driving) of the cargo to the Carrier. +The cargo must be in the UnLoaded state.

+ +

Parameters

+
    +
  • + +

    #number DelaySeconds : +The amount of seconds to delay the action.

    + +
  • +
  • + +

    Wrapper.Controllable#CONTROLLABLE ToCarrier : +The Carrier that will hold the cargo.

    + +
  • +
+
+
+
+
+ + +AI_CARGO:__Load(DelaySeconds, ToCarrier) + +
+
+ +

Loads the cargo to a Carrier.

+ + +

The event will load the cargo into the Carrier regardless of its position. There will be no movement simulated of the cargo loading. +The cargo must be in the UnLoaded state.

+ +

Parameters

+
    +
  • + +

    #number DelaySeconds : +The amount of seconds to delay the action.

    + +
  • +
  • + +

    Wrapper.Controllable#CONTROLLABLE ToCarrier : +The Carrier that will hold the cargo.

    + +
  • +
+
+
+
+
+ + +AI_CARGO:__UnBoard(DelaySeconds, ToPointVec2) + +
+
+ +

UnBoards the cargo to a Carrier.

+ + +

The event will create a movement (= running or driving) of the cargo from the Carrier. +The cargo must be in the Loaded state.

+ +

Parameters

+
    +
  • + +

    #number DelaySeconds : +The amount of seconds to delay the action.

    + +
  • +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 : +(optional) @{Core.Point#POINT_VEC2) to where the cargo should run after onboarding. If not provided, the cargo will run to 60 meters behind the Carrier location.

    + +
  • +
+
+
+
+
+ + +AI_CARGO:__UnLoad(DelaySeconds, ToPointVec2) + +
+
+ +

UnLoads the cargo to a Carrier.

+ + +

The event will unload the cargo from the Carrier. There will be no movement simulated of the cargo loading. +The cargo must be in the Loaded state.

+ +

Parameters

+
    +
  • + +

    #number DelaySeconds : +The amount of seconds to delay the action.

    + +
  • +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 : +(optional) @{Core.Point#POINT_VEC2) to where the cargo will be placed after unloading. If not provided, the cargo will be placed 60 meters behind the Carrier location.

    + +
  • +
+
+
+ +

Type AI_CARGO.CargoObjects

+ +

Type AI_CARGO_GROUP

+

Field(s)

+
+
+ + Set#SET_BASE + +AI_CARGO_GROUP.CargoSet + +
+
+ +

A set of cargo objects.

+ +
+
+
+
+ + #string + +AI_CARGO_GROUP.ClassName + +
+
+ + + +
+
+
+
+ + #string + +AI_CARGO_GROUP.Name + +
+
+ +

A string defining the name of the cargo group. The name is the unique identifier of the cargo.

+ +
+
+
+
+ + +AI_CARGO_GROUP:New(CargoSet, Type, Name, Weight, ReportRadius, NearRadius) + +
+
+ +

AICARGOGROUP constructor.

+ +

Parameters

+
    +
  • + +

    Core.Set#Set_BASE CargoSet :

    + +
  • +
  • + +

    #string Type :

    + +
  • +
  • + +

    #string Name :

    + +
  • +
  • + +

    #number Weight :

    + +
  • +
  • + +

    #number ReportRadius : +(optional)

    + +
  • +
  • + +

    #number NearRadius : +(optional)

    + +
  • +
+

Return value

+ +

#AICARGOGROUP:

+ + +
+
+ +

Type AI_CARGO_GROUPED

+

Field(s)

+
+
+ + #string + +AI_CARGO_GROUPED.ClassName + +
+
+ + + +
+
+
+
+ + +AI_CARGO_GROUPED:New(CargoSet, Type, Name, Weight, ReportRadius, NearRadius) + +
+
+ +

AICARGOGROUPED constructor.

+ +

Parameters

+
    +
  • + +

    Core.Set#Set_BASE CargoSet :

    + +
  • +
  • + +

    #string Type :

    + +
  • +
  • + +

    #string Name :

    + +
  • +
  • + +

    #number Weight :

    + +
  • +
  • + +

    #number ReportRadius : +(optional)

    + +
  • +
  • + +

    #number NearRadius : +(optional)

    + +
  • +
+

Return value

+ +

#AICARGOGROUPED:

+ + +
+
+
+
+ + +AI_CARGO_GROUPED:onafterUnBoarding(ToPointVec2, Event, From, To) + +
+
+ +

UnBoard Event.

+ +

Parameters

+
    +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_GROUPED:onenterBoarding(CargoCarrier, Event, From, To) + +
+
+ +

Enter Boarding State.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_GROUPED:onenterLoaded(CargoCarrier, Event, From, To) + +
+
+ +

Enter Loaded State.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_GROUPED:onenterUnBoarding(ToPointVec2, Event, From, To) + +
+
+ +

Enter UnBoarding State.

+ +

Parameters

+
    +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_GROUPED:onenterUnLoaded(Core, Event, From, To, ToPointVec2) + +
+
+ +

Enter UnLoaded State.

+ +

Parameters

+
    +
  • + +

    Core : +Point#POINT_VEC2

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    ToPointVec2 :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_GROUPED:onleaveBoarding(CargoCarrier, Event, From, To) + +
+
+ +

Leave Boarding State.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_GROUPED:onleaveUnBoarding(ToPointVec2, Event, From, To) + +
+
+ +

Leave UnBoarding State.

+ +

Parameters

+
    +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+ +

Type AI_CARGO_PACKAGE

+

Field(s)

+
+
+ + + +AI_CARGO_PACKAGE.CargoCarrier + +
+
+ + + +
+
+
+
+ + + +AI_CARGO_PACKAGE.CargoInAir + +
+
+ + + +
+
+
+
+ + #string + +AI_CARGO_PACKAGE.ClassName + +
+
+ + + +
+
+
+
+ + +AI_CARGO_PACKAGE:IsNear(CargoCarrier) + +
+
+ +

Check if CargoCarrier is near the Cargo to be Loaded.

+ +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +AI_CARGO_PACKAGE:New(CargoCarrier, Type, Name, Weight, ReportRadius, NearRadius) + +
+
+ +

AICARGOPACKAGE Constructor.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT CargoCarrier : +The UNIT carrying the package.

    + +
  • +
  • + +

    #string Type :

    + +
  • +
  • + +

    #string Name :

    + +
  • +
  • + +

    #number Weight :

    + +
  • +
  • + +

    #number ReportRadius : +(optional)

    + +
  • +
  • + +

    #number NearRadius : +(optional)

    + +
  • +
+

Return value

+ +

#AICARGOPACKAGE:

+ + +
+
+
+
+ + +AI_CARGO_PACKAGE:onafterLoad(Event, From, To, CargoCarrier, Speed, LoadDistance, Angle) + +
+
+ +

Load Event.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
  • + +

    #number Speed :

    + +
  • +
  • + +

    #number LoadDistance :

    + +
  • +
  • + +

    #number Angle :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_PACKAGE:onafterOnBoard(Event, From, To, CargoCarrier, Speed, BoardDistance, Angle, LoadDistance) + +
+
+ +

Board Event.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
  • + +

    #number Speed :

    + +
  • +
  • + +

    #number BoardDistance :

    + +
  • +
  • + +

    #number Angle :

    + +
  • +
  • + +

    LoadDistance :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_PACKAGE:onafterOnBoarded(Event, From, To, CargoCarrier, Speed, BoardDistance, LoadDistance, Angle) + +
+
+ +

Boarded Event.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
  • + +

    Speed :

    + +
  • +
  • + +

    BoardDistance :

    + +
  • +
  • + +

    LoadDistance :

    + +
  • +
  • + +

    Angle :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_PACKAGE:onafterUnBoard(Event, From, To, Speed, UnLoadDistance, UnBoardDistance, Radius, Angle, CargoCarrier) + +
+
+ +

UnBoard Event.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    #number Speed :

    + +
  • +
  • + +

    #number UnLoadDistance :

    + +
  • +
  • + +

    #number UnBoardDistance :

    + +
  • +
  • + +

    #number Radius :

    + +
  • +
  • + +

    #number Angle :

    + +
  • +
  • + +

    CargoCarrier :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_PACKAGE:onafterUnBoarded(Event, From, To, CargoCarrier, Speed) + +
+
+ +

UnBoarded Event.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
  • + +

    Speed :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_PACKAGE:onafterUnLoad(Event, From, To, Distance, Angle, CargoCarrier, Speed) + +
+
+ +

UnLoad Event.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    #number Distance :

    + +
  • +
  • + +

    #number Angle :

    + +
  • +
  • + +

    CargoCarrier :

    + +
  • +
  • + +

    Speed :

    + +
  • +
+
+
+ +

Type AI_CARGO_REPRESENTABLE

+

Field(s)

+
+
+ + #string + +AI_CARGO_REPRESENTABLE.ClassName + +
+
+ + + +
+
+
+
+ + +AI_CARGO_REPRESENTABLE:New(CargoObject, Type, Name, Weight, ReportRadius, NearRadius) + +
+
+ +

AICARGOREPRESENTABLE Constructor.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#Controllable CargoObject :

    + +
  • +
  • + +

    #string Type :

    + +
  • +
  • + +

    #string Name :

    + +
  • +
  • + +

    #number Weight :

    + +
  • +
  • + +

    #number ReportRadius : +(optional)

    + +
  • +
  • + +

    #number NearRadius : +(optional)

    + +
  • +
+

Return value

+ +

#AICARGOREPRESENTABLE:

+ + +
+
+
+
+ + +AI_CARGO_REPRESENTABLE:RouteTo(ToPointVec2, Speed) + +
+
+ +

Route a cargo unit to a PointVec2.

+ +

Parameters

+ +

Return value

+ +

#AICARGOREPRESENTABLE:

+ + +
+
+ +

Type AI_CARGO_UNIT

+

Field(s)

+
+
+ + +AI_CARGO_UNIT.CargoCarrier + +
+
+ + + +
+
+
+
+ + + +AI_CARGO_UNIT.CargoInAir + +
+
+ + + +
+
+
+
+ + + +AI_CARGO_UNIT.CargoObject + +
+
+ + + +
+
+
+
+ + #string + +AI_CARGO_UNIT.ClassName + +
+
+ + + +
+
+
+
+ + +AI_CARGO_UNIT:New(CargoUnit, Type, Name, Weight, ReportRadius, NearRadius) + +
+
+ +

AICARGOUNIT Constructor.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT CargoUnit :

    + +
  • +
  • + +

    #string Type :

    + +
  • +
  • + +

    #string Name :

    + +
  • +
  • + +

    #number Weight :

    + +
  • +
  • + +

    #number ReportRadius : +(optional)

    + +
  • +
  • + +

    #number NearRadius : +(optional)

    + +
  • +
+

Return value

+ +

#AICARGOUNIT:

+ + +
+
+
+
+ + +AI_CARGO_UNIT.OnUnLoadedCallBack + +
+
+ + + +
+
+
+
+ + +AI_CARGO_UNIT:onafterBoard(Event, From, To, CargoCarrier) + +
+
+ +

Board Event.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    CargoCarrier :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_UNIT:onafterUnBoarding(Event, From, To, ToPointVec2) + +
+
+ +

UnBoard Event.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_UNIT:onenterBoarding(Event, From, To, CargoCarrier) + +
+
+ +

Enter Boarding State.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_UNIT:onenterLoaded(Event, From, To, CargoCarrier) + +
+
+ +

Loaded State.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_UNIT:onenterUnBoarding(Event, From, To, ToPointVec2) + +
+
+ +

Enter UnBoarding State.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_UNIT:onenterUnLoaded(Event, From, To, Core, ToPointVec2) + +
+
+ +

Enter UnLoaded State.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Core : +Point#POINT_VEC2

    + +
  • +
  • + +

    ToPointVec2 :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_UNIT:onleaveBoarding(Event, From, To, CargoCarrier) + +
+
+ +

Leave Boarding State.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Wrapper.Unit#UNIT CargoCarrier :

    + +
  • +
+
+
+
+
+ + +AI_CARGO_UNIT:onleaveUnBoarding(Event, From, To, ToPointVec2) + +
+
+ +

Leave UnBoarding State.

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
  • + +

    Core.Point#POINT_VEC2 ToPointVec2 :

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/CleanUp.html b/docs/Documentation/CleanUp.html new file mode 100644 index 000000000..321d53fb1 --- /dev/null +++ b/docs/Documentation/CleanUp.html @@ -0,0 +1,563 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module CleanUp

+ +

The CLEANUP class keeps an area clean of crashing or colliding airplanes.

+ + +

It also prevents airplanes from firing within this area.

+ +

Global(s)

+ + + + + +
CLEANUP + +
+

Type CLEANUP

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CLEANUP.ClassName + +
CLEANUP.CleanUpList + +
CLEANUP:New(ZoneNames, TimeInterval) + +
CLEANUP.TimeInterval + +
CLEANUP.ZoneNames + +
CLEANUP:_AddForCleanUp(CleanUpUnit, CleanUpUnitName) +

Add the Dcs.DCSWrapper.Unit#Unit to the CleanUpList for CleanUp.

+
CLEANUP:_CleanUpScheduler() +

At the defined time interval, CleanUp the Groups within the CleanUpList.

+
CLEANUP:_DestroyGroup(GroupObject, CleanUpGroupName) +

Destroys a group from the simulator, but checks first if it is still existing!

+
CLEANUP:_DestroyMissile(MissileObject) + +
CLEANUP:_DestroyUnit(CleanUpUnit, CleanUpUnitName) +

Destroys a Dcs.DCSWrapper.Unit#Unit from the simulator, but checks first if it is still existing!

+
CLEANUP:_EventAddForCleanUp(event, Event) +

Detects if the Unit has an SEVENTENGINESHUTDOWN or an SEVENT_HIT within the given ZoneNames.

+
CLEANUP:_EventCrash(event, Event) +

Detects if a crash event occurs.

+
CLEANUP:_EventHitCleanUp(event, Event) +

Detects if the Unit has an SEVENTHIT within the given ZoneNames.

+
CLEANUP:_EventShot(event, Event) +

Detects if a unit shoots a missile.

+
CLEANUP:_OnEventBirth(Event) + +
+ +

Global(s)

+
+
+ + #CLEANUP + +CLEANUP + +
+
+ + + +
+
+

Type CleanUp

+ +

Type CLEANUP

+ +

The CLEANUP class.

+ +

Field(s)

+
+
+ + #string + +CLEANUP.ClassName + +
+
+ + + +
+
+
+
+ + + +CLEANUP.CleanUpList + +
+
+ + + +
+
+
+
+ + +CLEANUP:New(ZoneNames, TimeInterval) + +
+
+ + + +

Parameters

+
    +
  • + +

    ZoneNames :

    + +
  • +
  • + +

    TimeInterval :

    + +
  • +
+
+
+
+
+ + #number + +CLEANUP.TimeInterval + +
+
+ + + +
+
+
+
+ + + +CLEANUP.ZoneNames + +
+
+ + + +
+
+
+
+ + +CLEANUP:_AddForCleanUp(CleanUpUnit, CleanUpUnitName) + +
+
+ +

Add the Dcs.DCSWrapper.Unit#Unit to the CleanUpList for CleanUp.

+ +

Parameters

+
    +
  • + +

    CleanUpUnit :

    + +
  • +
  • + +

    CleanUpUnitName :

    + +
  • +
+
+
+
+
+ + +CLEANUP:_CleanUpScheduler() + +
+
+ +

At the defined time interval, CleanUp the Groups within the CleanUpList.

+ +
+
+
+
+ + +CLEANUP:_DestroyGroup(GroupObject, CleanUpGroupName) + +
+
+ +

Destroys a group from the simulator, but checks first if it is still existing!

+ +

Parameters

+
    +
  • + +

    Dcs.DCSWrapper.Group#Group GroupObject : +The object to be destroyed.

    + +
  • +
  • + +

    #string CleanUpGroupName : +The groupname...

    + +
  • +
+
+
+
+
+ + +CLEANUP:_DestroyMissile(MissileObject) + +
+
+ + + + +

TODO check Dcs.DCSTypes#Weapon +- Destroys a missile from the simulator, but checks first if it is still existing! + @param #CLEANUP self + @param Dcs.DCSTypes#Weapon MissileObject

+ +

Parameter

+
    +
  • + +

    MissileObject :

    + +
  • +
+
+
+
+
+ + +CLEANUP:_DestroyUnit(CleanUpUnit, CleanUpUnitName) + +
+
+ +

Destroys a Dcs.DCSWrapper.Unit#Unit from the simulator, but checks first if it is still existing!

+ +

Parameters

+
    +
  • + +

    Dcs.DCSWrapper.Unit#Unit CleanUpUnit : +The object to be destroyed.

    + +
  • +
  • + +

    #string CleanUpUnitName : +The Unit name ...

    + +
  • +
+
+
+
+
+ + +CLEANUP:_EventAddForCleanUp(event, Event) + +
+
+ +

Detects if the Unit has an SEVENTENGINESHUTDOWN or an SEVENT_HIT within the given ZoneNames.

+ + +

If this is the case, add the Group to the CLEANUP List.

+ +

Parameters

+ +
+
+
+
+ + +CLEANUP:_EventCrash(event, Event) + +
+
+ +

Detects if a crash event occurs.

+ + +

Crashed units go into a CleanUpList for removal.

+ +

Parameters

+ +
+
+
+
+ + +CLEANUP:_EventHitCleanUp(event, Event) + +
+
+ +

Detects if the Unit has an SEVENTHIT within the given ZoneNames.

+ + +

If this is the case, destroy the unit.

+ +

Parameters

+ +
+
+
+
+ + +CLEANUP:_EventShot(event, Event) + +
+
+ +

Detects if a unit shoots a missile.

+ + +

If this occurs within one of the zones, then the weapon used must be destroyed.

+ +

Parameters

+ +
+
+
+
+ + +CLEANUP:_OnEventBirth(Event) + +
+
+ + + +

Parameter

+
    +
  • + +

    Event :

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/Client.html b/docs/Documentation/Client.html new file mode 100644 index 000000000..76b67e040 --- /dev/null +++ b/docs/Documentation/Client.html @@ -0,0 +1,1119 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Client

+ +

This module contains the CLIENT class.

+ + + +

1) Wrapper.Client#CLIENT class, extends Wrapper.Unit#UNIT

+

Clients are those Units defined within the Mission Editor that have the skillset defined as Client or Player. +Note that clients are NOT the same as Units, they are NOT necessarily alive. +The Wrapper.Client#CLIENT class is a wrapper class to handle the DCS Unit objects that have the skillset defined as Client or Player:

+ +
    +
  • Wraps the DCS Unit objects with skill level set to Player or Client.
  • +
  • Support all DCS Unit APIs.
  • +
  • Enhance with Unit specific APIs not in the DCS Group API set.
  • +
  • When player joins Unit, execute alive init logic.
  • +
  • Handles messages to players.
  • +
  • Manage the "state" of the DCS Unit.
  • +
+ +

Clients are being used by the MISSION class to follow players and register their successes.

+ +

1.1) CLIENT reference methods

+

For each DCS Unit having skill level Player or Client, a CLIENT wrapper object (instance) will be created within the _DATABASE object. +This is done at the beginning of the mission (when the mission starts).

+ +

The CLIENT 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 CLIENT objects do not "contain" the DCS Unit object. +The CLIENT 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 CLIENT methods will return nil and log an exception in the DCS.log file.

+ +

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

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

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

+ + +

Global(s)

+ + + + + +
CLIENT + +
+

Type CLIENT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CLIENT:AddBriefing(ClientBriefing) +

AddBriefing adds a briefing to a CLIENT when a player joins a mission.

+
CLIENT:Alive(CallBack, CallBackFunction, ...) +

Checks for a client alive event and calls a function on a continuous basis.

+
CLIENT.ClassName + +
CLIENT.ClientAlive + +
CLIENT.ClientAlive2 + +
CLIENT.ClientBriefing + +
CLIENT.ClientBriefingShown + +
CLIENT.ClientCallBack + +
CLIENT.ClientGroupID + +
CLIENT.ClientGroupName + +
CLIENT.ClientGroupUnit + +
CLIENT.ClientName + +
CLIENT.ClientParameters + +
CLIENT.ClientTransport + +
CLIENT:Find(ClientName, ClientBriefing, DCSUnit) +

Finds a CLIENT from the _DATABASE using the relevant DCS Unit.

+
CLIENT:FindByName(ClientName, ClientBriefing, Error) +

Finds a CLIENT from the _DATABASE using the relevant Client Unit Name.

+
CLIENT:GetClientGroupDCSUnit() +

Returns the DCSUnit of the CLIENT.

+
CLIENT:GetClientGroupID() + +
CLIENT:GetClientGroupName() +

Get the name of the group of the client.

+
CLIENT:GetClientGroupUnit() +

Returns the UNIT of the CLIENT.

+
CLIENT:GetDCSGroup() +

Return the DCSGroup of a Client.

+
CLIENT:IsMultiSeated() +

Checks if the CLIENT is a multi-seated UNIT.

+
CLIENT:IsTransport() +

Evaluates if the CLIENT is a transport.

+
CLIENT:Message(Message, MessageDuration, MessageCategory, MessageInterval, MessageID) +

The main message driver for the CLIENT.

+
CLIENT.Messages + +
CLIENT.ONBOARDSIDE + +
CLIENT:Register(ClientName) + +
CLIENT:Reset(ClientName) +

Resets a CLIENT.

+
CLIENT:ShowBriefing() +

Show the briefing of a CLIENT.

+
CLIENT:ShowCargo() +

Shows the AI.AI_Cargo#CARGO contained within the CLIENT to the player as a message.

+
CLIENT:ShowMissionBriefing(MissionBriefing) +

Show the mission briefing of a MISSION to the CLIENT.

+
CLIENT.SwitchMessages(PrmTable) + +
CLIENT:Transport() +

Transport defines that the Client is a Transport.

+
CLIENT:_AliveCheckScheduler(SchedulerName) + +
CLIENT._Menus + +
CLIENT._Tasks + +
+ +

Global(s)

+
+
+ + #CLIENT + +CLIENT + +
+
+ + + +
+
+

Type Client

+ +

Type CLIENT

+ +

The CLIENT class

+ +

Field(s)

+
+
+ + +CLIENT:AddBriefing(ClientBriefing) + +
+
+ +

AddBriefing adds a briefing to a CLIENT when a player joins a mission.

+ +

Parameter

+
    +
  • + +

    #string ClientBriefing : +is the text defining the Mission briefing.

    + +
  • +
+

Return value

+ +

#CLIENT: +self

+ +
+
+
+
+ + +CLIENT:Alive(CallBack, CallBackFunction, ...) + +
+
+ +

Checks for a client alive event and calls a function on a continuous basis.

+ +

Parameters

+
    +
  • + +

    #function CallBack : +Function.

    + +
  • +
  • + +

    CallBackFunction :

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#CLIENT:

+ + +
+
+
+
+ + #string + +CLIENT.ClassName + +
+
+ + + +
+
+
+
+ + #boolean + +CLIENT.ClientAlive + +
+
+ + + +
+
+
+
+ + #boolean + +CLIENT.ClientAlive2 + +
+
+ + + +
+
+
+
+ + + +CLIENT.ClientBriefing + +
+
+ + + +
+
+
+
+ + #boolean + +CLIENT.ClientBriefingShown + +
+
+ + + +
+
+
+
+ + + +CLIENT.ClientCallBack + +
+
+ + + +
+
+
+
+ + + +CLIENT.ClientGroupID + +
+
+ + + +
+
+
+
+ + + +CLIENT.ClientGroupName + +
+
+ + + +
+
+
+
+ + +CLIENT.ClientGroupUnit + +
+
+ + + +
+
+
+
+ + +CLIENT.ClientName + +
+
+ + + +
+
+
+
+ + + +CLIENT.ClientParameters + +
+
+ + + +
+
+
+
+ + #boolean + +CLIENT.ClientTransport + +
+
+ + + +
+
+
+
+ + +CLIENT:Find(ClientName, ClientBriefing, DCSUnit) + +
+
+ +

Finds a CLIENT from the _DATABASE using the relevant DCS Unit.

+ +

Parameters

+
    +
  • + +

    #string ClientName : +Name of the DCS Unit as defined within the Mission Editor.

    + +
  • +
  • + +

    #string ClientBriefing : +Text that describes the briefing of the mission when a Player logs into the Client.

    + +
  • +
  • + +

    DCSUnit :

    + +
  • +
+

Return value

+ +

#CLIENT:

+ + +

Usage:

+
-- Create new Clients.
+ local Mission = MISSIONSCHEDULER.AddMission( 'Russia Transport Troops SA-6', 'Operational', 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 'Russia' )
+ Mission:AddGoal( DeploySA6TroopsGoal )
+
+ Mission:AddClient( CLIENT:FindByName( 'RU MI-8MTV2*HOT-Deploy Troops 1' ):Transport() )
+ Mission:AddClient( CLIENT:FindByName( 'RU MI-8MTV2*RAMP-Deploy Troops 3' ):Transport() )
+ Mission:AddClient( CLIENT:FindByName( 'RU MI-8MTV2*HOT-Deploy Troops 2' ):Transport() )
+ Mission:AddClient( CLIENT:FindByName( 'RU MI-8MTV2*RAMP-Deploy Troops 4' ):Transport() )
+ +
+
+
+
+ + +CLIENT:FindByName(ClientName, ClientBriefing, Error) + +
+
+ +

Finds a CLIENT from the _DATABASE using the relevant Client Unit Name.

+ + +

As an optional parameter, a briefing text can be given also.

+ +

Parameters

+
    +
  • + +

    #string ClientName : +Name of the DCS Unit as defined within the Mission Editor.

    + +
  • +
  • + +

    #string ClientBriefing : +Text that describes the briefing of the mission when a Player logs into the Client.

    + +
  • +
  • + +

    #boolean Error : +A flag that indicates whether an error should be raised if the CLIENT cannot be found. By default an error will be raised.

    + +
  • +
+

Return value

+ +

#CLIENT:

+ + +

Usage:

+
-- Create new Clients.
+	local Mission = MISSIONSCHEDULER.AddMission( 'Russia Transport Troops SA-6', 'Operational', 'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 'Russia' )
+	Mission:AddGoal( DeploySA6TroopsGoal )
+
+	Mission:AddClient( CLIENT:FindByName( 'RU MI-8MTV2*HOT-Deploy Troops 1' ):Transport() )
+	Mission:AddClient( CLIENT:FindByName( 'RU MI-8MTV2*RAMP-Deploy Troops 3' ):Transport() )
+	Mission:AddClient( CLIENT:FindByName( 'RU MI-8MTV2*HOT-Deploy Troops 2' ):Transport() )
+	Mission:AddClient( CLIENT:FindByName( 'RU MI-8MTV2*RAMP-Deploy Troops 4' ):Transport() )
+ +
+
+
+
+ + +CLIENT:GetClientGroupDCSUnit() + +
+
+ +

Returns the DCSUnit of the CLIENT.

+ +

Return value

+ +

Dcs.DCSTypes#Unit:

+ + +
+
+
+
+ + +CLIENT:GetClientGroupID() + +
+
+ + + + +

TODO: Check Dcs.DCSTypes#Group.ID +- Get the group ID of the client. + @param #CLIENT self + @return Dcs.DCSTypes#Group.ID

+ +
+
+
+
+ + +CLIENT:GetClientGroupName() + +
+
+ +

Get the name of the group of the client.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +CLIENT:GetClientGroupUnit() + +
+
+ +

Returns the UNIT of the CLIENT.

+ +

Return value

+ +

Wrapper.Unit#UNIT:

+ + +
+
+
+
+ + +CLIENT:GetDCSGroup() + +
+
+ +

Return the DCSGroup of a Client.

+ + +

This function is modified to deal with a couple of bugs in DCS 1.5.3

+ +

Return value

+ +

Dcs.DCSWrapper.Group#Group:

+ + +
+
+
+
+ + +CLIENT:IsMultiSeated() + +
+
+ +

Checks if the CLIENT is a multi-seated UNIT.

+ +

Return value

+ +

#boolean: +true if multi-seated.

+ +
+
+
+
+ + +CLIENT:IsTransport() + +
+
+ +

Evaluates if the CLIENT is a transport.

+ +

Return value

+ +

#boolean: +true is a transport.

+ +
+
+
+
+ + +CLIENT:Message(Message, MessageDuration, MessageCategory, MessageInterval, MessageID) + +
+
+ +

The main message driver for the CLIENT.

+ + +

This function displays various messages to the Player logged into the CLIENT through the DCS World Messaging system.

+ +

Parameters

+
    +
  • + +

    #string Message : +is the text describing the message.

    + +
  • +
  • + +

    #number MessageDuration : +is the duration in seconds that the Message should be displayed.

    + +
  • +
  • + +

    #string MessageCategory : +is the category of the message (the title).

    + +
  • +
  • + +

    #number MessageInterval : +is the interval in seconds between the display of the Core.Message#MESSAGE when the CLIENT is in the air.

    + +
  • +
  • + +

    #string MessageID : +is the identifier of the message when displayed with intervals.

    + +
  • +
+
+
+
+
+ + + +CLIENT.Messages + +
+
+ + + +
+
+
+
+ + + +CLIENT.ONBOARDSIDE + +
+
+ + + +
+
+
+
+ + +CLIENT:Register(ClientName) + +
+
+ + + +

Parameter

+
    +
  • + +

    ClientName :

    + +
  • +
+
+
+
+
+ + +CLIENT:Reset(ClientName) + +
+
+ +

Resets a CLIENT.

+ +

Parameter

+
    +
  • + +

    #string ClientName : +Name of the Group as defined within the Mission Editor. The Group must have a Unit with the type Client.

    + +
  • +
+
+
+
+
+ + +CLIENT:ShowBriefing() + +
+
+ +

Show the briefing of a CLIENT.

+ +

Return value

+ +

#CLIENT: +self

+ +
+
+
+
+ + +CLIENT:ShowCargo() + +
+
+ +

Shows the AI.AI_Cargo#CARGO contained within the CLIENT to the player as a message.

+ + +

The AI.AI_Cargo#CARGO is shown using the Core.Message#MESSAGE distribution system.

+ +
+
+
+
+ + +CLIENT:ShowMissionBriefing(MissionBriefing) + +
+
+ +

Show the mission briefing of a MISSION to the CLIENT.

+ +

Parameter

+
    +
  • + +

    #string MissionBriefing :

    + +
  • +
+

Return value

+ +

#CLIENT: +self

+ +
+
+
+
+ + +CLIENT.SwitchMessages(PrmTable) + +
+
+ + + + +

TODO (1) I urgently need to revise this. +- A local function called by the DCS World Menu system to switch off messages.

+ +

Parameter

+
    +
  • + +

    PrmTable :

    + +
  • +
+
+
+
+
+ + +CLIENT:Transport() + +
+
+ +

Transport defines that the Client is a Transport.

+ + +

Transports show cargo.

+ +

Return value

+ +

#CLIENT:

+ + +
+
+
+
+ + +CLIENT:_AliveCheckScheduler(SchedulerName) + +
+
+ + + +

Parameter

+
    +
  • + +

    SchedulerName :

    + +
  • +
+
+
+
+
+ + + +CLIENT._Menus + +
+
+ + + +
+
+
+
+ + + +CLIENT._Tasks + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/CommandCenter.html b/docs/Documentation/CommandCenter.html new file mode 100644 index 000000000..6557fc9bd --- /dev/null +++ b/docs/Documentation/CommandCenter.html @@ -0,0 +1,772 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module CommandCenter

+ +

A COMMANDCENTER is the owner of multiple missions within MOOSE.

+ + +

A COMMANDCENTER governs multiple missions, the tasking and the reporting.

+ +

Global(s)

+ + + + + + + + + +
COMMANDCENTER + +
REPORT + +
+

Type COMMANDCENTER

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
COMMANDCENTER:AddMission(Mission) +

Add a MISSION to be governed by the HQ command center.

+
COMMANDCENTER.ClassName + +
COMMANDCENTER.CommandCenterCoalition + +
COMMANDCENTER.CommandCenterMenu + +
COMMANDCENTER.CommandCenterName + +
COMMANDCENTER.CommandCenterPositionable + +
COMMANDCENTER:GetMissions() +

Get the Missions governed by the HQ command center.

+
COMMANDCENTER:GetName() +

Gets the name of the HQ command center.

+
COMMANDCENTER:GetPositionable() +

Gets the POSITIONABLE of the HQ command center.

+
COMMANDCENTER.HQ + +
COMMANDCENTER:HasGroup(Wrapper, MissionGroup) +

Checks of the COMMANDCENTER has a GROUP.

+
COMMANDCENTER:MessageToCoalition(Message) +

Send a CC message to the coalition of the CC.

+
COMMANDCENTER:MessageToGroup(Message, TaskGroup, Name) +

Send a CC message to a GROUP.

+
COMMANDCENTER.Name + +
COMMANDCENTER:New(CommandCenterPositionable, CommandCenterName) +

The constructor takes an IDENTIFIABLE as the HQ command center.

+
COMMANDCENTER:RemoveMission(Mission) +

Removes a MISSION to be governed by the HQ command center.

+
COMMANDCENTER:ReportDetails(ReportGroup, Task) +

Report the status of a Task to a Group.

+
COMMANDCENTER:ReportSummary(ReportGroup) +

Report the status of all MISSIONs to a GROUP.

+
COMMANDCENTER:SetMenu() +

Sets the menu structure of the Missions governed by the HQ command center.

+
+ +

Type REPORT

+ + + + + + + + + + + + + + + + + +
REPORT:Add(Text) +

Add a new line to a REPORT.

+
REPORT.ClassName + +
REPORT:New(Title) +

Create a new REPORT.

+
REPORT:Text() + +
+ +

Global(s)

+
+
+ + #COMMANDCENTER + +COMMANDCENTER + +
+
+ + + +
+
+
+
+ + #REPORT + +REPORT + +
+
+ + + +
+
+

Type CommandCenter

+ +

Type COMMANDCENTER

+ +

The COMMANDCENTER class

+ +

Field(s)

+
+
+ + +COMMANDCENTER:AddMission(Mission) + +
+
+ +

Add a MISSION to be governed by the HQ command center.

+ +

Parameter

+ +

Return value

+ +

Tasking.Mission#MISSION:

+ + +
+
+
+
+ + #string + +COMMANDCENTER.ClassName + +
+
+ + + +
+
+
+
+ + Dcs.DCSCoalitionWrapper.Object#coalition + +COMMANDCENTER.CommandCenterCoalition + +
+
+ + + +
+
+
+
+ + +COMMANDCENTER.CommandCenterMenu + +
+
+ + + +
+
+
+
+ + #string + +COMMANDCENTER.CommandCenterName + +
+
+ + + +
+
+
+
+ + +COMMANDCENTER.CommandCenterPositionable + +
+
+ + + +
+
+
+
+ + +COMMANDCENTER:GetMissions() + +
+
+ +

Get the Missions governed by the HQ command center.

+ +

Return value

+ +

#list: +Tasking.Mission#MISSION>

+ +
+
+
+
+ + +COMMANDCENTER:GetName() + +
+
+ +

Gets the name of the HQ command center.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +COMMANDCENTER:GetPositionable() + +
+
+ +

Gets the POSITIONABLE of the HQ command center.

+ +

Return value

+ +

Wrapper.Positionable#POSITIONABLE:

+ + +
+
+
+
+ + Wrapper.Group#GROUP + +COMMANDCENTER.HQ + +
+
+ + + +
+
+
+
+ + +COMMANDCENTER:HasGroup(Wrapper, MissionGroup) + +
+
+ +

Checks of the COMMANDCENTER has a GROUP.

+ +

Parameters

+
    +
  • + +

    Wrapper : +Group#GROUP

    + +
  • +
  • + +

    MissionGroup :

    + +
  • +
+

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +COMMANDCENTER:MessageToCoalition(Message) + +
+
+ +

Send a CC message to the coalition of the CC.

+ +

Parameter

+
    +
  • + +

    Message :

    + +
  • +
+
+
+
+
+ + +COMMANDCENTER:MessageToGroup(Message, TaskGroup, Name) + +
+
+ +

Send a CC message to a GROUP.

+ +

Parameters

+
    +
  • + +

    #string Message :

    + +
  • +
  • + +

    Wrapper.Group#GROUP TaskGroup :

    + +
  • +
  • + +

    #sring Name : +(optional) The name of the Group used as a prefix for the message to the Group. If not provided, there will be nothing shown.

    + +
  • +
+
+
+
+
+ + #string + +COMMANDCENTER.Name + +
+
+ + + +
+
+
+
+ + +COMMANDCENTER:New(CommandCenterPositionable, CommandCenterName) + +
+
+ +

The constructor takes an IDENTIFIABLE as the HQ command center.

+ +

Parameters

+ +

Return value

+ +

#COMMANDCENTER:

+ + +
+
+
+
+ + +COMMANDCENTER:RemoveMission(Mission) + +
+
+ +

Removes a MISSION to be governed by the HQ command center.

+ + +

The given Mission is not nilified.

+ +

Parameter

+ +

Return value

+ +

Tasking.Mission#MISSION:

+ + +
+
+
+
+ + +COMMANDCENTER:ReportDetails(ReportGroup, Task) + +
+
+ +

Report the status of a Task to a Group.

+ + +

Report the details of a Mission, listing the Mission, and all the Task details.

+ +

Parameters

+
    +
  • + +

    ReportGroup :

    + +
  • +
  • + +

    Task :

    + +
  • +
+
+
+
+
+ + +COMMANDCENTER:ReportSummary(ReportGroup) + +
+
+ +

Report the status of all MISSIONs to a GROUP.

+ + +

Each Mission is listed, with an indication how many Tasks are still to be completed.

+ +

Parameter

+
    +
  • + +

    ReportGroup :

    + +
  • +
+
+
+
+
+ + +COMMANDCENTER:SetMenu() + +
+
+ +

Sets the menu structure of the Missions governed by the HQ command center.

+ +
+
+ +

Type REPORT

+ +

The REPORT class

+ +

Field(s)

+
+
+ + +REPORT:Add(Text) + +
+
+ +

Add a new line to a REPORT.

+ +

Parameter

+
    +
  • + +

    #string Text :

    + +
  • +
+

Return value

+ +

#REPORT:

+ + +
+
+
+
+ + #string + +REPORT.ClassName + +
+
+ + + +
+
+
+
+ + +REPORT:New(Title) + +
+
+ +

Create a new REPORT.

+ +

Parameter

+
    +
  • + +

    #string Title :

    + +
  • +
+

Return value

+ +

#REPORT:

+ + +
+
+
+
+ + +REPORT:Text() + +
+
+ + + +
+
+ +

Type TASK

+ +

Type list

+ +

Type sring

+ +
+ +
+ + diff --git a/docs/Documentation/Controllable.html b/docs/Documentation/Controllable.html new file mode 100644 index 000000000..2b73fa9da --- /dev/null +++ b/docs/Documentation/Controllable.html @@ -0,0 +1,3120 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Controllable

+ +

This module contains the CONTROLLABLE class.

+ + + +

1) Wrapper.Controllable#CONTROLLABLE class, extends Wrapper.Positionable#POSITIONABLE

+

The Wrapper.Controllable#CONTROLLABLE class is a wrapper class to handle the DCS Controllable objects:

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

1.1) CONTROLLABLE constructor

+

The CONTROLLABLE class provides the following functions to construct a CONTROLLABLE instance:

+ + + +

1.2) CONTROLLABLE task methods

+

Several controllable task methods are available that help you to prepare tasks. +These methods return a string consisting of the task description, which can then be given to either a Wrapper.Controllable#CONTROLLABLE.PushTask or Wrapper.Controllable#SetTask method to assign the task to the CONTROLLABLE. +Tasks are specific for the category of the CONTROLLABLE, more specific, for AIR, GROUND or AIR and GROUND. +Each task description where applicable indicates for which controllable category the task is valid. +There are 2 main subdivisions of tasks: Assigned tasks and EnRoute tasks.

+ +

1.2.1) Assigned task methods

+ +

Assigned task methods make the controllable execute the task where the location of the (possible) targets of the task are known before being detected. +This is different from the EnRoute tasks, where the targets of the task need to be detected before the task can be executed.

+ +

Find below a list of the assigned task methods:

+ + + +

1.2.2) EnRoute task methods

+ +

EnRoute tasks require the targets of the task need to be detected by the controllable (using its sensors) before the task can be executed:

+ + + +

1.2.3) Preparation task methods

+ +

There are certain task methods that allow to tailor the task behaviour:

+ + + +

1.2.4) Obtain the mission from controllable templates

+ +

Controllable templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a controllable and assign it to another:

+ + + +

1.3) CONTROLLABLE Command methods

+

Controllable command methods prepare the execution of commands using the CONTROLLABLE.SetCommand method:

+ + + +

1.4) CONTROLLABLE Option methods

+

Controllable Option methods change the behaviour of the Controllable while being alive.

+ +

1.4.1) Rule of Engagement:

+ + + +

To check whether an ROE option is valid for a specific controllable, use:

+ + + +

1.4.2) Rule on thread:

+ + + +

To test whether an ROT option is valid for a specific controllable, use:

+ + + +
+ + +

Global(s)

+ + + + + +
CONTROLLABLE + +
+

Type CONTROLLABLE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CONTROLLABLE.ClassName + +
CONTROLLABLE:CommandDoScript(DoScript) +

Do Script command

+
CONTROLLABLE:CommandStopRoute(StopRoute, Index) +

Perform stop route command

+
CONTROLLABLE:CommandSwitchWayPoint(FromWayPoint, ToWayPoint) +

Perform a switch waypoint command

+
CONTROLLABLE.ControllableName +

The name of the controllable.

+
CONTROLLABLE:CopyRoute(Begin, End, Randomize, Radius) +

Return the route of a controllable by using the Core.Database#DATABASE class.

+
CONTROLLABLE.DCSControllable +

The DCS controllable class.

+
CONTROLLABLE:EnRouteTaskAWACS() +

(AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts).

+
CONTROLLABLE:EnRouteTaskEWR() +

(GROUND) Ground unit (EW-radar) will act as an EWR for friendly units (will provide them with information about contacts).

+
CONTROLLABLE:EnRouteTaskEngageGroup(AttackGroup, Priority, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit) +

(AIR) Engaging a controllable.

+
CONTROLLABLE:EnRouteTaskEngageTargets(Distance, TargetTypes, Priority) +

(AIR) Engaging targets of defined types.

+
CONTROLLABLE:EnRouteTaskEngageUnit(AttackUnit, Priority, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack) +

(AIR) Attack the Unit.

+
CONTROLLABLE:EnRouteTaskFAC(Radius, Priority) +

(AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose a targets (enemy ground controllable) around as well as other assigned targets.

+
CONTROLLABLE:EnRouteTaskFAC_EngageGroup(AttackGroup, Priority, WeaponType, Designation, Datalink) +

(AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose the target (enemy ground controllable) as well as other assigned targets.

+
CONTROLLABLE:EnRouteTaskTanker() +

(AIR) Aircraft will act as a tanker for friendly units.

+
CONTROLLABLE:GetDetectedTargets(DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK) +

Return the detected targets of the controllable.

+
CONTROLLABLE:GetTaskMission() +

Return the mission template of the controllable.

+
CONTROLLABLE:GetTaskRoute() +

Return the mission route of the controllable.

+
CONTROLLABLE:IsTargetDetected(DCSObject) + +
CONTROLLABLE:New(ControllableName) +

Create a new CONTROLLABLE from a DCSControllable

+
CONTROLLABLE:OptionROEHoldFire() +

Holding weapons.

+
CONTROLLABLE:OptionROEHoldFirePossible() +

Can the CONTROLLABLE hold their weapons?

+
CONTROLLABLE:OptionROEOpenFire() +

Openfire.

+
CONTROLLABLE:OptionROEOpenFirePossible() +

Can the CONTROLLABLE attack designated targets?

+
CONTROLLABLE:OptionROEReturnFire() +

Return fire.

+
CONTROLLABLE:OptionROEReturnFirePossible() +

Can the CONTROLLABLE attack returning on enemy fire?

+
CONTROLLABLE:OptionROEWeaponFree() +

Weapon free.

+
CONTROLLABLE:OptionROEWeaponFreePossible() +

Can the CONTROLLABLE attack targets of opportunity?

+
CONTROLLABLE:OptionROTEvadeFire() +

Evade on fire.

+
CONTROLLABLE:OptionROTEvadeFirePossible() +

Can the CONTROLLABLE evade on enemy fire?

+
CONTROLLABLE:OptionROTNoReaction() +

No evasion on enemy threats.

+
CONTROLLABLE:OptionROTNoReactionPossible() +

Can the CONTROLLABLE ignore enemy fire?

+
CONTROLLABLE:OptionROTPassiveDefense() +

Evasion passive defense.

+
CONTROLLABLE:OptionROTPassiveDefensePossible() +

Can the CONTROLLABLE evade using passive defenses?

+
CONTROLLABLE:OptionROTVertical() +

Evade on fire using vertical manoeuvres.

+
CONTROLLABLE:OptionROTVerticalPossible() +

Can the CONTROLLABLE evade on fire using vertical manoeuvres?

+
CONTROLLABLE:PopCurrentTask() +

Popping current Task from the controllable.

+
CONTROLLABLE:PushTask(DCSTask, WaitTime) +

Pushing Task on the queue from the controllable.

+
CONTROLLABLE:Route(GoPoints) +

Make the controllable to follow a given route.

+
CONTROLLABLE:RouteReturnToAirbase(ReturnAirbase, Speed) +

(AIR) Return the Controllable to an Wrapper.Airbase#AIRBASE +A speed can be given in km/h.

+
CONTROLLABLE:SetCommand(DCSCommand) +

Executes a command action

+
CONTROLLABLE:SetTask(DCSTask, WaitTime) +

Clearing the Task Queue and Setting the Task on the queue from the controllable.

+
CONTROLLABLE:TaskAttackGroup(AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit) +

(AIR) Attack a Controllable.

+
CONTROLLABLE:TaskAttackMapObject(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack) +

(AIR) Attacking the map object (building, structure, e.t.c).

+
CONTROLLABLE:TaskAttackUnit(AttackUnit, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack) +

(AIR) Attack the Unit.

+
CONTROLLABLE:TaskBombing(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack) +

(AIR) Delivering weapon at the point on the ground.

+
CONTROLLABLE:TaskBombingRunway(Airbase, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack) +

(AIR) Delivering weapon on the runway.

+
CONTROLLABLE:TaskCombo(DCSTasks) +

Return a Combo Task taking an array of Tasks.

+
CONTROLLABLE:TaskCondition(time, userFlag, userFlagValue, condition, duration, lastWayPoint) +

Return a condition section for a controlled task.

+
CONTROLLABLE:TaskControlled(DCSTask, DCSStopCondition) +

Return a Controlled Task taking a Task and a TaskCondition.

+
CONTROLLABLE:TaskEmbarkToTransport(Point, Radius) +

Move to a defined Vec2 Point, and embark to a controllable when arrived within a defined Radius.

+
CONTROLLABLE:TaskEmbarking(Point, Duration, EmbarkingControllable) +

(AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable.

+
CONTROLLABLE:TaskEscort(EscortControllable, Vec3, LastWaypointIndex, EngagementDistanceMax, TargetTypes, FollowControllable, EngagementDistance) +

(AIR) Escort another airborne controllable.

+
CONTROLLABLE:TaskFAC_AttackGroup(AttackGroup, WeaponType, Designation, Datalink) +

(AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.

+
CONTROLLABLE:TaskFireAtPoint(Vec2, Radius) +

(GROUND) Fire at a VEC2 point until ammunition is finished.

+
CONTROLLABLE:TaskFollow(FollowControllable, Vec3, LastWaypointIndex) +

(AIR) Following another airborne controllable.

+
CONTROLLABLE:TaskFunction(WayPoint, WayPointIndex, FunctionString, FunctionArguments) + +
CONTROLLABLE:TaskHold() +

(GROUND) Hold ground controllable from moving.

+
CONTROLLABLE:TaskHoldPosition(Duration) +

(AIR) Hold position at the current position of the first unit of the controllable.

+
CONTROLLABLE:TaskLandAtVec2(Point, Duration) +

(AIR HELICOPTER) Landing at the ground.

+
CONTROLLABLE:TaskLandAtZone(Zone, Duration, RandomPoint) +

(AIR) Land the controllable at a @{Core.Zone#ZONE_RADIUS).

+
CONTROLLABLE:TaskMission(TaskMission) +

(AIR + GROUND) Return a mission task from a mission template.

+
CONTROLLABLE:TaskOrbitCircle(Altitude, Speed) +

(AIR) Orbit at the current position of the first unit of the controllable at a specified alititude.

+
CONTROLLABLE:TaskOrbitCircleAtVec2(Point, Altitude, Speed) +

(AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.

+
CONTROLLABLE:TaskRefueling() +

(AIR) Refueling from the nearest tanker.

+
CONTROLLABLE:TaskRoute(Points) +

Return a Misson task to follow a given route defined by Points.

+
CONTROLLABLE:TaskRouteToVec2(Point, Speed) +

(AIR + GROUND) Make the Controllable move to fly to a given point.

+
CONTROLLABLE:TaskRouteToVec3(Point, Speed) +

(AIR + GROUND) Make the Controllable move to a given point.

+
CONTROLLABLE:TaskRouteToZone(Zone, Randomize, Speed, Formation) +

(AIR + GROUND) Route the controllable to a given zone.

+
CONTROLLABLE:TaskWrappedAction(DCSCommand, Index) +

Return a WrappedAction Task taking a Command.

+
CONTROLLABLE:WayPointExecute(WayPoint, WaitTime) +

Executes the WayPoint plan.

+
CONTROLLABLE:WayPointFunction(WayPoint, WayPointIndex, WayPointFunction, ...) +

Registers a waypoint function that will be executed when the controllable moves over the WayPoint.

+
CONTROLLABLE.WayPointFunctions + +
CONTROLLABLE:WayPointInitialize(WayPoints) +

Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan.

+
CONTROLLABLE.WayPoints + +
CONTROLLABLE:_GetController() +

Get the controller for the CONTROLLABLE.

+
+ +

Global(s)

+
+
+ + #CONTROLLABLE + +CONTROLLABLE + +
+
+ + + +
+
+

Type Controllable

+ +

Type CONTROLLABLE

+ +

The CONTROLLABLE class

+ +

Field(s)

+
+
+ + #string + +CONTROLLABLE.ClassName + +
+
+ + + +
+
+
+
+ + +CONTROLLABLE:CommandDoScript(DoScript) + +
+
+ +

Do Script command

+ +

Parameter

+
    +
  • + +

    #string DoScript :

    + +
  • +
+

Return value

+ +

#DCSCommand:

+ + +
+
+
+
+ + +CONTROLLABLE:CommandStopRoute(StopRoute, Index) + +
+
+ +

Perform stop route command

+ +

Parameters

+
    +
  • + +

    #boolean StopRoute :

    + +
  • +
  • + +

    Index :

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task:

+ + +
+
+
+
+ + +CONTROLLABLE:CommandSwitchWayPoint(FromWayPoint, ToWayPoint) + +
+
+ +

Perform a switch waypoint command

+ +

Parameters

+
    +
  • + +

    #number FromWayPoint :

    + +
  • +
  • + +

    #number ToWayPoint :

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task:

+ + +

Usage:

+
--- This test demonstrates the use(s) of the SwitchWayPoint method of the GROUP class.
+HeliGroup = GROUP:FindByName( "Helicopter" )
+
+--- Route the helicopter back to the FARP after 60 seconds.
+-- We use the SCHEDULER class to do this.
+SCHEDULER:New( nil,
+  function( HeliGroup )
+   local CommandRTB = HeliGroup:CommandSwitchWayPoint( 2, 8 )
+   HeliGroup:SetCommand( CommandRTB )
+ end, { HeliGroup }, 90 
+)
+ +
+
+
+
+ + #string + +CONTROLLABLE.ControllableName + +
+
+ +

The name of the controllable.

+ +
+
+
+
+ + +CONTROLLABLE:CopyRoute(Begin, End, Randomize, Radius) + +
+
+ +

Return the route of a controllable by using the Core.Database#DATABASE class.

+ +

Parameters

+
    +
  • + +

    #number Begin : +The route point from where the copy will start. The base route point is 0.

    + +
  • +
  • + +

    #number End : +The route point where the copy will end. The End point is the last point - the End point. The last point has base 0.

    + +
  • +
  • + +

    #boolean Randomize : +Randomization of the route, when true.

    + +
  • +
  • + +

    #number Radius : +When randomization is on, the randomization is within the radius.

    + +
  • +
+
+
+
+
+ + Dcs.DCSWrapper.Controllable#Controllable + +CONTROLLABLE.DCSControllable + +
+
+ +

The DCS controllable class.

+ +
+
+
+
+ + +CONTROLLABLE:EnRouteTaskAWACS() + +
+
+ +

(AIR) Aircraft will act as an AWACS for friendly units (will provide them with information about contacts).

+ + +

No parameters.

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:EnRouteTaskEWR() + +
+
+ +

(GROUND) Ground unit (EW-radar) will act as an EWR for friendly units (will provide them with information about contacts).

+ + +

No parameters.

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:EnRouteTaskEngageGroup(AttackGroup, Priority, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit) + +
+
+ +

(AIR) Engaging a controllable.

+ + +

The task does not assign the target controllable to the unit/controllable to attack now; it just allows the unit/controllable to engage the target controllable as well as other assigned targets.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE AttackGroup : +The Controllable to be attacked.

    + +
  • +
  • + +

    #number Priority : +All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

    + +
  • +
  • + +

    #number WeaponType : +(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : +(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    + +
  • +
  • + +

    #number AttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth Direction : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance Altitude : +(optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.

    + +
  • +
  • + +

    #boolean AttackQtyLimit : +(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:EnRouteTaskEngageTargets(Distance, TargetTypes, Priority) + +
+
+ +

(AIR) Engaging targets of defined types.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Distance Distance : +Maximal distance from the target to a route leg. If the target is on a greater distance it will be ignored.

    + +
  • +
  • + +

    Dcs.DCSTypes#AttributeNameArray TargetTypes : +Array of target categories allowed to engage.

    + +
  • +
  • + +

    #number Priority : +All enroute tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:EnRouteTaskEngageUnit(AttackUnit, Priority, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack) + +
+
+ +

(AIR) Attack the Unit.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT AttackUnit : +The UNIT.

    + +
  • +
  • + +

    #number Priority : +All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

    + +
  • +
  • + +

    #number WeaponType : +(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : +(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    + +
  • +
  • + +

    #number AttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth Direction : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
  • + +

    #boolean AttackQtyLimit : +(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.

    + +
  • +
  • + +

    #boolean ControllableAttack : +(optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:EnRouteTaskFAC(Radius, Priority) + +
+
+ +

(AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose a targets (enemy ground controllable) around as well as other assigned targets.

+ + +

The killer is player-controlled allied CAS-aircraft that is in contact with the FAC. +If the task is assigned to the controllable lead unit will be a FAC.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Distance Radius : + The maximal distance from the FAC to a target.

    + +
  • +
  • + +

    #number Priority : +All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:EnRouteTaskFAC_EngageGroup(AttackGroup, Priority, WeaponType, Designation, Datalink) + +
+
+ +

(AIR + GROUND) The task makes the controllable/unit a FAC and lets the FAC to choose the target (enemy ground controllable) as well as other assigned targets.

+ + +

The killer is player-controlled allied CAS-aircraft that is in contact with the FAC. +If the task is assigned to the controllable lead unit will be a FAC.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE AttackGroup : +Target CONTROLLABLE.

    + +
  • +
  • + +

    #number Priority : +All en-route tasks have the priority parameter. This is a number (less value - higher priority) that determines actions related to what task will be performed first.

    + +
  • +
  • + +

    #number WeaponType : +Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.Designation Designation : +(optional) Designation type.

    + +
  • +
  • + +

    #boolean Datalink : +(optional) Allows to use datalink to send the target information to attack aircraft. Enabled by default.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:EnRouteTaskTanker() + +
+
+ +

(AIR) Aircraft will act as a tanker for friendly units.

+ + +

No parameters.

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:GetDetectedTargets(DetectVisual, DetectOptical, DetectRadar, DetectIRST, DetectRWR, DetectDLINK) + +
+
+ +

Return the detected targets of the controllable.

+ + +

The optional parametes specify the detection methods that can be applied. +If no detection method is given, the detection will use all the available methods by default.

+ +

Parameters

+
    +
  • + +

    #boolean DetectVisual : +(optional)

    + +
  • +
  • + +

    #boolean DetectOptical : +(optional)

    + +
  • +
  • + +

    #boolean DetectRadar : +(optional)

    + +
  • +
  • + +

    #boolean DetectIRST : +(optional)

    + +
  • +
  • + +

    #boolean DetectRWR : +(optional)

    + +
  • +
  • + +

    #boolean DetectDLINK : +(optional)

    + +
  • +
+

Return value

+ +

#table: +DetectedTargets

+ +
+
+
+
+ + +CONTROLLABLE:GetTaskMission() + +
+
+ +

Return the mission template of the controllable.

+ +

Return value

+ +

#table: +The MissionTemplate +TODO: Rework the method how to retrieve a template ...

+ +
+
+
+
+ + +CONTROLLABLE:GetTaskRoute() + +
+
+ +

Return the mission route of the controllable.

+ +

Return value

+ +

#table: +The mission route defined by points.

+ +
+
+
+
+ + +CONTROLLABLE:IsTargetDetected(DCSObject) + +
+
+ + + +

Parameter

+
    +
  • + +

    DCSObject :

    + +
  • +
+
+
+
+
+ + +CONTROLLABLE:New(ControllableName) + +
+
+ +

Create a new CONTROLLABLE from a DCSControllable

+ +

Parameter

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROEHoldFire() + +
+
+ +

Holding weapons.

+ +

Return value

+ +

Wrapper.Controllable#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROEHoldFirePossible() + +
+
+ +

Can the CONTROLLABLE hold their weapons?

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CONTROLLABLE:OptionROEOpenFire() + +
+
+ +

Openfire.

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROEOpenFirePossible() + +
+
+ +

Can the CONTROLLABLE attack designated targets?

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CONTROLLABLE:OptionROEReturnFire() + +
+
+ +

Return fire.

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROEReturnFirePossible() + +
+
+ +

Can the CONTROLLABLE attack returning on enemy fire?

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CONTROLLABLE:OptionROEWeaponFree() + +
+
+ +

Weapon free.

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROEWeaponFreePossible() + +
+
+ +

Can the CONTROLLABLE attack targets of opportunity?

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CONTROLLABLE:OptionROTEvadeFire() + +
+
+ +

Evade on fire.

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROTEvadeFirePossible() + +
+
+ +

Can the CONTROLLABLE evade on enemy fire?

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CONTROLLABLE:OptionROTNoReaction() + +
+
+ +

No evasion on enemy threats.

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROTNoReactionPossible() + +
+
+ +

Can the CONTROLLABLE ignore enemy fire?

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CONTROLLABLE:OptionROTPassiveDefense() + +
+
+ +

Evasion passive defense.

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROTPassiveDefensePossible() + +
+
+ +

Can the CONTROLLABLE evade using passive defenses?

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CONTROLLABLE:OptionROTVertical() + +
+
+ +

Evade on fire using vertical manoeuvres.

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:OptionROTVerticalPossible() + +
+
+ +

Can the CONTROLLABLE evade on fire using vertical manoeuvres?

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +CONTROLLABLE:PopCurrentTask() + +
+
+ +

Popping current Task from the controllable.

+ +

Return value

+ +

Wrapper.Controllable#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:PushTask(DCSTask, WaitTime) + +
+
+ +

Pushing Task on the queue from the controllable.

+ +

Parameters

+
    +
  • + +

    DCSTask :

    + +
  • +
  • + +

    WaitTime :

    + +
  • +
+

Return value

+ +

Wrapper.Controllable#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:Route(GoPoints) + +
+
+ +

Make the controllable to follow a given route.

+ +

Parameter

+
    +
  • + +

    #table GoPoints : +A table of Route Points.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:RouteReturnToAirbase(ReturnAirbase, Speed) + +
+
+ +

(AIR) Return the Controllable to an Wrapper.Airbase#AIRBASE +A speed can be given in km/h.

+ + +

A given formation can be given.

+ +

Parameters

+ +

Return value

+ +

#string: +The route

+ +
+
+
+
+ + +CONTROLLABLE:SetCommand(DCSCommand) + +
+
+ +

Executes a command action

+ +

Parameter

+ +

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:SetTask(DCSTask, WaitTime) + +
+
+ +

Clearing the Task Queue and Setting the Task on the queue from the controllable.

+ +

Parameters

+
    +
  • + +

    DCSTask :

    + +
  • +
  • + +

    WaitTime :

    + +
  • +
+

Return value

+ +

Wrapper.Controllable#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:TaskAttackGroup(AttackGroup, WeaponType, WeaponExpend, AttackQty, Direction, Altitude, AttackQtyLimit) + +
+
+ +

(AIR) Attack a Controllable.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE AttackGroup : +The Controllable to be attacked.

    + +
  • +
  • + +

    #number WeaponType : +(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : +(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    + +
  • +
  • + +

    #number AttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth Direction : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance Altitude : +(optional) Desired attack start altitude. Controllable/aircraft will make its attacks from the altitude. If the altitude is too low or too high to use weapon aircraft/controllable will choose closest altitude to the desired attack start altitude. If the desired altitude is defined controllable/aircraft will not attack from safe altitude.

    + +
  • +
  • + +

    #boolean AttackQtyLimit : +(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskAttackMapObject(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack) + +
+
+ +

(AIR) Attacking the map object (building, structure, e.t.c).

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec2 Vec2 : +2D-coordinates of the point the map object is closest to. The distance between the point and the map object must not be greater than 2000 meters. Object id is not used here because Mission Editor doesn't support map object identificators.

    + +
  • +
  • + +

    #number WeaponType : +(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : +(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    + +
  • +
  • + +

    #number AttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth Direction : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
  • + +

    #boolean ControllableAttack : +(optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskAttackUnit(AttackUnit, WeaponType, WeaponExpend, AttackQty, Direction, AttackQtyLimit, ControllableAttack) + +
+
+ +

(AIR) Attack the Unit.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT AttackUnit : +The unit.

    + +
  • +
  • + +

    #number WeaponType : +(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : +(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    + +
  • +
  • + +

    #number AttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth Direction : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
  • + +

    #boolean AttackQtyLimit : +(optional) The flag determines how to interpret attackQty parameter. If the flag is true then attackQty is a limit on maximal attack quantity for "AttackControllable" and "AttackUnit" tasks. If the flag is false then attackQty is a desired attack quantity for "Bombing" and "BombingRunway" tasks.

    + +
  • +
  • + +

    #boolean ControllableAttack : +(optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskBombing(Vec2, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack) + +
+
+ +

(AIR) Delivering weapon at the point on the ground.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec2 Vec2 : +2D-coordinates of the point to deliver weapon at.

    + +
  • +
  • + +

    #number WeaponType : +(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : +(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    + +
  • +
  • + +

    #number AttackQty : +(optional) Desired quantity of passes. The parameter is not the same in AttackControllable and AttackUnit tasks.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth Direction : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
  • + +

    #boolean ControllableAttack : +(optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskBombingRunway(Airbase, WeaponType, WeaponExpend, AttackQty, Direction, ControllableAttack) + +
+
+ +

(AIR) Delivering weapon on the runway.

+ +

Parameters

+
    +
  • + +

    Wrapper.Airbase#AIRBASE Airbase : +Airbase to attack.

    + +
  • +
  • + +

    #number WeaponType : +(optional) Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.WeaponExpend WeaponExpend : +(optional) Determines how much weapon will be released at each attack. If parameter is not defined the unit / controllable will choose expend on its own discretion.

    + +
  • +
  • + +

    #number AttackQty : +(optional) This parameter limits maximal quantity of attack. The aicraft/controllable will not make more attack than allowed even if the target controllable not destroyed and the aicraft/controllable still have ammo. If not defined the aircraft/controllable will attack target until it will be destroyed or until the aircraft/controllable will run out of ammo.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth Direction : +(optional) Desired ingress direction from the target to the attacking aircraft. Controllable/aircraft will make its attacks from the direction. Of course if there is no way to attack from the direction due the terrain controllable/aircraft will choose another direction.

    + +
  • +
  • + +

    #boolean ControllableAttack : +(optional) Flag indicates that the target must be engaged by all aircrafts of the controllable. Has effect only if the task is assigned to a controllable, not to a single aircraft.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskCombo(DCSTasks) + +
+
+ +

Return a Combo Task taking an array of Tasks.

+ +

Parameter

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task:

+ + +
+
+
+
+ + +CONTROLLABLE:TaskCondition(time, userFlag, userFlagValue, condition, duration, lastWayPoint) + +
+
+ +

Return a condition section for a controlled task.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTime#Time time :

    + +
  • +
  • + +

    #string userFlag :

    + +
  • +
  • + +

    #boolean userFlagValue :

    + +
  • +
  • + +

    #string condition :

    + +
  • +
  • + +

    Dcs.DCSTime#Time duration :

    + +
  • +
  • + +

    #number lastWayPoint : +return Dcs.DCSTasking.Task#Task

    + +
  • +
+
+
+
+
+ + +CONTROLLABLE:TaskControlled(DCSTask, DCSStopCondition) + +
+
+ +

Return a Controlled Task taking a Task and a TaskCondition.

+ +

Parameters

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task:

+ + +
+
+
+
+ + +CONTROLLABLE:TaskEmbarkToTransport(Point, Radius) + +
+
+ +

Move to a defined Vec2 Point, and embark to a controllable when arrived within a defined Radius.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec2 Point : +The point where to wait.

    + +
  • +
  • + +

    #number Radius : +The radius of the embarking zone around the Point.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskEmbarking(Point, Duration, EmbarkingControllable) + +
+
+ +

(AIR) Move the controllable to a Vec2 Point, wait for a defined duration and embark a controllable.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec2 Point : +The point where to wait.

    + +
  • +
  • + +

    #number Duration : +The duration in seconds to wait.

    + +
  • +
  • + +

    #CONTROLLABLE EmbarkingControllable : +The controllable to be embarked.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure

+ +
+
+
+
+ + +CONTROLLABLE:TaskEscort(EscortControllable, Vec3, LastWaypointIndex, EngagementDistanceMax, TargetTypes, FollowControllable, EngagementDistance) + +
+
+ +

(AIR) Escort another airborne controllable.

+ + +

The unit / controllable will follow lead unit of another controllable, wingmens of both controllables will continue following their leaders. +The unit / controllable will also protect that controllable from threats of specified types.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE EscortControllable : +The controllable to be escorted.

    + +
  • +
  • + +

    Dcs.DCSTypes#Vec3 Vec3 : +Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.

    + +
  • +
  • + +

    #number LastWaypointIndex : +Detach waypoint of another controllable. Once reached the unit / controllable Follow task is finished.

    + +
  • +
  • + +

    #number EngagementDistanceMax : +Maximal distance from escorted controllable to threat. If the threat is already engaged by escort escort will disengage if the distance becomes greater than 1.5 * engagementDistMax.

    + +
  • +
  • + +

    Dcs.DCSTypes#AttributeNameArray TargetTypes : +Array of AttributeName that is contains threat categories allowed to engage.

    + +
  • +
  • + +

    FollowControllable :

    + +
  • +
  • + +

    EngagementDistance :

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskFAC_AttackGroup(AttackGroup, WeaponType, Designation, Datalink) + +
+
+ +

(AIR + GROUND) The task makes the controllable/unit a FAC and orders the FAC to control the target (enemy ground controllable) destruction.

+ + +

The killer is player-controlled allied CAS-aircraft that is in contact with the FAC. +If the task is assigned to the controllable lead unit will be a FAC.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE AttackGroup : +Target CONTROLLABLE.

    + +
  • +
  • + +

    #number WeaponType : +Bitmask of weapon types those allowed to use. If parameter is not defined that means no limits on weapon usage.

    + +
  • +
  • + +

    Dcs.DCSTypes#AI.Task.Designation Designation : +(optional) Designation type.

    + +
  • +
  • + +

    #boolean Datalink : +(optional) Allows to use datalink to send the target information to attack aircraft. Enabled by default.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskFireAtPoint(Vec2, Radius) + +
+
+ +

(GROUND) Fire at a VEC2 point until ammunition is finished.

+ +

Parameters

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskFollow(FollowControllable, Vec3, LastWaypointIndex) + +
+
+ +

(AIR) Following another airborne controllable.

+ + +

The unit / controllable will follow lead unit of another controllable, wingmens of both controllables will continue following their leaders. +If another controllable is on land the unit / controllable will orbit around.

+ +

Parameters

+
    +
  • + +

    Wrapper.Controllable#CONTROLLABLE FollowControllable : +The controllable to be followed.

    + +
  • +
  • + +

    Dcs.DCSTypes#Vec3 Vec3 : +Position of the unit / lead unit of the controllable relative lead unit of another controllable in frame reference oriented by course of lead unit of another controllable. If another controllable is on land the unit / controllable will orbit around.

    + +
  • +
  • + +

    #number LastWaypointIndex : +Detach waypoint of another controllable. Once reached the unit / controllable Follow task is finished.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskFunction(WayPoint, WayPointIndex, FunctionString, FunctionArguments) + +
+
+ + + +

Parameters

+
    +
  • + +

    WayPoint :

    + +
  • +
  • + +

    WayPointIndex :

    + +
  • +
  • + +

    FunctionString :

    + +
  • +
  • + +

    FunctionArguments :

    + +
  • +
+
+
+
+
+ + +CONTROLLABLE:TaskHold() + +
+
+ +

(GROUND) Hold ground controllable from moving.

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskHoldPosition(Duration) + +
+
+ +

(AIR) Hold position at the current position of the first unit of the controllable.

+ +

Parameter

+
    +
  • + +

    #number Duration : +The maximum duration in seconds to hold the position.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:TaskLandAtVec2(Point, Duration) + +
+
+ +

(AIR HELICOPTER) Landing at the ground.

+ + +

For helicopters only.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec2 Point : +The point where to land.

    + +
  • +
  • + +

    #number Duration : +The duration in seconds to stay on the ground.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:TaskLandAtZone(Zone, Duration, RandomPoint) + +
+
+ +

(AIR) Land the controllable at a @{Core.Zone#ZONE_RADIUS).

+ +

Parameters

+
    +
  • + +

    Core.Zone#ZONE Zone : +The zone where to land.

    + +
  • +
  • + +

    #number Duration : +The duration in seconds to stay on the ground.

    + +
  • +
  • + +

    RandomPoint :

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:TaskMission(TaskMission) + +
+
+ +

(AIR + GROUND) Return a mission task from a mission template.

+ +

Parameter

+
    +
  • + +

    #table TaskMission : +A table containing the mission task.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task:

+ + +
+
+
+
+ + +CONTROLLABLE:TaskOrbitCircle(Altitude, Speed) + +
+
+ +

(AIR) Orbit at the current position of the first unit of the controllable at a specified alititude.

+ +

Parameters

+
    +
  • + +

    #number Altitude : +The altitude to hold the position.

    + +
  • +
  • + +

    #number Speed : +The speed flying when holding the position.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:TaskOrbitCircleAtVec2(Point, Altitude, Speed) + +
+
+ +

(AIR) Orbit at a specified position at a specified alititude during a specified duration with a specified speed.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec2 Point : +The point to hold the position.

    + +
  • +
  • + +

    #number Altitude : +The altitude to hold the position.

    + +
  • +
  • + +

    #number Speed : +The speed flying when holding the position.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:TaskRefueling() + +
+
+ +

(AIR) Refueling from the nearest tanker.

+ + +

No parameters.

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task: +The DCS task structure.

+ +
+
+
+
+ + +CONTROLLABLE:TaskRoute(Points) + +
+
+ +

Return a Misson task to follow a given route defined by Points.

+ +

Parameter

+
    +
  • + +

    #table Points : +A table of route points.

    + +
  • +
+

Return value

+ +

Dcs.DCSTasking.Task#Task:

+ + +
+
+
+
+ + +CONTROLLABLE:TaskRouteToVec2(Point, Speed) + +
+
+ +

(AIR + GROUND) Make the Controllable move to fly to a given point.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec3 Point : +The destination point in Vec3 format.

    + +
  • +
  • + +

    #number Speed : +The speed to travel.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:TaskRouteToVec3(Point, Speed) + +
+
+ +

(AIR + GROUND) Make the Controllable move to a given point.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec3 Point : +The destination point in Vec3 format.

    + +
  • +
  • + +

    #number Speed : +The speed to travel.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE: +self

+ +
+
+
+
+ + +CONTROLLABLE:TaskRouteToZone(Zone, Randomize, Speed, Formation) + +
+
+ +

(AIR + GROUND) Route the controllable to a given zone.

+ + +

The controllable final destination point can be randomized. +A speed can be given in km/h. +A given formation can be given.

+ +

Parameters

+
    +
  • + +

    Core.Zone#ZONE Zone : +The zone where to route to.

    + +
  • +
  • + +

    #boolean Randomize : +Defines whether to target point gets randomized within the Zone.

    + +
  • +
  • + +

    #number Speed : +The speed.

    + +
  • +
  • + +

    Base#FORMATION Formation : +The formation string.

    + +
  • +
+
+
+
+
+ + +CONTROLLABLE:TaskWrappedAction(DCSCommand, Index) + +
+
+ +

Return a WrappedAction Task taking a Command.

+ +

Parameters

+ +

Return value

+ +

Dcs.DCSTasking.Task#Task:

+ + +
+
+
+
+ + +CONTROLLABLE:WayPointExecute(WayPoint, WaitTime) + +
+
+ +

Executes the WayPoint plan.

+ + +

The function gets a WayPoint parameter, that you can use to restart the mission at a specific WayPoint. +Note that when the WayPoint parameter is used, the new start mission waypoint of the controllable will be 1!

+ +

Parameters

+
    +
  • + +

    #number WayPoint : +The WayPoint from where to execute the mission.

    + +
  • +
  • + +

    #number WaitTime : +The amount seconds to wait before initiating the mission.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE:

+ + +
+
+
+
+ + +CONTROLLABLE:WayPointFunction(WayPoint, WayPointIndex, WayPointFunction, ...) + +
+
+ +

Registers a waypoint function that will be executed when the controllable moves over the WayPoint.

+ +

Parameters

+
    +
  • + +

    #number WayPoint : +The waypoint number. Note that the start waypoint on the route is WayPoint 1!

    + +
  • +
  • + +

    #number WayPointIndex : +When defining multiple WayPoint functions for one WayPoint, use WayPointIndex to set the sequence of actions.

    + +
  • +
  • + +

    #function WayPointFunction : +The waypoint function to be called when the controllable moves over the waypoint. The waypoint function takes variable parameters.

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#CONTROLLABLE:

+ + +
+
+
+
+ + + +CONTROLLABLE.WayPointFunctions + +
+
+ + + +
+
+
+
+ + +CONTROLLABLE:WayPointInitialize(WayPoints) + +
+
+ +

Retrieve the controllable mission and allow to place function hooks within the mission waypoint plan.

+ + +

Use the method Wrapper.Controllable#CONTROLLABLE to define the hook functions for specific waypoints. + Use the method @{Controllable@CONTROLLABLE:WayPointExecute) to start the execution of the new mission plan. + Note that when WayPointInitialize is called, the Mission of the controllable is RESTARTED!

+ +

Parameter

+
    +
  • + +

    #table WayPoints : +If WayPoints is given, then use the route.

    + +
  • +
+

Return value

+ +

#CONTROLLABLE:

+ + +
+
+
+
+ + + +CONTROLLABLE.WayPoints + +
+
+ + + +
+
+
+
+ + +CONTROLLABLE:_GetController() + +
+
+ +

Get the controller for the CONTROLLABLE.

+ +

Return value

+ +

Dcs.DCSController#Controller:

+ + +
+
+ +

Type DCSCommand

+ +

Type DCSStopCondition

+ +
+ +
+ + diff --git a/docs/Documentation/DCSAirbase.html b/docs/Documentation/DCSAirbase.html new file mode 100644 index 000000000..d47a0d2d4 --- /dev/null +++ b/docs/Documentation/DCSAirbase.html @@ -0,0 +1,466 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSAirbase

+ + + +

Global(s)

+ + + + + +
Airbase + +
+

Type Airbase

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Airbase.Category +

enum contains identifiers of airbase categories.

+
Airbase.Desc +

Airbase descriptor. Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.

+
Airbase.ID +

Identifier of an airbase. It assigned to an airbase by the Mission Editor automatically. This identifier is used in AI tasks to refer an airbase that exists (spawned and not dead) or not.

+
Airbase.getByName(name) +

Returns airbase by its name.

+
Airbase:getCallsign() +

Returns the airbase's callsign - the localized string.

+
Airbase:getDesc() +

Returns descriptor of the airbase.

+
Airbase.getDescByName(typeName) +

Returns airbase descriptor by type name.

+
Airbase:getID() +

Returns identifier of the airbase.

+
Airbase:getUnit() +

Returns Unit that is corresponded to the airbase.

+
+ +

Type Airbase.Category

+ + + + + + + + + + + + + +
Airbase.Category.AIRDROME + +
Airbase.Category.HELIPAD + +
Airbase.Category.SHIP + +
+ +

Type Airbase.Desc

+ + + + + +
Airbase.Desc.category +

Category of the airbase type.

+
+ +

Global(s)

+
+
+ + #Airbase + +Airbase + +
+
+ + + +
+
+

Type DCSAirbase

+ +

Type Airbase

+ +

Represents airbases: airdromes, helipads and ships with flying decks or landing pads.

+ + +

+ +

Field(s)

+
+
+ + #Airbase.Category + +Airbase.Category + +
+
+ +

enum contains identifiers of airbase categories.

+ +
+
+
+
+ + #Airbase.Desc + +Airbase.Desc + +
+
+ +

Airbase descriptor. Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.

+ +
+
+
+
+ + #Airbase.ID + +Airbase.ID + +
+
+ +

Identifier of an airbase. It assigned to an airbase by the Mission Editor automatically. This identifier is used in AI tasks to refer an airbase that exists (spawned and not dead) or not.

+ +
+
+
+
+ + +Airbase.getByName(name) + +
+
+ +

Returns airbase by its name.

+ + +

If no airbase found the function will return nil.

+ +

Parameter

+
    +
  • + +

    #string name :

    + +
  • +
+

Return value

+ +

#Airbase:

+ + +
+
+
+
+ + +Airbase:getCallsign() + +
+
+ +

Returns the airbase's callsign - the localized string.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +Airbase:getDesc() + +
+
+ +

Returns descriptor of the airbase.

+ +

Return value

+ +

#Airbase.Desc:

+ + +
+
+
+
+ + +Airbase.getDescByName(typeName) + +
+
+ +

Returns airbase descriptor by type name.

+ + +

If no descriptor is found the function will return nil.

+ +

Parameter

+
    +
  • + +

    #TypeName typeName : +Airbase type name.

    + +
  • +
+

Return value

+ +

#Airbase.Desc:

+ + +
+
+
+
+ + +Airbase:getID() + +
+
+ +

Returns identifier of the airbase.

+ +

Return value

+ +

#Airbase.ID:

+ + +
+
+
+
+ + +Airbase:getUnit() + +
+
+ +

Returns Unit that is corresponded to the airbase.

+ + +

Works only for ships.

+ +

Return value

+ +

Wrapper.Unit#Unit:

+ + +
+
+ +

Type Airbase.Category

+ +

Enum contains identifiers of airbase categories.

+ +

Field(s)

+
+
+ + +Airbase.Category.AIRDROME + +
+
+ + + +
+
+
+
+ + +Airbase.Category.HELIPAD + +
+
+ + + +
+
+
+
+ + +Airbase.Category.SHIP + +
+
+ + + +
+
+ +

Type Airbase.Desc

+ +

Airbase descriptor.

+ + +

Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.

+ +

Field(s)

+
+
+ + #Airbase.Category + +Airbase.Desc.category + +
+
+ +

Category of the airbase type.

+ +
+
+ +

Type Airbase.ID

+ +

Type TypeName

+ +
+ +
+ + diff --git a/docs/Documentation/DCSCoalitionObject.html b/docs/Documentation/DCSCoalitionObject.html new file mode 100644 index 000000000..b1b40e8b0 --- /dev/null +++ b/docs/Documentation/DCSCoalitionObject.html @@ -0,0 +1,287 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSCoalitionObject

+ + + +

Global(s)

+ + + + + + + + + +
CoalitionObject + +
coalition + +
+

Type CoalitionObject

+ + + + + + + + + +
CoalitionObject:getCoalition() +

Returns coalition of the object.

+
CoalitionObject:getCountry() +

Returns object country.

+
+ +

Type coalition

+ + + + + +
coalition.side + +
+ +

Type coalition.side

+ + + + + + + + + + + + + +
coalition.side.BLUE + +
coalition.side.NEUTRAL + +
coalition.side.RED + +
+ +

Global(s)

+
+
+ + #CoalitionObject + +CoalitionObject + +
+
+ + + +
+
+
+
+ + #coalition + +coalition + +
+
+ + + +
+
+

Type DCSCoalitionObject

+ +

Type CoalitionObject

+

Field(s)

+
+
+ + +CoalitionObject:getCoalition() + +
+
+ +

Returns coalition of the object.

+ +

Return value

+ +

Dcs.DCSTypes#coalition.side:

+ + +
+
+
+
+ + +CoalitionObject:getCountry() + +
+
+ +

Returns object country.

+ +

Return value

+ +

#country.id:

+ + +
+
+ +

Type coalition

+

Field(s)

+
+
+ + #coalition.side + +coalition.side + +
+
+ + + +
+
+ +

Type coalition.side

+

Field(s)

+
+
+ + +coalition.side.BLUE + +
+
+ + + +
+
+
+
+ + +coalition.side.NEUTRAL + +
+
+ + + +
+
+
+
+ + +coalition.side.RED + +
+
+ + + +
+
+ +

Type country.id

+ +
+ +
+ + diff --git a/docs/Documentation/DCSCommand.html b/docs/Documentation/DCSCommand.html new file mode 100644 index 000000000..50c815ce8 --- /dev/null +++ b/docs/Documentation/DCSCommand.html @@ -0,0 +1,144 @@ + + + + + + +
+
+ +
+
+
+ + + diff --git a/docs/Documentation/DCSController.html b/docs/Documentation/DCSController.html new file mode 100644 index 000000000..3b87c815f --- /dev/null +++ b/docs/Documentation/DCSController.html @@ -0,0 +1,741 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSController

+ + + +

Global(s)

+ + + + + +
Controller + +
+

Type Controller

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Controller.Detection +

Enum contains identifiers of surface types.

+
Controller:getDetectedTargets(detection) +

Returns list of detected targets.

+
Controller:hasTask() +

Returns true if the controller has a task.

+
Controller:isTargetDetected(target, detection) +

Checks if the target is detected or not.

+
Controller:knowTarget(object, type, distance) +

Know a target.

+
Controller:popTask() +

Pops current (front) task from the queue and makes active next task in the queue (if exists).

+
Controller:pushTask(task) +

Pushes the task to the front of the queue and makes the task active.

+
Controller:resetTask() +

Resets current task of the controller.

+
Controller:setOnOff(value) +

Enables and disables the controller.

+
Controller:setOption(optionId, optionValue) +

Sets the option to the controller.

+
Controller:setTask(task) +

Resets current task and then sets the task to the controller.

+
+ +

Type Controller.Detection

+ + + + + + + + + + + + + + + + + + + + + + + + + +
Controller.Detection.DLINK + +
Controller.Detection.IRST + +
Controller.Detection.OPTIC + +
Controller.Detection.RADAR + +
Controller.Detection.RWR + +
Controller.Detection.VISUAL + +
+ +

Type DetectedTarget

+ + + + + + + + + + + + + + + + + +
DetectedTarget.distance +

Distance to the target is known

+
DetectedTarget.object +

The target

+
DetectedTarget.type +

The target type is known

+
DetectedTarget.visible +

The target is visible

+
+ +

Global(s)

+
+
+ + #Controller + +Controller + +
+
+ + + +
+
+

Type DCSController

+ +

Type Controller

+ +

Controller is an object that performs A.I.-routines.

+ + +

Other words controller is an instance of A.I.. Controller stores current main task, active enroute tasks and behavior options. Controller performs commands. Please, read DCS A-10C GUI Manual EN.pdf chapter "Task Planning for Unit Groups", page 91 to understand A.I. system of DCS:A-10C.

+ +

This class has 2 types of functions:

+ +
    +
  • Tasks
  • +
  • Commands: Commands are instant actions those required zero time to perform. Commands may be used both for control unit/group behavior and control game mechanics.
  • +
+ +

Field(s)

+
+
+ + #Controller.Detection + +Controller.Detection + +
+
+ +

Enum contains identifiers of surface types.

+ +
+
+
+
+ + +Controller:getDetectedTargets(detection) + +
+
+ +

Returns list of detected targets.

+ + +

If one or more detection method is specified the function will return targets which were detected by at least one of these methods. If no detection methods are specified the function will return targets which were detected by any method.

+ +

Parameter

+
    +
  • + +

    #Controller.Detection detection : +Controller.Detection detection1, Controller.Detection detection2, ... Controller.Detection detectionN

    + +
  • +
+

Return value

+ +

#list:

+

DetectedTarget> array of DetectedTarget

+ +
+
+
+
+ + +Controller:hasTask() + +
+
+ +

Returns true if the controller has a task.

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +Controller:isTargetDetected(target, detection) + +
+
+ +

Checks if the target is detected or not.

+ + +

If one or more detection method is specified the function will return true if the target is detected by at least one of these methods. If no detection methods are specified the function will return true if the target is detected by any method.

+ +

Parameters

+ +

Return values

+
    +
  1. + +

    #boolean: +detected True if the target is detected.

    + +
  2. +
  3. + +

    #boolean: +visible Has effect only if detected is true. True if the target is visible now.

    + +
  4. +
  5. + +

    #ModelTime: +lastTime Has effect only if visible is false. Last time when target was seen.

    + +
  6. +
  7. + +

    #boolean: +type Has effect only if detected is true. True if the target type is known.

    + +
  8. +
  9. + +

    #boolean: +distance Has effect only if detected is true. True if the distance to the target is known.

    + +
  10. +
  11. + +

    #Vec3: +lastPos Has effect only if visible is false. Last position of the target when it was seen.

    + +
  12. +
  13. + +

    #Vec3: +lastVel Has effect only if visible is false. Last velocity of the target when it was seen.

    + +
  14. +
+
+
+
+
+ + +Controller:knowTarget(object, type, distance) + +
+
+ +

Know a target.

+ +

Parameters

+
    +
  • + +

    Wrapper.Object#Object object : +The target.

    + +
  • +
  • + +

    #boolean type : +Target type is known.

    + +
  • +
  • + +

    #boolean distance : +Distance to target is known.

    + +
  • +
+
+
+
+
+ + +Controller:popTask() + +
+
+ +

Pops current (front) task from the queue and makes active next task in the queue (if exists).

+ + +

If no more tasks in the queue the function works like function Controller.resetTask() function. Does nothing if the queue is empty.

+ +
+
+
+
+ + +Controller:pushTask(task) + +
+
+ +

Pushes the task to the front of the queue and makes the task active.

+ + +

Further call of function Controller.setTask() function will stop current task, clear the queue and set the new task active. If the task queue is empty the function will work like function Controller.setTask() function.

+ +

Parameter

+
    +
  • + +

    #Task task :

    + +
  • +
+
+
+
+
+ + +Controller:resetTask() + +
+
+ +

Resets current task of the controller.

+ +
+
+
+
+ + +Controller:setOnOff(value) + +
+
+ +

Enables and disables the controller.

+ + +

Note: Now it works only for ground / naval groups!

+ +

Parameter

+
    +
  • + +

    #boolean value : +Enable / Disable.

    + +
  • +
+
+
+
+
+ + +Controller:setOption(optionId, optionValue) + +
+
+ +

Sets the option to the controller.

+ + +

Option is a pair of identifier and value. Behavior options are global parameters those affect controller behavior in all tasks it performs. +Option identifiers and values are stored in table AI.Option in subtables Air, Ground and Naval.

+ +

OptionId = AI.Option.Air.id or AI.Option.Ground.id or AI.Option.Naval.id +OptionValue = AI.Option.Air.val[optionName] or AI.Option.Ground.val[optionName] or AI.Option.Naval.val[optionName]

+ + +

Parameters

+
    +
  • + +

    #OptionId optionId : +Option identifier.

    + +
  • +
  • + +

    #OptionValue optionValue : +Value of the option.

    + +
  • +
+
+
+
+
+ + +Controller:setTask(task) + +
+
+ +

Resets current task and then sets the task to the controller.

+ + +

Task is a table that contains task identifier and task parameters.

+ +

Parameter

+
    +
  • + +

    #Task task :

    + +
  • +
+
+
+ +

Type Controller.Detection

+ +

Enum contains identifiers of surface types.

+ +

Field(s)

+
+
+ + +Controller.Detection.DLINK + +
+
+ + + +
+
+
+
+ + +Controller.Detection.IRST + +
+
+ + + +
+
+
+
+ + +Controller.Detection.OPTIC + +
+
+ + + +
+
+
+
+ + +Controller.Detection.RADAR + +
+
+ + + +
+
+
+
+ + +Controller.Detection.RWR + +
+
+ + + +
+
+
+
+ + +Controller.Detection.VISUAL + +
+
+ + + +
+
+ +

Type DetectedTarget

+ +

Detected target.

+ +

Field(s)

+
+
+ + #boolean + +DetectedTarget.distance + +
+
+ +

Distance to the target is known

+ +
+
+
+
+ + Wrapper.Object#Object + +DetectedTarget.object + +
+
+ +

The target

+ +
+
+
+
+ + #boolean + +DetectedTarget.type + +
+
+ +

The target type is known

+ +
+
+
+
+ + #boolean + +DetectedTarget.visible + +
+
+ +

The target is visible

+ +
+
+ +

Type ModelTime

+ +

Type OptionId

+ +

Type OptionValue

+ +

Type Task

+ +

Type Vec3

+ +

Type list

+ +
+ +
+ + diff --git a/docs/Documentation/DCSGroup.html b/docs/Documentation/DCSGroup.html new file mode 100644 index 000000000..f5a439f32 --- /dev/null +++ b/docs/Documentation/DCSGroup.html @@ -0,0 +1,573 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSGroup

+ + + +

Global(s)

+ + + + + +
Group + +
+

Type Group

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Group.Category +

Enum contains identifiers of group types.

+
Group.ID +

Identifier of a group. It is assigned to a group by Mission Editor automatically.

+
Group:destroy() +

Destroys the group and all of its units.

+
Group.getByName(name) +

Returns group by the name assigned to the group in Mission Editor.

+
Group:getCategory() +

Returns category of the group.

+
Group:getCoalition() +

Returns the coalition of the group.

+
Group:getController() +

Returns controller of the group.

+
Group:getID() +

Returns the group identifier.

+
Group:getInitialSize() +

Returns initial size of the group.

+
Group:getName() +

Returns the group's name.

+
Group:getSize() +

Returns current size of the group.

+
Group:getUnit(unitNumber) +

Returns the unit with number unitNumber.

+
Group:getUnits() +

Returns array of the units present in the group now.

+
Group:isExist() +

returns true if the group exist or false otherwise.

+
+ +

Type Group.Category

+ + + + + + + + + + + + + + + + + +
Group.Category.AIRPLANE + +
Group.Category.GROUND + +
Group.Category.HELICOPTER + +
Group.Category.SHIP + +
+ +

Global(s)

+
+
+ + #Group + +Group + +
+
+ + + +
+
+

Type DCSGroup

+ +

Type Group

+ +

Represents group of Units.

+ +

Field(s)

+
+
+ + #Group.Category + +Group.Category + +
+
+ +

Enum contains identifiers of group types.

+ +
+
+
+
+ + #ID + +Group.ID + +
+
+ +

Identifier of a group. It is assigned to a group by Mission Editor automatically.

+ +
+
+
+
+ + +Group:destroy() + +
+
+ +

Destroys the group and all of its units.

+ +
+
+
+
+ + +Group.getByName(name) + +
+
+ +

Returns group by the name assigned to the group in Mission Editor.

+ +

Parameter

+
    +
  • + +

    #string name :

    + +
  • +
+

Return value

+ +

#Group:

+ + +
+
+
+
+ + +Group:getCategory() + +
+
+ +

Returns category of the group.

+ +

Return value

+ +

#Group.Category:

+ + +
+
+
+
+ + +Group:getCoalition() + +
+
+ +

Returns the coalition of the group.

+ +

Return value

+ +

Dcs.DCSCoalitionWrapper.Object#coalition.side:

+ + +
+
+
+
+ + +Group:getController() + +
+
+ +

Returns controller of the group.

+ +

Return value

+ +

Controller#Controller:

+ + +
+
+
+
+ + +Group:getID() + +
+
+ +

Returns the group identifier.

+ +

Return value

+ +

#ID:

+ + +
+
+
+
+ + +Group:getInitialSize() + +
+
+ +

Returns initial size of the group.

+ + +

If some of the units will be destroyed, initial size of the group will not be changed. Initial size limits the unitNumber parameter for Group.getUnit() function.

+ +

Return value

+ +

#number:

+ + +
+
+
+
+ + +Group:getName() + +
+
+ +

Returns the group's name.

+ + +

This is the same name assigned to the group in Mission Editor.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +Group:getSize() + +
+
+ +

Returns current size of the group.

+ + +

If some of the units will be destroyed, As units are destroyed the size of the group will be changed.

+ +

Return value

+ +

#number:

+ + +
+
+
+
+ + +Group:getUnit(unitNumber) + +
+
+ +

Returns the unit with number unitNumber.

+ + +

If the unit is not exists the function will return nil.

+ +

Parameter

+
    +
  • + +

    #number unitNumber :

    + +
  • +
+

Return value

+ +

Dcs.DCSWrapper.Unit#Unit:

+ + +
+
+
+
+ + +Group:getUnits() + +
+
+ +

Returns array of the units present in the group now.

+ + +

Destroyed units will not be enlisted at all.

+ +

Return value

+ +

#list: +Dcs.DCSWrapper.Unit#Unit> array of Units

+ +
+
+
+
+ + +Group:isExist() + +
+
+ +

returns true if the group exist or false otherwise.

+ +

Return value

+ +

#boolean:

+ + +
+
+ +

Type Group.Category

+ +

Enum contains identifiers of group types.

+ +

Field(s)

+
+
+ + +Group.Category.AIRPLANE + +
+
+ + + +
+
+
+
+ + +Group.Category.GROUND + +
+
+ + + +
+
+
+
+ + +Group.Category.HELICOPTER + +
+
+ + + +
+
+
+
+ + +Group.Category.SHIP + +
+
+ + + +
+
+ +

Type ID

+ +

Type list

+ +
+ +
+ + diff --git a/docs/Documentation/DCSObject.html b/docs/Documentation/DCSObject.html new file mode 100644 index 000000000..dc35705a3 --- /dev/null +++ b/docs/Documentation/DCSObject.html @@ -0,0 +1,594 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSObject

+ + + +

Global(s)

+ + + + + +
Object + +
+

Type Object

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Object.Category + +
Object.Desc + +
Object:destroy() + +
Object:getCategory() + +
Object:getDesc() +

Returns object descriptor.

+
Object:getName() +

Returns name of the object.

+
Object:getPoint() +

Returns object coordinates for current time.

+
Object:getPosition() +

Returns object position for current time.

+
Object:getTypeName() +

Returns type name of the Object.

+
Object:getVelocity() +

Returns the unit's velocity vector.

+
Object:hasAttribute(attributeName) +

Returns true if the object belongs to the category.

+
Object:inAir() +

Returns true if the unit is in air.

+
Object:isExist() + +
+ +

Type Object.Category

+ + + + + + + + + + + + + + + + + + + + + +
Object.Category.BASE + +
Object.Category.SCENERY + +
Object.Category.STATIC + +
Object.Category.UNIT + +
Object.Category.WEAPON + +
+ +

Type Object.Desc

+ + + + + + + + + +
Object.Desc.box +

bounding box of collision geometry

+
Object.Desc.life +

initial life level

+
+ +

Global(s)

+
+
+ + #Object + +Object + +
+
+ + + +
+
+

Type DCSObject

+ +

Type AttributeName

+ +

Type Box3

+ +

Type Object

+

Field(s)

+
+
+ + #Object.Category + +Object.Category + +
+
+ + + +
+
+
+
+ + #Object.Desc + +Object.Desc + +
+
+ + + +
+
+
+
+ + +Object:destroy() + +
+
+ + + +
+
+
+
+ + +Object:getCategory() + +
+
+ + + +

Return value

+ +

#Object.Category:

+ + +
+
+
+
+ + +Object:getDesc() + +
+
+ +

Returns object descriptor.

+ +

Return value

+ +

#Object.Desc:

+ + +
+
+
+
+ + +Object:getName() + +
+
+ +

Returns name of the object.

+ + +

This is the name that is assigned to the object in the Mission Editor.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +Object:getPoint() + +
+
+ +

Returns object coordinates for current time.

+ +

Return value

+ +

#Vec3:

+ + +
+
+
+
+ + +Object:getPosition() + +
+
+ +

Returns object position for current time.

+ +

Return value

+ +

#Position3:

+ + +
+
+
+
+ + +Object:getTypeName() + +
+
+ +

Returns type name of the Object.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +Object:getVelocity() + +
+
+ +

Returns the unit's velocity vector.

+ +

Return value

+ +

#Vec3:

+ + +
+
+
+
+ + +Object:hasAttribute(attributeName) + +
+
+ +

Returns true if the object belongs to the category.

+ +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +Object:inAir() + +
+
+ +

Returns true if the unit is in air.

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +Object:isExist() + +
+
+ + + +

Return value

+ +

#boolean:

+ + +
+
+ +

Type Object.Category

+

Field(s)

+
+
+ + +Object.Category.BASE + +
+
+ + + +
+
+
+
+ + +Object.Category.SCENERY + +
+
+ + + +
+
+
+
+ + +Object.Category.STATIC + +
+
+ + + +
+
+
+
+ + +Object.Category.UNIT + +
+
+ + + +
+
+
+
+ + +Object.Category.WEAPON + +
+
+ + + +
+
+ +

Type Object.Desc

+

Field(s)

+
+
+ + #Box3 + +Object.Desc.box + +
+
+ +

bounding box of collision geometry

+ +
+
+
+
+ + #number + +Object.Desc.life + +
+
+ +

initial life level

+ +
+
+ +

Type Position3

+ +

Type Vec3

+ +
+ +
+ + diff --git a/docs/Documentation/DCSTask.html b/docs/Documentation/DCSTask.html new file mode 100644 index 000000000..bd8d1c071 --- /dev/null +++ b/docs/Documentation/DCSTask.html @@ -0,0 +1,152 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSTask

+ + + +

Type Task

+ + + + + + + + + +
Task.id + +
Task.param + +
+ +

Type DCSTask

+ +

Type Task

+ +

A task descriptor (internal structure for DCS World)

+ +

Field(s)

+
+
+ + #string + +Task.id + +
+
+ + + +
+
+
+
+ + #Task.param + +Task.param + +
+
+ + + +
+
+ +

Type Task.param

+ +

Type TaskArray

+ +

List of #Task

+ + +
+ +
+ + diff --git a/docs/Documentation/DCSTypes.html b/docs/Documentation/DCSTypes.html new file mode 100644 index 000000000..eac8cf3fe --- /dev/null +++ b/docs/Documentation/DCSTypes.html @@ -0,0 +1,2509 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSTypes

+ + + +

Global(s)

+ + + + + +
AI + +
+

Type AI

+ + + + + + + + + + + + + +
AI.Option + +
AI.Skill + +
AI.Task + +
+ +

Type AI.Option

+ + + + + + + + + + + + + +
AI.Option.Air + +
AI.Option.Ground + +
AI.Option.Naval + +
+ +

Type AI.Option.Air

+ + + + + + + + + +
AI.Option.Air.id + +
AI.Option.Air.val + +
+ +

Type AI.Option.Air.val

+ + + + + + + + + + + + + + + + + +
AI.Option.Air.val.FLARE_USING + +
AI.Option.Air.val.RADAR_USING + +
AI.Option.Air.val.REACTION_ON_THREAT + +
AI.Option.Air.val.ROE + +
+ +

Type AI.Option.Air.val.FLARE_USING

+ + + + + + + + + + + + + + + + + +
AI.Option.Air.val.FLARE_USING.AGAINST_FIRED_MISSILE + +
AI.Option.Air.val.FLARE_USING.NEVER + +
AI.Option.Air.val.FLARE_USING.WHEN_FLYING_IN_SAM_WEZ + +
AI.Option.Air.val.FLARE_USING.WHEN_FLYING_NEAR_ENEMIES + +
+ +

Type AI.Option.Air.val.RADAR_USING

+ + + + + + + + + + + + + + + + + +
AI.Option.Air.val.RADAR_USING.FOR_ATTACK_ONLY + +
AI.Option.Air.val.RADAR_USING.FOR_CONTINUOUS_SEARCH + +
AI.Option.Air.val.RADAR_USING.FOR_SEARCH_IF_REQUIRED + +
AI.Option.Air.val.RADAR_USING.NEVER + +
+ +

Type AI.Option.Air.val.REACTION_ON_THREAT

+ + + + + + + + + + + + + + + + + + + + + +
AI.Option.Air.val.REACTION_ON_THREAT.ALLOW_ABORT_MISSION + +
AI.Option.Air.val.REACTION_ON_THREAT.BYPASS_AND_ESCAPE + +
AI.Option.Air.val.REACTION_ON_THREAT.EVADE_FIRE + +
AI.Option.Air.val.REACTION_ON_THREAT.NO_REACTION + +
AI.Option.Air.val.REACTION_ON_THREAT.PASSIVE_DEFENCE + +
+ +

Type AI.Option.Air.val.ROE

+ + + + + + + + + + + + + + + + + + + + + +
AI.Option.Air.val.ROE.OPEN_FIRE + +
AI.Option.Air.val.ROE.OPEN_FIRE_WEAPON_FREE + +
AI.Option.Air.val.ROE.RETURN_FIRE + +
AI.Option.Air.val.ROE.WEAPON_FREE + +
AI.Option.Air.val.ROE.WEAPON_HOLD + +
+ +

Type AI.Option.Ground

+ + + + + + + + + +
AI.Option.Ground.id + +
AI.Option.Ground.val + +
+ +

Type AI.Option.Ground.id

+ + + + + + + + + + + + + + + + + +
AI.Option.Ground.id.ALARM_STATE +

AI.Option.Ground.val.ALARM_STATE

+
AI.Option.Ground.id.DISPERSE_ON_ATTACK +

true or false

+
AI.Option.Ground.id.NO_OPTION + +
AI.Option.Ground.id.ROE +

AI.Option.Ground.val.ROE

+
+ +

Type AI.Option.Ground.val

+ + + + + + + + + +
AI.Option.Ground.val.ALARM_STATE + +
AI.Option.Ground.val.ROE + +
+ +

Type AI.Option.Ground.val.ALARM_STATE

+ + + + + + + + + + + + + +
AI.Option.Ground.val.ALARM_STATE.AUTO + +
AI.Option.Ground.val.ALARM_STATE.GREEN + +
AI.Option.Ground.val.ALARM_STATE.RED + +
+ +

Type AI.Option.Ground.val.ROE

+ + + + + + + + + + + + + +
AI.Option.Ground.val.ROE.OPEN_FIRE + +
AI.Option.Ground.val.ROE.RETURN_FIRE + +
AI.Option.Ground.val.ROE.WEAPON_HOLD + +
+ +

Type AI.Option.Naval

+ + + + + + + + + +
AI.Option.Naval.id + +
AI.Option.Naval.val + +
+ +

Type AI.Option.Naval.id

+ + + + + + + + + +
AI.Option.Naval.id.NO_OPTION + +
AI.Option.Naval.id.ROE + +
+ +

Type AI.Option.Naval.val

+ + + + + +
AI.Option.Naval.val.ROE + +
+ +

Type AI.Option.Naval.val.ROE

+ + + + + + + + + + + + + +
AI.Option.Naval.val.ROE.OPEN_FIRE + +
AI.Option.Naval.val.ROE.RETURN_FIRE + +
AI.Option.Naval.val.ROE.WEAPON_HOLD + +
+ +

Type AI.Skill

+ + + + + + + + + + + + + + + + + + + + + + + + + +
AI.Skill.AVERAGE + +
AI.Skill.CLIENT + +
AI.Skill.EXCELLENT + +
AI.Skill.GOOD + +
AI.Skill.HIGH + +
AI.Skill.PLAYER + +
+ +

Type AI.Task

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI.Task.AltitudeType + +
AI.Task.Designation + +
AI.Task.OrbitPattern + +
AI.Task.TurnMethod + +
AI.Task.VehicleFormation + +
AI.Task.WaypointType + +
AI.Task.WeaponExpend + +
+ +

Type AI.Task.AltitudeType

+ + + + + + + + + +
AI.Task.AltitudeType.BARO + +
AI.Task.AltitudeType.RADIO + +
+ +

Type AI.Task.Designation

+ + + + + + + + + + + + + + + + + + + + + +
AI.Task.Designation.AUTO + +
AI.Task.Designation.IR_POINTER + +
AI.Task.Designation.LASER + +
AI.Task.Designation.NO + +
AI.Task.Designation.WP + +
+ +

Type AI.Task.OrbitPattern

+ + + + + + + + + +
AI.Task.OrbitPattern.CIRCLE + +
AI.Task.OrbitPattern.RACE_TRACK + +
+ +

Type AI.Task.TurnMethod

+ + + + + + + + + +
AI.Task.TurnMethod.FIN_POINT + +
AI.Task.TurnMethod.FLY_OVER_POINT + +
+ +

Type AI.Task.VehicleFormation

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI.Task.VehicleFormation.CONE + +
AI.Task.VehicleFormation.DIAMOND + +
AI.Task.VehicleFormation.ECHELON_LEFT + +
AI.Task.VehicleFormation.ECHELON_RIGHT + +
AI.Task.VehicleFormation.OFF_ROAD + +
AI.Task.VehicleFormation.ON_ROAD + +
AI.Task.VehicleFormation.RANK + +
AI.Task.VehicleFormation.VEE + +
+ +

Type AI.Task.WaypointType

+ + + + + + + + + + + + + + + + + +
AI.Task.WaypointType.LAND + +
AI.Task.WaypointType.TAKEOFF + +
AI.Task.WaypointType.TAKEOFF_PARKING + +
AI.Task.WaypointType.TURNING_POINT + +
+ +

Type AI.Task.WeaponExpend

+ + + + + + + + + + + + + + + + + + + + + + + + + +
AI.Task.WeaponExpend.ALL + +
AI.Task.WeaponExpend.FOUR + +
AI.Task.WeaponExpend.HALF + +
AI.Task.WeaponExpend.ONE + +
AI.Task.WeaponExpend.QUARTER + +
AI.Task.WeaponExpend.TWO + +
+ +

Type Box3

+ + + + + + + + + +
Box3.max + +
Box3.min + +
+ +

Type Desc

+ + + + + + + + + + + + + +
Desc.attributes +

object type attributes

+
Desc.displayName +

localized display name

+
Desc.typeName +

type name

+
+ +

Type Position3

+ + + + + + + + + + + + + + + + + +
Position3.p + +
Position3.x + +
Position3.y + +
Position3.z + +
+ +

Type Vec2

+ + + + + + + + + +
Vec2.x +

Vec2.x = Vec3.x

+
Vec2.y +

Vec2.y = Vec3.z

+
+ +

Type Vec3

+ + + + + + + + + + + + + +
Vec3.x +

is directed to the north

+
Vec3.y +

is directed up

+
Vec3.z +

is directed to the east

+
+ +

Global(s)

+
+
+ + #AI + +AI + +
+
+ + + +
+
+

Type DCSTypes

+ +

Type AI

+

Field(s)

+
+
+ + #AI.Option + +AI.Option + +
+
+ + + +
+
+
+
+ + #AI.Skill + +AI.Skill + +
+
+ + + +
+
+
+
+ + #AI.Task + +AI.Task + +
+
+ + + +
+
+ +

Type AI.Option

+

Field(s)

+
+
+ + #AI.Option.Air + +AI.Option.Air + +
+
+ + + +
+
+
+
+ + #AI.Option.Ground + +AI.Option.Ground + +
+
+ + + +
+
+
+
+ + #AI.Option.Naval + +AI.Option.Naval + +
+
+ + + +
+
+ +

Type AI.Option.Air

+

Field(s)

+
+
+ + #AI.Option.Air.id + +AI.Option.Air.id + +
+
+ + + +
+
+
+
+ + #AI.Option.Air.val + +AI.Option.Air.val + +
+
+ + + +
+
+ +

Type AI.Option.Air.id

+ +

Type AI.Option.Air.val

+

Field(s)

+
+
+ + #AI.Option.Air.val.FLARE_USING + +AI.Option.Air.val.FLARE_USING + +
+
+ + + +
+
+
+
+ + #AI.Option.Air.val.RADAR_USING + +AI.Option.Air.val.RADAR_USING + +
+
+ + + +
+
+
+
+ + #AI.Option.Air.val.REACTION_ON_THREAT + +AI.Option.Air.val.REACTION_ON_THREAT + +
+
+ + + +
+
+
+
+ + #AI.Option.Air.val.ROE + +AI.Option.Air.val.ROE + +
+
+ + + +
+
+ +

Type AI.Option.Air.val.FLARE_USING

+

Field(s)

+
+
+ + +AI.Option.Air.val.FLARE_USING.AGAINST_FIRED_MISSILE + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.FLARE_USING.NEVER + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.FLARE_USING.WHEN_FLYING_IN_SAM_WEZ + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.FLARE_USING.WHEN_FLYING_NEAR_ENEMIES + +
+
+ + + +
+
+ +

Type AI.Option.Air.val.RADAR_USING

+

Field(s)

+
+
+ + +AI.Option.Air.val.RADAR_USING.FOR_ATTACK_ONLY + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.RADAR_USING.FOR_CONTINUOUS_SEARCH + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.RADAR_USING.FOR_SEARCH_IF_REQUIRED + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.RADAR_USING.NEVER + +
+
+ + + +
+
+ +

Type AI.Option.Air.val.REACTION_ON_THREAT

+

Field(s)

+
+
+ + +AI.Option.Air.val.REACTION_ON_THREAT.ALLOW_ABORT_MISSION + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.REACTION_ON_THREAT.BYPASS_AND_ESCAPE + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.REACTION_ON_THREAT.EVADE_FIRE + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.REACTION_ON_THREAT.NO_REACTION + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.REACTION_ON_THREAT.PASSIVE_DEFENCE + +
+
+ + + +
+
+ +

Type AI.Option.Air.val.ROE

+

Field(s)

+
+
+ + +AI.Option.Air.val.ROE.OPEN_FIRE + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.ROE.OPEN_FIRE_WEAPON_FREE + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.ROE.RETURN_FIRE + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.ROE.WEAPON_FREE + +
+
+ + + +
+
+
+
+ + +AI.Option.Air.val.ROE.WEAPON_HOLD + +
+
+ + + +
+
+ +

Type AI.Option.Ground

+

Field(s)

+
+
+ + #AI.Option.Ground.id + +AI.Option.Ground.id + +
+
+ + + +
+
+
+
+ + #AI.Option.Ground.val + +AI.Option.Ground.val + +
+
+ + + +
+
+ +

Type AI.Option.Ground.id

+

Field(s)

+
+
+ + +AI.Option.Ground.id.ALARM_STATE + +
+
+ +

AI.Option.Ground.val.ALARM_STATE

+ +
+
+
+
+ + +AI.Option.Ground.id.DISPERSE_ON_ATTACK + +
+
+ +

true or false

+ +
+
+
+
+ + +AI.Option.Ground.id.NO_OPTION + +
+
+ + + +
+
+
+
+ + +AI.Option.Ground.id.ROE + +
+
+ +

AI.Option.Ground.val.ROE

+ +
+
+ +

Type AI.Option.Ground.val

+

Field(s)

+
+
+ + #AI.Option.Ground.val.ALARM_STATE + +AI.Option.Ground.val.ALARM_STATE + +
+
+ + + +
+
+
+
+ + #AI.Option.Ground.val.ROE + +AI.Option.Ground.val.ROE + +
+
+ + + +
+
+ +

Type AI.Option.Ground.val.ALARM_STATE

+

Field(s)

+
+
+ + +AI.Option.Ground.val.ALARM_STATE.AUTO + +
+
+ + + +
+
+
+
+ + +AI.Option.Ground.val.ALARM_STATE.GREEN + +
+
+ + + +
+
+
+
+ + +AI.Option.Ground.val.ALARM_STATE.RED + +
+
+ + + +
+
+ +

Type AI.Option.Ground.val.ROE

+

Field(s)

+
+
+ + +AI.Option.Ground.val.ROE.OPEN_FIRE + +
+
+ + + +
+
+
+
+ + +AI.Option.Ground.val.ROE.RETURN_FIRE + +
+
+ + + +
+
+
+
+ + +AI.Option.Ground.val.ROE.WEAPON_HOLD + +
+
+ + + +
+
+ +

Type AI.Option.Naval

+

Field(s)

+
+
+ + #AI.Option.Naval.id + +AI.Option.Naval.id + +
+
+ + + +
+
+
+
+ + #AI.Option.Naval.val + +AI.Option.Naval.val + +
+
+ + + +
+
+ +

Type AI.Option.Naval.id

+

Field(s)

+
+
+ + +AI.Option.Naval.id.NO_OPTION + +
+
+ + + +
+
+
+
+ + +AI.Option.Naval.id.ROE + +
+
+ + + +
+
+ +

Type AI.Option.Naval.val

+

Field(s)

+
+
+ + #AI.Option.Naval.val.ROE + +AI.Option.Naval.val.ROE + +
+
+ + + +
+
+ +

Type AI.Option.Naval.val.ROE

+

Field(s)

+
+
+ + +AI.Option.Naval.val.ROE.OPEN_FIRE + +
+
+ + + +
+
+
+
+ + +AI.Option.Naval.val.ROE.RETURN_FIRE + +
+
+ + + +
+
+
+
+ + +AI.Option.Naval.val.ROE.WEAPON_HOLD + +
+
+ + + +
+
+ +

Type AI.Skill

+

Field(s)

+
+
+ + +AI.Skill.AVERAGE + +
+
+ + + +
+
+
+
+ + +AI.Skill.CLIENT + +
+
+ + + +
+
+
+
+ + +AI.Skill.EXCELLENT + +
+
+ + + +
+
+
+
+ + +AI.Skill.GOOD + +
+
+ + + +
+
+
+
+ + +AI.Skill.HIGH + +
+
+ + + +
+
+
+
+ + +AI.Skill.PLAYER + +
+
+ + + +
+
+ +

Type AI.Task

+

Field(s)

+
+
+ + #AI.Task.AltitudeType + +AI.Task.AltitudeType + +
+
+ + + +
+
+
+
+ + #AI.Task.Designation + +AI.Task.Designation + +
+
+ + + +
+
+
+
+ + #AI.Task.OrbitPattern + +AI.Task.OrbitPattern + +
+
+ + + +
+
+
+
+ + #AI.Task.TurnMethod + +AI.Task.TurnMethod + +
+
+ + + +
+
+
+
+ + #AI.Task.VehicleFormation + +AI.Task.VehicleFormation + +
+
+ + + +
+
+
+
+ + #AI.Task.WaypointType + +AI.Task.WaypointType + +
+
+ + + +
+
+
+
+ + #AI.Task.WeaponExpend + +AI.Task.WeaponExpend + +
+
+ + + +
+
+ +

Type AI.Task.AltitudeType

+

Field(s)

+
+
+ + +AI.Task.AltitudeType.BARO + +
+
+ + + +
+
+
+
+ + +AI.Task.AltitudeType.RADIO + +
+
+ + + +
+
+ +

Type AI.Task.Designation

+

Field(s)

+
+
+ + +AI.Task.Designation.AUTO + +
+
+ + + +
+
+
+
+ + +AI.Task.Designation.IR_POINTER + +
+
+ + + +
+
+
+
+ + +AI.Task.Designation.LASER + +
+
+ + + +
+
+
+
+ + +AI.Task.Designation.NO + +
+
+ + + +
+
+
+
+ + +AI.Task.Designation.WP + +
+
+ + + +
+
+ +

Type AI.Task.OrbitPattern

+

Field(s)

+
+
+ + +AI.Task.OrbitPattern.CIRCLE + +
+
+ + + +
+
+
+
+ + +AI.Task.OrbitPattern.RACE_TRACK + +
+
+ + + +
+
+ +

Type AI.Task.TurnMethod

+

Field(s)

+
+
+ + +AI.Task.TurnMethod.FIN_POINT + +
+
+ + + +
+
+
+
+ + +AI.Task.TurnMethod.FLY_OVER_POINT + +
+
+ + + +
+
+ +

Type AI.Task.VehicleFormation

+

Field(s)

+
+
+ + +AI.Task.VehicleFormation.CONE + +
+
+ + + +
+
+
+
+ + +AI.Task.VehicleFormation.DIAMOND + +
+
+ + + +
+
+
+
+ + +AI.Task.VehicleFormation.ECHELON_LEFT + +
+
+ + + +
+
+
+
+ + +AI.Task.VehicleFormation.ECHELON_RIGHT + +
+
+ + + +
+
+
+
+ + +AI.Task.VehicleFormation.OFF_ROAD + +
+
+ + + +
+
+
+
+ + +AI.Task.VehicleFormation.ON_ROAD + +
+
+ + + +
+
+
+
+ + +AI.Task.VehicleFormation.RANK + +
+
+ + + +
+
+
+
+ + +AI.Task.VehicleFormation.VEE + +
+
+ + + +
+
+ +

Type AI.Task.WaypointType

+

Field(s)

+
+
+ + +AI.Task.WaypointType.LAND + +
+
+ + + +
+
+
+
+ + +AI.Task.WaypointType.TAKEOFF + +
+
+ + + +
+
+
+
+ + +AI.Task.WaypointType.TAKEOFF_PARKING + +
+
+ + + +
+
+
+
+ + +AI.Task.WaypointType.TURNING_POINT + +
+
+ + + +
+
+ +

Type AI.Task.WeaponExpend

+

Field(s)

+
+
+ + +AI.Task.WeaponExpend.ALL + +
+
+ + + +
+
+
+
+ + +AI.Task.WeaponExpend.FOUR + +
+
+ + + +
+
+
+
+ + +AI.Task.WeaponExpend.HALF + +
+
+ + + +
+
+
+
+ + +AI.Task.WeaponExpend.ONE + +
+
+ + + +
+
+
+
+ + +AI.Task.WeaponExpend.QUARTER + +
+
+ + + +
+
+
+
+ + +AI.Task.WeaponExpend.TWO + +
+
+ + + +
+
+ +

Type Angle

+ +

An angle type

+ + +

Type AttributeName

+ +

AttributeName = string +Each object type may have attributes.

+ + +

Attributes are enlisted in ./Scripts/Database/db_attributes.Lua. +To know what attributes the object type has, look for the unit type script in sub-directories planes/, helicopter/s, vehicles, navy/ of ./Scripts/Database/ directory.

+ + +

Type AttributeNameArray

+ +

List of #AttributeName

+ + +

Type Azimuth

+ +

Azimuth is an angle of rotation around world axis y counter-clockwise.

+ + +

Type Box3

+ +

3-dimensional box.

+ +

Field(s)

+
+
+ + #Vec3 + +Box3.max + +
+
+ + + +
+
+
+
+ + #Vec3 + +Box3.min + +
+
+ + + +
+
+ +

Type Desc

+

Field(s)

+
+
+ + #table + +Desc.attributes + +
+
+ +

object type attributes

+ +
+
+
+
+ + #string + +Desc.displayName + +
+
+ +

localized display name

+ +
+
+
+
+ + #TypeName + +Desc.typeName + +
+
+ +

type name

+ +
+
+ +

Type Distance

+ +

A distance type

+ + +

Type Mass

+ +

Mass is given in kilograms.

+ + +

Type MissionTime

+ +

Mission time is a model time plus time of the mission start.

+ + +

Type ModelTime

+ +

Model time is the time that drives the simulation.

+ + +

Model time may be stopped, accelerated and decelerated relative real time.

+ + +

Type Position3

+ +

Position is a composite structure.

+ + +

It consists of both coordinate vector and orientation matrix. Position3 (also known as "Pos3" for short) is a table that has following format:

+ +

Field(s)

+
+
+ + #Vec3 + +Position3.p + +
+
+ + + +
+
+
+
+ + #Vec3 + +Position3.x + +
+
+ + + +
+
+
+
+ + #Vec3 + +Position3.y + +
+
+ + + +
+
+
+
+ + #Vec3 + +Position3.z + +
+
+ + + +
+
+ +

Type Time

+ +

Time is given in seconds.

+ + +

Type TypeName

+ +

Each object belongs to a type.

+ + +

Object type is a named couple of properties those independent of mission and common for all units of the same type. Name of unit type is a string. Samples of unit type: "Su-27", "KAMAZ" and "M2 Bradley".

+ + +

Type Vec2

+ +

Vec2 is a 2D-vector for the ground plane as a reference plane.

+ +

Field(s)

+
+
+ + #Distance + +Vec2.x + +
+
+ +

Vec2.x = Vec3.x

+ +
+
+
+
+ + #Distance + +Vec2.y + +
+
+ +

Vec2.y = Vec3.z

+ +
+
+ +

Type Vec3

+ +

Vec3 type is a 3D-vector.

+ + +

DCS world has 3-dimensional coordinate system. DCS ground is an infinite plain.

+ +

Field(s)

+
+
+ + #Distance + +Vec3.x + +
+
+ +

is directed to the north

+ +
+
+
+
+ + #Distance + +Vec3.y + +
+
+ +

is directed up

+ +
+
+
+
+ + #Distance + +Vec3.z + +
+
+ +

is directed to the east

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/DCSUnit.html b/docs/Documentation/DCSUnit.html new file mode 100644 index 000000000..d5f785b48 --- /dev/null +++ b/docs/Documentation/DCSUnit.html @@ -0,0 +1,2071 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSUnit

+ + + +

Global(s)

+ + + + + +
Unit + +
+

Type Unit

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Unit.< +

Unit.AmmoItem> Ammo

+
Unit.AmmoItem + +
Unit.Category + +
Unit.Desc + +
Unit.DescAircraft + +
Unit.DescAirplane + +
Unit.DescHelicopter + +
Unit.DescShip + +
Unit.DescVehicle + +
Unit.ID +

Identifier of an unit. It assigned to an unit by the Mission Editor automatically.

+
Unit.IRST + +
Unit.Optic + +
Unit.OpticType + +
Unit.Radar + +
Unit.RadarType + +
Unit.RefuelingSystem + +
Unit.Sensor + +
Unit.SensorType + +
Unit:getAmmo() +

Returns the unit ammunition.

+
Unit.getByName(name) +

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

+
Unit:getCallsign() +

Returns the unit's callsign - the localized string.

+
Unit:getController() +

Returns controller of the unit if it exist and nil otherwise

+
Unit:getDesc() +

Returns unit descriptor.

+
Unit:getFuel() +

Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks.

+
Unit:getGroup() +

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

+
Unit:getID() +

returns the unit's unique identifier.

+
Unit:getLife() +

Returns the unit's health.

+
Unit:getLife0() +

returns the unit's initial health.

+
Unit:getNumber() +

Returns the unit's number in the group.

+
Unit:getPlayerName() +

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

+
Unit:getRadar() +

returns two values: +First value indicates if at least one of the unit's radar(s) is on.

+
Unit:getSensors() +

Returns the unit sensors.

+
Unit:hasSensors(sensorType, ...) +

Returns true if the unit has specified types of sensors.

+
Unit:isActive() +

Returns if the unit is activated.

+
+ +

Type Unit.AmmoItem

+ + + + + + + + + +
Unit.AmmoItem.count +

ammunition count

+
Unit.AmmoItem.desc +

ammunition descriptor

+
+ +

Type Unit.Category

+ + + + + + + + + + + + + + + + + + + + + +
Unit.Category.AIRPLANE + +
Unit.Category.GROUND_UNIT + +
Unit.Category.HELICOPTER + +
Unit.Category.SHIP + +
Unit.Category.STRUCTURE + +
+ +

Type Unit.Desc

+ + + + + + + + + + + + + +
Unit.Desc.category +

Unit Category

+
Unit.Desc.massEmpty +

mass of empty unit

+
Unit.Desc.speedMax +

istance / Time, --maximal velocity

+
+ +

Type Unit.DescAircraft

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Unit.DescAircraft.Hmax +

Ceiling

+
Unit.DescAircraft.NyMax +

maximal safe acceleration

+
Unit.DescAircraft.NyMin +

minimal safe acceleration

+
Unit.DescAircraft.VyMax +

#Distance / #Time, --maximal climb rate

+
Unit.DescAircraft.fuelMassMax +

maximal inner fuel mass

+
Unit.DescAircraft.range +

Operational range

+
Unit.DescAircraft.tankerType +

refueling system type

+
+ +

Type Unit.DescAirplane

+ + + + + + + + + +
Unit.DescAirplane.speedMax0 +

Distance / Time maximal TAS at ground level

+
Unit.DescAirplane.speedMax10K +

Distance / Time maximal TAS at altitude of 10 km

+
+ +

Type Unit.DescHelicopter

+ + + + + +
Unit.DescHelicopter.HmaxStat +

static ceiling

+
+ +

Type Unit.DescVehicle

+ + + + + + + + + +
Unit.DescVehicle.maxSlopeAngle +

maximal slope angle

+
Unit.DescVehicle.riverCrossing +

can the vehicle cross a rivers

+
+ +

Type Unit.Optic

+ + + + + +
Unit.Optic.opticType + +
+ +

Type Unit.OpticType

+ + + + + + + + + + + + + +
Unit.OpticType.IR +

Infra-Red optic sensor

+
Unit.OpticType.LLTV +

Low-level TV-sensor

+
Unit.OpticType.TV +

TV-sensor

+
+ +

Type Unit.Radar

+ + + + + + + + + + + + + +
Unit.Radar.detectionDistanceAir +

detection distance for RCS=1m^2 airborne target, nil if radar doesn't support air search

+
Unit.Radar.detectionDistanceHRM +

detection distance for RCS=1m^2 in high-resolution mapping mode, nil if radar has no HRM

+
Unit.Radar.detectionDistanceRBM +

detection distance for RCS=1m^2 in real-beam mapping mode, nil if radar doesn't support surface/land search

+
+ +

Type Unit.Radar.detectionDistanceAir

+ + + + + + + + + +
Unit.Radar.detectionDistanceAir.lowerHemisphere + +
Unit.Radar.detectionDistanceAir.upperHemisphere + +
+ +

Type Unit.Radar.detectionDistanceAir.lowerHemisphere

+ + + + + + + + + +
Unit.Radar.detectionDistanceAir.lowerHemisphere.headOn + +
Unit.Radar.detectionDistanceAir.lowerHemisphere.tailOn + +
+ +

Type Unit.Radar.detectionDistanceAir.upperHemisphere

+ + + + + + + + + +
Unit.Radar.detectionDistanceAir.upperHemisphere.headOn + +
Unit.Radar.detectionDistanceAir.upperHemisphere.tailOn + +
+ +

Type Unit.RadarType

+ + + + + + + + + +
Unit.RadarType.AS +

air search radar

+
Unit.RadarType.SS +

surface/land search radar

+
+ +

Type Unit.RefuelingSystem

+ + + + + + + + + +
Unit.RefuelingSystem.BOOM_AND_RECEPTACLE + +
Unit.RefuelingSystem.PROBE_AND_DROGUE + +
+ +

Type Unit.Sensor

+ + + + + + + + + +
Unit.Sensor.type + +
Unit.Sensor.typeName + +
+ +

Type Unit.SensorType

+ + + + + + + + + + + + + + + + + +
Unit.SensorType.IRST + +
Unit.SensorType.OPTIC + +
Unit.SensorType.RADAR + +
Unit.SensorType.RWR + +
+ +

Type Wrapper.Unit

+ + + + + + + + + + + + + +
Wrapper.Unit.detectionDistanceAfterburner +

..., engines are in afterburner mode

+
Wrapper.Unit.detectionDistanceIdle +

detection of tail-on target with heat signature = 1 in upper hemisphere, engines are in idle

+
Wrapper.Unit.detectionDistanceMaximal +

..., engines are in maximal mode

+
+ +

Global(s)

+
+
+ + #Unit + +Unit + +
+
+ + + +
+
+

Type DCSUnit

+ +

Type Angle

+ +

Type Controller

+ +

Type Distance

+ +

Type Mass

+ +

Type TypeName

+ +

Type Unit

+

Field(s)

+
+
+ + #list + +Unit.< + +
+
+ +

Unit.AmmoItem> Ammo

+ +
+
+
+
+ + #Unit.AmmoItem + +Unit.AmmoItem + +
+
+ + + +
+
+
+
+ + #Unit.Category + +Unit.Category + +
+
+ + + +
+
+
+
+ + #Unit.Desc + +Unit.Desc + +
+
+ + + +
+
+
+
+ + #Unit.DescAircraft + +Unit.DescAircraft + +
+
+ + + +
+
+
+
+ + #Unit.DescAirplane + +Unit.DescAirplane + +
+
+ + + +
+
+
+
+ + #Unit.DescHelicopter + +Unit.DescHelicopter + +
+
+ + + +
+
+
+
+ + #Unit.DescShip + +Unit.DescShip + +
+
+ + + +
+
+
+
+ + #Unit.DescVehicle + +Unit.DescVehicle + +
+
+ + + +
+
+
+
+ + +Unit.ID + +
+
+ +

Identifier of an unit. It assigned to an unit by the Mission Editor automatically.

+ +
+
+
+
+ + #Unit.IRST + +Unit.IRST + +
+
+ + + +
+
+
+
+ + #Unit.Optic + +Unit.Optic + +
+
+ + + +
+
+
+
+ + #Unit.OpticType + +Unit.OpticType + +
+
+ + + +
+
+
+
+ + #Unit.Radar + +Unit.Radar + +
+
+ + + +
+
+
+
+ + #Unit.RadarType + +Unit.RadarType + +
+
+ + + +
+
+
+
+ + #Unit.RefuelingSystem + +Unit.RefuelingSystem + +
+
+ + + +
+
+
+
+ + #Unit.Sensor + +Unit.Sensor + +
+
+ + + +
+
+
+
+ + #Unit.SensorType + +Unit.SensorType + +
+
+ + + +
+
+
+
+ + +Unit:getAmmo() + +
+
+ +

Returns the unit ammunition.

+ +

Return value

+ +

#Unit.Ammo:

+ + +
+
+
+
+ + +Unit.getByName(name) + +
+
+ +

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. The function provides access to non-activated units too.

+ +

Parameter

+
    +
  • + +

    #string name :

    + +
  • +
+

Return value

+ +

#Unit:

+ + +
+
+
+
+ + +Unit:getCallsign() + +
+
+ +

Returns the unit's callsign - the localized string.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +Unit:getController() + +
+
+ +

Returns controller of the unit if it exist and nil otherwise

+ +

Return value

+ +

#Controller:

+ + +
+
+
+
+ + +Unit:getDesc() + +
+
+ +

Returns unit descriptor.

+ + +

Descriptor type depends on unit category.

+ +

Return value

+ +

#Unit.Desc:

+ + +
+
+
+
+ + +Unit:getFuel() + +
+
+ +

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.

+ +

Return value

+ +

#number:

+ + +
+
+
+
+ + +Unit:getGroup() + +
+
+ +

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

+ +

Return value

+ +

Dcs.DCSWrapper.Group#Group:

+ + +
+
+
+
+ + +Unit:getID() + +
+
+ +

returns the unit's unique identifier.

+ +

Return value

+ +

#Unit.ID:

+ + +
+
+
+
+ + +Unit:getLife() + +
+
+ +

Returns the unit's health.

+ + +

Dead units has health <= 1.0

+ +

Return value

+ +

#number:

+ + +
+
+
+
+ + +Unit:getLife0() + +
+
+ +

returns the unit's initial health.

+ +

Return value

+ +

#number:

+ + +
+
+
+
+ + +Unit:getNumber() + +
+
+ +

Returns the unit's number in the group.

+ + +

The number is the same number the unit has in ME. 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

+ +

#number:

+ + +
+
+
+
+ + +Unit:getPlayerName() + +
+
+ +

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

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +Unit:getRadar() + +
+
+ +

returns two values: +First value indicates if at least one of the unit's radar(s) is on.

+ + +

Second value is the object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.

+ +

Return value

+ +

#boolean, Wrapper.Object#Object:

+ + +
+
+
+
+ + +Unit:getSensors() + +
+
+ +

Returns the unit sensors.

+ +

Return value

+ +

#Unit.Sensors:

+ + +
+
+
+
+ + +Unit:hasSensors(sensorType, ...) + +
+
+ +

Returns true if the unit has specified types of sensors.

+ + +

This function is more preferable than Unit.getSensors() if you don't want to get information about all the unit's sensors, and just want to check if the unit has specified types of sensors.

+ +

Parameters

+
    +
  • + +

    #Unit.SensorType sensorType : +(= nil) Sensor type.

    + +
  • +
  • + +

    ... : +Additional parameters.

    + +
  • +
+

Return value

+ +

#boolean:

+ + +

Usage:

+
If sensorType is Unit.SensorType.OPTIC, additional parameters are optic sensor types. Following example checks if the unit has LLTV or IR optics:
+unit:hasSensors(Unit.SensorType.OPTIC, Unit.OpticType.LLTV, Unit.OpticType.IR)
+If sensorType is Unit.SensorType.RADAR, additional parameters are radar types. Following example checks if the unit has air search radars:
+unit:hasSensors(Unit.SensorType.RADAR, Unit.RadarType.AS)
+If no additional parameters are specified the function returns true if the unit has at least one sensor of specified type.
+If sensor type is not specified the function returns true if the unit has at least one sensor of any type.
+
+ +
+
+
+
+ + +Unit:isActive() + +
+
+ +

Returns if the unit is activated.

+ +

Return value

+ +

#boolean:

+ + +
+
+ +

Type Unit.Ammo

+ +

Type Unit.AmmoItem

+ +

ammunition item: "type-count" pair.

+ +

Field(s)

+
+
+ + #number + +Unit.AmmoItem.count + +
+
+ +

ammunition count

+ +
+
+
+
+ + #Weapon.Desc + +Unit.AmmoItem.desc + +
+
+ +

ammunition descriptor

+ +
+
+ +

Type Unit.Category

+ +

Enum that stores unit categories.

+ +

Field(s)

+
+
+ + +Unit.Category.AIRPLANE + +
+
+ + + +
+
+
+
+ + +Unit.Category.GROUND_UNIT + +
+
+ + + +
+
+
+
+ + +Unit.Category.HELICOPTER + +
+
+ + + +
+
+
+
+ + +Unit.Category.SHIP + +
+
+ + + +
+
+
+
+ + +Unit.Category.STRUCTURE + +
+
+ + + +
+
+ +

Type Unit.Desc

+ +

A unit descriptor.

+ +

Field(s)

+
+
+ + #Unit.Category + +Unit.Desc.category + +
+
+ +

Unit Category

+ +
+
+
+
+ + #Mass + +Unit.Desc.massEmpty + +
+
+ +

mass of empty unit

+ +
+
+
+
+ + #number + +Unit.Desc.speedMax + +
+
+ +

istance / Time, --maximal velocity

+ +
+
+ +

Type Unit.DescAircraft

+ +

An aircraft descriptor.

+ +

Field(s)

+
+
+ + #Distance + +Unit.DescAircraft.Hmax + +
+
+ +

Ceiling

+ +
+
+
+
+ + #number + +Unit.DescAircraft.NyMax + +
+
+ +

maximal safe acceleration

+ +
+
+
+
+ + #number + +Unit.DescAircraft.NyMin + +
+
+ +

minimal safe acceleration

+ +
+
+
+
+ + #number + +Unit.DescAircraft.VyMax + +
+
+ +

#Distance / #Time, --maximal climb rate

+ +
+
+
+
+ + #Mass + +Unit.DescAircraft.fuelMassMax + +
+
+ +

maximal inner fuel mass

+ +
+
+
+
+ + #Distance + +Unit.DescAircraft.range + +
+
+ +

Operational range

+ +
+
+
+
+ + #Unit.RefuelingSystem + +Unit.DescAircraft.tankerType + +
+
+ +

refueling system type

+ +
+
+ +

Type Unit.DescAirplane

+ +

An airplane descriptor.

+ +

Field(s)

+
+
+ + #number + +Unit.DescAirplane.speedMax0 + +
+
+ +

Distance / Time maximal TAS at ground level

+ +
+
+
+
+ + #number + +Unit.DescAirplane.speedMax10K + +
+
+ +

Distance / Time maximal TAS at altitude of 10 km

+ +
+
+ +

Type Unit.DescHelicopter

+ +

A helicopter descriptor.

+ +

Field(s)

+
+
+ + #Distance + +Unit.DescHelicopter.HmaxStat + +
+
+ +

static ceiling

+ +
+
+ +

Type Unit.DescShip

+ +

A ship descriptor.

+ + +

Type Unit.DescVehicle

+ +

A vehicle descriptor.

+ +

Field(s)

+
+
+ + #Angle + +Unit.DescVehicle.maxSlopeAngle + +
+
+ +

maximal slope angle

+ +
+
+
+
+ + #boolean + +Unit.DescVehicle.riverCrossing + +
+
+ +

can the vehicle cross a rivers

+ +
+
+ +

Type Unit.ID

+ +

Type Unit.IRST

+ +

Type Unit.Optic

+ +

An optic sensor.

+ +

Field(s)

+
+
+ + #Unit.OpticType + +Unit.Optic.opticType + +
+
+ + + +
+
+ +

Type Unit.OpticType

+ +

Enum that stores types of optic sensors.

+ +

Field(s)

+
+
+ + +Unit.OpticType.IR + +
+
+ +

Infra-Red optic sensor

+ +
+
+
+
+ + +Unit.OpticType.LLTV + +
+
+ +

Low-level TV-sensor

+ +
+
+
+
+ + +Unit.OpticType.TV + +
+
+ +

TV-sensor

+ +
+
+ +

Type Unit.RWR

+ +

An RWR.

+ + +

Type Unit.Radar

+ +

A radar.

+ +

Field(s)

+
+
+ + #Unit.Radar.detectionDistanceAir + +Unit.Radar.detectionDistanceAir + +
+
+ +

detection distance for RCS=1m^2 airborne target, nil if radar doesn't support air search

+ +
+
+
+
+ + #Distance + +Unit.Radar.detectionDistanceHRM + +
+
+ +

detection distance for RCS=1m^2 in high-resolution mapping mode, nil if radar has no HRM

+ +
+
+
+
+ + #Distance + +Unit.Radar.detectionDistanceRBM + +
+
+ +

detection distance for RCS=1m^2 in real-beam mapping mode, nil if radar doesn't support surface/land search

+ +
+
+ +

Type Unit.Radar.detectionDistanceAir

+

Field(s)

+
+
+ + #Unit.Radar.detectionDistanceAir.lowerHemisphere + +Unit.Radar.detectionDistanceAir.lowerHemisphere + +
+
+ + + +
+
+
+
+ + #Unit.Radar.detectionDistanceAir.upperHemisphere + +Unit.Radar.detectionDistanceAir.upperHemisphere + +
+
+ + + +
+
+ +

Type Unit.Radar.detectionDistanceAir.lowerHemisphere

+

Field(s)

+
+
+ + #Distance + +Unit.Radar.detectionDistanceAir.lowerHemisphere.headOn + +
+
+ + + +
+
+
+
+ + #Distance + +Unit.Radar.detectionDistanceAir.lowerHemisphere.tailOn + +
+
+ + + +
+
+ +

Type Unit.Radar.detectionDistanceAir.upperHemisphere

+

Field(s)

+
+
+ + #Distance + +Unit.Radar.detectionDistanceAir.upperHemisphere.headOn + +
+
+ + + +
+
+
+
+ + #Distance + +Unit.Radar.detectionDistanceAir.upperHemisphere.tailOn + +
+
+ + + +
+
+ +

Type Unit.RadarType

+ +

Enum that stores radar types.

+ +

Field(s)

+
+
+ + +Unit.RadarType.AS + +
+
+ +

air search radar

+ +
+
+
+
+ + +Unit.RadarType.SS + +
+
+ +

surface/land search radar

+ +
+
+ +

Type Unit.RefuelingSystem

+ +

Enum that stores aircraft refueling system types.

+ +

Field(s)

+
+
+ + +Unit.RefuelingSystem.BOOM_AND_RECEPTACLE + +
+
+ + + +
+
+
+
+ + +Unit.RefuelingSystem.PROBE_AND_DROGUE + +
+
+ + + +
+
+ +

Type Unit.Sensor

+ +

A unit sensor.

+ +

Field(s)

+
+
+ + #Unit.SensorType + +Unit.Sensor.type + +
+
+ + + +
+
+
+
+ + #TypeName + +Unit.Sensor.typeName + +
+
+ + + +
+
+ +

Type Unit.SensorType

+ +

Enum that stores sensor types.

+ +

Field(s)

+
+
+ + +Unit.SensorType.IRST + +
+
+ + + +
+
+
+
+ + +Unit.SensorType.OPTIC + +
+
+ + + +
+
+
+
+ + +Unit.SensorType.RADAR + +
+
+ + + +
+
+
+
+ + +Unit.SensorType.RWR + +
+
+ + + +
+
+ +

Type Unit.Sensors

+ +

Type Weapon.Desc

+ +

Type Wrapper.Unit

+ +

An IRST.

+ +

Field(s)

+
+
+ + #Distance + +Wrapper.Unit.detectionDistanceAfterburner + +
+
+ +

..., engines are in afterburner mode

+ +
+
+
+
+ + #Distance + +Wrapper.Unit.detectionDistanceIdle + +
+
+ +

detection of tail-on target with heat signature = 1 in upper hemisphere, engines are in idle

+ +
+
+
+
+ + #Distance + +Wrapper.Unit.detectionDistanceMaximal + +
+
+ +

..., engines are in maximal mode

+ +
+
+ +

Type list

+ +
+ +
+ + diff --git a/docs/Documentation/DCSWorld.html b/docs/Documentation/DCSWorld.html new file mode 100644 index 000000000..204ed66c2 --- /dev/null +++ b/docs/Documentation/DCSWorld.html @@ -0,0 +1,628 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCSWorld

+ + + +

Global(s)

+ + + + + +
world + +
+

Type world

+ + + + + +
world.event + +
+ +

Type world.event

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
world.event.S_EVENT_BASE_CAPTURED + +
world.event.S_EVENT_BIRTH + +
world.event.S_EVENT_CRASH + +
world.event.S_EVENT_DEAD + +
world.event.S_EVENT_EJECTION + +
world.event.S_EVENT_ENGINE_SHUTDOWN + +
world.event.S_EVENT_ENGINE_STARTUP + +
world.event.S_EVENT_HIT + +
world.event.S_EVENT_HUMAN_FAILURE + +
world.event.S_EVENT_INVALID + +
world.event.S_EVENT_LAND + +
world.event.S_EVENT_MAX + +
world.event.S_EVENT_MISSION_END + +
world.event.S_EVENT_MISSION_START + +
world.event.S_EVENT_PILOT_DEAD + +
world.event.S_EVENT_PLAYER_COMMENT + +
world.event.S_EVENT_PLAYER_ENTER_UNIT + +
world.event.S_EVENT_PLAYER_LEAVE_UNIT + +
world.event.S_EVENT_REFUELING + +
world.event.S_EVENT_REFUELING_STOP + +
world.event.S_EVENT_SHOOTING_END + +
world.event.S_EVENT_SHOOTING_START + +
world.event.S_EVENT_SHOT + +
world.event.S_EVENT_TAKEOFF + +
world.event.S_EVENT_TOOK_CONTROL + +
+ +

Global(s)

+
+
+ + #world + +world + +
+
+ + + +
+
+

Type DCSWorld

+ +

Type world

+

Field(s)

+
+
+ + #world.event + +world.event + +
+
+ + + +
+
+ +

Type world.event

+

Field(s)

+
+
+ + +world.event.S_EVENT_BASE_CAPTURED + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_BIRTH + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_CRASH + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_DEAD + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_EJECTION + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_ENGINE_SHUTDOWN + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_ENGINE_STARTUP + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_HIT + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_HUMAN_FAILURE + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_INVALID + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_LAND + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_MAX + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_MISSION_END + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_MISSION_START + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_PILOT_DEAD + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_PLAYER_COMMENT + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_PLAYER_ENTER_UNIT + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_PLAYER_LEAVE_UNIT + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_REFUELING + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_REFUELING_STOP + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_SHOOTING_END + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_SHOOTING_START + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_SHOT + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_TAKEOFF + +
+
+ + + +
+
+
+
+ + +world.event.S_EVENT_TOOK_CONTROL + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/DCScountry.html b/docs/Documentation/DCScountry.html new file mode 100644 index 000000000..671fb9887 --- /dev/null +++ b/docs/Documentation/DCScountry.html @@ -0,0 +1,514 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCScountry

+ + + +

Global(s)

+ + + + + +
country + +
+

Type country

+ + + + + +
country.id + +
+ +

Type country.id

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
country.id.ABKHAZIA + +
country.id.BELGIUM + +
country.id.CANADA + +
country.id.DENMARK + +
country.id.FRANCE + +
country.id.GEORGIA + +
country.id.GERMANY + +
country.id.INSURGENTS + +
country.id.ISRAEL + +
country.id.ITALY + +
country.id.NORWAY + +
country.id.RUSSIA + +
country.id.SOUTH_OSETIA + +
country.id.SPAIN + +
country.id.THE_NETHERLANDS + +
country.id.TURKEY + +
country.id.UK + +
country.id.UKRAINE + +
country.id.USA + +
+ +

Global(s)

+
+
+ + #country + +country + +
+
+ + + +
+
+

Type DCScountry

+ +

Type country

+

Field(s)

+
+
+ + #country.id + +country.id + +
+
+ + + +
+
+ +

Type country.id

+

Field(s)

+
+
+ + +country.id.ABKHAZIA + +
+
+ + + +
+
+
+
+ + +country.id.BELGIUM + +
+
+ + + +
+
+
+
+ + +country.id.CANADA + +
+
+ + + +
+
+
+
+ + +country.id.DENMARK + +
+
+ + + +
+
+
+
+ + +country.id.FRANCE + +
+
+ + + +
+
+
+
+ + +country.id.GEORGIA + +
+
+ + + +
+
+
+
+ + +country.id.GERMANY + +
+
+ + + +
+
+
+
+ + +country.id.INSURGENTS + +
+
+ + + +
+
+
+
+ + +country.id.ISRAEL + +
+
+ + + +
+
+
+
+ + +country.id.ITALY + +
+
+ + + +
+
+
+
+ + +country.id.NORWAY + +
+
+ + + +
+
+
+
+ + +country.id.RUSSIA + +
+
+ + + +
+
+
+
+ + +country.id.SOUTH_OSETIA + +
+
+ + + +
+
+
+
+ + +country.id.SPAIN + +
+
+ + + +
+
+
+
+ + +country.id.THE_NETHERLANDS + +
+
+ + + +
+
+
+
+ + +country.id.TURKEY + +
+
+ + + +
+
+
+
+ + +country.id.UK + +
+
+ + + +
+
+
+
+ + +country.id.UKRAINE + +
+
+ + + +
+
+
+
+ + +country.id.USA + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/DCStimer.html b/docs/Documentation/DCStimer.html new file mode 100644 index 000000000..2c30988a4 --- /dev/null +++ b/docs/Documentation/DCStimer.html @@ -0,0 +1,320 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module DCStimer

+ + + +

Global(s)

+ + + + + +
timer + +
+

Type timer

+ + + + + + + + + + + + + + + + + + + + + + + + + +
timer.getAbsTime() +

Returns mission time in seconds.

+
timer.getTime() +

Returns model time in seconds.

+
timer.getTime0() +

Returns mission start time in seconds.

+
timer.removeFunction(functionId) +

Removes the function from schedule.

+
timer.scheduleFunction(functionToCall, functionArgument, time) +

Schedules function to call at desired model time.

+
timer.setFunctionTime(functionId, time) +

Re-schedules function to call at another model time.

+
+ +

Global(s)

+
+
+ + #timer + +timer + +
+
+ + + +
+
+

Type DCStimer

+ +

Type FunctionToCall

+ +

Type Time

+ +

Type timer

+

Field(s)

+
+
+ + +timer.getAbsTime() + +
+
+ +

Returns mission time in seconds.

+ +

Return value

+ +

#Time:

+ + +
+
+
+
+ + +timer.getTime() + +
+
+ +

Returns model time in seconds.

+ +

Return value

+ +

#Time: +

+ +
+
+
+
+ + +timer.getTime0() + +
+
+ +

Returns mission start time in seconds.

+ +

Return value

+ +

#Time:

+ + +
+
+
+
+ + +timer.removeFunction(functionId) + +
+
+ +

Removes the function from schedule.

+ +

Parameter

+
    +
  • + +

    functionId : +Function identifier to remove from schedule

    + +
  • +
+
+
+
+
+ + +timer.scheduleFunction(functionToCall, functionArgument, time) + +
+
+ +

Schedules function to call at desired model time.

+ + +

Time function FunctionToCall(any argument, Time time)

+ +

...

+ +

return ...

+ +

end

+ +

Must return model time of next call or nil. Note that the DCS scheduler calls the function in protected mode and any Lua errors in the called function will be trapped and not reported. If the function triggers a Lua error then it will be terminated and not scheduled to run again.

+ +

Parameters

+
    +
  • + +

    #FunctionToCall functionToCall : +Lua-function to call. Must have prototype of FunctionToCall.

    + +
  • +
  • + +

    functionArgument : +Function argument of any type to pass to functionToCall.

    + +
  • +
  • + +

    #Time time : +Model time of the function call.

    + +
  • +
+

Return value

+ + +

functionId

+ +
+
+
+
+ + +timer.setFunctionTime(functionId, time) + +
+
+ +

Re-schedules function to call at another model time.

+ +

Parameters

+
    +
  • + +

    functionId : +Lua-function to call. Must have prototype of FunctionToCall.

    + +
  • +
  • + +

    #Time time : +Model time of the function call.

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/DCStrigger.html b/docs/Documentation/DCStrigger.html new file mode 100644 index 000000000..a6617cd23 --- /dev/null +++ b/docs/Documentation/DCStrigger.html @@ -0,0 +1,121 @@ + + + + + + +
+
+ +
+
+
+ + + diff --git a/docs/Documentation/Database.html b/docs/Documentation/Database.html new file mode 100644 index 000000000..79b6817d5 --- /dev/null +++ b/docs/Documentation/Database.html @@ -0,0 +1,1669 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Database

+ +

This module contains the DATABASE class, managing the database of mission objects.

+ + + +
+ +

1) Core.Database#DATABASE class, extends Core.Base#BASE

+

Mission designers can use the DATABASE class to refer to:

+ +
    +
  • UNITS
  • +
  • GROUPS
  • +
  • CLIENTS
  • +
  • AIRPORTS
  • +
  • PLAYERSJOINED
  • +
  • PLAYERS
  • +
+ +

On top, for internal MOOSE administration purposes, the DATBASE administers the Unit and Group TEMPLATES as defined within the Mission Editor.

+ +

Moose will automatically create one instance of the DATABASE class into the global object _DATABASE. +Moose refers to _DATABASE within the framework extensively, but you can also refer to the _DATABASE object within your missions if required.

+ +

1.1) DATABASE iterators

+

You can iterate the database with the available iterator methods. +The iterator methods will walk the DATABASE set, and call for each element within the set a function that you provide. +The following iterator methods are currently available within the DATABASE:

+ + + +
+ + +

Global(s)

+ + + + + +
DATABASE + +
+

Type DATABASE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DATABASE.AIRBASES + +
DATABASE:AddAirbase(DCSAirbaseName) +

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

+
DATABASE:AddClient(ClientName) +

Adds a CLIENT based on the ClientName in the DATABASE.

+
DATABASE:AddGroup(GroupName) +

Adds a GROUP based on the GroupName in the DATABASE.

+
DATABASE:AddPlayer(UnitName, PlayerName) +

Adds a player based on the Player Name in the DATABASE.

+
DATABASE:AddStatic(DCSStaticName) +

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

+
DATABASE:AddUnit(DCSUnitName) +

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

+
DATABASE.CLIENTS + +
DATABASE.ClassName + +
DATABASE:DeleteAirbase(DCSAirbaseName) +

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

+
DATABASE:DeletePlayer(PlayerName) +

Deletes a player from the DATABASE based on the Player Name.

+
DATABASE:DeleteStatic(DCSStaticName) +

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

+
DATABASE:DeleteUnit(DCSUnitName) +

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

+
DATABASE:FindAirbase(AirbaseName) +

Finds a AIRBASE based on the AirbaseName.

+
DATABASE:FindClient(ClientName) +

Finds a CLIENT based on the ClientName.

+
DATABASE:FindGroup(GroupName) +

Finds a GROUP based on the GroupName.

+
DATABASE:FindStatic(StaticName) +

Finds a STATIC based on the StaticName.

+
DATABASE:FindUnit(UnitName) +

Finds a Unit based on the Unit Name.

+
DATABASE:ForEach(IteratorFunction, FinalizeFunction, arg, Set) +

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

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

Iterate the DATABASE and call an iterator function for each CLIENT, providing the CLIENT to the function and optional parameters.

+
DATABASE:ForEachGroup(IteratorFunction, ...) +

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

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

Iterate the DATABASE and call an iterator function for each ALIVE player, providing the player name and optional parameters.

+
DATABASE:ForEachPlayerJoined(IteratorFunction, ...) +

Iterate the DATABASE and call an iterator function for each player who has joined the mission, providing the Unit of the player and optional parameters.

+
DATABASE:ForEachUnit(IteratorFunction, FinalizeFunction, ...) +

Iterate the DATABASE and call an iterator function for each alive UNIT, providing the UNIT and optional parameters.

+
DATABASE.GROUPS + +
DATABASE:GetCategoryFromAirbase(AirbaseName) + +
DATABASE:GetCategoryFromClientTemplate(ClientName) + +
DATABASE:GetCoalitionFromAirbase(AirbaseName) + +
DATABASE:GetCoalitionFromClientTemplate(ClientName) + +
DATABASE:GetCountryFromClientTemplate(ClientName) + +
DATABASE:GetGroupNameFromUnitName(UnitName) + +
DATABASE:GetGroupTemplate(GroupName) + +
DATABASE:GetGroupTemplateFromUnitName(UnitName) + +
DATABASE:GetStatusGroup(GroupName) +

Get a status to a Group within the Database, this to check crossing events for example.

+
DATABASE.NavPoints + +
DATABASE:New() +

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

+
DATABASE.PLAYERS + +
DATABASE.PLAYERSJOINED + +
DATABASE.STATICS + +
DATABASE:SetStatusGroup(GroupName, Status) +

Set a status to a Group within the Database, this to check crossing events for example.

+
DATABASE:Spawn(SpawnTemplate) +

Instantiate new Groups within the DCSRTE.

+
DATABASE.Templates + +
DATABASE.UNITS + +
DATABASE:_EventOnBirth(Event) +

Handles the OnBirth event for the alive units set.

+
DATABASE:_EventOnDeadOrCrash(Event) +

Handles the OnDead or OnCrash event for alive units set.

+
DATABASE:_EventOnPlayerEnterUnit(Event) +

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

+
DATABASE:_EventOnPlayerLeaveUnit(Event) +

Handles the OnPlayerLeaveUnit event to clean the active players table.

+
DATABASE:_RegisterAirbases() + +
DATABASE:_RegisterClients() +

Private method that registers all Units of skill Client or Player within in the mission.

+
DATABASE:_RegisterGroupsAndUnits() +

Private method that registers all Groups and Units within in the mission.

+
DATABASE:_RegisterPlayers() +

Private method that registers all alive players in the mission.

+
DATABASE:_RegisterStatics() + +
DATABASE:_RegisterTemplate(GroupTemplate, CoalitionID, CategoryID, CountryID) +

Private method that registers new Group Templates within the DATABASE Object.

+
DATABASE:_RegisterTemplates() + +
+ +

Global(s)

+
+
+ + #DATABASE + +DATABASE + +
+
+ + + +
+
+

Type Database

+ +

Type DATABASE

+ +

DATABASE class

+ +

Field(s)

+
+
+ + + +DATABASE.AIRBASES + +
+
+ + + +
+
+
+
+ + +DATABASE:AddAirbase(DCSAirbaseName) + +
+
+ +

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

+ +

Parameter

+
    +
  • + +

    DCSAirbaseName :

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

Adds a CLIENT based on the ClientName in the DATABASE.

+ +

Parameter

+
    +
  • + +

    ClientName :

    + +
  • +
+
+
+
+
+ + +DATABASE:AddGroup(GroupName) + +
+
+ +

Adds a GROUP based on the GroupName in the DATABASE.

+ +

Parameter

+
    +
  • + +

    GroupName :

    + +
  • +
+
+
+
+
+ + +DATABASE:AddPlayer(UnitName, PlayerName) + +
+
+ +

Adds a player based on the Player Name in the DATABASE.

+ +

Parameters

+
    +
  • + +

    UnitName :

    + +
  • +
  • + +

    PlayerName :

    + +
  • +
+
+
+
+
+ + +DATABASE:AddStatic(DCSStaticName) + +
+
+ +

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

+ +

Parameter

+
    +
  • + +

    DCSStaticName :

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

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

+ +

Parameter

+
    +
  • + +

    DCSUnitName :

    + +
  • +
+
+
+
+
+ + + +DATABASE.CLIENTS + +
+
+ + + +
+
+
+
+ + #string + +DATABASE.ClassName + +
+
+ + + +
+
+
+
+ + +DATABASE:DeleteAirbase(DCSAirbaseName) + +
+
+ +

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

+ +

Parameter

+
    +
  • + +

    DCSAirbaseName :

    + +
  • +
+
+
+
+
+ + +DATABASE:DeletePlayer(PlayerName) + +
+
+ +

Deletes a player from the DATABASE based on the Player Name.

+ +

Parameter

+
    +
  • + +

    PlayerName :

    + +
  • +
+
+
+
+
+ + +DATABASE:DeleteStatic(DCSStaticName) + +
+
+ +

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

+ +

Parameter

+
    +
  • + +

    DCSStaticName :

    + +
  • +
+
+
+
+
+ + +DATABASE:DeleteUnit(DCSUnitName) + +
+
+ +

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

+ +

Parameter

+
    +
  • + +

    DCSUnitName :

    + +
  • +
+
+
+
+
+ + +DATABASE:FindAirbase(AirbaseName) + +
+
+ +

Finds a AIRBASE based on the AirbaseName.

+ +

Parameter

+
    +
  • + +

    #string AirbaseName :

    + +
  • +
+

Return value

+ +

Wrapper.Airbase#AIRBASE: +The found AIRBASE.

+ +
+
+
+
+ + +DATABASE:FindClient(ClientName) + +
+
+ +

Finds a CLIENT based on the ClientName.

+ +

Parameter

+
    +
  • + +

    #string ClientName :

    + +
  • +
+

Return value

+ +

Wrapper.Client#CLIENT: +The found CLIENT.

+ +
+
+
+
+ + +DATABASE:FindGroup(GroupName) + +
+
+ +

Finds a GROUP based on the GroupName.

+ +

Parameter

+
    +
  • + +

    #string GroupName :

    + +
  • +
+

Return value

+ +

Wrapper.Group#GROUP: +The found GROUP.

+ +
+
+
+
+ + +DATABASE:FindStatic(StaticName) + +
+
+ +

Finds a STATIC based on the StaticName.

+ +

Parameter

+
    +
  • + +

    #string StaticName :

    + +
  • +
+

Return value

+ +

Wrapper.Static#STATIC: +The found STATIC.

+ +
+
+
+
+ + +DATABASE:FindUnit(UnitName) + +
+
+ +

Finds a Unit based on the Unit Name.

+ +

Parameter

+
    +
  • + +

    #string UnitName :

    + +
  • +
+

Return value

+ +

Wrapper.Unit#UNIT: +The found Unit.

+ +
+
+
+
+ + +DATABASE:ForEach(IteratorFunction, FinalizeFunction, arg, Set) + +
+
+ +

Iterate the DATABASE and call an iterator 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 database.

    + +
  • +
  • + +

    FinalizeFunction :

    + +
  • +
  • + +

    arg :

    + +
  • +
  • + +

    Set :

    + +
  • +
+

Return value

+ +

#DATABASE: +self

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

Iterate the DATABASE and call an iterator 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 database. The function needs to accept a CLIENT parameter.

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + +DATABASE:ForEachGroup(IteratorFunction, ...) + +
+
+ +

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

+ +

Parameters

+
    +
  • + +

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

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#DATABASE: +self

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

Iterate the DATABASE and call an iterator function for each ALIVE player, providing the player name and optional parameters.

+ +

Parameters

+
    +
  • + +

    #function IteratorFunction : +The function that will be called when there is an player in the database. The function needs to accept the player name.

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + +DATABASE:ForEachPlayerJoined(IteratorFunction, ...) + +
+
+ +

Iterate the DATABASE and call an iterator function for each player who has joined the mission, providing the Unit of the player and optional parameters.

+ +

Parameters

+
    +
  • + +

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

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + +DATABASE:ForEachUnit(IteratorFunction, FinalizeFunction, ...) + +
+
+ +

Iterate the DATABASE and call an iterator 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 database. The function needs to accept a UNIT parameter.

    + +
  • +
  • + +

    FinalizeFunction :

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + + +DATABASE.GROUPS + +
+
+ + + +
+
+
+
+ + +DATABASE:GetCategoryFromAirbase(AirbaseName) + +
+
+ + + +

Parameter

+
    +
  • + +

    AirbaseName :

    + +
  • +
+
+
+
+
+ + +DATABASE:GetCategoryFromClientTemplate(ClientName) + +
+
+ + + +

Parameter

+
    +
  • + +

    ClientName :

    + +
  • +
+
+
+
+
+ + +DATABASE:GetCoalitionFromAirbase(AirbaseName) + +
+
+ + + +

Parameter

+
    +
  • + +

    AirbaseName :

    + +
  • +
+
+
+
+
+ + +DATABASE:GetCoalitionFromClientTemplate(ClientName) + +
+
+ + + +

Parameter

+
    +
  • + +

    ClientName :

    + +
  • +
+
+
+
+
+ + +DATABASE:GetCountryFromClientTemplate(ClientName) + +
+
+ + + +

Parameter

+
    +
  • + +

    ClientName :

    + +
  • +
+
+
+
+
+ + +DATABASE:GetGroupNameFromUnitName(UnitName) + +
+
+ + + +

Parameter

+
    +
  • + +

    UnitName :

    + +
  • +
+
+
+
+
+ + +DATABASE:GetGroupTemplate(GroupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    GroupName :

    + +
  • +
+
+
+
+
+ + +DATABASE:GetGroupTemplateFromUnitName(UnitName) + +
+
+ + + +

Parameter

+
    +
  • + +

    UnitName :

    + +
  • +
+
+
+
+
+ + +DATABASE:GetStatusGroup(GroupName) + +
+
+ +

Get a status to a Group within the Database, this to check crossing events for example.

+ +

Parameter

+
    +
  • + +

    GroupName :

    + +
  • +
+
+
+
+
+ + + +DATABASE.NavPoints + +
+
+ + + +
+
+
+
+ + +DATABASE:New() + +
+
+ +

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

+ +

Return value

+ +

#DATABASE:

+ + +

Usage:

+
-- Define a new DATABASE Object. This DBObject will contain a reference to all Group and Unit Templates defined within the ME and the DCSRTE.
+DBObject = DATABASE:New()
+ +
+
+
+
+ + + +DATABASE.PLAYERS + +
+
+ + + +
+
+
+
+ + + +DATABASE.PLAYERSJOINED + +
+
+ + + +
+
+
+
+ + + +DATABASE.STATICS + +
+
+ + + +
+
+
+
+ + +DATABASE:SetStatusGroup(GroupName, Status) + +
+
+ +

Set a status to a Group within the Database, this to check crossing events for example.

+ +

Parameters

+
    +
  • + +

    GroupName :

    + +
  • +
  • + +

    Status :

    + +
  • +
+
+
+
+
+ + +DATABASE:Spawn(SpawnTemplate) + +
+
+ +

Instantiate new Groups within the DCSRTE.

+ + +

This method expects EXACTLY the same structure as a structure within the ME, and needs 2 additional fields defined: +SpawnCountryID, SpawnCategoryID +This method is used by the SPAWN class.

+ +

Parameter

+
    +
  • + +

    #table SpawnTemplate :

    + +
  • +
+

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + + +DATABASE.Templates + +
+
+ + + +
+
+
+
+ + + +DATABASE.UNITS + +
+
+ + + +
+
+
+
+ + +DATABASE:_EventOnBirth(Event) + +
+
+ +

Handles the OnBirth event for the alive units set.

+ +

Parameter

+ +
+
+
+
+ + +DATABASE:_EventOnDeadOrCrash(Event) + +
+
+ +

Handles the OnDead or OnCrash event for alive units set.

+ +

Parameter

+ +
+
+
+
+ + +DATABASE:_EventOnPlayerEnterUnit(Event) + +
+
+ +

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

+ +

Parameter

+ +
+
+
+
+ + +DATABASE:_EventOnPlayerLeaveUnit(Event) + +
+
+ +

Handles the OnPlayerLeaveUnit event to clean the active players table.

+ +

Parameter

+ +
+
+
+
+ + +DATABASE:_RegisterAirbases() + +
+
+ + + +
+
+
+
+ + +DATABASE:_RegisterClients() + +
+
+ +

Private method that registers all Units of skill Client or Player within in the mission.

+ +

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + +DATABASE:_RegisterGroupsAndUnits() + +
+
+ +

Private method that registers all Groups and Units within in the mission.

+ +

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + +DATABASE:_RegisterPlayers() + +
+
+ +

Private method that registers all alive players in the mission.

+ +

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + +DATABASE:_RegisterStatics() + +
+
+ + + +
+
+
+
+ + +DATABASE:_RegisterTemplate(GroupTemplate, CoalitionID, CategoryID, CountryID) + +
+
+ +

Private method that registers new Group Templates within the DATABASE Object.

+ +

Parameters

+
    +
  • + +

    #table GroupTemplate :

    + +
  • +
  • + +

    CoalitionID :

    + +
  • +
  • + +

    CategoryID :

    + +
  • +
  • + +

    CountryID :

    + +
  • +
+

Return value

+ +

#DATABASE: +self

+ +
+
+
+
+ + +DATABASE:_RegisterTemplates() + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Detection.html b/docs/Documentation/Detection.html new file mode 100644 index 000000000..e3bdab022 --- /dev/null +++ b/docs/Documentation/Detection.html @@ -0,0 +1,2175 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Detection

+ +

This module contains the DETECTION classes.

+ + +

+ +

1) Functional.Detection#DETECTION_BASE class, extends Core.Base#BASE

+

The Functional.Detection#DETECTION_BASE class defines the core functions to administer detected objects. + The Functional.Detection#DETECTION_BASE class will detect objects within the battle zone for a list of Groups detecting targets following (a) detection method(s).

+ +

1.1) DETECTION_BASE constructor

+

Construct a new DETECTION_BASE instance using the Functional.Detection#DETECTION_BASE.New() method.

+ +

1.2) DETECTION_BASE initialization

+

By default, detection will return detected objects with all the detection sensors available. + However, you can ask how the objects were found with specific detection methods. + If you use one of the below methods, the detection will work with the detection method specified. + You can specify to apply multiple detection methods.

+ +

Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:

+ + + +

1.3) Obtain objects detected by DETECTION_BASE

+

DETECTION_BASE builds Sets of objects detected. These Core.Set#SET_BASEs can be retrieved using the method Functional.Detection#DETECTION_BASE.GetDetectedSets(). + The method will return a list (table) of Core.Set#SET_BASE objects.

+ +
+ +

2) Functional.Detection#DETECTION_AREAS class, extends Functional.Detection#DETECTION_BASE

+

The Functional.Detection#DETECTION_AREAS class will detect units within the battle zone for a list of Groups detecting targets following (a) detection method(s), + and will build a list (table) of Core.Set#SET_UNITs containing the Wrapper.Unit#UNITs detected. + The class is group the detected units within zones given a DetectedZoneRange parameter. + A set with multiple detected zones will be created as there are groups of units detected.

+ +

2.1) Retrieve the Detected Unit sets and Detected Zones

+

The DetectedUnitSets methods are implemented in Functional.Detection#DECTECTION_BASE and the DetectedZones methods is implemented in Functional.Detection#DETECTION_AREAS.

+ +

Retrieve the DetectedUnitSets with the method Functional.Detection#DETECTION_BASE.GetDetectedSets(). A table will be return of Core.Set#SET_UNITs. + To understand the amount of sets created, use the method Functional.Detection#DETECTION_BASE.GetDetectedSetCount(). + If you want to obtain a specific set from the DetectedSets, use the method Functional.Detection#DETECTION_BASE.GetDetectedSet() with a given index.

+ +

Retrieve the formed Zones as a result of the grouping the detected units within the DetectionZoneRange, use the method Functional.Detection#DETECTION_BASE.GetDetectionZones(). + To understand the amount of zones created, use the method Functional.Detection#DETECTION_BASE.GetDetectionZoneCount(). + If you want to obtain a specific zone from the DetectedZones, use the method Functional.Detection#DETECTION_BASE.GetDetectionZone() with a given index.

+ +

1.4) Flare or Smoke detected units

+

Use the methods Functional.Detection#DETECTION_AREAS.FlareDetectedUnits() or Functional.Detection#DETECTION_AREAS.SmokeDetectedUnits() to flare or smoke the detected units when a new detection has taken place.

+ +

1.5) Flare or Smoke detected zones

+

Use the methods Functional.Detection#DETECTION_AREAS.FlareDetectedZones() or Functional.Detection#DETECTION_AREAS.SmokeDetectedZones() to flare or smoke the detected zones when a new detection has taken place.

+ +
+ +

### Contributions:

+ +
    +
  • Mechanist : Concept & Testing
  • +
+ +

### Authors:

+ +
    +
  • FlightControl : Design & Programming +
  • +
+ +

Global(s)

+ + + + + + + + + +
DETECTION_AREAS + +
DETECTION_BASE + +
+

Type DETECTION_AREAS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DETECTION_AREAS:AcceptChanges(DetectedArea) +

Accepts changes from the detected zone.

+
DETECTION_AREAS:AddChangeArea(DetectedArea, ChangeCode, AreaUnitType) +

Add a change to the detected zone.

+
DETECTION_AREAS:AddChangeUnit(DetectedArea, ChangeCode, ChangeUnitType) +

Add a change to the detected zone.

+
DETECTION_AREAS.AddDetectedArea(Set, Zone, self) +

Add a detected DETECTION_AREAS.DetectedArea.

+
DETECTION_AREAS:CalculateThreatLevelA2G(DetectedArea) +

Calculate the maxium A2G threat level of the DetectedArea.

+
DETECTION_AREAS.ClassName + +
DETECTION_AREAS:CreateDetectionSets() +

Make a DetectionSet table.

+
DETECTION_AREAS.DetectedAreas +

A list of areas containing the set of Units, Zones, the center Unit within the zone, and ID of each area that was detected within a DetectionZoneRange.

+
DETECTION_AREAS.DetectionZoneRange +

The range till which targets are grouped upon the first detected target.

+
DETECTION_AREAS:FlareDetectedUnits() +

Flare the detected units

+
DETECTION_AREAS:FlareDetectedZones() +

Flare the detected zones

+
DETECTION_AREAS:GetChangeText(DetectedArea) +

Make text documenting the changes of the detected zone.

+
DETECTION_AREAS:GetDetectedAreaCount() +

Get the amount of DETECTION_AREAS.DetectedAreas.

+
DETECTION_AREAS:GetDetectedAreas() +

Get the detected DETECTION_AREAS.DetectedAreas.

+
DETECTION_AREAS:GetDetectedSet(Index) +

Get the Core.Set#SET_UNIT of a detecttion area using a given numeric index.

+
DETECTION_AREAS:GetDetectedZone(Index) +

Get the Core.Zone#ZONE_UNIT of a detection area using a given numeric index.

+
DETECTION_AREAS:GetTreatLevelA2G(DetectedArea) +

Returns the A2G threat level of the units in the DetectedArea

+
DETECTION_AREAS:IsFriendliesNearBy(DetectedArea) +

Returns if there are friendlies nearby the FAC units ...

+
DETECTION_AREAS:NearestFAC(DetectedArea) +

Find the nearest FAC of the DetectedArea.

+
DETECTION_AREAS:New(DetectionSetGroup, DetectionRange, DetectionZoneRange) +

DETECTION_AREAS constructor.

+
DETECTION_AREAS:RemoveDetectedArea(Index) +

Remove a detected DETECTION_AREAS.DetectedArea with a given Index.

+
DETECTION_AREAS:ReportFriendliesNearBy(ReportUnit, ReportGroupData) +

Background worker function to determine if there are friendlies nearby ...

+
DETECTION_AREAS:SmokeDetectedUnits() +

Smoke the detected units

+
DETECTION_AREAS:SmokeDetectedZones() +

Smoke the detected zones

+
DETECTION_AREAS._FlareDetectedUnits + +
DETECTION_AREAS._FlareDetectedZones + +
DETECTION_AREAS._SmokeDetectedUnits + +
DETECTION_AREAS._SmokeDetectedZones + +
+ +

Type DETECTION_AREAS.DetectedArea

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DETECTION_AREAS.DetectedArea.AreaID +

-- The identifier of the detected area.

+
DETECTION_AREAS.DetectedArea.Changed +

Documents if the detected area has changes.

+
DETECTION_AREAS.DetectedArea.Changes +

A list of the changes reported on the detected area. (It is up to the user of the detected area to consume those changes).

+
DETECTION_AREAS.DetectedArea.FriendliesNearBy +

Indicates if there are friendlies within the detected area.

+
DETECTION_AREAS.DetectedArea.MaxThreatLevelA2G + +
DETECTION_AREAS.DetectedArea.NearestFAC +

The nearest FAC near the Area.

+
DETECTION_AREAS.DetectedArea.Set +

-- The Set of Units in the detected area.

+
DETECTION_AREAS.DetectedArea.Zone +

-- The Zone of the detected area.

+
+ +

Type DETECTION_BASE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
DETECTION_BASE.ClassName + +
DETECTION_BASE:CreateDetectionSets() +

Make a DetectionSet table.

+
DETECTION_BASE.DetectDLINK + +
DETECTION_BASE.DetectIRST + +
DETECTION_BASE.DetectOptical + +
DETECTION_BASE.DetectRWR + +
DETECTION_BASE.DetectRadar + +
DETECTION_BASE.DetectVisual + +
DETECTION_BASE.DetectedObjects +

The list of detected objects.

+
DETECTION_BASE.DetectedObjectsIdentified +

Map of the DetectedObjects identified.

+
DETECTION_BASE.DetectionRange +

The range till which targets are accepted to be detected.

+
DETECTION_BASE.DetectionRun + +
DETECTION_BASE.DetectionScheduler + +
DETECTION_BASE.DetectionSetGroup +

The Set of GROUPs in the Forward Air Controller role.

+
DETECTION_BASE:GetDetectedObject(ObjectName) +

Gets a detected object with a given name.

+
DETECTION_BASE:GetDetectedSet(Index) +

Get a SET of detected objects using a given numeric index.

+
DETECTION_BASE:GetDetectedSetCount() +

Get the amount of SETs with detected objects.

+
DETECTION_BASE:GetDetectedSets() +

Get the detected Core.Set#SET_BASEs.

+
DETECTION_BASE:GetDetectionSetGroup() +

Get the detection Groups.

+
DETECTION_BASE:IdentifyDetectedObject(DetectedObject) +

Identifies a detected object during detection processing.

+
DETECTION_BASE:InitDetectDLINK(DetectDLINK) +

Detect DLINK.

+
DETECTION_BASE:InitDetectIRST(DetectIRST) +

Detect IRST.

+
DETECTION_BASE:InitDetectOptical(DetectOptical) +

Detect Optical.

+
DETECTION_BASE:InitDetectRWR(DetectRWR) +

Detect RWR.

+
DETECTION_BASE:InitDetectRadar(DetectRadar) +

Detect Radar.

+
DETECTION_BASE:InitDetectVisual(DetectVisual) +

Detect Visual.

+
DETECTION_BASE:IsDetectedObjectIdentified(DetectedObject) +

Determines if a detected object has already been identified during detection processing.

+
DETECTION_BASE:New(DetectionSetGroup, DetectionRange) +

DETECTION constructor.

+
DETECTION_BASE:Schedule(DelayTime, RepeatInterval) +

Schedule the DETECTION construction.

+
DETECTION_BASE.ScheduleDelayTime + +
DETECTION_BASE.ScheduleRepeatInterval + +
DETECTION_BASE:UnIdentifyAllDetectedObjects() +

UnIdentify all detected objects during detection processing.

+
DETECTION_BASE:UnIdentifyDetectedObject(DetectedObject) +

UnIdentify a detected object during detection processing.

+
DETECTION_BASE:_DetectionScheduler(SchedulerName) +

Form Sets of detected Wrapper.Unit#UNITs in an array of Core.Set#SET_BASEs.

+
+ +

Type DETECTION_BASE.DetectedObject

+ + + + + + + + + + + + + + + + + + + + + +
DETECTION_BASE.DetectedObject.Distance + +
DETECTION_BASE.DetectedObject.Identified + +
DETECTION_BASE.DetectedObject.Name + +
DETECTION_BASE.DetectedObject.Type + +
DETECTION_BASE.DetectedObject.Visible + +
+ +

Global(s)

+
+
+ + #DETECTION_AREAS + +DETECTION_AREAS + +
+
+ + + +
+
+
+
+ + #DETECTION_BASE + +DETECTION_BASE + +
+
+ + + +
+
+

Type Detection

+ +

Type DETECTION_AREAS

+ +

DETECTION_AREAS class

+ +

Field(s)

+
+
+ + +DETECTION_AREAS:AcceptChanges(DetectedArea) + +
+
+ +

Accepts changes from the detected zone.

+ +

Parameter

+ +

Return value

+ +

#DETECTION_AREAS: +self

+ +
+
+
+
+ + +DETECTION_AREAS:AddChangeArea(DetectedArea, ChangeCode, AreaUnitType) + +
+
+ +

Add a change to the detected zone.

+ +

Parameters

+ +

Return value

+ +

#DETECTION_AREAS: +self

+ +
+
+
+
+ + +DETECTION_AREAS:AddChangeUnit(DetectedArea, ChangeCode, ChangeUnitType) + +
+
+ +

Add a change to the detected zone.

+ +

Parameters

+ +

Return value

+ +

#DETECTION_AREAS: +self

+ +
+
+
+
+ + +DETECTION_AREAS.AddDetectedArea(Set, Zone, self) + +
+
+ +

Add a detected DETECTION_AREAS.DetectedArea.

+ +

Parameters

+ +

Return value

+ +

#DETECTION_AREAS.DetectedArea: +DetectedArea

+ +
+
+
+
+ + +DETECTION_AREAS:CalculateThreatLevelA2G(DetectedArea) + +
+
+ +

Calculate the maxium A2G threat level of the DetectedArea.

+ +

Parameter

+ +
+
+
+
+ + #string + +DETECTION_AREAS.ClassName + +
+
+ + + +
+
+
+
+ + +DETECTION_AREAS:CreateDetectionSets() + +
+
+ +

Make a DetectionSet table.

+ + +

This function will be overridden in the derived clsses.

+ +

Return value

+ +

#DETECTION_AREAS: +self

+ +
+
+
+
+ + #DETECTION_AREAS.DetectedAreas + +DETECTION_AREAS.DetectedAreas + +
+
+ +

A list of areas containing the set of Units, Zones, the center Unit within the zone, and ID of each area that was detected within a DetectionZoneRange.

+ +
+
+
+
+ + Dcs.DCSTypes#Distance + +DETECTION_AREAS.DetectionZoneRange + +
+
+ +

The range till which targets are grouped upon the first detected target.

+ +
+
+
+
+ + +DETECTION_AREAS:FlareDetectedUnits() + +
+
+ +

Flare the detected units

+ +

Return value

+ +

#DETECTION_AREAS: +self

+ +
+
+
+
+ + +DETECTION_AREAS:FlareDetectedZones() + +
+
+ +

Flare the detected zones

+ +

Return value

+ +

#DETECTION_AREAS: +self

+ +
+
+
+
+ + +DETECTION_AREAS:GetChangeText(DetectedArea) + +
+
+ +

Make text documenting the changes of the detected zone.

+ +

Parameter

+ +

Return value

+ +

#string: +The Changes text

+ +
+
+
+
+ + +DETECTION_AREAS:GetDetectedAreaCount() + +
+
+ +

Get the amount of DETECTION_AREAS.DetectedAreas.

+ +

Return value

+ +

#number: +DetectedAreaCount

+ +
+
+
+
+ + +DETECTION_AREAS:GetDetectedAreas() + +
+
+ +

Get the detected DETECTION_AREAS.DetectedAreas.

+ +

Return value

+ +

#DETECTION_AREAS.DetectedAreas: +DetectedAreas

+ +
+
+
+
+ + +DETECTION_AREAS:GetDetectedSet(Index) + +
+
+ +

Get the Core.Set#SET_UNIT of a detecttion area using a given numeric index.

+ +

Parameter

+
    +
  • + +

    #number Index :

    + +
  • +
+

Return value

+ +

Core.Set#SET_UNIT: +DetectedSet

+ +
+
+
+
+ + +DETECTION_AREAS:GetDetectedZone(Index) + +
+
+ +

Get the Core.Zone#ZONE_UNIT of a detection area using a given numeric index.

+ +

Parameter

+
    +
  • + +

    #number Index :

    + +
  • +
+

Return value

+ +

Core.Zone#ZONE_UNIT: +DetectedZone

+ +
+
+
+
+ + +DETECTION_AREAS:GetTreatLevelA2G(DetectedArea) + +
+
+ +

Returns the A2G threat level of the units in the DetectedArea

+ +

Parameter

+ +

Return value

+ +

#number: +a scale from 0 to 10.

+ +
+
+
+
+ + +DETECTION_AREAS:IsFriendliesNearBy(DetectedArea) + +
+
+ +

Returns if there are friendlies nearby the FAC units ...

+ +

Parameter

+
    +
  • + +

    DetectedArea :

    + +
  • +
+

Return value

+ +

#boolean: +trhe if there are friendlies nearby

+ +
+
+
+
+ + +DETECTION_AREAS:NearestFAC(DetectedArea) + +
+
+ +

Find the nearest FAC of the DetectedArea.

+ +

Parameter

+ +

Return value

+ +

Wrapper.Unit#UNIT: +The nearest FAC unit

+ +
+
+
+
+ + +DETECTION_AREAS:New(DetectionSetGroup, DetectionRange, DetectionZoneRange) + +
+
+ +

DETECTION_AREAS constructor.

+ +

Parameters

+
    +
  • + +

    Core.Set#SET_GROUP DetectionSetGroup : +The Set of GROUPs in the Forward Air Controller role.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance DetectionRange : +The range till which targets are accepted to be detected.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance DetectionZoneRange : +The range till which targets are grouped upon the first detected target.

    + +
  • +
+

Return value

+ +

Functional.Detection#DETECTION_AREAS: +self

+ +
+
+
+
+ + +DETECTION_AREAS:RemoveDetectedArea(Index) + +
+
+ +

Remove a detected DETECTION_AREAS.DetectedArea with a given Index.

+ +

Parameter

+
    +
  • + +

    #number Index : +The Index of the detection are to be removed.

    + +
  • +
+

Return value

+ +

#nil:

+ + +
+
+
+
+ + +DETECTION_AREAS:ReportFriendliesNearBy(ReportUnit, ReportGroupData) + +
+
+ +

Background worker function to determine if there are friendlies nearby ...

+ +

Parameters

+ +
+
+
+
+ + +DETECTION_AREAS:SmokeDetectedUnits() + +
+
+ +

Smoke the detected units

+ +

Return value

+ +

#DETECTION_AREAS: +self

+ +
+
+
+
+ + +DETECTION_AREAS:SmokeDetectedZones() + +
+
+ +

Smoke the detected zones

+ +

Return value

+ +

#DETECTION_AREAS: +self

+ +
+
+
+
+ + #boolean + +DETECTION_AREAS._FlareDetectedUnits + +
+
+ + + +
+
+
+
+ + #boolean + +DETECTION_AREAS._FlareDetectedZones + +
+
+ + + +
+
+
+
+ + #boolean + +DETECTION_AREAS._SmokeDetectedUnits + +
+
+ + + +
+
+
+
+ + #boolean + +DETECTION_AREAS._SmokeDetectedZones + +
+
+ + + +
+
+ +

Type DETECTION_AREAS.DetectedArea

+

Field(s)

+
+
+ + #number + +DETECTION_AREAS.DetectedArea.AreaID + +
+
+ +

-- The identifier of the detected area.

+ +
+
+
+
+ + #boolean + +DETECTION_AREAS.DetectedArea.Changed + +
+
+ +

Documents if the detected area has changes.

+ +
+
+
+
+ + #table + +DETECTION_AREAS.DetectedArea.Changes + +
+
+ +

A list of the changes reported on the detected area. (It is up to the user of the detected area to consume those changes).

+ +
+
+
+
+ + #boolean + +DETECTION_AREAS.DetectedArea.FriendliesNearBy + +
+
+ +

Indicates if there are friendlies within the detected area.

+ +
+
+
+
+ + + +DETECTION_AREAS.DetectedArea.MaxThreatLevelA2G + +
+
+ + + +
+
+
+
+ + Wrapper.Unit#UNIT + +DETECTION_AREAS.DetectedArea.NearestFAC + +
+
+ +

The nearest FAC near the Area.

+ +
+
+
+
+ + Core.Set#SET_UNIT + +DETECTION_AREAS.DetectedArea.Set + +
+
+ +

-- The Set of Units in the detected area.

+ +
+
+
+
+ + Core.Zone#ZONE_UNIT + +DETECTION_AREAS.DetectedArea.Zone + +
+
+ +

-- The Zone of the detected area.

+ +
+
+ +

Type DETECTION_AREAS.DetectedAreas

+ +

Type DETECTION_BASE

+ +

DETECTION_BASE class

+ +

Field(s)

+
+
+ + #string + +DETECTION_BASE.ClassName + +
+
+ + + +
+
+
+
+ + +DETECTION_BASE:CreateDetectionSets() + +
+
+ +

Make a DetectionSet table.

+ + +

This function will be overridden in the derived clsses.

+ +

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + + +DETECTION_BASE.DetectDLINK + +
+
+ + + +
+
+
+
+ + + +DETECTION_BASE.DetectIRST + +
+
+ + + +
+
+
+
+ + + +DETECTION_BASE.DetectOptical + +
+
+ + + +
+
+
+
+ + + +DETECTION_BASE.DetectRWR + +
+
+ + + +
+
+
+
+ + + +DETECTION_BASE.DetectRadar + +
+
+ + + +
+
+
+
+ + + +DETECTION_BASE.DetectVisual + +
+
+ + + +
+
+
+
+ + #DETECTION_BASE.DetectedObjects + +DETECTION_BASE.DetectedObjects + +
+
+ +

The list of detected objects.

+ +
+
+
+
+ + #table + +DETECTION_BASE.DetectedObjectsIdentified + +
+
+ +

Map of the DetectedObjects identified.

+ +
+
+
+
+ + Dcs.DCSTypes#Distance + +DETECTION_BASE.DetectionRange + +
+
+ +

The range till which targets are accepted to be detected.

+ +
+
+
+
+ + #number + +DETECTION_BASE.DetectionRun + +
+
+ + + +
+
+
+
+ + + +DETECTION_BASE.DetectionScheduler + +
+
+ + + +
+
+
+
+ + Core.Set#SET_GROUP + +DETECTION_BASE.DetectionSetGroup + +
+
+ +

The Set of GROUPs in the Forward Air Controller role.

+ +
+
+
+
+ + +DETECTION_BASE:GetDetectedObject(ObjectName) + +
+
+ +

Gets a detected object with a given name.

+ +

Parameter

+
    +
  • + +

    #string ObjectName :

    + +
  • +
+

Return value

+ +

#DETECTION_BASE.DetectedObject:

+ + +
+
+
+
+ + +DETECTION_BASE:GetDetectedSet(Index) + +
+
+ +

Get a SET of detected objects using a given numeric index.

+ +

Parameter

+
    +
  • + +

    #number Index :

    + +
  • +
+

Return value

+ +

Core.Set#SET_BASE:

+ + +
+
+
+
+ + +DETECTION_BASE:GetDetectedSetCount() + +
+
+ +

Get the amount of SETs with detected objects.

+ +

Return value

+ +

#number: +Count

+ +
+
+
+
+ + +DETECTION_BASE:GetDetectedSets() + +
+
+ +

Get the detected Core.Set#SET_BASEs.

+ +

Return value

+ +

#DETECTION_BASE.DetectedSets: +DetectedSets

+ +
+
+
+
+ + +DETECTION_BASE:GetDetectionSetGroup() + +
+
+ +

Get the detection Groups.

+ +

Return value

+ +

Wrapper.Group#GROUP:

+ + +
+
+
+
+ + +DETECTION_BASE:IdentifyDetectedObject(DetectedObject) + +
+
+ +

Identifies a detected object during detection processing.

+ +

Parameter

+ +
+
+
+
+ + +DETECTION_BASE:InitDetectDLINK(DetectDLINK) + +
+
+ +

Detect DLINK.

+ +

Parameter

+
    +
  • + +

    #boolean DetectDLINK :

    + +
  • +
+

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + +DETECTION_BASE:InitDetectIRST(DetectIRST) + +
+
+ +

Detect IRST.

+ +

Parameter

+
    +
  • + +

    #boolean DetectIRST :

    + +
  • +
+

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + +DETECTION_BASE:InitDetectOptical(DetectOptical) + +
+
+ +

Detect Optical.

+ +

Parameter

+
    +
  • + +

    #boolean DetectOptical :

    + +
  • +
+

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + +DETECTION_BASE:InitDetectRWR(DetectRWR) + +
+
+ +

Detect RWR.

+ +

Parameter

+
    +
  • + +

    #boolean DetectRWR :

    + +
  • +
+

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + +DETECTION_BASE:InitDetectRadar(DetectRadar) + +
+
+ +

Detect Radar.

+ +

Parameter

+
    +
  • + +

    #boolean DetectRadar :

    + +
  • +
+

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + +DETECTION_BASE:InitDetectVisual(DetectVisual) + +
+
+ +

Detect Visual.

+ +

Parameter

+
    +
  • + +

    #boolean DetectVisual :

    + +
  • +
+

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + +DETECTION_BASE:IsDetectedObjectIdentified(DetectedObject) + +
+
+ +

Determines if a detected object has already been identified during detection processing.

+ +

Parameter

+ +

Return value

+ +

#boolean: +true if already identified.

+ +
+
+
+
+ + +DETECTION_BASE:New(DetectionSetGroup, DetectionRange) + +
+
+ +

DETECTION constructor.

+ +

Parameters

+
    +
  • + +

    Core.Set#SET_GROUP DetectionSetGroup : +The Set of GROUPs in the Forward Air Controller role.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance DetectionRange : +The range till which targets are accepted to be detected.

    + +
  • +
+

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + +DETECTION_BASE:Schedule(DelayTime, RepeatInterval) + +
+
+ +

Schedule the DETECTION construction.

+ +

Parameters

+
    +
  • + +

    #number DelayTime : +The delay in seconds to wait the reporting.

    + +
  • +
  • + +

    #number RepeatInterval : +The repeat interval in seconds for the reporting to happen repeatedly.

    + +
  • +
+

Return value

+ +

#DETECTION_BASE: +self

+ +
+
+
+
+ + + +DETECTION_BASE.ScheduleDelayTime + +
+
+ + + +
+
+
+
+ + + +DETECTION_BASE.ScheduleRepeatInterval + +
+
+ + + +
+
+
+
+ + +DETECTION_BASE:UnIdentifyAllDetectedObjects() + +
+
+ +

UnIdentify all detected objects during detection processing.

+ +
+
+
+
+ + +DETECTION_BASE:UnIdentifyDetectedObject(DetectedObject) + +
+
+ +

UnIdentify a detected object during detection processing.

+ +

Parameter

+ +
+
+
+
+ + +DETECTION_BASE:_DetectionScheduler(SchedulerName) + +
+
+ +

Form Sets of detected Wrapper.Unit#UNITs in an array of Core.Set#SET_BASEs.

+ +

Parameter

+
    +
  • + +

    SchedulerName :

    + +
  • +
+
+
+ +

Type DETECTION_BASE.DetectedObject

+

Field(s)

+
+
+ + #number + +DETECTION_BASE.DetectedObject.Distance + +
+
+ + + +
+
+
+
+ + #boolean + +DETECTION_BASE.DetectedObject.Identified + +
+
+ + + +
+
+
+
+ + #string + +DETECTION_BASE.DetectedObject.Name + +
+
+ + + +
+
+
+
+ + #string + +DETECTION_BASE.DetectedObject.Type + +
+
+ + + +
+
+
+
+ + #boolean + +DETECTION_BASE.DetectedObject.Visible + +
+
+ + + +
+
+ +

Type DETECTION_BASE.DetectedObjects

+ +

Type DETECTION_BASE.DetectedSets

+ +
+ +
+ + diff --git a/docs/Documentation/Escort.html b/docs/Documentation/Escort.html new file mode 100644 index 000000000..5741ba4bd --- /dev/null +++ b/docs/Documentation/Escort.html @@ -0,0 +1,2385 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Escort

+ +

Taking the lead of AI escorting your flight.

+ + + +

#ESCORT class

+

The #ESCORT class allows you to interact with escorting AI on your flight and take the lead. +Each escorting group can be commanded with a whole set of radio commands (radio menu in your flight, and then F10).

+ +

The radio commands will vary according the category of the group. The richest set of commands are with Helicopters and AirPlanes. +Ships and Ground troops will have a more limited set, but they can provide support through the bombing of targets designated by the other escorts.

+ +

RADIO MENUs that can be created:

+

Find a summary below of the current available commands:

+ +

Navigation ...:

+

Escort group navigation functions:

+ +
    +
  • "Join-Up and Follow at x meters": The escort group fill follow you at about x meters, and they will follow you.
  • +
  • "Flare": Provides menu commands to let the escort group shoot a flare in the air in a color.
  • +
  • "Smoke": Provides menu commands to let the escort group smoke the air in a color. Note that smoking is only available for ground and naval troops.
  • +
+ +

Hold position ...:

+

Escort group navigation functions:

+ +
    +
  • "At current location": Stops the escort group and they will hover 30 meters above the ground at the position they stopped.
  • +
  • "At client location": Stops the escort group and they will hover 30 meters above the ground at the position they stopped.
  • +
+ +

Report targets ...:

+

Report targets will make the escort group to report any target that it identifies within a 8km range. Any detected target can be attacked using the 4. Attack nearby targets function. (see below).

+ +
    +
  • "Report now": Will report the current detected targets.
  • +
  • "Report targets on": Will make the escort group to report detected targets and will fill the "Attack nearby targets" menu list.
  • +
  • "Report targets off": Will stop detecting targets.
  • +
+ +

Scan targets ...:

+

Menu items to pop-up the escort group for target scanning. After scanning, the escort group will resume with the mission or defined task.

+ +
    +
  • "Scan targets 30 seconds": Scan 30 seconds for targets.
  • +
  • "Scan targets 60 seconds": Scan 60 seconds for targets.
  • +
+ +

Attack targets ...:

+

This menu item will list all detected targets within a 15km range. Depending on the level of detection (known/unknown) and visuality, the targets type will also be listed.

+ +

Request assistance from ...:

+

This menu item will list all detected targets within a 15km range, as with the menu item Attack Targets. +This menu item allows to request attack support from other escorts supporting the current client group. +eg. the function allows a player to request support from the Ship escort to attack a target identified by the Plane escort with its Tomahawk missiles. +eg. the function allows a player to request support from other Planes escorting to bomb the unit with illumination missiles or bombs, so that the main plane escort can attack the area.

+ +

ROE ...:

+

Sets the Rules of Engagement (ROE) of the escort group when in flight.

+ +
    +
  • "Hold Fire": The escort group will hold fire.
  • +
  • "Return Fire": The escort group will return fire.
  • +
  • "Open Fire": The escort group will open fire on designated targets.
  • +
  • "Weapon Free": The escort group will engage with any target.
  • +
+ +

Evasion ...:

+

Will define the evasion techniques that the escort group will perform during flight or combat.

+ +
    +
  • "Fight until death": The escort group will have no reaction to threats.
  • +
  • "Use flares, chaff and jammers": The escort group will use passive defense using flares and jammers. No evasive manoeuvres are executed.
  • +
  • "Evade enemy fire": The rescort group will evade enemy fire before firing.
  • +
  • "Go below radar and evade fire": The escort group will perform evasive vertical manoeuvres.
  • +
+ +

Resume Mission ...:

+

Escort groups can have their own mission. This menu item will allow the escort group to resume their Mission from a given waypoint. +Note that this is really fantastic, as you now have the dynamic of taking control of the escort groups, and allowing them to resume their path or mission.

+ +

ESCORT construction methods.

+

Create a new SPAWN object with the ESCORT.New method:

+ + + +

ESCORT initialization methods.

+

The following menus are created within the RADIO MENU of an active unit hosted by a player:

+ + + + + +

Usage:

+
-- Declare a new EscortPlanes object as follows:
+
+-- First find the GROUP object and the CLIENT object.
+local EscortClient = CLIENT:FindByName( "Unit Name" ) -- The Unit Name is the name of the unit flagged with the skill Client in the mission editor.
+local EscortGroup = GROUP:FindByName( "Group Name" ) -- The Group Name is the name of the group that will escort the Escort Client.
+
+-- Now use these 2 objects to construct the new EscortPlanes object.
+EscortPlanes = ESCORT:New( EscortClient, EscortGroup, "Desert", "Welcome to the mission. You are escorted by a plane with code name 'Desert', which can be instructed through the F10 radio menu." )
+
+
+
+ +

Global(s)

+ + + + + + + + + +
ESCORT + +
_Resume(EscortGroup) + +
+

Type ESCORT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ESCORT.ClassName + +
ESCORT.EscortClient + +
ESCORT.EscortGroup + +
ESCORT.EscortMenuAttackNearbyTargets + +
ESCORT.EscortMenuEvasion + +
ESCORT.EscortMenuEvasionEvadeFire + +
ESCORT.EscortMenuEvasionNoReaction + +
ESCORT.EscortMenuEvasionPassiveDefense + +
ESCORT.EscortMenuFlare + +
ESCORT.EscortMenuFlareGreen + +
ESCORT.EscortMenuFlareRed + +
ESCORT.EscortMenuFlareWhite + +
ESCORT.EscortMenuFlareYellow + +
ESCORT.EscortMenuHold + +
ESCORT.EscortMenuHoldAtLeaderPosition + +
ESCORT.EscortMenuHoldPosition + +
ESCORT.EscortMenuJoinUpAndFollow + +
ESCORT.EscortMenuOptionEvasionVertical + +
ESCORT.EscortMenuROE + +
ESCORT.EscortMenuROEHoldFire + +
ESCORT.EscortMenuROEOpenFire + +
ESCORT.EscortMenuROEReturnFire + +
ESCORT.EscortMenuROEWeaponFree + +
ESCORT.EscortMenuReportNavigation + +
ESCORT.EscortMenuReportNearbyTargets + +
ESCORT.EscortMenuReportNearbyTargetsNow + +
ESCORT.EscortMenuReportNearbyTargetsOff + +
ESCORT.EscortMenuReportNearbyTargetsOn + +
ESCORT.EscortMenuResumeMission + +
ESCORT.EscortMenuScan + +
ESCORT.EscortMenuScanForTargets + +
ESCORT.EscortMenuSmoke + +
ESCORT.EscortMenuSmokeBlue + +
ESCORT.EscortMenuSmokeGreen + +
ESCORT.EscortMenuSmokeOrange + +
ESCORT.EscortMenuSmokeRed + +
ESCORT.EscortMenuSmokeWhite + +
ESCORT.EscortMenuTargetAssistance + +
ESCORT.EscortMode +

The mode the escort is in.

+
ESCORT.EscortName + +
ESCORT.FollowDistance +

The current follow distance.

+
ESCORT.FollowScheduler +

The instance of the SCHEDULER class.

+
ESCORT:JoinUpAndFollow(EscortGroup, EscortClient, Distance) +

JoinsUp and Follows a CLIENT.

+
ESCORT.MODE + +
ESCORT:MenuAssistedAttack() +

Defines a menu slot to let the escort attack its detected targets using assisted attack from another escort joined also with the client.

+
ESCORT:MenuEvasion(MenuTextFormat) +

Defines a menu to let the escort set its evasion when under threat.

+
ESCORT:MenuFlare(MenuTextFormat) +

Defines a menu slot to let the escort disperse a flare in a certain color.

+
ESCORT:MenuFollowAt(Distance) +

Defines a menu slot to let the escort Join and Follow you at a certain distance.

+
ESCORT:MenuHoldAtEscortPosition(Height, Seconds, MenuTextFormat) +

Defines a menu slot to let the escort hold at their current position and stay low with a specified height during a specified time in seconds.

+
ESCORT:MenuHoldAtLeaderPosition(Height, Seconds, MenuTextFormat) +

Defines a menu slot to let the escort hold at the client position and stay low with a specified height during a specified time in seconds.

+
ESCORT:MenuROE(MenuTextFormat) +

Defines a menu to let the escort set its rules of engagement.

+
ESCORT:MenuReportTargets(Seconds) +

Defines a menu slot to let the escort report their current detected targets with a specified time interval in seconds.

+
ESCORT:MenuResumeMission() +

Defines a menu to let the escort resume its mission from a waypoint on its route.

+
ESCORT:MenuScanForTargets(Height, Seconds, MenuTextFormat) +

Defines a menu slot to let the escort scan for targets at a certain height for a certain time in seconds.

+
ESCORT:MenuSmoke(MenuTextFormat) +

Defines a menu slot to let the escort disperse a smoke in a certain color.

+
ESCORT:Menus() +

Defines the default menus

+
ESCORT:New(EscortClient, EscortGroup, EscortName, EscortBriefing) +

ESCORT class constructor for an AI group

+
ESCORT.OptionROE + +
ESCORT.OptionReactionOnThreat +

Which REACTIONONTHREAT is set to the EscortGroup.

+
ESCORT:RegisterRoute() +

Registers the waypoints

+
ESCORT.ReportTargets +

If true, nearby targets are reported.

+
ESCORT.ReportTargetsScheduler + +
ESCORT.SmokeDirectionVector + +
ESCORT.Targets + +
ESCORT.TaskPoints + +
ESCORT:TestSmokeDirectionVector(SmokeDirection) +

This function is for test, it will put on the frequency of the FollowScheduler a red smoke at the direction vector calculated for the escort to fly to.

+
ESCORT._AssistTarget(MenuParam) + +
ESCORT._AttackTarget(MenuParam) + +
ESCORT._Flare(MenuParam) + +
ESCORT:_FollowScheduler() + +
ESCORT._HoldPosition(MenuParam) + +
ESCORT._JoinUpAndFollow(MenuParam) + +
ESCORT._ROE(MenuParam) + +
ESCORT._ROT(MenuParam) + +
ESCORT._ReportNearbyTargetsNow(MenuParam) + +
ESCORT:_ReportTargetsScheduler() +

Report Targets Scheduler.

+
ESCORT._ResumeMission(MenuParam) + +
ESCORT._ScanTargets(MenuParam) + +
ESCORT._Smoke(MenuParam) + +
ESCORT._SwitchReportNearbyTargets(MenuParam) + +
+ +

Type ESCORT.MODE

+ + + + + + + + + +
ESCORT.MODE.FOLLOW + +
ESCORT.MODE.MISSION + +
+ +

Type MENUPARAM

+ + + + + + + + + + + + + + + + + +
MENUPARAM.ParamDistance + +
MENUPARAM.ParamFunction + +
MENUPARAM.ParamMessage + +
MENUPARAM.ParamSelf + +
+ +

Global(s)

+
+
+ + #ESCORT + +ESCORT + +
+
+ + + +
+
+
+
+ + +_Resume(EscortGroup) + +
+
+ + + +

Parameter

+ +
+
+

Type Escort

+ +

Type Distance

+ +

Type ESCORT

+ +

ESCORT class

+ +

Field(s)

+
+
+ + #string + +ESCORT.ClassName + +
+
+ + + +
+
+
+
+ + Wrapper.Client#CLIENT + +ESCORT.EscortClient + +
+
+ + + +
+
+
+
+ + Wrapper.Group#GROUP + +ESCORT.EscortGroup + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuAttackNearbyTargets + +
+
+ + + + +

Attack Targets

+ +
+
+
+
+ + + +ESCORT.EscortMenuEvasion + +
+
+ + + + +

Reaction to Threats

+ +
+
+
+
+ + + +ESCORT.EscortMenuEvasionEvadeFire + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuEvasionNoReaction + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuEvasionPassiveDefense + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuFlare + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuFlareGreen + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuFlareRed + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuFlareWhite + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuFlareYellow + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuHold + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuHoldAtLeaderPosition + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuHoldPosition + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuJoinUpAndFollow + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuOptionEvasionVertical + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuROE + +
+
+ + + + +

Rules of Engagement

+ +
+
+
+
+ + + +ESCORT.EscortMenuROEHoldFire + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuROEOpenFire + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuROEReturnFire + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuROEWeaponFree + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuReportNavigation + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuReportNearbyTargets + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuReportNearbyTargetsNow + +
+
+ + + + +

Report Targets

+ +
+
+
+
+ + + +ESCORT.EscortMenuReportNearbyTargetsOff + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuReportNearbyTargetsOn + +
+
+ + + +
+
+
+
+ + Core.Menu#MENU_CLIENT + +ESCORT.EscortMenuResumeMission + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuScan + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuScanForTargets + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuSmoke + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuSmokeBlue + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuSmokeGreen + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuSmokeOrange + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuSmokeRed + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuSmokeWhite + +
+
+ + + +
+
+
+
+ + + +ESCORT.EscortMenuTargetAssistance + +
+
+ + + + +

Request assistance from other escorts. + This is very useful to let f.e. an escorting ship attack a target detected by an escorting plane...

+ +
+
+
+
+ + #ESCORT.MODE + +ESCORT.EscortMode + +
+
+ +

The mode the escort is in.

+ +
+
+
+
+ + #string + +ESCORT.EscortName + +
+
+ + + +
+
+
+
+ + #number + +ESCORT.FollowDistance + +
+
+ +

The current follow distance.

+ +
+
+
+
+ + Core.Scheduler#SCHEDULER + +ESCORT.FollowScheduler + +
+
+ +

The instance of the SCHEDULER class.

+ +
+
+
+
+ + +ESCORT:JoinUpAndFollow(EscortGroup, EscortClient, Distance) + +
+
+ +

JoinsUp and Follows a CLIENT.

+ +

Parameters

+ +
+
+
+
+ + + +ESCORT.MODE + +
+
+ + + +
+
+
+
+ + +ESCORT:MenuAssistedAttack() + +
+
+ +

Defines a menu slot to let the escort attack its detected targets using assisted attack from another escort joined also with the client.

+ + +

This menu will appear under Request assistance from. +Note that this method needs to be preceded with the method MenuReportTargets.

+ +

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:MenuEvasion(MenuTextFormat) + +
+
+ +

Defines a menu to let the escort set its evasion when under threat.

+ + +

All rules of engagement will appear under the menu Evasion.

+ +

Parameter

+
    +
  • + +

    MenuTextFormat :

    + +
  • +
+

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:MenuFlare(MenuTextFormat) + +
+
+ +

Defines a menu slot to let the escort disperse a flare in a certain color.

+ + +

This menu will appear under Navigation. +The flare will be fired from the first unit in the group.

+ +

Parameter

+
    +
  • + +

    #string MenuTextFormat : +Optional parameter that shows the menu option text. If no text is given, the default text will be displayed.

    + +
  • +
+

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:MenuFollowAt(Distance) + +
+
+ +

Defines a menu slot to let the escort Join and Follow you at a certain distance.

+ + +

This menu will appear under Navigation.

+ +

Parameter

+
    +
  • + +

    Dcs.DCSTypes#Distance Distance : +The distance in meters that the escort needs to follow the client.

    + +
  • +
+

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:MenuHoldAtEscortPosition(Height, Seconds, MenuTextFormat) + +
+
+ +

Defines a menu slot to let the escort hold at their current position and stay low with a specified height during a specified time in seconds.

+ + +

This menu will appear under Hold position.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Distance Height : +Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.

    + +
  • +
  • + +

    Dcs.DCSTypes#Time Seconds : +Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.

    + +
  • +
  • + +

    #string MenuTextFormat : +Optional parameter that shows the menu option text. The text string is formatted, and should contain two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.

    + +
  • +
+

Return value

+ +

#ESCORT: +TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function.

+ +
+
+
+
+ + +ESCORT:MenuHoldAtLeaderPosition(Height, Seconds, MenuTextFormat) + +
+
+ +

Defines a menu slot to let the escort hold at the client position and stay low with a specified height during a specified time in seconds.

+ + +

This menu will appear under Navigation.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Distance Height : +Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.

    + +
  • +
  • + +

    Dcs.DCSTypes#Time Seconds : +Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.

    + +
  • +
  • + +

    #string MenuTextFormat : +Optional parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.

    + +
  • +
+

Return value

+ +

#ESCORT: +TODO: Implement Seconds parameter. Challenge is to first develop the "continue from last activity" function.

+ +
+
+
+
+ + +ESCORT:MenuROE(MenuTextFormat) + +
+
+ +

Defines a menu to let the escort set its rules of engagement.

+ + +

All rules of engagement will appear under the menu ROE.

+ +

Parameter

+
    +
  • + +

    MenuTextFormat :

    + +
  • +
+

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:MenuReportTargets(Seconds) + +
+
+ +

Defines a menu slot to let the escort report their current detected targets with a specified time interval in seconds.

+ + +

This menu will appear under Report targets. +Note that if a report targets menu is not specified, no targets will be detected by the escort, and the attack and assisted attack menus will not be displayed.

+ +

Parameter

+
    +
  • + +

    Dcs.DCSTypes#Time Seconds : +Optional parameter that lets the escort report their current detected targets after specified time interval in seconds. The default time is 30 seconds.

    + +
  • +
+

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:MenuResumeMission() + +
+
+ +

Defines a menu to let the escort resume its mission from a waypoint on its route.

+ + +

All rules of engagement will appear under the menu Resume mission from.

+ +

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:MenuScanForTargets(Height, Seconds, MenuTextFormat) + +
+
+ +

Defines a menu slot to let the escort scan for targets at a certain height for a certain time in seconds.

+ + +

This menu will appear under Scan targets.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Distance Height : +Optional parameter that sets the height in meters to let the escort orbit at the current location. The default value is 30 meters.

    + +
  • +
  • + +

    Dcs.DCSTypes#Time Seconds : +Optional parameter that lets the escort orbit at the current position for a specified time. (not implemented yet). The default value is 0 seconds, meaning, that the escort will orbit forever until a sequent command is given.

    + +
  • +
  • + +

    #string MenuTextFormat : +Optional parameter that shows the menu option text. The text string is formatted, and should contain one or two %d tokens in the string. The first for the Height, the second for the Time (if given). If no text is given, the default text will be displayed.

    + +
  • +
+

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:MenuSmoke(MenuTextFormat) + +
+
+ +

Defines a menu slot to let the escort disperse a smoke in a certain color.

+ + +

This menu will appear under Navigation. +Note that smoke menu options will only be displayed for ships and ground units. Not for air units. +The smoke will be fired from the first unit in the group.

+ +

Parameter

+
    +
  • + +

    #string MenuTextFormat : +Optional parameter that shows the menu option text. If no text is given, the default text will be displayed.

    + +
  • +
+

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:Menus() + +
+
+ +

Defines the default menus

+ +

Return value

+ +

#ESCORT:

+ + +
+
+
+
+ + +ESCORT:New(EscortClient, EscortGroup, EscortName, EscortBriefing) + +
+
+ +

ESCORT class constructor for an AI group

+ +

Parameters

+
    +
  • + +

    Wrapper.Client#CLIENT EscortClient : +The client escorted by the EscortGroup.

    + +
  • +
  • + +

    Wrapper.Group#GROUP EscortGroup : +The group AI escorting the EscortClient.

    + +
  • +
  • + +

    #string EscortName : +Name of the escort.

    + +
  • +
  • + +

    #string EscortBriefing : +A text showing the ESCORT briefing to the player. Note that if no EscortBriefing is provided, the default briefing will be shown.

    + +
  • +
+

Return value

+ +

#ESCORT: +self

+ +

Usage:

+
-- Declare a new EscortPlanes object as follows:
+
+-- First find the GROUP object and the CLIENT object.
+local EscortClient = CLIENT:FindByName( "Unit Name" ) -- The Unit Name is the name of the unit flagged with the skill Client in the mission editor.
+local EscortGroup = GROUP:FindByName( "Group Name" ) -- The Group Name is the name of the group that will escort the Escort Client.
+
+-- Now use these 2 objects to construct the new EscortPlanes object.
+EscortPlanes = ESCORT:New( EscortClient, EscortGroup, "Desert", "Welcome to the mission. You are escorted by a plane with code name 'Desert', which can be instructed through the F10 radio menu." )
+ +
+
+
+
+ + + +ESCORT.OptionROE + +
+
+ + + +
+
+
+
+ + Dcs.DCSTypes#AI.Option.Air.val.REACTION_ON_THREAT + +ESCORT.OptionReactionOnThreat + +
+
+ +

Which REACTIONONTHREAT is set to the EscortGroup.

+ +
+
+
+
+ + +ESCORT:RegisterRoute() + +
+
+ +

Registers the waypoints

+ +

Return value

+ +

#table:

+ + +
+
+
+
+ + #boolean + +ESCORT.ReportTargets + +
+
+ +

If true, nearby targets are reported.

+ +
+
+
+
+ + + +ESCORT.ReportTargetsScheduler + +
+
+ + + +
+
+
+
+ + +ESCORT.SmokeDirectionVector + +
+
+ + + +
+
+
+
+ + + +ESCORT.Targets + +
+
+ + + +
+
+
+
+ + + +ESCORT.TaskPoints + +
+
+ + + +
+
+
+
+ + +ESCORT:TestSmokeDirectionVector(SmokeDirection) + +
+
+ +

This function is for test, it will put on the frequency of the FollowScheduler a red smoke at the direction vector calculated for the escort to fly to.

+ + +

This allows to visualize where the escort is flying to.

+ +

Parameter

+
    +
  • + +

    #boolean SmokeDirection : +If true, then the direction vector will be smoked.

    + +
  • +
+
+
+
+
+ + +ESCORT._AssistTarget(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._AttackTarget(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._Flare(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT:_FollowScheduler() + +
+
+ + + +
+
+
+
+ + +ESCORT._HoldPosition(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._JoinUpAndFollow(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._ROE(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._ROT(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._ReportNearbyTargetsNow(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT:_ReportTargetsScheduler() + +
+
+ +

Report Targets Scheduler.

+ +
+
+
+
+ + +ESCORT._ResumeMission(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._ScanTargets(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._Smoke(MenuParam) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +ESCORT._SwitchReportNearbyTargets(MenuParam) + +
+
+ + + +

Parameter

+
    +
  • + +

    MenuParam :

    + +
  • +
+
+
+ +

Type ESCORT.MODE

+ +

ESCORT.Mode class

+ +

Field(s)

+
+
+ + #number + +ESCORT.MODE.FOLLOW + +
+
+ + + +
+
+
+
+ + #number + +ESCORT.MODE.MISSION + +
+
+ + + +
+
+ +

Type MENUPARAM

+ +

MENUPARAM type

+ +

Field(s)

+
+
+ + #Distance + +MENUPARAM.ParamDistance + +
+
+ + + +
+
+
+
+ + #function + +MENUPARAM.ParamFunction + +
+
+ + + +
+
+
+
+ + #string + +MENUPARAM.ParamMessage + +
+
+ + + +
+
+
+
+ + #ESCORT + +MENUPARAM.ParamSelf + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Event.html b/docs/Documentation/Event.html new file mode 100644 index 000000000..534b6412e --- /dev/null +++ b/docs/Documentation/Event.html @@ -0,0 +1,2310 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Event

+ +

This module contains the EVENT class.

+ + + +
+ +

Takes care of EVENT dispatching between DCS events and event handling functions defined in MOOSE classes.

+ +
+ +

The above menus classes are derived from 2 main abstract classes defined within the MOOSE framework (so don't use these):

+ +
+ +

Contributions: -

+

Authors: FlightControl : Design & Programming

+ + +

Global(s)

+ + + + + +
EVENT + +
+

Type EVENT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EVENT.ClassID + +
EVENT.ClassName + +
EVENT:EventText(EventID) + +
EVENT.Events + +
EVENT:Init(EventID, EventClass) +

Initializes the Events structure for the event

+
EVENT:New() + +
EVENT:OnBirth(EventFunction, EventClass) +

Set a new listener for an SEVENTBIRTH event, and registers the unit born.

+
EVENT:OnBirthForTemplate(EventGroup, EventFunction, EventClass, EventTemplate) +

Create an OnBirth event handler for a group

+
EVENT:OnBirthForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTBIRTH event.

+
EVENT:OnBirthRemove(EventClass) +

Stop listening to SEVENTBIRTH event.

+
EVENT:OnCrash(EventFunction, EventClass) +

Set a new listener for an SEVENTCRASH event.

+
EVENT:OnCrashForTemplate(EventGroup, EventFunction, EventClass, EventTemplate) +

Create an OnCrash event handler for a group

+
EVENT:OnCrashForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTCRASH event.

+
EVENT:OnCrashRemove(EventClass) +

Stop listening to SEVENTCRASH event.

+
EVENT:OnDead(EventFunction, EventClass) +

Set a new listener for an SEVENTDEAD event.

+
EVENT:OnDeadForTemplate(EventGroup, EventFunction, EventClass, EventTemplate) +

Create an OnDead event handler for a group

+
EVENT:OnDeadForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTDEAD event.

+
EVENT:OnDeadRemove(EventClass) +

Stop listening to SEVENTDEAD event.

+
EVENT:OnEngineShutDownForTemplate(EventTemplate, EventFunction, EventClass) +

Create an OnDead event handler for a group

+
EVENT:OnEngineShutDownForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTENGINE_SHUTDOWN event.

+
EVENT:OnEngineShutDownRemove(EventClass) +

Stop listening to SEVENTENGINE_SHUTDOWN event.

+
EVENT:OnEngineStartUpForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTENGINE_STARTUP event.

+
EVENT:OnEngineStartUpRemove(EventClass) +

Stop listening to SEVENTENGINE_STARTUP event.

+
EVENT:OnEventForTemplate(EventTemplate, EventFunction, EventClass, OnEventFunction) +

Create an OnDead event handler for a group

+
EVENT:OnEventForUnit(EventDCSUnitName, EventFunction, EventClass, EventID) +

Set a new listener for an SEVENTX event

+
EVENT:OnEventGeneric(EventFunction, EventClass, EventID) +

Set a new listener for an SEVENTX event independent from a unit or a weapon.

+
EVENT:OnHit(EventFunction, EventClass) +

Set a new listener for an SEVENTHIT event.

+
EVENT:OnHitForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTHIT event.

+
EVENT:OnHitRemove(EventClass) +

Stop listening to SEVENTHIT event.

+
EVENT:OnLandForTemplate(EventTemplate, EventFunction, EventClass) + +
EVENT:OnLandForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTLAND event.

+
EVENT:OnLandRemove(EventClass) +

Stop listening to SEVENTLAND event.

+
EVENT:OnPilotDead(EventFunction, EventClass) +

Set a new listener for an SEVENTPILOT_DEAD event.

+
EVENT:OnPilotDeadForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTPILOT_DEAD event.

+
EVENT:OnPilotDeadRemove(EventClass) +

Stop listening to SEVENTPILOT_DEAD event.

+
EVENT:OnPlayerEnterRemove(EventClass) +

Stop listening to SEVENTPLAYERENTERUNIT event.

+
EVENT:OnPlayerEnterUnit(EventFunction, EventClass) +

Set a new listener for an SEVENTPLAYERENTERUNIT event.

+
EVENT:OnPlayerLeaveRemove(EventClass) +

Stop listening to SEVENTPLAYERLEAVEUNIT event.

+
EVENT:OnPlayerLeaveUnit(EventFunction, EventClass) + +
EVENT:OnShot(EventFunction, EventClass) + +
EVENT:OnShotForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTSHOT event for a unit.

+
EVENT:OnShotRemove(EventClass) +

Stop listening to SEVENTSHOT event.

+
EVENT:OnTakeOffForTemplate(EventTemplate, EventFunction, EventClass) + +
EVENT:OnTakeOffForUnit(EventDCSUnitName, EventFunction, EventClass) +

Set a new listener for an SEVENTTAKEOFF event.

+
EVENT:OnTakeOffRemove(EventClass) +

Stop listening to SEVENTTAKEOFF event.

+
EVENT:Remove(EventClass, EventID) +

Removes an Events entry

+
EVENT:RemoveAll(EventObject) +

Clears all event subscriptions for a Core.Base#BASE derived object.

+
EVENT:onEvent(Event) + +
+ +

Type EVENT.Events

+ + + + + +
EVENT.Events.IniUnit + +
+ +

Type EVENTDATA

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
EVENTDATA.IniDCSGroup + +
EVENTDATA.IniDCSGroupName + +
EVENTDATA.IniDCSUnit + +
EVENTDATA.IniDCSUnitName + +
EVENTDATA.IniUnit + +
EVENTDATA.IniUnitName + +
EVENTDATA.TgtDCSGroup + +
EVENTDATA.TgtDCSGroupName + +
EVENTDATA.TgtDCSUnit + +
EVENTDATA.TgtDCSUnitName + +
EVENTDATA.TgtUnit + +
EVENTDATA.TgtUnitName + +
EVENTDATA.Weapon + +
EVENTDATA.WeaponName + +
EVENTDATA.WeaponTgtDCSUnit + +
EVENTDATA.id + +
EVENTDATA.initiator + +
EVENTDATA.target + +
EVENTDATA.weapon + +
+ +

Global(s)

+
+
+ + #EVENT + +EVENT + +
+
+ + + +
+
+

Type Event

+ +

Type EVENT

+ +

The EVENT structure

+ +

Field(s)

+
+
+ + #number + +EVENT.ClassID + +
+
+ + + +
+
+
+
+ + #string + +EVENT.ClassName + +
+
+ + + +
+
+
+
+ + +EVENT:EventText(EventID) + +
+
+ + + +

Parameter

+
    +
  • + +

    EventID :

    + +
  • +
+
+
+
+
+ + #EVENT.Events + +EVENT.Events + +
+
+ + + +
+
+
+
+ + +EVENT:Init(EventID, EventClass) + +
+
+ +

Initializes the Events structure for the event

+ +

Parameters

+ +

Return value

+ +

#EVENT.Events:

+ + +
+
+
+
+ + +EVENT:New() + +
+
+ + + +
+
+
+
+ + +EVENT:OnBirth(EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTBIRTH event, and registers the unit born.

+ +

Parameters

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnBirthForTemplate(EventGroup, EventFunction, EventClass, EventTemplate) + +
+
+ +

Create an OnBirth event handler for a group

+ +

Parameters

+
    +
  • + +

    Wrapper.Group#GROUP EventGroup :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    EventClass : +The self instance of the class for which the event is.

    + +
  • +
  • + +

    EventTemplate :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnBirthForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTBIRTH event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName : +The id of the unit for the event to be handled.

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnBirthRemove(EventClass) + +
+
+ +

Stop listening to SEVENTBIRTH event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnCrash(EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTCRASH event.

+ +

Parameters

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnCrashForTemplate(EventGroup, EventFunction, EventClass, EventTemplate) + +
+
+ +

Create an OnCrash event handler for a group

+ +

Parameters

+
    +
  • + +

    Wrapper.Group#GROUP EventGroup :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    EventClass : +The self instance of the class for which the event is.

    + +
  • +
  • + +

    EventTemplate :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnCrashForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTCRASH event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnCrashRemove(EventClass) + +
+
+ +

Stop listening to SEVENTCRASH event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnDead(EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTDEAD event.

+ +

Parameters

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnDeadForTemplate(EventGroup, EventFunction, EventClass, EventTemplate) + +
+
+ +

Create an OnDead event handler for a group

+ +

Parameters

+
    +
  • + +

    Wrapper.Group#GROUP EventGroup :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    EventClass : +The self instance of the class for which the event is.

    + +
  • +
  • + +

    EventTemplate :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnDeadForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTDEAD event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnDeadRemove(EventClass) + +
+
+ +

Stop listening to SEVENTDEAD event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnEngineShutDownForTemplate(EventTemplate, EventFunction, EventClass) + +
+
+ +

Create an OnDead event handler for a group

+ +

Parameters

+
    +
  • + +

    #table EventTemplate :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnEngineShutDownForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTENGINE_SHUTDOWN event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnEngineShutDownRemove(EventClass) + +
+
+ +

Stop listening to SEVENTENGINE_SHUTDOWN event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnEngineStartUpForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTENGINE_STARTUP event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnEngineStartUpRemove(EventClass) + +
+
+ +

Stop listening to SEVENTENGINE_STARTUP event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnEventForTemplate(EventTemplate, EventFunction, EventClass, OnEventFunction) + +
+
+ +

Create an OnDead event handler for a group

+ +

Parameters

+
    +
  • + +

    #table EventTemplate :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    EventClass : +The instance of the class for which the event is.

    + +
  • +
  • + +

    #function OnEventFunction :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnEventForUnit(EventDCSUnitName, EventFunction, EventClass, EventID) + +
+
+ +

Set a new listener for an SEVENTX event

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Core.Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
  • + +

    EventID :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnEventGeneric(EventFunction, EventClass, EventID) + +
+
+ +

Set a new listener for an SEVENTX event independent from a unit or a weapon.

+ +

Parameters

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Core.Base#BASE EventClass : +The self instance of the class for which the event is captured. When the event happens, the event process will be called in this class provided.

    + +
  • +
  • + +

    EventID :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnHit(EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTHIT event.

+ +

Parameters

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnHitForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTHIT event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnHitRemove(EventClass) + +
+
+ +

Stop listening to SEVENTHIT event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnLandForTemplate(EventTemplate, EventFunction, EventClass) + +
+
+ + + +

Parameters

+
    +
  • + +

    EventTemplate :

    + +
  • +
  • + +

    EventFunction :

    + +
  • +
  • + +

    EventClass :

    + +
  • +
+
+
+
+
+ + +EVENT:OnLandForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTLAND event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnLandRemove(EventClass) + +
+
+ +

Stop listening to SEVENTLAND event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnPilotDead(EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTPILOT_DEAD event.

+ +

Parameters

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass :

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnPilotDeadForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTPILOT_DEAD event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnPilotDeadRemove(EventClass) + +
+
+ +

Stop listening to SEVENTPILOT_DEAD event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnPlayerEnterRemove(EventClass) + +
+
+ +

Stop listening to SEVENTPLAYERENTERUNIT event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnPlayerEnterUnit(EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTPLAYERENTERUNIT event.

+ +

Parameters

+
    +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnPlayerLeaveRemove(EventClass) + +
+
+ +

Stop listening to SEVENTPLAYERLEAVEUNIT event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnPlayerLeaveUnit(EventFunction, EventClass) + +
+
+ + + +

Parameters

+
    +
  • + +

    EventFunction :

    + +
  • +
  • + +

    EventClass :

    + +
  • +
+
+
+
+
+ + +EVENT:OnShot(EventFunction, EventClass) + +
+
+ + + +

Parameters

+
    +
  • + +

    EventFunction :

    + +
  • +
  • + +

    EventClass :

    + +
  • +
+
+
+
+
+ + +EVENT:OnShotForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTSHOT event for a unit.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnShotRemove(EventClass) + +
+
+ +

Stop listening to SEVENTSHOT event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnTakeOffForTemplate(EventTemplate, EventFunction, EventClass) + +
+
+ + + +

Parameters

+
    +
  • + +

    EventTemplate :

    + +
  • +
  • + +

    EventFunction :

    + +
  • +
  • + +

    EventClass :

    + +
  • +
+
+
+
+
+ + +EVENT:OnTakeOffForUnit(EventDCSUnitName, EventFunction, EventClass) + +
+
+ +

Set a new listener for an SEVENTTAKEOFF event.

+ +

Parameters

+
    +
  • + +

    #string EventDCSUnitName :

    + +
  • +
  • + +

    #function EventFunction : +The function to be called when the event occurs for the unit.

    + +
  • +
  • + +

    Base#BASE EventClass : +The self instance of the class for which the event is.

    + +
  • +
+

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:OnTakeOffRemove(EventClass) + +
+
+ +

Stop listening to SEVENTTAKEOFF event.

+ +

Parameter

+ +

Return value

+ +

#EVENT:

+ + +
+
+
+
+ + +EVENT:Remove(EventClass, EventID) + +
+
+ +

Removes an Events entry

+ +

Parameters

+ +

Return value

+ +

#EVENT.Events:

+ + +
+
+
+
+ + +EVENT:RemoveAll(EventObject) + +
+
+ +

Clears all event subscriptions for a Core.Base#BASE derived object.

+ +

Parameter

+ +
+
+
+
+ + +EVENT:onEvent(Event) + +
+
+ + + +

Parameter

+ +
+
+ +

Type EVENT.Events

+ +

The Events structure

+ +

Field(s)

+
+
+ + #number + +EVENT.Events.IniUnit + +
+
+ + + +
+
+ +

Type EVENTDATA

+ +

The Event structure

+ +

Field(s)

+
+
+ + +EVENTDATA.IniDCSGroup + +
+
+ + + +
+
+
+
+ + +EVENTDATA.IniDCSGroupName + +
+
+ + + +
+
+
+
+ + +EVENTDATA.IniDCSUnit + +
+
+ + + +
+
+
+
+ + +EVENTDATA.IniDCSUnitName + +
+
+ + + +
+
+
+
+ + Wrapper.Unit#UNIT + +EVENTDATA.IniUnit + +
+
+ + + +
+
+
+
+ + #string + +EVENTDATA.IniUnitName + +
+
+ + + +
+
+
+
+ + +EVENTDATA.TgtDCSGroup + +
+
+ + + +
+
+
+
+ + +EVENTDATA.TgtDCSGroupName + +
+
+ + + +
+
+
+
+ + +EVENTDATA.TgtDCSUnit + +
+
+ + + +
+
+
+
+ + +EVENTDATA.TgtDCSUnitName + +
+
+ + + +
+
+
+
+ + Wrapper.Unit#UNIT + +EVENTDATA.TgtUnit + +
+
+ + + +
+
+
+
+ + #string + +EVENTDATA.TgtUnitName + +
+
+ + + +
+
+
+
+ + +EVENTDATA.Weapon + +
+
+ + + +
+
+
+
+ + +EVENTDATA.WeaponName + +
+
+ + + +
+
+
+
+ + +EVENTDATA.WeaponTgtDCSUnit + +
+
+ + + +
+
+
+
+ + +EVENTDATA.id + +
+
+ + + +
+
+
+
+ + +EVENTDATA.initiator + +
+
+ + + +
+
+
+
+ + +EVENTDATA.target + +
+
+ + + +
+
+
+
+ + +EVENTDATA.weapon + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Fsm.html b/docs/Documentation/Fsm.html new file mode 100644 index 000000000..0b08c42d6 --- /dev/null +++ b/docs/Documentation/Fsm.html @@ -0,0 +1,2035 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Fsm

+ +

This module contains the FSM class.

+ + +

This development is based on a state machine implementation made by Conroy Kyle. +The state machine can be found here: https://github.com/kyleconroy/lua-state-machine

+ +

I've taken the development and enhanced it to make the state machine hierarchical... +It is a fantastic development, this module.

+ +
+ +

1) Workflow#FSM class, extends Core.Base#BASE

+ +

1.1) Add or remove objects from the FSM

+ +

Global(s)

+ + + + + + + + + + + + + + + + + + + + + +
FSM + +
FSM_CONTROLLABLE + +
FSM_PROCESS + +
FSM_SET + +
FSM_TASK + +
+

Type FSM

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FSM:AddEndState(State) + +
FSM:AddProcess(From, Event, Process, ReturnEvents) +

Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Controllable by the task.

+
FSM:AddScore(State, ScoreText, Score) +

Adds a score for the FSM to be achieved.

+
FSM:AddScoreProcess(From, Event, State, ScoreText, Score) +

Adds a score for the FSM_PROCESS to be achieved.

+
FSM:AddTransition(From, Event, To) + +
FSM.ClassName + +
FSM:GetEndStates() + +
FSM:GetProcess(From, Event) + +
FSM:GetProcesses() + +
FSM:GetScores() + +
FSM:GetStartState() + +
FSM:GetState() + +
FSM:GetSubs() + +
FSM:GetTransitions() + +
FSM:Is(State) + +
FSM:LoadCallBacks(CallBackTable) + +
FSM:New(FsmT) +

Creates a new FSM object.

+
FSM:SetStartState(State) + +
FSM:_add_to_map(Map, Event) + +
FSM:_call_handler(handler, params) + +
FSM:_create_transition(EventName) + +
FSM:_delayed_transition(EventName) + +
FSM:_eventmap(Events, EventStructure) + +
FSM:_gosub(ParentFrom, ParentEvent) + +
FSM:_handler(EventName, ...) + +
FSM:_isendstate(Current) + +
FSM:_submap(subs, sub, name) + +
FSM:can(e) + +
FSM:cannot(e) + +
FSM:is(state) + +
+ +

Type FSM_CONTROLLABLE

+ + + + + + + + + + + + + + + + + + + + + + + + + +
FSM_CONTROLLABLE.ClassName + +
FSM_CONTROLLABLE.Controllable + +
FSM_CONTROLLABLE:GetControllable() +

Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.

+
FSM_CONTROLLABLE:New(FSMT, Controllable) +

Creates a new FSM_CONTROLLABLE object.

+
FSM_CONTROLLABLE:SetControllable(FSMControllable) +

Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.

+
FSM_CONTROLLABLE:_call_handler(handler, params) + +
+ +

Type FSM_PROCESS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FSM_PROCESS:AddScore(State, ScoreText, Score) +

Adds a score for the FSM_PROCESS to be achieved.

+
FSM_PROCESS:Assign(Task, ProcessUnit) +

Assign the process to a Unit and activate the process.

+
FSM_PROCESS.ClassName + +
FSM_PROCESS:Copy(Controllable, Task) +

Creates a new FSMPROCESS object based on this FSMPROCESS.

+
FSM_PROCESS:GetCommandCenter() +

Gets the mission of the process.

+
FSM_PROCESS:GetMission() +

Gets the mission of the process.

+
FSM_PROCESS:GetTask() +

Gets the task of the process.

+
FSM_PROCESS:Init(FsmProcess) + +
FSM_PROCESS:Message(Message) +

Send a message of the Task to the Group of the Unit.

+
FSM_PROCESS:New(Controllable, Task) +

Creates a new FSM_PROCESS object.

+
FSM_PROCESS:SetTask(Task) +

Sets the task of the process.

+
FSM_PROCESS.Task + +
FSM_PROCESS:onenterAssigned(ProcessUnit) + +
FSM_PROCESS:onenterFailed(ProcessUnit) + +
FSM_PROCESS:onenterSuccess(ProcessUnit) + +
FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Dummy) +

StateMachine callback function for a FSM_PROCESS

+
+ +

Type FSM_SET

+ + + + + + + + + + + + + + + + + + + + + +
FSM_SET.ClassName + +
FSM_SET:Get() +

Gets the SETBASE object that the FSMSET governs.

+
FSM_SET:New(FSMT, Set_SET_BASE, FSMSet) +

Creates a new FSM_SET object.

+
FSM_SET.Set + +
FSM_SET:_call_handler(handler, params) + +
+ +

Type FSM_TASK

+ + + + + + + + + + + + + + + + + +
FSM_TASK.ClassName + +
FSM_TASK:New(FSMT, Task, TaskUnit) +

Creates a new FSM_TASK object.

+
FSM_TASK.Task + +
FSM_TASK:_call_handler(handler, params) + +
+ +

Global(s)

+
+
+ + #FSM + +FSM + +
+
+ + + +
+
+
+
+ + #FSM_CONTROLLABLE + +FSM_CONTROLLABLE + +
+
+ + + +
+
+
+
+ + #FSM_PROCESS + +FSM_PROCESS + +
+
+ + + +
+
+
+
+ + #FSM_SET + +FSM_SET + +
+
+ + + +
+
+
+
+ + #FSM_TASK + +FSM_TASK + +
+
+ + + +
+
+

Type Fsm

+ +

Type FSM

+ +

FSM class

+ +

Field(s)

+
+
+ + +FSM:AddEndState(State) + +
+
+ + + +

Parameter

+
    +
  • + +

    State :

    + +
  • +
+
+
+
+
+ + +FSM:AddProcess(From, Event, Process, ReturnEvents) + +
+
+ +

Set the default Process template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Controllable by the task.

+ +

Parameters

+
    +
  • + +

    From :

    + +
  • +
  • + +

    Event :

    + +
  • +
  • + +

    Process :

    + +
  • +
  • + +

    ReturnEvents :

    + +
  • +
+

Return value

+ +

Core.Fsm#FSM_PROCESS:

+ + +
+
+
+
+ + +FSM:AddScore(State, ScoreText, Score) + +
+
+ +

Adds a score for the FSM to be achieved.

+ +

Parameters

+
    +
  • + +

    #string State : +is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

    + +
  • +
  • + +

    #string ScoreText : +is a text describing the score that is given according the status.

    + +
  • +
  • + +

    #number Score : +is a number providing the score of the status.

    + +
  • +
+

Return value

+ +

#FSM: +self

+ +
+
+
+
+ + +FSM:AddScoreProcess(From, Event, State, ScoreText, Score) + +
+
+ +

Adds a score for the FSM_PROCESS to be achieved.

+ +

Parameters

+
    +
  • + +

    #string From : +is the From State of the main process.

    + +
  • +
  • + +

    #string Event : +is the Event of the main process.

    + +
  • +
  • + +

    #string State : +is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

    + +
  • +
  • + +

    #string ScoreText : +is a text describing the score that is given according the status.

    + +
  • +
  • + +

    #number Score : +is a number providing the score of the status.

    + +
  • +
+

Return value

+ +

#FSM: +self

+ +
+
+
+
+ + +FSM:AddTransition(From, Event, To) + +
+
+ + + +

Parameters

+
    +
  • + +

    From :

    + +
  • +
  • + +

    Event :

    + +
  • +
  • + +

    To :

    + +
  • +
+
+
+
+
+ + #string + +FSM.ClassName + +
+
+ + + +
+
+
+
+ + +FSM:GetEndStates() + +
+
+ + + +
+
+
+
+ + +FSM:GetProcess(From, Event) + +
+
+ + + +

Parameters

+
    +
  • + +

    From :

    + +
  • +
  • + +

    Event :

    + +
  • +
+
+
+
+
+ + +FSM:GetProcesses() + +
+
+ + + +
+
+
+
+ + +FSM:GetScores() + +
+
+ + + +
+
+
+
+ + +FSM:GetStartState() + +
+
+ + + +
+
+
+
+ + +FSM:GetState() + +
+
+ + + +
+
+
+
+ + +FSM:GetSubs() + +
+
+ + + +
+
+
+
+ + +FSM:GetTransitions() + +
+
+ + + +
+
+
+
+ + +FSM:Is(State) + +
+
+ + + +

Parameter

+
    +
  • + +

    State :

    + +
  • +
+
+
+
+
+ + +FSM:LoadCallBacks(CallBackTable) + +
+
+ + + +

Parameter

+
    +
  • + +

    CallBackTable :

    + +
  • +
+
+
+
+
+ + +FSM:New(FsmT) + +
+
+ +

Creates a new FSM object.

+ +

Parameter

+
    +
  • + +

    FsmT :

    + +
  • +
+

Return value

+ +

#FSM:

+ + +
+
+
+
+ + +FSM:SetStartState(State) + +
+
+ + + +

Parameter

+
    +
  • + +

    State :

    + +
  • +
+
+
+
+
+ + +FSM:_add_to_map(Map, Event) + +
+
+ + + +

Parameters

+
    +
  • + +

    Map :

    + +
  • +
  • + +

    Event :

    + +
  • +
+
+
+
+
+ + +FSM:_call_handler(handler, params) + +
+
+ + + +

Parameters

+
    +
  • + +

    handler :

    + +
  • +
  • + +

    params :

    + +
  • +
+
+
+
+
+ + +FSM:_create_transition(EventName) + +
+
+ + + +

Parameter

+
    +
  • + +

    EventName :

    + +
  • +
+
+
+
+
+ + +FSM:_delayed_transition(EventName) + +
+
+ + + +

Parameter

+
    +
  • + +

    EventName :

    + +
  • +
+
+
+
+
+ + +FSM:_eventmap(Events, EventStructure) + +
+
+ + + +

Parameters

+
    +
  • + +

    Events :

    + +
  • +
  • + +

    EventStructure :

    + +
  • +
+
+
+
+
+ + +FSM:_gosub(ParentFrom, ParentEvent) + +
+
+ + + +

Parameters

+
    +
  • + +

    ParentFrom :

    + +
  • +
  • + +

    ParentEvent :

    + +
  • +
+
+
+
+
+ + +FSM:_handler(EventName, ...) + +
+
+ + + +

Parameters

+
    +
  • + +

    EventName :

    + +
  • +
  • + +

    ... :

    + +
  • +
+
+
+
+
+ + +FSM:_isendstate(Current) + +
+
+ + + +

Parameter

+
    +
  • + +

    Current :

    + +
  • +
+
+
+
+
+ + +FSM:_submap(subs, sub, name) + +
+
+ + + +

Parameters

+
    +
  • + +

    subs :

    + +
  • +
  • + +

    sub :

    + +
  • +
  • + +

    name :

    + +
  • +
+
+
+
+
+ + +FSM:can(e) + +
+
+ + + +

Parameter

+
    +
  • + +

    e :

    + +
  • +
+
+
+
+
+ + +FSM:cannot(e) + +
+
+ + + +

Parameter

+
    +
  • + +

    e :

    + +
  • +
+
+
+
+
+ + +FSM:is(state) + +
+
+ + + +

Parameter

+
    +
  • + +

    state :

    + +
  • +
+
+
+ +

Type FSM_CONTROLLABLE

+ +

FSM_CONTROLLABLE class

+ +

Field(s)

+
+
+ + #string + +FSM_CONTROLLABLE.ClassName + +
+
+ + + +
+
+
+
+ + Wrapper.Controllable#CONTROLLABLE + +FSM_CONTROLLABLE.Controllable + +
+
+ + + +
+
+
+
+ + +FSM_CONTROLLABLE:GetControllable() + +
+
+ +

Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.

+ +

Return value

+ +

Wrapper.Controllable#CONTROLLABLE:

+ + +
+
+
+
+ + +FSM_CONTROLLABLE:New(FSMT, Controllable) + +
+
+ +

Creates a new FSM_CONTROLLABLE object.

+ +

Parameters

+
    +
  • + +

    #table FSMT : +Finite State Machine Table

    + +
  • +
  • + +

    Wrapper.Controllable#CONTROLLABLE Controllable : +(optional) The CONTROLLABLE object that the FSM_CONTROLLABLE governs.

    + +
  • +
+

Return value

+ +

#FSM_CONTROLLABLE:

+ + +
+
+
+
+ + +FSM_CONTROLLABLE:SetControllable(FSMControllable) + +
+
+ +

Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.

+ +

Parameter

+ +

Return value

+ +

#FSM_CONTROLLABLE:

+ + +
+
+
+
+ + +FSM_CONTROLLABLE:_call_handler(handler, params) + +
+
+ + + +

Parameters

+
    +
  • + +

    handler :

    + +
  • +
  • + +

    params :

    + +
  • +
+
+
+ +

Type FSM_PROCESS

+ +

FSM_PROCESS class

+ +

Field(s)

+
+
+ + +FSM_PROCESS:AddScore(State, ScoreText, Score) + +
+
+ +

Adds a score for the FSM_PROCESS to be achieved.

+ +

Parameters

+
    +
  • + +

    #string State : +is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

    + +
  • +
  • + +

    #string ScoreText : +is a text describing the score that is given according the status.

    + +
  • +
  • + +

    #number Score : +is a number providing the score of the status.

    + +
  • +
+

Return value

+ +

#FSM_PROCESS: +self

+ +
+
+
+
+ + +FSM_PROCESS:Assign(Task, ProcessUnit) + +
+
+ +

Assign the process to a Unit and activate the process.

+ +

Parameters

+ +

Return value

+ +

#FSM_PROCESS: +self

+ +
+
+
+
+ + #string + +FSM_PROCESS.ClassName + +
+
+ + + +
+
+
+
+ + +FSM_PROCESS:Copy(Controllable, Task) + +
+
+ +

Creates a new FSMPROCESS object based on this FSMPROCESS.

+ +

Parameters

+
    +
  • + +

    Controllable :

    + +
  • +
  • + +

    Task :

    + +
  • +
+

Return value

+ +

#FSM_PROCESS:

+ + +
+
+
+
+ + +FSM_PROCESS:GetCommandCenter() + +
+
+ +

Gets the mission of the process.

+ +

Return value

+ +

Tasking.CommandCenter#COMMANDCENTER:

+ + +
+
+
+
+ + +FSM_PROCESS:GetMission() + +
+
+ +

Gets the mission of the process.

+ +

Return value

+ +

Tasking.Mission#MISSION:

+ + +
+
+
+
+ + +FSM_PROCESS:GetTask() + +
+
+ +

Gets the task of the process.

+ +

Return value

+ +

Tasking.Task#TASK:

+ + +
+
+
+
+ + +FSM_PROCESS:Init(FsmProcess) + +
+
+ + + +

Parameter

+
    +
  • + +

    FsmProcess :

    + +
  • +
+
+
+
+
+ + +FSM_PROCESS:Message(Message) + +
+
+ +

Send a message of the Task to the Group of the Unit.

+ +

Parameter

+
    +
  • + +

    Message :

    + +
  • +
+
+
+
+
+ + +FSM_PROCESS:New(Controllable, Task) + +
+
+ +

Creates a new FSM_PROCESS object.

+ +

Parameters

+
    +
  • + +

    Controllable :

    + +
  • +
  • + +

    Task :

    + +
  • +
+

Return value

+ +

#FSM_PROCESS:

+ + +
+
+
+
+ + +FSM_PROCESS:SetTask(Task) + +
+
+ +

Sets the task of the process.

+ +

Parameter

+ +

Return value

+ +

#FSM_PROCESS:

+ + +
+
+
+
+ + Tasking.Task#TASK + +FSM_PROCESS.Task + +
+
+ + + +
+
+
+
+ + +FSM_PROCESS:onenterAssigned(ProcessUnit) + +
+
+ + + +

Parameter

+
    +
  • + +

    ProcessUnit :

    + +
  • +
+
+
+
+
+ + +FSM_PROCESS:onenterFailed(ProcessUnit) + +
+
+ + + +

Parameter

+
    +
  • + +

    ProcessUnit :

    + +
  • +
+
+
+
+
+ + +FSM_PROCESS:onenterSuccess(ProcessUnit) + +
+
+ + + +

Parameter

+
    +
  • + +

    ProcessUnit :

    + +
  • +
+
+
+
+
+ + +FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Dummy) + +
+
+ +

StateMachine callback function for a FSM_PROCESS

+ +

Parameters

+ +
+
+ +

Type FSM_SET

+ +

FSM_SET class

+ +

Field(s)

+
+
+ + #string + +FSM_SET.ClassName + +
+
+ + + +
+
+
+
+ + +FSM_SET:Get() + +
+
+ +

Gets the SETBASE object that the FSMSET governs.

+ +

Return value

+ +

Core.Set#SET_BASE:

+ + +
+
+
+
+ + +FSM_SET:New(FSMT, Set_SET_BASE, FSMSet) + +
+
+ +

Creates a new FSM_SET object.

+ +

Parameters

+
    +
  • + +

    #table FSMT : +Finite State Machine Table

    + +
  • +
  • + +

    SetSETBASE : +FSMSet (optional) The Set object that the FSM_SET governs.

    + +
  • +
  • + +

    FSMSet :

    + +
  • +
+

Return value

+ +

#FSM_SET:

+ + +
+
+
+
+ + Core.Set#SET_BASE + +FSM_SET.Set + +
+
+ + + +
+
+
+
+ + +FSM_SET:_call_handler(handler, params) + +
+
+ + + +

Parameters

+
    +
  • + +

    handler :

    + +
  • +
  • + +

    params :

    + +
  • +
+
+
+ +

Type FSM_TASK

+ +

FSM_TASK class

+ +

Field(s)

+
+
+ + #string + +FSM_TASK.ClassName + +
+
+ + + +
+
+
+
+ + +FSM_TASK:New(FSMT, Task, TaskUnit) + +
+
+ +

Creates a new FSM_TASK object.

+ +

Parameters

+ +

Return value

+ +

#FSM_TASK:

+ + +
+
+
+
+ + Tasking.Task#TASK + +FSM_TASK.Task + +
+
+ + + +
+
+
+
+ + +FSM_TASK:_call_handler(handler, params) + +
+
+ + + +

Parameters

+
    +
  • + +

    handler :

    + +
  • +
  • + +

    params :

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/Group.html b/docs/Documentation/Group.html new file mode 100644 index 000000000..f258edf15 --- /dev/null +++ b/docs/Documentation/Group.html @@ -0,0 +1,1537 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Group

+ +

This module contains the GROUP class.

+ + + +

1) Wrapper.Group#GROUP class, extends Wrapper.Controllable#CONTROLLABLE

+

The Wrapper.Group#GROUP class is a wrapper class to handle the DCS Group objects:

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

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

+ +

1.1) GROUP reference methods

+

For each DCS Group object alive within a running mission, a GROUP 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 Group objects are spawned (using the SPAWN class).

+ +

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

+ +

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

+ +

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

+ +
    +
  • GROUP.Find(): Find a GROUP instance from the _DATABASE object using a DCS Group object.
  • +
  • GROUP.FindByName(): Find a GROUP instance from the _DATABASE object using a DCS Group name.
  • +
+ +

1.2) GROUP task methods

+

Several group task methods are available that help you to prepare tasks. +These methods return a string consisting of the task description, which can then be given to either a
+Wrapper.Controllable#CONTROLLABLE.PushTask or Wrapper.Controllable#CONTROLLABLE.SetTask method to assign the task to the GROUP. +Tasks are specific for the category of the GROUP, more specific, for AIR, GROUND or AIR and GROUND. +Each task description where applicable indicates for which group category the task is valid. +There are 2 main subdivisions of tasks: Assigned tasks and EnRoute tasks.

+ +

1.2.1) Assigned task methods

+ +

Assigned task methods make the group execute the task where the location of the (possible) targets of the task are known before being detected. +This is different from the EnRoute tasks, where the targets of the task need to be detected before the task can be executed.

+ +

Find below a list of the assigned task methods:

+ + + +

1.2.2) EnRoute task methods

+ +

EnRoute tasks require the targets of the task need to be detected by the group (using its sensors) before the task can be executed:

+ + + +

1.2.3) Preparation task methods

+ +

There are certain task methods that allow to tailor the task behaviour:

+ + + +

1.2.4) Obtain the mission from group templates

+ +

Group templates contain complete mission descriptions. Sometimes you want to copy a complete mission from a group and assign it to another:

+ + + +

1.3) GROUP Command methods

+

Group command methods prepare the execution of commands using the Wrapper.Controllable#CONTROLLABLE.SetCommand method:

+ + + +

1.4) GROUP Option methods

+

Group Option methods change the behaviour of the Group while being alive.

+ +

1.4.1) Rule of Engagement:

+ + + +

To check whether an ROE option is valid for a specific group, use:

+ + + +

1.4.2) Rule on thread:

+ + + +

To test whether an ROT option is valid for a specific group, use:

+ + + +

1.5) GROUP Zone validation methods

+

The group can be validated whether it is completely, partly or not within a Zone. +Use the following Zone validation methods on the group:

+ + + +

The zone can be of any Zone class derived from Core.Zone#ZONE_BASE. So, these methods are polymorphic to the zones tested on.

+ + +

Global(s)

+ + + + + +
GROUP + +
+

Type GROUP

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
GROUP:Activate() +

Activates a GROUP.

+
GROUP:AllOnGround() +

Returns if all units of the group are on the ground or landed.

+
GROUP:CalculateThreatLevelA2G() +

Calculate the maxium A2G threat level of the Group.

+
GROUP.ClassName + +
GROUP:CopyRoute(Begin, End, Randomize, Radius) +

Return the route of a group by using the Core.Database#DATABASE class.

+
GROUP:Destroy() +

Destroys the DCS Group and all of its DCS Units.

+
GROUP:Find(DCSGroup) +

Find the GROUP wrapper class instance using the DCS Group.

+
GROUP:FindByName(GroupName) +

Find the created GROUP using the DCS Group Name.

+
GROUP:GetCallsign() +

Gets the CallSign of the first DCS Unit of the DCS Group.

+
GROUP:GetCategory() +

Returns category of the DCS Group.

+
GROUP:GetCategoryName() +

Returns the category name of the DCS Group.

+
GROUP:GetCoalition() +

Returns the coalition of the DCS Group.

+
GROUP:GetCountry() +

Returns the country of the DCS Group.

+
GROUP:GetDCSObject() +

Returns the DCS Group.

+
GROUP:GetDCSUnit(UnitNumber) +

Returns the DCS Unit with number UnitNumber.

+
GROUP:GetDCSUnits() +

Returns the DCS Units of the DCS Group.

+
GROUP:GetInitialSize() +
    +
  • Returns the initial size of the DCS Group.
  • +
+
GROUP:GetMaxHeight() +

Returns the current maximum height of the group.

+
GROUP:GetMaxVelocity() +

Returns the current maximum velocity of the group.

+
GROUP:GetMinHeight() +

Returns the current minimum height of the group.

+
GROUP:GetSize() +

Returns current size of the DCS Group.

+
GROUP:GetTaskMission() +

Return the mission template of the group.

+
GROUP:GetTaskRoute() +

Return the mission route of the group.

+
GROUP:GetTemplate() +

Returns the group template from the DATABASE (_DATABASE object).

+
GROUP:GetTypeName() +

Gets the type name of the group.

+
GROUP:GetUnit(UnitNumber) +

Returns the UNIT wrapper class with number UnitNumber.

+
GROUP:GetUnits() +

Returns the UNITs wrappers of the DCS Units of the DCS Group.

+
GROUP:GetVec2() +

Returns the current point (Vec2 vector) of the first DCS Unit in the DCS Group.

+
GROUP:GetVec3() +

Returns the current Vec3 vector of the first DCS Unit in the GROUP.

+
GROUP.GroupName +

The name of the group.

+
GROUP:IsAir() +

Returns if the group is of an air category.

+
GROUP:IsAirPlane() +

Returns if the DCS Group contains AirPlanes.

+
GROUP:IsAlive() +

Returns if the DCS Group is alive.

+
GROUP:IsCompletelyInZone(Zone) +

Returns true if all units of the group are within a Zone.

+
GROUP:IsGround() +

Returns if the DCS Group contains Ground troops.

+
GROUP:IsHelicopter() +

Returns if the DCS Group contains Helicopters.

+
GROUP:IsNotInZone(Zone) +

Returns true if none of the group units of the group are within a Zone.

+
GROUP:IsPartlyInZone(Zone) +

Returns true if some units of the group are within a Zone.

+
GROUP:IsShip() +

Returns if the DCS Group contains Ships.

+
GROUP:Register(GroupName) +

Create a new GROUP from a DCSGroup

+
GROUP:Respawn(Template) +

Respawn the GROUP using a (tweaked) template of the Group.

+
GROUP:SetTemplateCoalition(CoalitionID, Template) +

Sets the CoalitionID of the group in a Template.

+
GROUP:SetTemplateControlled(Controlled, Template) +

Sets the controlled status in a Template.

+
GROUP:SetTemplateCountry(CountryID, Template) +

Sets the CountryID of the group in a Template.

+
+ +

Global(s)

+
+
+ + #GROUP + +GROUP + +
+
+ + + +
+
+

Type Group

+ +

Type GROUP

+ +

The GROUP class

+ +

Field(s)

+
+
+ + +GROUP:Activate() + +
+
+ +

Activates a GROUP.

+ +
+
+
+
+ + +GROUP:AllOnGround() + +
+
+ +

Returns if all units of the group are on the ground or landed.

+ + +

If all units of this group are on the ground, this function will return true, otherwise false.

+ +

Return value

+ +

#boolean: +All units on the ground result.

+ +
+
+
+
+ + +GROUP:CalculateThreatLevelA2G() + +
+
+ +

Calculate the maxium A2G threat level of the Group.

+ +
+
+
+
+ + #string + +GROUP.ClassName + +
+
+ + + +
+
+
+
+ + +GROUP:CopyRoute(Begin, End, Randomize, Radius) + +
+
+ +

Return the route of a group by using the Core.Database#DATABASE class.

+ +

Parameters

+
    +
  • + +

    #number Begin : +The route point from where the copy will start. The base route point is 0.

    + +
  • +
  • + +

    #number End : +The route point where the copy will end. The End point is the last point - the End point. The last point has base 0.

    + +
  • +
  • + +

    #boolean Randomize : +Randomization of the route, when true.

    + +
  • +
  • + +

    #number Radius : +When randomization is on, the randomization is within the radius.

    + +
  • +
+
+
+
+
+ + +GROUP:Destroy() + +
+
+ +

Destroys the DCS Group and all of its DCS Units.

+ + +

Note that this destroy method also raises a destroy event at run-time. +So all event listeners will catch the destroy event of this DCS Group.

+ +
+
+
+
+ + +GROUP:Find(DCSGroup) + +
+
+ +

Find the GROUP wrapper class instance using the DCS Group.

+ +

Parameter

+ +

Return value

+ +

#GROUP: +The GROUP.

+ +
+
+
+
+ + +GROUP:FindByName(GroupName) + +
+
+ +

Find the created GROUP using the DCS Group Name.

+ +

Parameter

+
    +
  • + +

    #string GroupName : +The DCS Group Name.

    + +
  • +
+

Return value

+ +

#GROUP: +The GROUP.

+ +
+
+
+
+ + +GROUP:GetCallsign() + +
+
+ +

Gets the CallSign of the first DCS Unit of the DCS Group.

+ +

Return value

+ +

#string: +The CallSign of the first DCS Unit of the DCS Group.

+ +
+
+
+
+ + +GROUP:GetCategory() + +
+
+ +

Returns category of the DCS Group.

+ +

Return value

+ +

Dcs.DCSWrapper.Group#Group.Category: +The category ID

+ +
+
+
+
+ + +GROUP:GetCategoryName() + +
+
+ +

Returns the category name of the DCS Group.

+ +

Return value

+ +

#string: +Category name = Helicopter, Airplane, Ground Unit, Ship

+ +
+
+
+
+ + +GROUP:GetCoalition() + +
+
+ +

Returns the coalition of the DCS Group.

+ +

Return value

+ +

Dcs.DCSCoalitionWrapper.Object#coalition.side: +The coalition side of the DCS Group.

+ +
+
+
+
+ + +GROUP:GetCountry() + +
+
+ +

Returns the country of the DCS Group.

+ +

Return values

+
    +
  1. + +

    Dcs.DCScountry#country.id: +The country identifier.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +GROUP:GetDCSObject() + +
+
+ +

Returns the DCS Group.

+ +

Return value

+ +

Dcs.DCSWrapper.Group#Group: +The DCS Group.

+ +
+
+
+
+ + +GROUP:GetDCSUnit(UnitNumber) + +
+
+ +

Returns the DCS Unit with number UnitNumber.

+ + +

If the underlying DCS Unit does not exist, the method will return nil. .

+ +

Parameter

+
    +
  • + +

    #number UnitNumber : +The number of the DCS Unit to be returned.

    + +
  • +
+

Return value

+ +

Dcs.DCSWrapper.Unit#Unit: +The DCS Unit.

+ +
+
+
+
+ + +GROUP:GetDCSUnits() + +
+
+ +

Returns the DCS Units of the DCS Group.

+ +

Return value

+ +

#table: +The DCS Units.

+ +
+
+
+
+ + +GROUP:GetInitialSize() + +
+
+ +
    +
  • Returns the initial size of the DCS Group.
  • +
+ + +

If some of the DCS Units of the DCS Group are destroyed, the initial size of the DCS Group is unchanged.

+ +

Return value

+ +

#number: +The DCS Group initial size.

+ +
+
+
+
+ + +GROUP:GetMaxHeight() + +
+
+ +

Returns the current maximum height of the group.

+ + +

Each unit within the group gets evaluated, and the maximum height (= the unit which is the highest elevated) is returned.

+ +

Return value

+ +

#number: +Maximum height found.

+ +
+
+
+
+ + +GROUP:GetMaxVelocity() + +
+
+ +

Returns the current maximum velocity of the group.

+ + +

Each unit within the group gets evaluated, and the maximum velocity (= the unit which is going the fastest) is returned.

+ +

Return value

+ +

#number: +Maximum velocity found.

+ +
+
+
+
+ + +GROUP:GetMinHeight() + +
+
+ +

Returns the current minimum height of the group.

+ + +

Each unit within the group gets evaluated, and the minimum height (= the unit which is the lowest elevated) is returned.

+ +

Return value

+ +

#number: +Minimum height found.

+ +
+
+
+
+ + +GROUP:GetSize() + +
+
+ +

Returns current size of the DCS Group.

+ + +

If some of the DCS Units of the DCS Group are destroyed the size of the DCS Group is changed.

+ +

Return value

+ +

#number: +The DCS Group size.

+ +
+
+
+
+ + +GROUP:GetTaskMission() + +
+
+ +

Return the mission template of the group.

+ +

Return value

+ +

#table: +The MissionTemplate

+ +
+
+
+
+ + +GROUP:GetTaskRoute() + +
+
+ +

Return the mission route of the group.

+ +

Return value

+ +

#table: +The mission route defined by points.

+ +
+
+
+
+ + +GROUP:GetTemplate() + +
+
+ +

Returns the group template from the DATABASE (_DATABASE object).

+ +

Return value

+ +

#table:

+ + +
+
+
+
+ + +GROUP:GetTypeName() + +
+
+ +

Gets the type name of the group.

+ +

Return value

+ +

#string: +The type name of the group.

+ +
+
+
+
+ + +GROUP:GetUnit(UnitNumber) + +
+
+ +

Returns the UNIT wrapper class with number UnitNumber.

+ + +

If the underlying DCS Unit does not exist, the method will return nil. .

+ +

Parameter

+
    +
  • + +

    #number UnitNumber : +The number of the UNIT wrapper class to be returned.

    + +
  • +
+

Return value

+ +

Wrapper.Unit#UNIT: +The UNIT wrapper class.

+ +
+
+
+
+ + +GROUP:GetUnits() + +
+
+ +

Returns the UNITs wrappers of the DCS Units of the DCS Group.

+ +

Return value

+ +

#table: +The UNITs wrappers.

+ +
+
+
+
+ + +GROUP:GetVec2() + +
+
+ +

Returns the current point (Vec2 vector) of the first DCS Unit in the DCS Group.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +Current Vec2 point of the first DCS Unit of the DCS Group.

+ +
+
+
+
+ + +GROUP:GetVec3() + +
+
+ +

Returns the current Vec3 vector of the first DCS Unit in the GROUP.

+ +

Return value

+ +

Dcs.DCSTypes#Vec3: +Current Vec3 of the first DCS Unit of the GROUP.

+ +
+
+
+
+ + #string + +GROUP.GroupName + +
+
+ +

The name of the group.

+ +
+
+
+
+ + +GROUP:IsAir() + +
+
+ +

Returns if the group is of an air category.

+ + +

If the group is a helicopter or a plane, then this method will return true, otherwise false.

+ +

Return value

+ +

#boolean: +Air category evaluation result.

+ +
+
+
+
+ + +GROUP:IsAirPlane() + +
+
+ +

Returns if the DCS Group contains AirPlanes.

+ +

Return value

+ +

#boolean: +true if DCS Group contains AirPlanes.

+ +
+
+
+
+ + +GROUP:IsAlive() + +
+
+ +

Returns if the DCS Group is alive.

+ + +

When the group exists at run-time, this method will return true, otherwise false.

+ +

Return value

+ +

#boolean: +true if the DCS Group is alive.

+ +
+
+
+
+ + +GROUP:IsCompletelyInZone(Zone) + +
+
+ +

Returns true if all units of the group are within a Zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +Returns true if the Group is completely within the Core.Zone#ZONE_BASE

+ +
+
+
+
+ + +GROUP:IsGround() + +
+
+ +

Returns if the DCS Group contains Ground troops.

+ +

Return value

+ +

#boolean: +true if DCS Group contains Ground troops.

+ +
+
+
+
+ + +GROUP:IsHelicopter() + +
+
+ +

Returns if the DCS Group contains Helicopters.

+ +

Return value

+ +

#boolean: +true if DCS Group contains Helicopters.

+ +
+
+
+
+ + +GROUP:IsNotInZone(Zone) + +
+
+ +

Returns true if none of the group units of the group are within a Zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +Returns true if the Group is completely within the Core.Zone#ZONE_BASE

+ +
+
+
+
+ + +GROUP:IsPartlyInZone(Zone) + +
+
+ +

Returns true if some units of the group are within a Zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +Returns true if the Group is completely within the Core.Zone#ZONE_BASE

+ +
+
+
+
+ + +GROUP:IsShip() + +
+
+ +

Returns if the DCS Group contains Ships.

+ +

Return value

+ +

#boolean: +true if DCS Group contains Ships.

+ +
+
+
+
+ + +GROUP:Register(GroupName) + +
+
+ +

Create a new GROUP from a DCSGroup

+ +

Parameter

+ +

Return value

+ +

#GROUP: +self

+ +
+
+
+
+ + +GROUP:Respawn(Template) + +
+
+ +

Respawn the GROUP using a (tweaked) template of the Group.

+ + +

The template must be retrieved with the Wrapper.Group#GROUP.GetTemplate() function. +The template contains all the definitions as declared within the mission file. +To understand templates, do the following:

+ +
    +
  • unpack your .miz file into a directory using 7-zip.
  • +
  • browse in the directory created to the file mission.
  • +
  • open the file and search for the country group definitions.
  • +
+ +

Your group template will contain the fields as described within the mission file.

+ +

This function will:

+ +
    +
  • Get the current position and heading of the group.
  • +
  • When the group is alive, it will tweak the template x, y and heading coordinates of the group and the embedded units to the current units positions.
  • +
  • Then it will destroy the current alive group.
  • +
  • And it will respawn the group using your new template definition.
  • +
+ +

Parameter

+
    +
  • + +

    #table Template : +The template of the Group retrieved with GROUP:GetTemplate()

    + +
  • +
+
+
+
+
+ + +GROUP:SetTemplateCoalition(CoalitionID, Template) + +
+
+ +

Sets the CoalitionID of the group in a Template.

+ +

Parameters

+ +

Return value

+ +

#table:

+ + +
+
+
+
+ + +GROUP:SetTemplateControlled(Controlled, Template) + +
+
+ +

Sets the controlled status in a Template.

+ +

Parameters

+
    +
  • + +

    #boolean Controlled : +true is controlled, false is uncontrolled.

    + +
  • +
  • + +

    Template :

    + +
  • +
+

Return value

+ +

#table:

+ + +
+
+
+
+ + +GROUP:SetTemplateCountry(CountryID, Template) + +
+
+ +

Sets the CountryID of the group in a Template.

+ +

Parameters

+ +

Return value

+ +

#table:

+ + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Identifiable.html b/docs/Documentation/Identifiable.html new file mode 100644 index 000000000..95e500f12 --- /dev/null +++ b/docs/Documentation/Identifiable.html @@ -0,0 +1,518 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Identifiable

+ +

This module contains the IDENTIFIABLE class.

+ + + +

1) #IDENTIFIABLE class, extends Wrapper.Object#OBJECT

+

The #IDENTIFIABLE class is a wrapper class to handle the DCS Identifiable objects:

+ +
    +
  • Support all DCS Identifiable APIs.
  • +
  • Enhance with Identifiable specific APIs not in the DCS Identifiable API set.
  • +
  • Manage the "state" of the DCS Identifiable.
  • +
+ +

1.1) IDENTIFIABLE constructor:

+

The IDENTIFIABLE class provides the following functions to construct a IDENTIFIABLE instance:

+ + + +

1.2) IDENTIFIABLE methods:

+

The following methods can be used to identify an identifiable object:

+ + + + +
+ + +

Global(s)

+ + + + + +
IDENTIFIABLE + +
+

Type IDENTIFIABLE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDENTIFIABLE.ClassName + +
IDENTIFIABLE:GetCallsign() +

Gets the CallSign of the IDENTIFIABLE, which is a blank by default.

+
IDENTIFIABLE:GetCategory() +

Returns category of the DCS Identifiable.

+
IDENTIFIABLE:GetCategoryName() +

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

+
IDENTIFIABLE:GetCoalition() +

Returns coalition of the Identifiable.

+
IDENTIFIABLE:GetCountry() +

Returns country of the Identifiable.

+
IDENTIFIABLE:GetDesc() +

Returns Identifiable descriptor.

+
IDENTIFIABLE:GetName() +

Returns DCS Identifiable object name.

+
IDENTIFIABLE:GetTypeName() +

Returns the type name of the DCS Identifiable.

+
IDENTIFIABLE.IdentifiableName +

The name of the identifiable.

+
IDENTIFIABLE:IsAlive() +

Returns if the Identifiable is alive.

+
IDENTIFIABLE:New(IdentifiableName) +

Create a new IDENTIFIABLE from a DCSIdentifiable

+
+ +

Global(s)

+
+
+ + #IDENTIFIABLE + +IDENTIFIABLE + +
+
+ + + +
+
+

Type Identifiable

+ +

Type IDENTIFIABLE

+ +

The IDENTIFIABLE class

+ +

Field(s)

+
+
+ + #string + +IDENTIFIABLE.ClassName + +
+
+ + + +
+
+
+
+ + +IDENTIFIABLE:GetCallsign() + +
+
+ +

Gets the CallSign of the IDENTIFIABLE, which is a blank by default.

+ +

Return value

+ +

#string: +The CallSign of the IDENTIFIABLE.

+ +
+
+
+
+ + +IDENTIFIABLE:GetCategory() + +
+
+ +

Returns category of the DCS Identifiable.

+ +

Return value

+ +

Dcs.DCSWrapper.Object#Object.Category: +The category ID

+ +
+
+
+
+ + +IDENTIFIABLE:GetCategoryName() + +
+
+ +

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

+ +

Return value

+ +

#string: +The DCS Identifiable Category Name

+ +
+
+
+
+ + +IDENTIFIABLE:GetCoalition() + +
+
+ +

Returns coalition of the Identifiable.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSCoalitionWrapper.Object#coalition.side: +The side of the coalition.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +IDENTIFIABLE:GetCountry() + +
+
+ +

Returns country of the Identifiable.

+ +

Return values

+
    +
  1. + +

    Dcs.DCScountry#country.id: +The country identifier.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +IDENTIFIABLE:GetDesc() + +
+
+ +

Returns Identifiable descriptor.

+ + +

Descriptor type depends on Identifiable category.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSWrapper.Identifiable#Identifiable.Desc: +The Identifiable descriptor.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +IDENTIFIABLE:GetName() + +
+
+ +

Returns DCS Identifiable object name.

+ + +

The function provides access to non-activated objects too.

+ +

Return values

+
    +
  1. + +

    #string: +The name of the DCS Identifiable.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +IDENTIFIABLE:GetTypeName() + +
+
+ +

Returns the type name of the DCS Identifiable.

+ +

Return values

+
    +
  1. + +

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

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + #string + +IDENTIFIABLE.IdentifiableName + +
+
+ +

The name of the identifiable.

+ +
+
+
+
+ + +IDENTIFIABLE:IsAlive() + +
+
+ +

Returns if the Identifiable is alive.

+ +

Return values

+
    +
  1. + +

    #boolean: +true if Identifiable is alive.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +IDENTIFIABLE:New(IdentifiableName) + +
+
+ +

Create a new IDENTIFIABLE from a DCSIdentifiable

+ +

Parameter

+ +

Return value

+ +

#IDENTIFIABLE: +self

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/MOVEMENT.html b/docs/Documentation/MOVEMENT.html new file mode 100644 index 000000000..4b01f546a --- /dev/null +++ b/docs/Documentation/MOVEMENT.html @@ -0,0 +1,296 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module MOVEMENT

+ +

Limit the simultaneous movement of Groups within a running Mission.

+ + +

This module is defined to improve the performance in missions, and to bring additional realism for GROUND vehicles. +Performance: If in a DCSRTE there are a lot of moving GROUND units, then in a multi player mission, this WILL create lag if +the main DCS execution core of your CPU is fully utilized. So, this class will limit the amount of simultaneous moving GROUND units +on defined intervals (currently every minute).

+ +

Global(s)

+ + + + + +
MOVEMENT + +
+

Type MOVEMENT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MOVEMENT.ClassName + +
MOVEMENT:New(MovePrefixes, MoveMaximum) + +
MOVEMENT:OnBirth(Event) +

Captures the birth events when new Units were spawned.

+
MOVEMENT:OnDeadOrCrash(Event) +

Captures the Dead or Crash events when Units crash or are destroyed.

+
MOVEMENT:ScheduleStart() +

Call this function to start the MOVEMENT scheduling.

+
MOVEMENT:ScheduleStop() +

Call this function to stop the MOVEMENT scheduling.

+
MOVEMENT:_Scheduler() +

This function is called automatically by the MOVEMENT scheduler.

+
+ +

Global(s)

+
+
+ + #MOVEMENT + +MOVEMENT + +
+
+ + + +
+
+

Type MOVEMENT

+

Field(s)

+
+
+ + #string + +MOVEMENT.ClassName + +
+
+ + + +
+
+
+
+ + +MOVEMENT:New(MovePrefixes, MoveMaximum) + +
+
+ + + +

Parameters

+
    +
  • + +

    MovePrefixes :

    + +
  • +
  • + +

    MoveMaximum :

    + +
  • +
+
+
+
+
+ + +MOVEMENT:OnBirth(Event) + +
+
+ +

Captures the birth events when new Units were spawned.

+ +

Parameter

+
    +
  • + +

    Event :

    + +
  • +
+
+
+
+
+ + +MOVEMENT:OnDeadOrCrash(Event) + +
+
+ +

Captures the Dead or Crash events when Units crash or are destroyed.

+ +

Parameter

+
    +
  • + +

    Event :

    + +
  • +
+
+
+
+
+ + +MOVEMENT:ScheduleStart() + +
+
+ +

Call this function to start the MOVEMENT scheduling.

+ +
+
+
+
+ + +MOVEMENT:ScheduleStop() + +
+
+ +

Call this function to stop the MOVEMENT scheduling.

+ +
+
+
+
+ + +MOVEMENT:_Scheduler() + +
+
+ +

This function is called automatically by the MOVEMENT scheduler.

+ + +

A new function is scheduled when MoveScheduled is true.

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Menu.html b/docs/Documentation/Menu.html new file mode 100644 index 000000000..fc4b11dcc --- /dev/null +++ b/docs/Documentation/Menu.html @@ -0,0 +1,2042 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Menu

+ +

This module contains the MENU classes.

+ + + +

There is a small note... When you see a class like MENUCOMMANDCOALITION with COMMAND in italic, it acutally represents it like this: MENU_COMMAND_COALITION.

+ +
+ +

DCS Menus can be managed using the MENU classes. +The advantage of using MENU classes is that it hides the complexity of dealing with menu management in more advanced scanerios where you need to +set menus and later remove them, and later set them again. You'll find while using use normal DCS scripting functions, that setting and removing +menus is not a easy feat if you have complex menu hierarchies defined. +Using the MOOSE menu classes, the removal and refreshing of menus are nicely being handled within these classes, and becomes much more easy. +On top, MOOSE implements variable parameter passing for command menus.

+ +

There are basically two different MENU class types that you need to use:

+ +

To manage main menus, the classes begin with MENU_:

+ + + +

To manage command menus, which are menus that allow the player to issue functions, the classes begin with MENUCOMMAND:

+ + + +
+ +

The above menus classes are derived from 2 main abstract classes defined within the MOOSE framework (so don't use these):

+ +

1) MENU_ BASE abstract base classes (don't use them)

+

The underlying base menu classes are NOT to be used within your missions. +These are simply abstract base classes defining a couple of fields that are used by the +derived MENU_ classes to manage menus.

+ +

1.1) Core.Menu#MENU_BASE class, extends Core.Base#BASE

+

The #MENU_BASE class defines the main MENU class where other MENU classes are derived from.

+ +

1.2) Core.Menu#MENUCOMMANDBASE class, extends Core.Base#BASE

+

The #MENUCOMMANDBASE class defines the main MENU class where other MENU COMMAND_ classes are derived from, in order to set commands.

+ +
+ +

The next menus define the MENU classes that you can use within your missions.

+ +

2) MENU MISSION classes

+

The underlying classes manage the menus for a complete mission file.

+ +

2.1) Menu#MENU_MISSION class, extends Core.Menu#MENU_BASE

+

The Core.Menu#MENU_MISSION class manages the main menus for a complete mission.
+You can add menus with the MENU_MISSION.New method, which constructs a MENU_MISSION object and returns you the object reference. +Using this object reference, you can then remove ALL the menus and submenus underlying automatically with MENU_MISSION.Remove.

+ +

2.2) Menu#MENUMISSIONCOMMAND class, extends Core.Menu#MENUCOMMANDBASE

+

The Core.Menu#MENUMISSIONCOMMAND class manages the command menus for a complete mission, which allow players to execute functions during mission execution.
+You can add menus with the MENUMISSIONCOMMAND.New method, which constructs a MENUMISSIONCOMMAND object and returns you the object reference. +Using this object reference, you can then remove ALL the menus and submenus underlying automatically with MENUMISSIONCOMMAND.Remove.

+ +
+ +

3) MENU COALITION classes

+

The underlying classes manage the menus for whole coalitions.

+ +

3.1) Menu#MENU_COALITION class, extends Core.Menu#MENU_BASE

+

The Core.Menu#MENU_COALITION class manages the main menus for coalitions.
+You can add menus with the MENU_COALITION.New method, which constructs a MENU_COALITION object and returns you the object reference. +Using this object reference, you can then remove ALL the menus and submenus underlying automatically with MENU_COALITION.Remove.

+ +

3.2) Menu#MENUCOALITIONCOMMAND class, extends Core.Menu#MENUCOMMANDBASE

+

The Core.Menu#MENUCOALITIONCOMMAND class manages the command menus for coalitions, which allow players to execute functions during mission execution.
+You can add menus with the MENUCOALITIONCOMMAND.New method, which constructs a MENUCOALITIONCOMMAND object and returns you the object reference. +Using this object reference, you can then remove ALL the menus and submenus underlying automatically with MENUCOALITIONCOMMAND.Remove.

+ +
+ +

4) MENU GROUP classes

+

The underlying classes manage the menus for groups. Note that groups can be inactive, alive or can be destroyed.

+ +

4.1) Menu#MENU_GROUP class, extends Core.Menu#MENU_BASE

+

The Core.Menu#MENU_GROUP class manages the main menus for coalitions.
+You can add menus with the MENU_GROUP.New method, which constructs a MENU_GROUP object and returns you the object reference. +Using this object reference, you can then remove ALL the menus and submenus underlying automatically with MENU_GROUP.Remove.

+ +

4.2) Menu#MENUGROUPCOMMAND class, extends Core.Menu#MENUCOMMANDBASE

+

The Core.Menu#MENUGROUPCOMMAND class manages the command menus for coalitions, which allow players to execute functions during mission execution.
+You can add menus with the MENUGROUPCOMMAND.New method, which constructs a MENUGROUPCOMMAND object and returns you the object reference. +Using this object reference, you can then remove ALL the menus and submenus underlying automatically with MENUGROUPCOMMAND.Remove.

+ +
+ +

5) MENU CLIENT classes

+

The underlying classes manage the menus for units with skill level client or player.

+ +

5.1) Menu#MENU_CLIENT class, extends Core.Menu#MENU_BASE

+

The Core.Menu#MENU_CLIENT class manages the main menus for coalitions.
+You can add menus with the MENU_CLIENT.New method, which constructs a MENU_CLIENT object and returns you the object reference. +Using this object reference, you can then remove ALL the menus and submenus underlying automatically with MENU_CLIENT.Remove.

+ +

5.2) Menu#MENUCLIENTCOMMAND class, extends Core.Menu#MENUCOMMANDBASE

+

The Core.Menu#MENUCLIENTCOMMAND class manages the command menus for coalitions, which allow players to execute functions during mission execution.
+You can add menus with the MENUCLIENTCOMMAND.New method, which constructs a MENUCLIENTCOMMAND object and returns you the object reference. +Using this object reference, you can then remove ALL the menus and submenus underlying automatically with MENUCLIENTCOMMAND.Remove.

+ +
+ +

Contributions: -

+

Authors: FlightControl : Design & Programming

+ + +

Global(s)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MENU_BASE + +
MENU_CLIENT + +
MENU_CLIENT_COMMAND + +
MENU_COALITION + +
MENU_COALITION_COMMAND + +
MENU_COMMAND_BASE + +
MENU_GROUP + +
MENU_GROUP_COMMAND + +
MENU_MISSION + +
MENU_MISSION_COMMAND + +
+

Type MENU_BASE

+ + + + + + + + + + + + + + + + + + + + + +
MENU_BASE.ClassName + +
MENU_BASE.MenuParentPath + +
MENU_BASE.MenuPath + +
MENU_BASE.MenuText + +
MENU_BASE:New(MenuText, ParentMenu) +

Consructor

+
+ +

Type MENU_CLIENT

+ + + + + + + + + + + + + + + + + +
MENU_CLIENT.ClassName + +
MENU_CLIENT:New(Client, MenuText, ParentMenu) +

MENU_CLIENT constructor.

+
MENU_CLIENT:Remove() +

Removes the sub menus recursively of this MENU_CLIENT.

+
MENU_CLIENT:RemoveSubMenus() +

Removes the sub menus recursively of this #MENU_CLIENT.

+
+ +

Type MENU_CLIENT_COMMAND

+ + + + + + + + + + + + + +
MENU_CLIENT_COMMAND.ClassName + +
MENU_CLIENT_COMMAND:New(Client, MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument, MenuClient, ...) +

MENUCLIENTCOMMAND constructor.

+
MENU_CLIENT_COMMAND:Remove() +

Removes a menu structure for a client.

+
+ +

Type MENU_COALITION

+ + + + + + + + + + + + + + + + + +
MENU_COALITION.ClassName + +
MENU_COALITION:New(Coalition, MenuText, ParentMenu) +

MENU_COALITION constructor.

+
MENU_COALITION:Remove() +

Removes the main menu and the sub menus recursively of this MENU_COALITION.

+
MENU_COALITION:RemoveSubMenus() +

Removes the sub menus recursively of this MENU_COALITION.

+
+ +

Type MENU_COALITION_COMMAND

+ + + + + + + + + + + + + +
MENU_COALITION_COMMAND.ClassName + +
MENU_COALITION_COMMAND:New(Coalition, MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument, ...) +

MENU_COALITION constructor.

+
MENU_COALITION_COMMAND:Remove() +

Removes a radio command item for a coalition

+
+ +

Type MENU_COMMAND_BASE

+ + + + + + + + + + + + + + + + + + + + + +
MENU_COMMAND_BASE.ClassName + +
MENU_COMMAND_BASE.CommandMenuArgument + +
MENU_COMMAND_BASE.CommandMenuFunction + +
MENU_COMMAND_BASE.MenuCallHandler + +
MENU_COMMAND_BASE:New(MenuText, ParentMenu, CommandMenuFunction, CommandMenuArguments) +

Constructor

+
+ +

Type MENU_GROUP

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MENU_GROUP.ClassName + +
MENU_GROUP.MenuGroup + +
MENU_GROUP.MenuGroupID + +
MENU_GROUP.MenuPath + +
MENU_GROUP.MenuText + +
MENU_GROUP.Menus + +
MENU_GROUP:New(MenuGroup, MenuText, ParentMenu) +

MENU_GROUP constructor.

+
MENU_GROUP.ParentMenu + +
MENU_GROUP.Path + +
MENU_GROUP:Remove() +

Removes the main menu and sub menus recursively of this MENU_GROUP.

+
MENU_GROUP:RemoveSubMenus() +

Removes the sub menus recursively of this MENU_GROUP.

+
+ +

Type MENU_GROUP_COMMAND

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MENU_GROUP_COMMAND.ClassName + +
MENU_GROUP_COMMAND.MenuGroup + +
MENU_GROUP_COMMAND.MenuGroupID + +
MENU_GROUP_COMMAND.MenuPath + +
MENU_GROUP_COMMAND.MenuText + +
MENU_GROUP_COMMAND:New(MenuGroup, MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument, ...) +

Creates a new radio command item for a group

+
MENU_GROUP_COMMAND.ParentMenu + +
MENU_GROUP_COMMAND.Path + +
MENU_GROUP_COMMAND:Remove() +

Removes a menu structure for a group.

+
+ +

Type MENU_MISSION

+ + + + + + + + + + + + + + + + + +
MENU_MISSION.ClassName + +
MENU_MISSION:New(MenuText, ParentMenu) +

MENU_MISSION constructor.

+
MENU_MISSION:Remove() +

Removes the main menu and the sub menus recursively of this MENU_MISSION.

+
MENU_MISSION:RemoveSubMenus() +

Removes the sub menus recursively of this MENU_MISSION.

+
+ +

Type MENU_MISSION_COMMAND

+ + + + + + + + + + + + + +
MENU_MISSION_COMMAND.ClassName + +
MENU_MISSION_COMMAND:New(MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument, ...) +

MENU_MISSION constructor.

+
MENU_MISSION_COMMAND:Remove() +

Removes a radio command item for a coalition

+
+ +

Global(s)

+
+
+ + #MENU_BASE + +MENU_BASE + +
+
+ + + +
+
+
+
+ + #MENU_CLIENT + +MENU_CLIENT + +
+
+ + + +
+
+
+
+ + #MENU_CLIENT_COMMAND + +MENU_CLIENT_COMMAND + +
+
+ + + +
+
+
+
+ + #MENU_COALITION + +MENU_COALITION + +
+
+ + + +
+
+
+
+ + #MENU_COALITION_COMMAND + +MENU_COALITION_COMMAND + +
+
+ + + +
+
+
+
+ + #MENU_COMMAND_BASE + +MENU_COMMAND_BASE + +
+
+ + + +
+
+
+
+ + #MENU_GROUP + +MENU_GROUP + +
+
+ + + +
+
+
+
+ + #MENU_GROUP_COMMAND + +MENU_GROUP_COMMAND + +
+
+ + + +
+
+
+
+ + #MENU_MISSION + +MENU_MISSION + +
+
+ + + +
+
+
+
+ + #MENU_MISSION_COMMAND + +MENU_MISSION_COMMAND + +
+
+ + + +
+
+

Type Menu

+ +

Type MENU_BASE

+ +

The MENU_BASE class

+ +

Field(s)

+
+
+ + #string + +MENU_BASE.ClassName + +
+
+ + + +
+
+
+
+ + +MENU_BASE.MenuParentPath + +
+
+ + + +
+
+
+
+ + +MENU_BASE.MenuPath + +
+
+ + + +
+
+
+
+ + #string + +MENU_BASE.MenuText + +
+
+ + + +
+
+
+
+ + +MENU_BASE:New(MenuText, ParentMenu) + +
+
+ +

Consructor

+ +

Parameters

+
    +
  • + +

    MenuText :

    + +
  • +
  • + +

    ParentMenu :

    + +
  • +
+
+
+ +

Type MENU_CLIENT

+ +

MENU_COALITION constructor.

+ + +

Creates a new radio command item for a coalition, which can invoke a function with parameters.

+ +

Usage:

+
 -- This demo creates a menu structure for the two clients of planes.
+ -- Each client will receive a different menu structure.
+ -- To test, join the planes, then look at the other radio menus (Option F10).
+ -- Then switch planes and check if the menu is still there.
+ -- And play with the Add and Remove menu options.
+ 
+ -- Note that in multi player, this will only work after the DCS clients bug is solved.
+
+ local function ShowStatus( PlaneClient, StatusText, Coalition )
+
+   MESSAGE:New( Coalition, 15 ):ToRed()
+   PlaneClient:Message( StatusText, 15 )
+ end
+
+ local MenuStatus = {}
+
+ local function RemoveStatusMenu( MenuClient )
+   local MenuClientName = MenuClient:GetName()
+   MenuStatus[MenuClientName]:Remove()
+ end
+
+ --- @param Wrapper.Client#CLIENT MenuClient
+ local function AddStatusMenu( MenuClient )
+   local MenuClientName = MenuClient:GetName()
+   -- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
+   MenuStatus[MenuClientName] = MENU_CLIENT:New( MenuClient, "Status for Planes" )
+   MENU_CLIENT_COMMAND:New( MenuClient, "Show Status", MenuStatus[MenuClientName], ShowStatus, MenuClient, "Status of planes is ok!", "Message to Red Coalition" )
+ end
+
+ SCHEDULER:New( nil,
+   function()
+     local PlaneClient = CLIENT:FindByName( "Plane 1" )
+     if PlaneClient and PlaneClient:IsAlive() then
+       local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" )
+       MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneClient )
+       MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneClient )
+     end
+   end, {}, 10, 10 )
+
+ SCHEDULER:New( nil,
+   function()
+     local PlaneClient = CLIENT:FindByName( "Plane 2" )
+     if PlaneClient and PlaneClient:IsAlive() then
+       local MenuManage = MENU_CLIENT:New( PlaneClient, "Manage Menus" )
+       MENU_CLIENT_COMMAND:New( PlaneClient, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneClient )
+       MENU_CLIENT_COMMAND:New( PlaneClient, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneClient )
+     end
+   end, {}, 10, 10 )
+ +

Field(s)

+
+
+ + #string + +MENU_CLIENT.ClassName + +
+
+ + + +
+
+
+
+ + +MENU_CLIENT:New(Client, MenuText, ParentMenu) + +
+
+ +

MENU_CLIENT constructor.

+ + +

Creates a new radio menu item for a client.

+ +

Parameters

+
    +
  • + +

    Wrapper.Client#CLIENT Client : +The Client owning the menu.

    + +
  • +
  • + +

    #string MenuText : +The text for the menu.

    + +
  • +
  • + +

    #table ParentMenu : +The parent menu.

    + +
  • +
+

Return value

+ +

#MENU_CLIENT: +self

+ +
+
+
+
+ + +MENU_CLIENT:Remove() + +
+
+ +

Removes the sub menus recursively of this MENU_CLIENT.

+ +

Return value

+ +

#nil:

+ + +
+
+
+
+ + +MENU_CLIENT:RemoveSubMenus() + +
+
+ +

Removes the sub menus recursively of this #MENU_CLIENT.

+ +

Return value

+ +

#MENU_CLIENT: +self

+ +
+
+ +

Type MENU_CLIENT_COMMAND

+ +

The MENUCLIENTCOMMAND class

+ +

Field(s)

+
+
+ + #string + +MENU_CLIENT_COMMAND.ClassName + +
+
+ + + +
+
+
+
+ + +MENU_CLIENT_COMMAND:New(Client, MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument, MenuClient, ...) + +
+
+ +

MENUCLIENTCOMMAND constructor.

+ + +

Creates a new radio command item for a client, which can invoke a function with parameters.

+ +

Parameters

+
    +
  • + +

    Wrapper.Client#CLIENT Client : +The Client owning the menu.

    + +
  • +
  • + +

    #string MenuText : +The text for the menu.

    + +
  • +
  • + +

    #MENU_BASE ParentMenu : +The parent menu.

    + +
  • +
  • + +

    CommandMenuFunction : +A function that is called when the menu key is pressed.

    + +
  • +
  • + +

    CommandMenuArgument : +An argument for the function.

    + +
  • +
  • + +

    MenuClient :

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

Menu#MENUCLIENTCOMMAND: +self

+ +
+
+
+
+ + +MENU_CLIENT_COMMAND:Remove() + +
+
+ +

Removes a menu structure for a client.

+ +

Return value

+ +

#nil:

+ + +
+
+ +

Type MENU_COALITION

+ +

The MENU_COALITION class

+ +

Usage:

+
 -- This demo creates a menu structure for the planes within the red coalition.
+ -- To test, join the planes, then look at the other radio menus (Option F10).
+ -- Then switch planes and check if the menu is still there.
+
+ local Plane1 = CLIENT:FindByName( "Plane 1" )
+ local Plane2 = CLIENT:FindByName( "Plane 2" )
+
+
+ -- This would create a menu for the red coalition under the main DCS "Others" menu.
+ local MenuCoalitionRed = MENU_COALITION:New( coalition.side.RED, "Manage Menus" )
+
+
+ local function ShowStatus( StatusText, Coalition )
+
+   MESSAGE:New( Coalition, 15 ):ToRed()
+   Plane1:Message( StatusText, 15 )
+   Plane2:Message( StatusText, 15 )
+ end
+
+ local MenuStatus -- Menu#MENU_COALITION
+ local MenuStatusShow -- Menu#MENU_COALITION_COMMAND
+
+ local function RemoveStatusMenu()
+   MenuStatus:Remove()
+ end
+
+ local function AddStatusMenu()
+   
+   -- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
+   MenuStatus = MENU_COALITION:New( coalition.side.RED, "Status for Planes" )
+   MenuStatusShow = MENU_COALITION_COMMAND:New( coalition.side.RED, "Show Status", MenuStatus, ShowStatus, "Status of planes is ok!", "Message to Red Coalition" )
+ end
+
+ local MenuAdd = MENU_COALITION_COMMAND:New( coalition.side.RED, "Add Status Menu", MenuCoalitionRed, AddStatusMenu )
+ local MenuRemove = MENU_COALITION_COMMAND:New( coalition.side.RED, "Remove Status Menu", MenuCoalitionRed, RemoveStatusMenu )
+ +

Field(s)

+
+
+ + #string + +MENU_COALITION.ClassName + +
+
+ + + +
+
+
+
+ + +MENU_COALITION:New(Coalition, MenuText, ParentMenu) + +
+
+ +

MENU_COALITION constructor.

+ + +

Creates a new MENU_COALITION object and creates the menu for a complete coalition.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSCoalition#coalition.side Coalition : +The coalition owning the menu.

    + +
  • +
  • + +

    #string MenuText : +The text for the menu.

    + +
  • +
  • + +

    #table ParentMenu : +The parent menu. This parameter can be ignored if you want the menu to be located at the perent menu of DCS world (under F10 other).

    + +
  • +
+

Return value

+ +

#MENU_COALITION: +self

+ +
+
+
+
+ + +MENU_COALITION:Remove() + +
+
+ +

Removes the main menu and the sub menus recursively of this MENU_COALITION.

+ +

Return value

+ +

#nil:

+ + +
+
+
+
+ + +MENU_COALITION:RemoveSubMenus() + +
+
+ +

Removes the sub menus recursively of this MENU_COALITION.

+ + +

Note that the main menu is kept!

+ +

Return value

+ +

#MENU_COALITION: +self

+ +
+
+ +

Type MENU_COALITION_COMMAND

+ +

The MENUCOALITIONCOMMAND class

+ +

Field(s)

+
+
+ + #string + +MENU_COALITION_COMMAND.ClassName + +
+
+ + + +
+
+
+
+ + +MENU_COALITION_COMMAND:New(Coalition, MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument, ...) + +
+
+ +

MENU_COALITION constructor.

+ + +

Creates a new radio command item for a coalition, which can invoke a function with parameters.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSCoalition#coalition.side Coalition : +The coalition owning the menu.

    + +
  • +
  • + +

    #string MenuText : +The text for the menu.

    + +
  • +
  • + +

    Menu#MENU_COALITION ParentMenu : +The parent menu.

    + +
  • +
  • + +

    CommandMenuFunction : +A function that is called when the menu key is pressed.

    + +
  • +
  • + +

    CommandMenuArgument : +An argument for the function. There can only be ONE argument given. So multiple arguments must be wrapped into a table. See the below example how to do this.

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#MENUCOALITIONCOMMAND: +self

+ +
+
+
+
+ + +MENU_COALITION_COMMAND:Remove() + +
+
+ +

Removes a radio command item for a coalition

+ +

Return value

+ +

#nil:

+ + +
+
+ +

Type MENU_COMMAND_BASE

+ +

The MENUCOMMANDBASE class

+ +

Field(s)

+
+
+ + #string + +MENU_COMMAND_BASE.ClassName + +
+
+ + + +
+
+
+
+ + +MENU_COMMAND_BASE.CommandMenuArgument + +
+
+ + + +
+
+
+
+ + +MENU_COMMAND_BASE.CommandMenuFunction + +
+
+ + + +
+
+
+
+ + #function + +MENU_COMMAND_BASE.MenuCallHandler + +
+
+ + + +
+
+
+
+ + +MENU_COMMAND_BASE:New(MenuText, ParentMenu, CommandMenuFunction, CommandMenuArguments) + +
+
+ +

Constructor

+ +

Parameters

+
    +
  • + +

    MenuText :

    + +
  • +
  • + +

    ParentMenu :

    + +
  • +
  • + +

    CommandMenuFunction :

    + +
  • +
  • + +

    CommandMenuArguments :

    + +
  • +
+
+
+ +

Type MENU_GROUP

+ +

The MENU_GROUP class

+ +

Usage:

+
 -- This demo creates a menu structure for the two groups of planes.
+ -- Each group will receive a different menu structure.
+ -- To test, join the planes, then look at the other radio menus (Option F10).
+ -- Then switch planes and check if the menu is still there.
+ -- And play with the Add and Remove menu options.
+ 
+ -- Note that in multi player, this will only work after the DCS groups bug is solved.
+
+ local function ShowStatus( PlaneGroup, StatusText, Coalition )
+
+   MESSAGE:New( Coalition, 15 ):ToRed()
+   PlaneGroup:Message( StatusText, 15 )
+ end
+
+ local MenuStatus = {}
+
+ local function RemoveStatusMenu( MenuGroup )
+   local MenuGroupName = MenuGroup:GetName()
+   MenuStatus[MenuGroupName]:Remove()
+ end
+
+ --- @param Wrapper.Group#GROUP MenuGroup
+ local function AddStatusMenu( MenuGroup )
+   local MenuGroupName = MenuGroup:GetName()
+   -- This would create a menu for the red coalition under the MenuCoalitionRed menu object.
+   MenuStatus[MenuGroupName] = MENU_GROUP:New( MenuGroup, "Status for Planes" )
+   MENU_GROUP_COMMAND:New( MenuGroup, "Show Status", MenuStatus[MenuGroupName], ShowStatus, MenuGroup, "Status of planes is ok!", "Message to Red Coalition" )
+ end
+
+ SCHEDULER:New( nil,
+   function()
+     local PlaneGroup = GROUP:FindByName( "Plane 1" )
+     if PlaneGroup and PlaneGroup:IsAlive() then
+       local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" )
+       MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 1", MenuManage, AddStatusMenu, PlaneGroup )
+       MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 1", MenuManage, RemoveStatusMenu, PlaneGroup )
+     end
+   end, {}, 10, 10 )
+
+ SCHEDULER:New( nil,
+   function()
+     local PlaneGroup = GROUP:FindByName( "Plane 2" )
+     if PlaneGroup and PlaneGroup:IsAlive() then
+       local MenuManage = MENU_GROUP:New( PlaneGroup, "Manage Menus" )
+       MENU_GROUP_COMMAND:New( PlaneGroup, "Add Status Menu Plane 2", MenuManage, AddStatusMenu, PlaneGroup )
+       MENU_GROUP_COMMAND:New( PlaneGroup, "Remove Status Menu Plane 2", MenuManage, RemoveStatusMenu, PlaneGroup )
+     end
+   end, {}, 10, 10 )
+
+ +

Field(s)

+
+
+ + #string + +MENU_GROUP.ClassName + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP.MenuGroup + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP.MenuGroupID + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP.MenuPath + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP.MenuText + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP.Menus + +
+
+ + + +
+
+
+
+ + +MENU_GROUP:New(MenuGroup, MenuText, ParentMenu) + +
+
+ +

MENU_GROUP constructor.

+ + +

Creates a new radio menu item for a group.

+ +

Parameters

+
    +
  • + +

    Wrapper.Group#GROUP MenuGroup : +The Group owning the menu.

    + +
  • +
  • + +

    #string MenuText : +The text for the menu.

    + +
  • +
  • + +

    #table ParentMenu : +The parent menu.

    + +
  • +
+

Return value

+ +

#MENU_GROUP: +self

+ +
+
+
+
+ + + +MENU_GROUP.ParentMenu + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP.Path + +
+
+ + + +
+
+
+
+ + +MENU_GROUP:Remove() + +
+
+ +

Removes the main menu and sub menus recursively of this MENU_GROUP.

+ +

Return value

+ +

#nil:

+ + +
+
+
+
+ + +MENU_GROUP:RemoveSubMenus() + +
+
+ +

Removes the sub menus recursively of this MENU_GROUP.

+ +

Return value

+ +

#MENU_GROUP: +self

+ +
+
+ +

Type MENU_GROUP_COMMAND

+ +

The MENUGROUPCOMMAND class

+ +

Field(s)

+
+
+ + #string + +MENU_GROUP_COMMAND.ClassName + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP_COMMAND.MenuGroup + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP_COMMAND.MenuGroupID + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP_COMMAND.MenuPath + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP_COMMAND.MenuText + +
+
+ + + +
+
+
+
+ + +MENU_GROUP_COMMAND:New(MenuGroup, MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument, ...) + +
+
+ +

Creates a new radio command item for a group

+ +

Parameters

+
    +
  • + +

    Wrapper.Group#GROUP MenuGroup : +The Group owning the menu.

    + +
  • +
  • + +

    MenuText : +The text for the menu.

    + +
  • +
  • + +

    ParentMenu : +The parent menu.

    + +
  • +
  • + +

    CommandMenuFunction : +A function that is called when the menu key is pressed.

    + +
  • +
  • + +

    CommandMenuArgument : +An argument for the function.

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

Menu#MENUGROUPCOMMAND: +self

+ +
+
+
+
+ + + +MENU_GROUP_COMMAND.ParentMenu + +
+
+ + + +
+
+
+
+ + + +MENU_GROUP_COMMAND.Path + +
+
+ + + +
+
+
+
+ + +MENU_GROUP_COMMAND:Remove() + +
+
+ +

Removes a menu structure for a group.

+ +

Return value

+ +

#nil:

+ + +
+
+ +

Type MENU_MISSION

+ +

The MENU_MISSION class

+ +

Field(s)

+
+
+ + #string + +MENU_MISSION.ClassName + +
+
+ + + +
+
+
+
+ + +MENU_MISSION:New(MenuText, ParentMenu) + +
+
+ +

MENU_MISSION constructor.

+ + +

Creates a new MENU_MISSION object and creates the menu for a complete mission file.

+ +

Parameters

+
    +
  • + +

    #string MenuText : +The text for the menu.

    + +
  • +
  • + +

    #table ParentMenu : +The parent menu. This parameter can be ignored if you want the menu to be located at the perent menu of DCS world (under F10 other).

    + +
  • +
+

Return value

+ +

#MENU_MISSION: +self

+ +
+
+
+
+ + +MENU_MISSION:Remove() + +
+
+ +

Removes the main menu and the sub menus recursively of this MENU_MISSION.

+ +

Return value

+ +

#nil:

+ + +
+
+
+
+ + +MENU_MISSION:RemoveSubMenus() + +
+
+ +

Removes the sub menus recursively of this MENU_MISSION.

+ + +

Note that the main menu is kept!

+ +

Return value

+ +

#MENU_MISSION: +self

+ +
+
+ +

Type MENU_MISSION_COMMAND

+ +

The MENUMISSIONCOMMAND class

+ +

Field(s)

+
+
+ + #string + +MENU_MISSION_COMMAND.ClassName + +
+
+ + + +
+
+
+
+ + +MENU_MISSION_COMMAND:New(MenuText, ParentMenu, CommandMenuFunction, CommandMenuArgument, ...) + +
+
+ +

MENU_MISSION constructor.

+ + +

Creates a new radio command item for a complete mission file, which can invoke a function with parameters.

+ +

Parameters

+
    +
  • + +

    #string MenuText : +The text for the menu.

    + +
  • +
  • + +

    Menu#MENU_MISSION ParentMenu : +The parent menu.

    + +
  • +
  • + +

    CommandMenuFunction : +A function that is called when the menu key is pressed.

    + +
  • +
  • + +

    CommandMenuArgument : +An argument for the function. There can only be ONE argument given. So multiple arguments must be wrapped into a table. See the below example how to do this.

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#MENUMISSIONCOMMAND: +self

+ +
+
+
+
+ + +MENU_MISSION_COMMAND:Remove() + +
+
+ +

Removes a radio command item for a coalition

+ +

Return value

+ +

#nil:

+ + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Message.html b/docs/Documentation/Message.html new file mode 100644 index 000000000..67087258c --- /dev/null +++ b/docs/Documentation/Message.html @@ -0,0 +1,495 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Message

+ +

This module contains the MESSAGE class.

+ + + +

1) Core.Message#MESSAGE class, extends Core.Base#BASE

+

Message System to display Messages to Clients, Coalitions or All. +Messages are shown on the display panel for an amount of seconds, and will then disappear. +Messages can contain a category which is indicating the category of the message.

+ +

1.1) MESSAGE construction methods

+

Messages are created with Core.Message#MESSAGE.New. Note that when the MESSAGE object is created, no message is sent yet. +To send messages, you need to use the To functions.

+ +

1.2) Send messages with MESSAGE To methods

+

Messages are sent to:

+ + + +

Global(s)

+ + + + + +
MESSAGE + +
+

Type MESSAGE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MESSAGE.ClassName + +
MESSAGE.MessageCategory + +
MESSAGE.MessageID + +
MESSAGE:New(MessageText, MessageDuration, MessageCategory) +

Creates a new MESSAGE object.

+
MESSAGE:ToAll() +

Sends a MESSAGE to all players.

+
MESSAGE:ToBlue() +

Sends a MESSAGE to the Blue coalition.

+
MESSAGE:ToClient(Client) +

Sends a MESSAGE to a Client Group.

+
MESSAGE:ToCoalition(CoalitionSide) +

Sends a MESSAGE to a Coalition.

+
MESSAGE:ToGroup(Group) +

Sends a MESSAGE to a Group.

+
MESSAGE:ToRed() +

Sends a MESSAGE to the Red Coalition.

+
+ +

Global(s)

+
+
+ + #MESSAGE + +MESSAGE + +
+
+ + + +
+
+

Type Message

+ +

Type MESSAGE

+ +

The MESSAGE class

+ +

Field(s)

+
+
+ + #string + +MESSAGE.ClassName + +
+
+ + + +
+
+
+
+ + #number + +MESSAGE.MessageCategory + +
+
+ + + +
+
+
+
+ + #number + +MESSAGE.MessageID + +
+
+ + + +
+
+
+
+ + +MESSAGE:New(MessageText, MessageDuration, MessageCategory) + +
+
+ +

Creates a new MESSAGE object.

+ + +

Note that these MESSAGE objects are not yet displayed on the display panel. You must use the functions ToClient or ToCoalition or ToAll to send these Messages to the respective recipients.

+ +

Parameters

+
    +
  • + +

    #string MessageText : +is the text of the Message.

    + +
  • +
  • + +

    #number MessageDuration : +is a number in seconds of how long the MESSAGE should be shown on the display panel.

    + +
  • +
  • + +

    #string MessageCategory : +(optional) is a string expressing the "category" of the Message. The category will be shown as the first text in the message followed by a ": ".

    + +
  • +
+

Return value

+ +

#MESSAGE:

+ + +

Usage:

+
-- Create a series of new Messages.
+-- MessageAll is meant to be sent to all players, for 25 seconds, and is classified as "Score".
+-- MessageRED is meant to be sent to the RED players only, for 10 seconds, and is classified as "End of Mission", with ID "Win".
+-- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
+-- MessageClient1 is meant to be sent to a Client, for 25 seconds, and is classified as "Score", with ID "Score".
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!",  25, "End of Mission" )
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", 25, "Penalty" )
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target",  25, "Score" )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", 25, "Score")
+ +
+
+
+
+ + +MESSAGE:ToAll() + +
+
+ +

Sends a MESSAGE to all players.

+ +

Return value

+ +

#MESSAGE:

+ + +

Usage:

+
-- Send a message created to all players.
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
+or
+MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" ):ToAll()
+or
+MessageAll = MESSAGE:New( "To all Players: BLUE has won! Each player of BLUE wins 50 points!", "End of Mission", 25, "Win" )
+MessageAll:ToAll()
+ +
+
+
+
+ + +MESSAGE:ToBlue() + +
+
+ +

Sends a MESSAGE to the Blue coalition.

+ +

Return value

+ +

#MESSAGE:

+ + +

Usage:

+
-- Send a message created with the @{New} method to the BLUE coalition.
+MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
+or
+MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToBlue()
+or
+MessageBLUE = MESSAGE:New( "To the BLUE Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageBLUE:ToBlue()
+ +
+
+
+
+ + +MESSAGE:ToClient(Client) + +
+
+ +

Sends a MESSAGE to a Client Group.

+ + +

Note that the Group needs to be defined within the ME with the skillset "Client" or "Player".

+ +

Parameter

+ +

Return value

+ +

#MESSAGE:

+ + +

Usage:

+
-- Send the 2 messages created with the @{New} method to the Client Group.
+-- Note that the Message of MessageClient2 is overwriting the Message of MessageClient1.
+ClientGroup = Group.getByName( "ClientGroup" )
+
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+or
+MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" ):ToClient( ClientGroup )
+or
+MessageClient1 = MESSAGE:New( "Congratulations, you've just hit a target", "Score", 25, "Score" )
+MessageClient2 = MESSAGE:New( "Congratulations, you've just killed a target", "Score", 25, "Score" )
+MessageClient1:ToClient( ClientGroup )
+MessageClient2:ToClient( ClientGroup )
+ +
+
+
+
+ + +MESSAGE:ToCoalition(CoalitionSide) + +
+
+ +

Sends a MESSAGE to a Coalition.

+ +

Parameter

+
    +
  • + +

    CoalitionSide : +needs to be filled out by the defined structure of the standard scripting engine coalition.side.

    + +
  • +
+

Return value

+ +

#MESSAGE:

+ + +

Usage:

+
-- Send a message created with the @{New} method to the RED coalition.
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
+or
+MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToCoalition( coalition.side.RED )
+or
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageRED:ToCoalition( coalition.side.RED )
+ +
+
+
+
+ + +MESSAGE:ToGroup(Group) + +
+
+ +

Sends a MESSAGE to a Group.

+ +

Parameter

+ +

Return value

+ +

#MESSAGE:

+ + +
+
+
+
+ + +MESSAGE:ToRed() + +
+
+ +

Sends a MESSAGE to the Red Coalition.

+ +

Return value

+ +

#MESSAGE:

+ + +

Usage:

+
-- Send a message created with the @{New} method to the RED coalition.
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
+or
+MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" ):ToRed()
+or
+MessageRED = MESSAGE:New( "To the RED Players: You receive a penalty because you've killed one of your own units", "Penalty", 25, "Score" )
+MessageRED:ToRed()
+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/MissileTrainer.html b/docs/Documentation/MissileTrainer.html new file mode 100644 index 000000000..1e5374aae --- /dev/null +++ b/docs/Documentation/MissileTrainer.html @@ -0,0 +1,1029 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module MissileTrainer

+ +

This module contains the MISSILETRAINER class.

+ + + +
+ +

1) Functional.MissileTrainer#MISSILETRAINER class, extends Core.Base#BASE

+

The #MISSILETRAINER class uses the DCS world messaging system to be alerted of any missiles fired, and when a missile would hit your aircraft, +the class will destroy the missile within a certain range, to avoid damage to your aircraft. +It suports the following functionality:

+ +
    +
  • Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.
  • +
  • Provide alerts of missile launches, including detailed information of the units launching, including bearing, range �
  • +
  • Provide alerts when a missile would have killed your aircraft.
  • +
  • Provide alerts when the missile self destructs.
  • +
  • Enable / Disable and Configure the Missile Trainer using the various menu options.
  • +
+ +

When running a mission where MISSILETRAINER is used, the following radio menu structure ( 'Radio Menu' -> 'Other (F10)' -> 'MissileTrainer' ) options are available for the players:

+ +
    +
  • Messages: Menu to configure all messages. +
      +
    • Messages On: Show all messages.
    • +
    • Messages Off: Disable all messages.
    • +
  • +
  • Tracking: Menu to configure missile tracking messages. +
      +
    • To All: Shows missile tracking messages to all players.
    • +
    • To Target: Shows missile tracking messages only to the player where the missile is targetted at.
    • +
    • Tracking On: Show missile tracking messages.
    • +
    • Tracking Off: Disable missile tracking messages.
    • +
    • Frequency Increase: Increases the missile tracking message frequency with one second.
    • +
    • Frequency Decrease: Decreases the missile tracking message frequency with one second.
    • +
  • +
  • Alerts: Menu to configure alert messages. +
      +
    • To All: Shows alert messages to all players.
    • +
    • To Target: Shows alert messages only to the player where the missile is (was) targetted at.
    • +
    • Hits On: Show missile hit alert messages.
    • +
    • Hits Off: Disable missile hit alert messages.
    • +
    • Launches On: Show missile launch messages.
    • +
    • Launches Off: Disable missile launch messages.
    • +
  • +
  • Details: Menu to configure message details. +
      +
    • Range On: Shows range information when a missile is fired to a target.
    • +
    • Range Off: Disable range information when a missile is fired to a target.
    • +
    • Bearing On: Shows bearing information when a missile is fired to a target.
    • +
    • Bearing Off: Disable bearing information when a missile is fired to a target.
    • +
  • +
  • Distance: Menu to configure the distance when a missile needs to be destroyed when near to a player, during tracking. This will improve/influence hit calculation accuracy, but has the risk of damaging the aircraft when the missile reaches the aircraft before the distance is measured. +
      +
    • 50 meter: Destroys the missile when the distance to the aircraft is below or equal to 50 meter.
    • +
    • 100 meter: Destroys the missile when the distance to the aircraft is below or equal to 100 meter.
    • +
    • 150 meter: Destroys the missile when the distance to the aircraft is below or equal to 150 meter.
    • +
    • 200 meter: Destroys the missile when the distance to the aircraft is below or equal to 200 meter.
    • +
  • +
+ + +

1.1) MISSILETRAINER construction methods:

+

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

+ +
    +
  • MISSILETRAINER.New: Creates a new MISSILETRAINER object taking the maximum distance to your aircraft to evaluate when a missile needs to be destroyed.
  • +
+ +

MISSILETRAINER will collect each unit declared in the mission with a skill level "Client" and "Player", and will monitor the missiles shot at those.

+ +

1.2) MISSILETRAINER initialization methods:

+

A MISSILETRAINER object will behave differently based on the usage of initialization methods:

+ + + +
+ +

CREDITS

+

Stuka (Danny) Who you can search on the Eagle Dynamics Forums. +Working together with Danny has resulted in the MISSILETRAINER class. +Danny has shared his ideas and together we made a design. +Together with the 476 virtual team, we tested the MISSILETRAINER class, and got much positive feedback!

+ + +

Global(s)

+ + + + + +
MISSILETRAINER + +
+

Type MISSILETRAINER

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MISSILETRAINER.AlertsHitsOnOff + +
MISSILETRAINER.AlertsLaunchesOnOff + +
MISSILETRAINER.AlertsToAll + +
MISSILETRAINER.ClassName + +
MISSILETRAINER.DBClients + +
MISSILETRAINER.DetailsBearingOnOff + +
MISSILETRAINER.DetailsRangeOnOff + +
MISSILETRAINER:InitAlertsHitsOnOff(AlertsHitsOnOff) +

Sets by default the display of hit alerts ON or OFF.

+
MISSILETRAINER:InitAlertsLaunchesOnOff(AlertsLaunchesOnOff) +

Sets by default the display of launch alerts ON or OFF.

+
MISSILETRAINER:InitAlertsToAll(AlertsToAll) +

Sets by default the display of alerts to be shown to all players or only to you.

+
MISSILETRAINER:InitBearingOnOff(DetailsBearingOnOff) +

Sets by default the display of bearing information of missiles ON of OFF.

+
MISSILETRAINER:InitMenusOnOff(MenusOnOff) +

Enables / Disables the menus.

+
MISSILETRAINER:InitMessagesOnOff(MessagesOnOff) +

Sets by default the display of any message to be ON or OFF.

+
MISSILETRAINER:InitRangeOnOff(DetailsRangeOnOff) +

Sets by default the display of range information of missiles ON of OFF.

+
MISSILETRAINER:InitTrackingFrequency(TrackingFrequency) +

Increases, decreases the missile tracking message display frequency with the provided time interval in seconds.

+
MISSILETRAINER:InitTrackingOnOff(TrackingOnOff) +

Sets by default the display of missile tracking report to be ON or OFF.

+
MISSILETRAINER:InitTrackingToAll(TrackingToAll) +

Sets by default the missile tracking report for all players or only for those missiles targetted to you.

+
MISSILETRAINER.MenusOnOff + +
MISSILETRAINER.MessagesOnOff + +
MISSILETRAINER:New(Distance, Briefing) +

Creates the main object which is handling missile tracking.

+
MISSILETRAINER.TrackingFrequency + +
MISSILETRAINER.TrackingMissiles + +
MISSILETRAINER.TrackingOnOff + +
MISSILETRAINER.TrackingToAll + +
MISSILETRAINER:_AddBearing(Client, TrainerWeapon) + +
MISSILETRAINER:_AddRange(Client, TrainerWeapon) + +
MISSILETRAINER._Alive(Client, self) + +
MISSILETRAINER:_EventShot(Event) +

Detects if an SA site was shot with an anti radiation missile.

+
MISSILETRAINER._MenuMessages(MenuParameters) + +
MISSILETRAINER:_TrackMissiles() + +
+ +

Global(s)

+
+
+ + #MISSILETRAINER + +MISSILETRAINER + +
+
+ + + +
+
+

Type MissileTrainer

+ +

Type MISSILETRAINER

+ +

The MISSILETRAINER class

+ +

Field(s)

+
+
+ + + +MISSILETRAINER.AlertsHitsOnOff + +
+
+ + + +
+
+
+
+ + + +MISSILETRAINER.AlertsLaunchesOnOff + +
+
+ + + +
+
+
+
+ + + +MISSILETRAINER.AlertsToAll + +
+
+ + + +
+
+
+
+ + #string + +MISSILETRAINER.ClassName + +
+
+ + + +
+
+
+
+ + Core.Set#SET_CLIENT + +MISSILETRAINER.DBClients + +
+
+ + + +
+
+
+
+ + + +MISSILETRAINER.DetailsBearingOnOff + +
+
+ + + +
+
+
+
+ + + +MISSILETRAINER.DetailsRangeOnOff + +
+
+ + + +
+
+
+
+ + +MISSILETRAINER:InitAlertsHitsOnOff(AlertsHitsOnOff) + +
+
+ +

Sets by default the display of hit alerts ON or OFF.

+ +

Parameter

+
    +
  • + +

    #boolean AlertsHitsOnOff : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitAlertsLaunchesOnOff(AlertsLaunchesOnOff) + +
+
+ +

Sets by default the display of launch alerts ON or OFF.

+ +

Parameter

+
    +
  • + +

    #boolean AlertsLaunchesOnOff : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitAlertsToAll(AlertsToAll) + +
+
+ +

Sets by default the display of alerts to be shown to all players or only to you.

+ +

Parameter

+
    +
  • + +

    #boolean AlertsToAll : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitBearingOnOff(DetailsBearingOnOff) + +
+
+ +

Sets by default the display of bearing information of missiles ON of OFF.

+ +

Parameter

+
    +
  • + +

    #boolean DetailsBearingOnOff : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitMenusOnOff(MenusOnOff) + +
+
+ +

Enables / Disables the menus.

+ +

Parameter

+
    +
  • + +

    #boolean MenusOnOff : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitMessagesOnOff(MessagesOnOff) + +
+
+ +

Sets by default the display of any message to be ON or OFF.

+ +

Parameter

+
    +
  • + +

    #boolean MessagesOnOff : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitRangeOnOff(DetailsRangeOnOff) + +
+
+ +

Sets by default the display of range information of missiles ON of OFF.

+ +

Parameter

+
    +
  • + +

    #boolean DetailsRangeOnOff : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitTrackingFrequency(TrackingFrequency) + +
+
+ +

Increases, decreases the missile tracking message display frequency with the provided time interval in seconds.

+ + +

The default frequency is a 3 second interval, so the Tracking Frequency parameter specifies the increase or decrease from the default 3 seconds or the last frequency update.

+ +

Parameter

+
    +
  • + +

    #number TrackingFrequency : +Provide a negative or positive value in seconds to incraese or decrease the display frequency.

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitTrackingOnOff(TrackingOnOff) + +
+
+ +

Sets by default the display of missile tracking report to be ON or OFF.

+ +

Parameter

+
    +
  • + +

    #boolean TrackingOnOff : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + +MISSILETRAINER:InitTrackingToAll(TrackingToAll) + +
+
+ +

Sets by default the missile tracking report for all players or only for those missiles targetted to you.

+ +

Parameter

+
    +
  • + +

    #boolean TrackingToAll : +true or false

    + +
  • +
+

Return value

+ +

#MISSILETRAINER: +self

+ +
+
+
+
+ + + +MISSILETRAINER.MenusOnOff + +
+
+ + + +
+
+
+
+ + + +MISSILETRAINER.MessagesOnOff + +
+
+ + + +
+
+
+
+ + +MISSILETRAINER:New(Distance, Briefing) + +
+
+ +

Creates the main object which is handling missile tracking.

+ + +

When a missile is fired a SCHEDULER is set off that follows the missile. When near a certain a client player, the missile will be destroyed.

+ +

Parameters

+
    +
  • + +

    #number Distance : +The distance in meters when a tracked missile needs to be destroyed when close to a player.

    + +
  • +
  • + +

    #string Briefing : +(Optional) Will show a text to the players when starting their mission. Can be used for briefing purposes.

    + +
  • +
+

Return value

+ +

#MISSILETRAINER:

+ + +
+
+
+
+ + +MISSILETRAINER.TrackingFrequency + +
+
+ + + +
+
+
+
+ + + +MISSILETRAINER.TrackingMissiles + +
+
+ + + +
+
+
+
+ + + +MISSILETRAINER.TrackingOnOff + +
+
+ + + +
+
+
+
+ + + +MISSILETRAINER.TrackingToAll + +
+
+ + + +
+
+
+
+ + +MISSILETRAINER:_AddBearing(Client, TrainerWeapon) + +
+
+ + + +

Parameters

+
    +
  • + +

    Client :

    + +
  • +
  • + +

    TrainerWeapon :

    + +
  • +
+
+
+
+
+ + +MISSILETRAINER:_AddRange(Client, TrainerWeapon) + +
+
+ + + +

Parameters

+
    +
  • + +

    Client :

    + +
  • +
  • + +

    TrainerWeapon :

    + +
  • +
+
+
+
+
+ + +MISSILETRAINER._Alive(Client, self) + +
+
+ + + +

Parameters

+
    +
  • + +

    Client :

    + +
  • +
  • + +

    self :

    + +
  • +
+
+
+
+
+ + +MISSILETRAINER:_EventShot(Event) + +
+
+ +

Detects if an SA site was shot with an anti radiation missile.

+ + +

In this case, take evasive actions based on the skill level set within the ME.

+ +

Parameter

+ +
+
+
+
+ + +MISSILETRAINER._MenuMessages(MenuParameters) + +
+
+ + + +

Parameter

+
    +
  • + +

    MenuParameters :

    + +
  • +
+
+
+
+
+ + +MISSILETRAINER:_TrackMissiles() + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Mission.html b/docs/Documentation/Mission.html new file mode 100644 index 000000000..04f83b0c9 --- /dev/null +++ b/docs/Documentation/Mission.html @@ -0,0 +1,2346 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Mission

+ +

A MISSION is the main owner of a Mission orchestration within MOOSE .

+ + +

The Mission framework orchestrates CLIENTs, TASKs, STAGEs etc. +A CLIENT needs to be registered within the MISSION through the function AddClient. A TASK needs to be registered within the MISSION through the function AddTask.

+ +

Global(s)

+ + + + + + + + + + + + + +
MISSION + +
MISSIONSCHEDULER + +
_TransportExecuteStage + +
+

Type MISSION

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MISSION:AbortUnit(PlayerUnit) +

Aborts a PlayerUnit from the Mission.

+
MISSION.AddClient(CLIENT, self, Client) +

Register a new CLIENT to participate within the mission.

+
MISSION.AddGoalFunction(function, self, GoalFunction) +

Add a goal function to a MISSION.

+
MISSION:AddScoring(Scoring) +

Add a scoring to the mission.

+
MISSION:AddTask(Task) +

Register a Task to be completed within the Mission.

+
MISSION.ClassName + +
MISSION:ClearMissionMenu() +

Clears the mission menu for the coalition.

+
MISSION:Completed() +

Set a Mission to completed.

+
MISSION:CrashUnit(PlayerUnit) +

Handles a crash of a PlayerUnit from the Mission.

+
MISSION.FAILED + +
MISSION:Failed() +

Set a Mission to failed.

+
MISSION.FindClient(CLIENT, self, ClientName) +

Find a CLIENT object within the MISSION by its ClientName.

+
MISSION:GetCommandCenter() +

Gets the COMMANDCENTER.

+
MISSION:GetGroups() +

Get the groups for which TASKS are given in the mission

+
MISSION:GetMissionMenu(TaskGroup) +

Gets the mission menu for the coalition.

+
MISSION:GetName() +

Gets the mission name.

+
MISSION:GetNextTaskID(Task) +

Return the next Task ID to be completed within the Mission.

+
MISSION:GetScoring() +

Get the scoring object of a mission.

+
MISSION.GetTask(TaskName, self) +

Get the TASK identified by the TaskNumber from the Mission.

+
MISSION:GetTasks() +

Get all the TASKs from the Mission.

+
MISSION.GoalFunction + +
MISSION:HasGroup(TaskGroup) + +
MISSION:IsCompleted() +

Returns if a Mission has completed.

+
MISSION:IsFailed() +

Returns if a Mission has failed.

+
MISSION:IsOngoing() +

Returns if a Mission is ongoing.

+
MISSION:IsPending() +

Returns if a Mission is pending.

+
MISSION:JoinUnit(PlayerUnit) +

Add a Unit to join the Mission.

+
MISSION.MissionBriefing + +
MISSION.MissionCoalition + +
MISSION.MissionMenu + +
MISSION.MissionProgressTrigger + +
MISSION.MissionReportFlash + +
MISSION.MissionReportShow + +
MISSION.MissionReportTrigger + +
MISSION.MissionStatus + +
MISSION.MissionTimeInterval + +
MISSION.Name + +
MISSION:New(CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition) +

This is the main MISSION declaration method.

+
MISSION:Ongoing() +

Set a Mission to ongoing.

+
MISSION:Pending() +

Set a Mission to pending.

+
MISSION.REPEAT + +
MISSION:RemoveMenu() +

Removes the Planned Task menu.

+
MISSION:RemoveTask(Task) +

Removes a Task to be completed within the Mission.

+
MISSION:RemoveTaskMenu(Task) +

Removes a Task menu.

+
MISSION:ReportDetails() +

Create a detailed report of the Mission, listing all the details of the Task.

+
MISSION:ReportOverview() +

Create a overview report of the Mission (multiple lines).

+
MISSION:ReportSummary() +

Create a summary report of the Mission (one line).

+
MISSION:ReportToAll() +

Report the status of all MISSIONs to all active Clients.

+
MISSION.SUCCESS + +
MISSION.Scoring + +
MISSION:SetAssignedMenu(Task, MenuText) +

Sets the Assigned Task menu.

+
MISSION:SetMenu() +

Sets the Planned Task menu.

+
MISSION:StatusToClients() +

Send the status of the MISSION to all Clients.

+
MISSION.TaskCategoryMenus + +
MISSION.TaskMenus + +
MISSION.TaskTypeMenus + +
MISSION._ActiveTasks + +
MISSION._Clients + +
MISSION._GoalTasks + +
MISSION:onbeforeComplete(Event, From, To) +

FSM function for a MISSION

+
MISSION:onenterCompleted(Event, From, To) +

FSM function for a MISSION

+
+ +

Type MISSIONSCHEDULER

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MISSIONSCHEDULER.AddMission(Mission) +

This is the main MISSION declaration method.

+
MISSIONSCHEDULER.FindMission(MissionName) +

Find a MISSION within the MISSIONSCHEDULER.

+
MISSIONSCHEDULER.MissionCount + +
MISSIONSCHEDULER.Missions + +
MISSIONSCHEDULER.RemoveMission(MissionName) +

Remove a MISSION from the MISSIONSCHEDULER.

+
MISSIONSCHEDULER.ReportMenu() +

Enables a MENU option in the communications menu under F10 to control the status of the active missions.

+
MISSIONSCHEDULER.ReportMissionsFlash(TimeInterval) + +
MISSIONSCHEDULER.ReportMissionsHide(Prm) + +
MISSIONSCHEDULER.ReportMissionsShow() + +
MISSIONSCHEDULER.Scheduler() +

This is the main MISSIONSCHEDULER Scheduler function.

+
MISSIONSCHEDULER.SchedulerId + +
MISSIONSCHEDULER:Scoring(Scoring) +

Adds a mission scoring to the game.

+
MISSIONSCHEDULER.Start() +

Start the MISSIONSCHEDULER.

+
MISSIONSCHEDULER.Stop() +

Stop the MISSIONSCHEDULER.

+
MISSIONSCHEDULER:Time(TimeSeconds, TimeIntervalShow, TimeShow) + +
MISSIONSCHEDULER.TimeIntervalCount + +
MISSIONSCHEDULER.TimeIntervalShow + +
MISSIONSCHEDULER.TimeSeconds + +
MISSIONSCHEDULER.TimeShow + +
+ +

Global(s)

+
+
+ + #MISSION + +MISSION + +
+
+ + + +
+
+
+
+ + #MISSIONSCHEDULER + +MISSIONSCHEDULER + +
+
+ + + +
+
+
+
+ + + +_TransportExecuteStage + +
+
+ + + + +

_TransportExecuteStage: Defines the different stages of Transport unload/load execution. This table is internal and is used to control the validity of Transport load/unload timing.

+ +
    +
  • _TransportExecuteStage.EXECUTING
  • +
  • _TransportExecuteStage.SUCCESS
  • +
  • _TransportExecuteStage.FAILED
  • +
+ +

--

+ +
+
+

Type Mission

+ +

Type MISSION

+ +

The MISSION class

+ +

Field(s)

+
+
+ + +MISSION:AbortUnit(PlayerUnit) + +
+
+ +

Aborts a PlayerUnit from the Mission.

+ + +

For each Task within the Mission, the PlayerUnit is removed from Task where it is assigned. +If the Unit was not part of a Task in the Mission, false is returned. +If the Unit is part of a Task in the Mission, true is returned.

+ +

Parameter

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The CLIENT or UNIT of the Player joining the Mission.

    + +
  • +
+

Return value

+ +

#boolean: +true if Unit is part of a Task in the Mission.

+ +
+
+
+
+ + +MISSION.AddClient(CLIENT, self, Client) + +
+
+ +

Register a new CLIENT to participate within the mission.

+ +

Parameters

+
    +
  • + +

    CLIENT : +Client is the CLIENT object. The object must have been instantiated with CLIENT.

    + +
  • +
  • + +

    self :

    + +
  • +
  • + +

    Client :

    + +
  • +
+

Return value

+ + +

CLIENT

+ +

Usage:

+
Add a number of Client objects to the Mission.
+	Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 1', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+	Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 3', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+	Mission:AddClient( CLIENT:FindByName( 'US UH-1H*HOT-Deploy Troops 2', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+	Mission:AddClient( CLIENT:FindByName( 'US UH-1H*RAMP-Deploy Troops 4', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.' ):Transport() )
+ +
+
+
+
+ + +MISSION.AddGoalFunction(function, self, GoalFunction) + +
+
+ +

Add a goal function to a MISSION.

+ + +

Goal functions are called when a TASK within a mission has been completed.

+ +

Parameters

+
    +
  • + +

    function : +GoalFunction is the function defined by the mission designer to evaluate whether a certain goal has been reached after a TASK finishes within the MISSION. A GoalFunction must accept 2 parameters: Mission, Client, which contains the current MISSION object and the current CLIENT object respectively.

    + +
  • +
  • + +

    self :

    + +
  • +
  • + +

    GoalFunction :

    + +
  • +
+

Usage:

+
 PatriotActivation = { 
+		{ "US SAM Patriot Zerti", false },
+		{ "US SAM Patriot Zegduleti", false },
+		{ "US SAM Patriot Gvleti", false }
+	}
+
+	function DeployPatriotTroopsGoal( Mission, Client )
+
+
+		-- Check if the cargo is all deployed for mission success.
+		for CargoID, CargoData in pairs( Mission._Cargos ) do
+			if Group.getByName( CargoData.CargoGroupName ) then
+				CargoGroup = Group.getByName( CargoData.CargoGroupName )
+				if CargoGroup then
+					-- Check if the cargo is ready to activate
+					CurrentLandingZoneID = routines.IsUnitInZones( CargoGroup:getUnits()[1], Mission:GetTask( 2 ).LandingZones ) -- The second task is the Deploytask to measure mission success upon
+					if CurrentLandingZoneID then
+						if PatriotActivation[CurrentLandingZoneID][2] == false then
+							-- Now check if this is a new Mission Task to be completed...
+							trigger.action.setGroupAIOn( Group.getByName( PatriotActivation[CurrentLandingZoneID][1] ) )
+							PatriotActivation[CurrentLandingZoneID][2] = true
+							MessageToBlue( "Mission Command: Message to all airborne units! The " .. PatriotActivation[CurrentLandingZoneID][1] .. " is armed. Our air defenses are now stronger.", 60, "BLUE/PatriotDefense" )
+							MessageToRed( "Mission Command: Our satellite systems are detecting additional NATO air defenses. To all airborne units: Take care!!!", 60, "RED/PatriotDefense" )
+							Mission:GetTask( 2 ):AddGoalCompletion( "Patriots activated", PatriotActivation[CurrentLandingZoneID][1], 1 ) -- Register Patriot activation as part of mission goal.
+						end
+					end
+				end
+			end
+		end
+	end
+
+	local Mission = MISSIONSCHEDULER.AddMission( 'NATO Transport Troops', 'Operational', 'Transport 3 groups of air defense engineers from our barracks "Gold" and "Titan" to each patriot battery control center to activate our air defenses.', 'NATO' )
+	Mission:AddGoalFunction( DeployPatriotTroopsGoal )
+ +
+
+
+
+ + +MISSION:AddScoring(Scoring) + +
+
+ +

Add a scoring to the mission.

+ +

Parameter

+
    +
  • + +

    Scoring :

    + +
  • +
+

Return value

+ +

#MISSION: +self

+ +
+
+
+
+ + +MISSION:AddTask(Task) + +
+
+ +

Register a Task to be completed within the Mission.

+ + +

Note that there can be multiple Tasks registered to be completed. +Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.

+ +

Parameter

+ +

Return value

+ +

Tasking.Task#TASK: +The task added.

+ +
+
+
+
+ + #string + +MISSION.ClassName + +
+
+ + + +
+
+
+
+ + +MISSION:ClearMissionMenu() + +
+
+ +

Clears the mission menu for the coalition.

+ +

Return value

+ +

#MISSION: +self

+ +
+
+
+
+ + +MISSION:Completed() + +
+
+ +

Set a Mission to completed.

+ +
+
+
+
+ + +MISSION:CrashUnit(PlayerUnit) + +
+
+ +

Handles a crash of a PlayerUnit from the Mission.

+ + +

For each Task within the Mission, the PlayerUnit is removed from Task where it is assigned. +If the Unit was not part of a Task in the Mission, false is returned. +If the Unit is part of a Task in the Mission, true is returned.

+ +

Parameter

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The CLIENT or UNIT of the Player crashing.

    + +
  • +
+

Return value

+ +

#boolean: +true if Unit is part of a Task in the Mission.

+ +
+
+
+
+ + #number + +MISSION.FAILED + +
+
+ + + +
+
+
+
+ + +MISSION:Failed() + +
+
+ +

Set a Mission to failed.

+ +
+
+
+
+ + +MISSION.FindClient(CLIENT, self, ClientName) + +
+
+ +

Find a CLIENT object within the MISSION by its ClientName.

+ +

Parameters

+
    +
  • + +

    CLIENT : +ClientName is a string defining the Client Group as defined within the ME.

    + +
  • +
  • + +

    self :

    + +
  • +
  • + +

    ClientName :

    + +
  • +
+

Return value

+ + +

CLIENT

+ +

Usage:

+
-- Seach for Client "Bomber" within the Mission.
+local BomberClient = Mission:FindClient( "Bomber" )
+ +
+
+
+
+ + +MISSION:GetCommandCenter() + +
+
+ +

Gets the COMMANDCENTER.

+ +

Return value

+ +

Tasking.CommandCenter#COMMANDCENTER:

+ + +
+
+
+
+ + +MISSION:GetGroups() + +
+
+ +

Get the groups for which TASKS are given in the mission

+ +

Return value

+ +

Core.Set#SET_GROUP:

+ + +
+
+
+
+ + +MISSION:GetMissionMenu(TaskGroup) + +
+
+ +

Gets the mission menu for the coalition.

+ +

Parameter

+ +

Return value

+ +

Core.Menu#MENU_COALITION: +self

+ +
+
+
+
+ + +MISSION:GetName() + +
+
+ +

Gets the mission name.

+ +

Return value

+ +

#MISSION: +self

+ +
+
+
+
+ + +MISSION:GetNextTaskID(Task) + +
+
+ +

Return the next Task ID to be completed within the Mission.

+ +

Parameter

+ +

Return value

+ +

Tasking.Task#TASK: +The task added.

+ +
+
+
+
+ + +MISSION:GetScoring() + +
+
+ +

Get the scoring object of a mission.

+ +

Return value

+ +

#SCORING: +Scoring

+ +
+
+
+
+ + +MISSION.GetTask(TaskName, self) + +
+
+ +

Get the TASK identified by the TaskNumber from the Mission.

+ + +

This function is useful in GoalFunctions.

+ +

Parameters

+
    +
  • + +

    #string TaskName : +The Name of the Task within the Mission.

    + +
  • +
  • + +

    self :

    + +
  • +
+

Return values

+
    +
  1. + +

    Tasking.Task#TASK: +The Task

    + +
  2. +
  3. + +

    #nil: +Returns nil if no task was found.

    + +
  4. +
+
+
+
+
+ + +MISSION:GetTasks() + +
+
+ +

Get all the TASKs from the Mission.

+ + +

This function is useful in GoalFunctions.

+ +

Return value

+ + +

{TASK,...} Structure of TASKS with the TASK number as the key.

+ +

Usage:

+
-- Get Tasks from the Mission.
+Tasks = Mission:GetTasks()
+env.info( "Task 2 Completion = " .. Tasks[2]:GetGoalPercentage() .. "%" )
+ +
+
+
+
+ + +MISSION.GoalFunction + +
+
+ + + +
+
+
+
+ + +MISSION:HasGroup(TaskGroup) + +
+
+ + + +

Parameter

+
    +
  • + +

    TaskGroup :

    + +
  • +
+
+
+
+
+ + +MISSION:IsCompleted() + +
+
+ +

Returns if a Mission has completed.

+ +

Return value

+ + +

bool

+ +
+
+
+
+ + +MISSION:IsFailed() + +
+
+ +

Returns if a Mission has failed.

+ + +

treturn bool

+ +
+
+
+
+ + +MISSION:IsOngoing() + +
+
+ +

Returns if a Mission is ongoing.

+ + +

treturn bool

+ +
+
+
+
+ + +MISSION:IsPending() + +
+
+ +

Returns if a Mission is pending.

+ + +

treturn bool

+ +
+
+
+
+ + +MISSION:JoinUnit(PlayerUnit) + +
+
+ +

Add a Unit to join the Mission.

+ + +

For each Task within the Mission, the Unit is joined with the Task. +If the Unit was not part of a Task in the Mission, false is returned. +If the Unit is part of a Task in the Mission, true is returned.

+ +

Parameter

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The CLIENT or UNIT of the Player joining the Mission.

    + +
  • +
+

Return value

+ +

#boolean: +true if Unit is part of a Task in the Mission.

+ +
+
+
+
+ + #string + +MISSION.MissionBriefing + +
+
+ + + +
+
+
+
+ + #string + +MISSION.MissionCoalition + +
+
+ + + +
+
+
+
+ + Core.Menu#MENU_COALITION + +MISSION.MissionMenu + +
+
+ + + +
+
+
+
+ + #number + +MISSION.MissionProgressTrigger + +
+
+ + + +
+
+
+
+ + #boolean + +MISSION.MissionReportFlash + +
+
+ + + +
+
+
+
+ + #boolean + +MISSION.MissionReportShow + +
+
+ + + +
+
+
+
+ + #number + +MISSION.MissionReportTrigger + +
+
+ + + +
+
+
+
+ + #string + +MISSION.MissionStatus + +
+
+ + + +
+
+
+
+ + #number + +MISSION.MissionTimeInterval + +
+
+ + + +
+
+
+
+ + #string + +MISSION.Name + +
+
+ + + +
+
+
+
+ + +MISSION:New(CommandCenter, MissionName, MissionPriority, MissionBriefing, MissionCoalition) + +
+
+ +

This is the main MISSION declaration method.

+ + +

Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.

+ +

Parameters

+
    +
  • + +

    Tasking.CommandCenter#COMMANDCENTER CommandCenter :

    + +
  • +
  • + +

    #string MissionName : +is the name of the mission. This name will be used to reference the status of each mission by the players.

    + +
  • +
  • + +

    #string MissionPriority : +is a string indicating the "priority" of the Mission. f.e. "Primary", "Secondary" or "First", "Second". It is free format and up to the Mission designer to choose. There are no rules behind this field.

    + +
  • +
  • + +

    #string MissionBriefing : +is a string indicating the mission briefing to be shown when a player joins a CLIENT.

    + +
  • +
  • + +

    Dcs.DCSCoalitionWrapper.Object#coalition MissionCoalition : +is a string indicating the coalition or party to which this mission belongs to. It is free format and can be chosen freely by the mission designer. Note that this field is not to be confused with the coalition concept of the ME. Examples of a Mission Coalition could be "NATO", "CCCP", "Intruders", "Terrorists"...

    + +
  • +
+

Return value

+ +

#MISSION: +self

+ +
+
+
+
+ + +MISSION:Ongoing() + +
+
+ +

Set a Mission to ongoing.

+ +
+
+
+
+ + +MISSION:Pending() + +
+
+ +

Set a Mission to pending.

+ +
+
+
+
+ + #number + +MISSION.REPEAT + +
+
+ + + +
+
+
+
+ + +MISSION:RemoveMenu() + +
+
+ +

Removes the Planned Task menu.

+ +
+
+
+
+ + +MISSION:RemoveTask(Task) + +
+
+ +

Removes a Task to be completed within the Mission.

+ + +

Note that there can be multiple Tasks registered to be completed. +Each Task can be set a certain Goals. The Mission will not be completed until all Goals are reached.

+ +

Parameter

+ +

Return value

+ +

#nil: +The cleaned Task reference.

+ +
+
+
+
+ + +MISSION:RemoveTaskMenu(Task) + +
+
+ +

Removes a Task menu.

+ +

Parameter

+ +

Return value

+ +

#MISSION: +self

+ +
+
+
+
+ + +MISSION:ReportDetails() + +
+
+ +

Create a detailed report of the Mission, listing all the details of the Task.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +MISSION:ReportOverview() + +
+
+ +

Create a overview report of the Mission (multiple lines).

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +MISSION:ReportSummary() + +
+
+ +

Create a summary report of the Mission (one line).

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +MISSION:ReportToAll() + +
+
+ +

Report the status of all MISSIONs to all active Clients.

+ +
+
+
+
+ + #number + +MISSION.SUCCESS + +
+
+ + + +
+
+
+
+ + + +MISSION.Scoring + +
+
+ + + +
+
+
+
+ + +MISSION:SetAssignedMenu(Task, MenuText) + +
+
+ +

Sets the Assigned Task menu.

+ +

Parameters

+ +

Return value

+ +

#MISSION: +self

+ +
+
+
+
+ + +MISSION:SetMenu() + +
+
+ +

Sets the Planned Task menu.

+ +
+
+
+
+ + +MISSION:StatusToClients() + +
+
+ +

Send the status of the MISSION to all Clients.

+ +
+
+
+
+ + + +MISSION.TaskCategoryMenus + +
+
+ + + +
+
+
+
+ + + +MISSION.TaskMenus + +
+
+ + + +
+
+
+
+ + + +MISSION.TaskTypeMenus + +
+
+ + + +
+
+
+
+ + + +MISSION._ActiveTasks + +
+
+ + + +
+
+
+
+ + #MISSION.Clients + +MISSION._Clients + +
+
+ + + +
+
+
+
+ + + +MISSION._GoalTasks + +
+
+ + + +
+
+
+
+ + +MISSION:onbeforeComplete(Event, From, To) + +
+
+ +

FSM function for a MISSION

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +MISSION:onenterCompleted(Event, From, To) + +
+
+ +

FSM function for a MISSION

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+ +

Type MISSION.Clients

+ +

Type MISSIONSCHEDULER

+ +

The MISSIONSCHEDULER is an OBJECT and is the main scheduler of ALL active MISSIONs registered within this scheduler.

+ + +

It's workings are considered internal and is automatically created when the Mission.lua file is included.

+ +

Field(s)

+
+
+ + +MISSIONSCHEDULER.AddMission(Mission) + +
+
+ +

This is the main MISSION declaration method.

+ + +

Each Mission is like the master or a Mission orchestration between, Clients, Tasks, Stages etc.

+ +

Parameter

+
    +
  • + +

    Mission : +is the MISSION object instantiated by MISSION.

    + +
  • +
+

Return value

+ + +

MISSION

+ +

Usage:

+

+-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6', 
+                       'Operational', 
+                       'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 
+                       'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+ +
+
+
+
+ + +MISSIONSCHEDULER.FindMission(MissionName) + +
+
+ +

Find a MISSION within the MISSIONSCHEDULER.

+ +

Parameter

+
    +
  • + +

    MissionName : +is the name of the MISSION given at declaration using AddMission.

    + +
  • +
+

Return value

+ + +

MISSION

+ +

Usage:

+
-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6', 
+                       'Operational', 
+                       'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 
+                       'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+
+-- Now find the Mission.
+MissionFind = MISSIONSCHEDULER:FindMission( 'Russia Transport Troops SA-6' )
+ +
+
+
+
+ + #number + +MISSIONSCHEDULER.MissionCount + +
+
+ + + +
+
+
+
+ + #MISSIONSCHEDULER.MISSIONS + +MISSIONSCHEDULER.Missions + +
+
+ + + +
+
+
+
+ + +MISSIONSCHEDULER.RemoveMission(MissionName) + +
+
+ +

Remove a MISSION from the MISSIONSCHEDULER.

+ +

Parameter

+
    +
  • + +

    MissionName : +is the name of the MISSION given at declaration using AddMission.

    + +
  • +
+

Usage:

+
-- Declare a mission.
+Mission = MISSION:New( 'Russia Transport Troops SA-6', 
+                       'Operational', 
+                       'Transport troops from the control center to one of the SA-6 SAM sites to activate their operation.', 
+                       'Russia' )
+MISSIONSCHEDULER:AddMission( Mission )
+
+-- Now remove the Mission.
+MISSIONSCHEDULER:RemoveMission( 'Russia Transport Troops SA-6' )
+ +
+
+
+
+ + +MISSIONSCHEDULER.ReportMenu() + +
+
+ +

Enables a MENU option in the communications menu under F10 to control the status of the active missions.

+ + +

This function should be called only once when starting the MISSIONSCHEDULER.

+ +
+
+
+
+ + +MISSIONSCHEDULER.ReportMissionsFlash(TimeInterval) + +
+
+ + + + +

Internal function used by the MISSIONSCHEDULER menu.

+ +

Parameter

+
    +
  • + +

    TimeInterval :

    + +
  • +
+
+
+
+
+ + +MISSIONSCHEDULER.ReportMissionsHide(Prm) + +
+
+ + + + +

Internal function used by the MISSIONSCHEDULER menu.

+ +

Parameter

+
    +
  • + +

    Prm :

    + +
  • +
+
+
+
+
+ + +MISSIONSCHEDULER.ReportMissionsShow() + +
+
+ + + + +

Internal function used by the MISSIONSCHEDULER menu.

+ +
+
+
+
+ + +MISSIONSCHEDULER.Scheduler() + +
+
+ +

This is the main MISSIONSCHEDULER Scheduler function.

+ + +

It is considered internal and is automatically created when the Mission.lua file is included.

+ +
+
+
+
+ + + +MISSIONSCHEDULER.SchedulerId + +
+
+ + + + +

MISSIONSCHEDULER.SchedulerId = routines.scheduleFunction( MISSIONSCHEDULER.Scheduler, { }, 0, 2 )

+ +
+
+
+
+ + +MISSIONSCHEDULER:Scoring(Scoring) + +
+
+ +

Adds a mission scoring to the game.

+ +

Parameter

+
    +
  • + +

    Scoring :

    + +
  • +
+
+
+
+
+ + +MISSIONSCHEDULER.Start() + +
+
+ +

Start the MISSIONSCHEDULER.

+ +
+
+
+
+ + +MISSIONSCHEDULER.Stop() + +
+
+ +

Stop the MISSIONSCHEDULER.

+ +
+
+
+
+ + +MISSIONSCHEDULER:Time(TimeSeconds, TimeIntervalShow, TimeShow) + +
+
+ + + +

Parameters

+
    +
  • + +

    TimeSeconds :

    + +
  • +
  • + +

    TimeIntervalShow :

    + +
  • +
  • + +

    TimeShow :

    + +
  • +
+
+
+
+
+ + #number + +MISSIONSCHEDULER.TimeIntervalCount + +
+
+ + + +
+
+
+
+ + #number + +MISSIONSCHEDULER.TimeIntervalShow + +
+
+ + + +
+
+
+
+ + #number + +MISSIONSCHEDULER.TimeSeconds + +
+
+ + + +
+
+
+
+ + #number + +MISSIONSCHEDULER.TimeShow + +
+
+ + + +
+
+ +

Type MISSIONSCHEDULER.MISSIONS

+ +

Type SCORING

+ +
+ +
+ + diff --git a/docs/Documentation/Object.html b/docs/Documentation/Object.html new file mode 100644 index 000000000..f9ad6aa8a --- /dev/null +++ b/docs/Documentation/Object.html @@ -0,0 +1,317 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Object

+ +

This module contains the OBJECT class.

+ + + +

1) Wrapper.Object#OBJECT class, extends Core.Base#BASE

+

The Wrapper.Object#OBJECT class is a wrapper class to handle the DCS Object objects:

+ +
    +
  • Support all DCS Object APIs.
  • +
  • Enhance with Object specific APIs not in the DCS Object API set.
  • +
  • Manage the "state" of the DCS Object.
  • +
+ +

1.1) OBJECT constructor:

+

The OBJECT class provides the following functions to construct a OBJECT instance:

+ + + +

1.2) OBJECT methods:

+

The following methods can be used to identify an Object object:

+ + + +
+ + +

Global(s)

+ + + + + +
OBJECT + +
+

Type DCSObject

+ + + + + +
DCSObject.id_ +

The ID of the controllable in DCS

+
+ +

Type OBJECT

+ + + + + + + + + + + + + + + + + + + + + +
OBJECT.ClassName + +
OBJECT:Destroy() +

Destroys the OBJECT.

+
OBJECT:GetID() +

Returns the unit's unique identifier.

+
OBJECT:New(ObjectName) +

Create a new OBJECT from a DCSObject

+
OBJECT.ObjectName +

The name of the Object.

+
+ +

Global(s)

+
+
+ + #OBJECT + +OBJECT + +
+
+ + + +
+
+

Type Object

+ +

Type DCSObject

+ +

A DCSObject

+ +

Field(s)

+
+
+ + +DCSObject.id_ + +
+
+ +

The ID of the controllable in DCS

+ +
+
+ +

Type OBJECT

+ +

The OBJECT class

+ +

Field(s)

+
+
+ + #string + +OBJECT.ClassName + +
+
+ + + +
+
+
+
+ + +OBJECT:Destroy() + +
+
+ +

Destroys the OBJECT.

+ +

Return value

+ +

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

+ +
+
+
+
+ + +OBJECT:GetID() + +
+
+ +

Returns the unit's unique identifier.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSWrapper.Object#Object.ID: +ObjectID

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +OBJECT:New(ObjectName) + +
+
+ +

Create a new OBJECT from a DCSObject

+ +

Parameter

+ +

Return value

+ +

#OBJECT: +self

+ +
+
+
+
+ + #string + +OBJECT.ObjectName + +
+
+ +

The name of the Object.

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Patrol.html b/docs/Documentation/Patrol.html new file mode 100644 index 000000000..70b53baab --- /dev/null +++ b/docs/Documentation/Patrol.html @@ -0,0 +1,787 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Patrol

+ +

(AI) (FSM) Make AI patrol routes or zones.

+ + + +
+ +

1) #AI_PATROLZONE class, extends Core.Fsm#FSM_CONTROLLABLE

+

The #AI_PATROLZONE class implements the core functions to patrol a Zone by an AIR Controllable Group. +The patrol algorithm works that for each airplane patrolling, upon arrival at the patrol zone, +a random point is selected as the route point within the 3D space, within the given boundary limits. +The airplane will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits. +Upon arrival at the random 3D point, a new 3D random point will be selected within the patrol zone using the given limits. +This cycle will continue until a fuel treshold has been reached by the airplane. +When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.

+ +

1.1) AI_PATROLZONE constructor:

+ + + +

1.2) AI_PATROLZONE state machine:

+

The AI_PATROLZONE is a state machine: it manages the different events and states of the AIControllable it is controlling.

+ +

1.2.1) AI_PATROLZONE Events:

+ +
    +
  • AI_PATROLZONE.Route( AIControllable ): A new 3D route point is selected and the AIControllable will fly towards that point with the given speed.
  • +
  • AI_PATROLZONE.Patrol( AIControllable ): The AIControllable reports it is patrolling. This event is called every 30 seconds.
  • +
  • AI_PATROLZONE.RTB( AIControllable ): The AIControllable will report return to base.
  • +
  • AI_PATROLZONE.End( AIControllable ): The end of the AI_PATROLZONE process.
  • +
  • AI_PATROLZONE.Dead( AIControllable ): The AIControllable is dead. The AI_PATROLZONE process will be ended.
  • +
+ +

1.2.2) AI_PATROLZONE States:

+ +
    +
  • Route: A new 3D route point is selected and the AIControllable will fly towards that point with the given speed.
  • +
  • Patrol: The AIControllable is patrolling. This state is set every 30 seconds, so every 30 seconds, a state transition method can be used.
  • +
  • RTB: The AIControllable reports it wants to return to the base.
  • +
  • Dead: The AIControllable is dead ...
  • +
  • End: The process has come to an end.
  • +
+ +

1.2.3) AI_PATROLZONE state transition methods:

+ +

State transition functions can be set by the mission designer customizing or improving the behaviour of the state. +There are 2 moments when state transition methods will be called by the state machine:

+ +
    +
  • Before the state transition. + The state transition method needs to start with the name OnBefore + the name of the state. + If the state transition method returns false, then the processing of the state transition will not be done! + If you want to change the behaviour of the AIControllable at this event, return false, + but then you'll need to specify your own logic using the AIControllable!

  • +
  • After the state transition. + The state transition method needs to start with the name OnAfter + the name of the state. + These state transition methods need to provide a return value, which is specified at the function description.

  • +
+ +

An example how to manage a state transition for an AI_PATROLZONE object Patrol for the state RTB:

+ +
 local PatrolZoneGroup = GROUP:FindByName( "Patrol Zone" )
+ local PatrolZone = ZONE_POLYGON:New( "PatrolZone", PatrolZoneGroup )
+
+ local PatrolSpawn = SPAWN:New( "Patrol Group" )
+ local PatrolGroup = PatrolSpawn:Spawn()
+
+ local Patrol = AI_PATROLZONE:New( PatrolZone, 3000, 6000, 300, 600 )
+ Patrol:SetControllable( PatrolGroup )
+ Patrol:ManageFuel( 0.2, 60 )
+
+ +

OnBeforeRTB( AIGroup ) will be called by the AIPATROLZONE object when the AIGroup reports RTB, but before the RTB default action is processed by the AIPATROLZONE object.

+ +
 --- State transition function for the AI_PATROLZONE **Patrol** object
+ -- @param #AI_PATROLZONE self 
+ -- @param Wrapper.Controllable#CONTROLLABLE AIGroup
+ -- @return #boolean If false is returned, then the OnAfter state transition method will not be called.
+ function Patrol:OnBeforeRTB( AIGroup )
+   AIGroup:MessageToRed( "Returning to base", 20 )
+ end
+
+ +

OnAfterRTB( AIGroup ) will be called by the AIPATROLZONE object when the AIGroup reports RTB, but after the RTB default action was processed by the AIPATROLZONE object.

+ +
 --- State transition function for the AI_PATROLZONE **Patrol** object
+ -- @param #AI_PATROLZONE self 
+ -- @param Wrapper.Controllable#CONTROLLABLE AIGroup
+ -- @return #Wrapper.Controllable#CONTROLLABLE The new AIGroup object that is set to be patrolling the zone.
+ function Patrol:OnAfterRTB( AIGroup )
+   return PatrolSpawn:Spawn()
+ end 
+
+ +

1.3) Manage the AI_PATROLZONE parameters:

+

The following methods are available to modify the parameters of a AI_PATROLZONE object:

+ + + +

1.3) Manage the out of fuel in the AI_PATROLZONE:

+

When the AIControllable is out of fuel, it is required that a new AIControllable is started, before the old AIControllable can return to the home base. +Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated. +When the fuel treshold is reached, the AIControllable will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the AI_PATROLZONE. +Once the time is finished, the old AIControllable will return to the base. +Use the method AI_PATROLZONE.ManageFuel() to have this proces in place.

+ +
+ +

API CHANGE HISTORY

+ +

The underlying change log documents the API changes. Please read this carefully. The following notation is used:

+ +
    +
  • Added parts are expressed in bold type face.
  • +
  • Removed parts are expressed in italic type face.
  • +
+ +

Hereby the change log:

+ +

2016-09-01: Initial class and API.

+ +
+ +

AUTHORS and CONTRIBUTIONS

+ +

Contributions:

+ +
    +
  • DutchBaron: Testing.
  • +
  • Pikey: Testing and API concept review.
  • +
+ +

Authors:

+ +
    +
  • FlightControl: Design & Programming.
  • +
+ + + +

Global(s)

+ + + + + + + + + +
AI_PATROLZONE + +
_NewPatrolRoute(AIControllable) + +
+

Type AI_PATROLZONE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_PATROLZONE.AIControllable +

The Controllable patrolling.

+
AI_PATROLZONE.ClassName + +
AI_PATROLZONE:ManageFuel(PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime) +

When the AIControllable is out of fuel, it is required that a new AIControllable is started, before the old AIControllable can return to the home base.

+
AI_PATROLZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed) +

Creates a new AI_PATROLZONE object

+
AI_PATROLZONE:OnAfterRoute(Controllable) +

OnAfter State Transition Function

+
AI_PATROLZONE:OnBeforeRoute(Controllable) +

OnBefore State Transition Function

+
AI_PATROLZONE.PatrolCeilingAltitude +

The highest altitude in meters where to execute the patrol.

+
AI_PATROLZONE.PatrolFloorAltitude +

The lowest altitude in meters where to execute the patrol.

+
AI_PATROLZONE.PatrolFuelTresholdPercentage + +
AI_PATROLZONE.PatrolManageFuel + +
AI_PATROLZONE.PatrolMaxSpeed +

The maximum speed of the Controllable in km/h.

+
AI_PATROLZONE.PatrolMinSpeed +

The minimum speed of the Controllable in km/h.

+
AI_PATROLZONE.PatrolOutOfFuelOrbitTime + +
AI_PATROLZONE.PatrolZone +

The Zone where the patrol needs to be executed.

+
AI_PATROLZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude) +

Sets the floor and ceiling altitude of the patrol.

+
AI_PATROLZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed) +

Sets (modifies) the minimum and maximum speed of the patrol.

+
AI_PATROLZONE:onenterPatrol() + +
AI_PATROLZONE:onenterRoute() +

Defines a new patrol route using the Process_PatrolZone parameters and settings.

+
+ +

Global(s)

+
+
+ + #AI_PATROLZONE + +AI_PATROLZONE + +
+
+ + + +
+
+
+
+ + +_NewPatrolRoute(AIControllable) + +
+
+ + + +

Parameter

+ +
+
+

Type Patrol

+ +

Type AI_PATROLZONE

+ +

AI_PATROLZONE class

+ +

Field(s)

+
+
+ + Wrapper.Controllable#CONTROLLABLE + +AI_PATROLZONE.AIControllable + +
+
+ +

The Controllable patrolling.

+ +
+
+
+
+ + #string + +AI_PATROLZONE.ClassName + +
+
+ + + +
+
+
+
+ + +AI_PATROLZONE:ManageFuel(PatrolFuelTresholdPercentage, PatrolOutOfFuelOrbitTime) + +
+
+ +

When the AIControllable is out of fuel, it is required that a new AIControllable is started, before the old AIControllable can return to the home base.

+ + +

Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated. +When the fuel treshold is reached, the AIControllable will continue for a given time its patrol task in orbit, while a new AIControllable is targetted to the AI_PATROLZONE. +Once the time is finished, the old AIControllable will return to the base.

+ +

Parameters

+
    +
  • + +

    #number PatrolFuelTresholdPercentage : +The treshold in percentage (between 0 and 1) when the AIControllable is considered to get out of fuel.

    + +
  • +
  • + +

    #number PatrolOutOfFuelOrbitTime : +The amount of seconds the out of fuel AIControllable will orbit before returning to the base.

    + +
  • +
+

Return value

+ +

#AI_PATROLZONE: +self

+ +
+
+
+
+ + +AI_PATROLZONE:New(PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed) + +
+
+ +

Creates a new AI_PATROLZONE object

+ +

Parameters

+ +

Return value

+ +

#AI_PATROLZONE: +self

+ +

Usage:

+
-- Define a new AI_PATROLZONE Object. This PatrolArea will patrol an AIControllable within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
+PatrolZone = ZONE:New( 'PatrolZone' )
+PatrolSpawn = SPAWN:New( 'Patrol Group' )
+PatrolArea = AI_PATROLZONE:New( PatrolZone, 3000, 6000, 600, 900 )
+ +
+
+
+
+ + +AI_PATROLZONE:OnAfterRoute(Controllable) + +
+
+ +

OnAfter State Transition Function

+ +

Parameter

+ +
+
+
+
+ + +AI_PATROLZONE:OnBeforeRoute(Controllable) + +
+
+ +

OnBefore State Transition Function

+ +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + Dcs.DCSTypes#Altitude + +AI_PATROLZONE.PatrolCeilingAltitude + +
+
+ +

The highest altitude in meters where to execute the patrol.

+ +
+
+
+
+ + Dcs.DCSTypes#Altitude + +AI_PATROLZONE.PatrolFloorAltitude + +
+
+ +

The lowest altitude in meters where to execute the patrol.

+ +
+
+
+
+ + + +AI_PATROLZONE.PatrolFuelTresholdPercentage + +
+
+ + + +
+
+
+
+ + #boolean + +AI_PATROLZONE.PatrolManageFuel + +
+
+ + + +
+
+
+
+ + Dcs.DCSTypes#Speed + +AI_PATROLZONE.PatrolMaxSpeed + +
+
+ +

The maximum speed of the Controllable in km/h.

+ +
+
+
+
+ + Dcs.DCSTypes#Speed + +AI_PATROLZONE.PatrolMinSpeed + +
+
+ +

The minimum speed of the Controllable in km/h.

+ +
+
+
+
+ + + +AI_PATROLZONE.PatrolOutOfFuelOrbitTime + +
+
+ + + +
+
+
+
+ + Core.Zone#ZONE_BASE + +AI_PATROLZONE.PatrolZone + +
+
+ +

The Zone where the patrol needs to be executed.

+ +
+
+
+
+ + +AI_PATROLZONE:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude) + +
+
+ +

Sets the floor and ceiling altitude of the patrol.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Altitude PatrolFloorAltitude : +The lowest altitude in meters where to execute the patrol.

    + +
  • +
  • + +

    Dcs.DCSTypes#Altitude PatrolCeilingAltitude : +The highest altitude in meters where to execute the patrol.

    + +
  • +
+

Return value

+ +

#AI_PATROLZONE: +self

+ +
+
+
+
+ + +AI_PATROLZONE:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed) + +
+
+ +

Sets (modifies) the minimum and maximum speed of the patrol.

+ +

Parameters

+ +

Return value

+ +

#AI_PATROLZONE: +self

+ +
+
+
+
+ + +AI_PATROLZONE:onenterPatrol() + +
+
+ + + +
+
+
+
+ + +AI_PATROLZONE:onenterRoute() + +
+
+ +

Defines a new patrol route using the Process_PatrolZone parameters and settings.

+ +

Return value

+ +

#AI_PATROLZONE: +self

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Point.html b/docs/Documentation/Point.html new file mode 100644 index 000000000..ad3129506 --- /dev/null +++ b/docs/Documentation/Point.html @@ -0,0 +1,2169 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Point

+ +

This module contains the POINT classes.

+ + + +

1) Core.Point#POINT_VEC3 class, extends Core.Base#BASE

+

The Core.Point#POINT_VEC3 class defines a 3D point in the simulator.

+ +

Important Note: Most of the functions in this section were taken from MIST, and reworked to OO concepts. +In order to keep the credibility of the the author, I want to emphasize that the of the MIST framework was created by Grimes, who you can find on the Eagle Dynamics Forums.

+ +

1.1) POINT_VEC3 constructor

+

A new POINT_VEC3 instance can be created with:

+ + + + +

2) Core.Point#POINT_VEC2 class, extends Core.Point#POINT_VEC3

+

The Core.Point#POINT_VEC2 class defines a 2D point in the simulator. The height coordinate (if needed) will be the land height + an optional added height specified.

+ +

2.1) POINT_VEC2 constructor

+

A new POINT_VEC2 instance can be created with:

+ + + +
+ +

API CHANGE HISTORY

+ +

The underlying change log documents the API changes. Please read this carefully. The following notation is used:

+ +
    +
  • Added parts are expressed in bold type face.
  • +
  • Removed parts are expressed in italic type face.
  • +
+ +

Hereby the change log:

+ +

2016-08-12: POINT_VEC3:Translate( Distance, Angle ) added.

+ +

2016-08-06: Made PointVec3 and Vec3, PointVec2 and Vec2 terminology used in the code consistent.

+ +
    +
  • Replaced method PointVec3() to Vec3() where the code manages a Vec3. Replaced all references to the method.
  • +
  • Replaced method PointVec2() to Vec2() where the code manages a Vec2. Replaced all references to the method.
  • +
  • Replaced method RandomPointVec3() to RandomVec3() where the code manages a Vec3. Replaced all references to the method. + .
  • +
+ +

Authors:

+ +
    +
  • FlightControl : Design & Programming
  • +
+ +

Contributions:

+ + +

Global(s)

+ + + + + + + + + +
POINT_VEC2 + +
POINT_VEC3 + +
+

Type POINT_VEC2

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
POINT_VEC2.ClassName + +
POINT_VEC2:DistanceFromPointVec2(PointVec2Reference) +

Calculate the distance from a reference #POINT_VEC2.

+
POINT_VEC2:DistanceFromVec2(Vec2Reference) +

Calculate the distance from a reference Dcs.DCSTypes#Vec2.

+
POINT_VEC2:GetAlt() +

Return the altitude of the land at the POINT_VEC2.

+
POINT_VEC2:GetAltitudeText() +

Return no text for the altitude of the POINT_VEC2.

+
POINT_VEC2:GetX() +

Return the x coordinate of the POINT_VEC2.

+
POINT_VEC2:GetY() +

Return the y coordinate of the POINT_VEC2.

+
POINT_VEC2:New(x, y, LandHeightAdd) +

POINT_VEC2 constructor.

+
POINT_VEC2:NewFromVec2(Vec2, LandHeightAdd) +

Create a new POINT_VEC2 object from Vec2 coordinates.

+
POINT_VEC2:NewFromVec3(Vec3) +

Create a new POINT_VEC2 object from Vec3 coordinates.

+
POINT_VEC2.SetX(x, self) +

Set the x coordinate of the POINT_VEC2.

+
POINT_VEC2.SetY(y, self) +

Set the y coordinate of the POINT_VEC2.

+
POINT_VEC2:Translate(Distance, Angle) +

Add a Distance in meters from the POINTVEC2 orthonormal plane, with the given angle, and calculate the new POINTVEC2.

+
POINT_VEC2.x +

The x coordinate in meters.

+
POINT_VEC2.y +

the y coordinate in meters.

+
+ +

Type POINT_VEC3

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
POINT_VEC3.ClassName + +
POINT_VEC3:Flare(FlareColor, (, Azimuth) +

Flares the point in a color.

+
POINT_VEC3.FlareColor + +
POINT_VEC3:FlareGreen((, Azimuth) +

Flare the POINT_VEC3 Green.

+
POINT_VEC3:FlareRed(Azimuth) +

Flare the POINT_VEC3 Red.

+
POINT_VEC3:FlareWhite((, Azimuth) +

Flare the POINT_VEC3 White.

+
POINT_VEC3:FlareYellow((, Azimuth) +

Flare the POINT_VEC3 Yellow.

+
POINT_VEC3:Get2DDistance(TargetPointVec3) +

Return the 2D distance in meters between the target POINTVEC3 and the POINTVEC3.

+
POINT_VEC3:Get3DDistance(TargetPointVec3) +

Return the 3D distance in meters between the target POINTVEC3 and the POINTVEC3.

+
POINT_VEC3:GetAltitudeText() +

Return the altitude text of the POINT_VEC3.

+
POINT_VEC3:GetBRText(TargetPointVec3) +

Return a BR string from a POINTVEC3 to the POINTVEC3.

+
POINT_VEC3:GetDirectionRadians(DirectionVec3) +

Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format.

+
POINT_VEC3:GetDirectionVec3(TargetPointVec3) +

Return a direction vector Vec3 from POINTVEC3 to the POINTVEC3.

+
POINT_VEC3:GetNorthCorrectionRadians() +

Get a correction in radians of the real magnetic north of the POINT_VEC3.

+
POINT_VEC3:GetRandomPointVec2InRadius(OuterRadius, InnerRadius) +

Return a random POINTVEC2 within an Outer Radius and optionally NOT within an Inner Radius of the POINTVEC3.

+
POINT_VEC3:GetRandomPointVec3InRadius(OuterRadius, InnerRadius) +

Return a random POINTVEC3 within an Outer Radius and optionally NOT within an Inner Radius of the POINTVEC3.

+
POINT_VEC3:GetRandomVec2InRadius(OuterRadius, InnerRadius) +

Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.

+
POINT_VEC3:GetRandomVec3InRadius(OuterRadius, InnerRadius) +

Return a random Vec3 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.

+
POINT_VEC3:GetVec2() +

Return the coordinates of the POINT_VEC3 in Vec2 format.

+
POINT_VEC3:GetVec3() +

Return the coordinates of the POINT_VEC3 in Vec3 format.

+
POINT_VEC3:GetX() +

Return the x coordinate of the POINT_VEC3.

+
POINT_VEC3:GetY() +

Return the y coordinate of the POINT_VEC3.

+
POINT_VEC3:GetZ() +

Return the z coordinate of the POINT_VEC3.

+
POINT_VEC3:IsMetric() +

Gets if the POINT_VEC3 is metric or NM.

+
POINT_VEC3.Metric + +
POINT_VEC3:New(x, y, z) +

Create a new POINT_VEC3 object.

+
POINT_VEC3:NewFromVec3(Vec3) +

Create a new POINT_VEC3 object from Vec3 coordinates.

+
POINT_VEC3.RoutePointAction + +
POINT_VEC3:RoutePointAir(AltType, Type, Action, Speed, SpeedLocked) +

Build an air type route point.

+
POINT_VEC3.RoutePointAltType + +
POINT_VEC3:RoutePointGround(Speed, Formation) +

Build an ground type route point.

+
POINT_VEC3.RoutePointType + +
POINT_VEC3:SetMetric(Metric) +

Sets the POINT_VEC3 metric or NM.

+
POINT_VEC3.SetX(x, self) +

Set the x coordinate of the POINT_VEC3.

+
POINT_VEC3.SetY(y, self) +

Set the y coordinate of the POINT_VEC3.

+
POINT_VEC3.SetZ(z, self) +

Set the z coordinate of the POINT_VEC3.

+
POINT_VEC3:Smoke(SmokeColor) +

Smokes the point in a color.

+
POINT_VEC3:SmokeBlue() +

Smoke the POINT_VEC3 Blue.

+
POINT_VEC3.SmokeColor + +
POINT_VEC3:SmokeGreen() +

Smoke the POINT_VEC3 Green.

+
POINT_VEC3:SmokeOrange() +

Smoke the POINT_VEC3 Orange.

+
POINT_VEC3:SmokeRed() +

Smoke the POINT_VEC3 Red.

+
POINT_VEC3:SmokeWhite() +

Smoke the POINT_VEC3 White.

+
POINT_VEC3:ToStringBR(AngleRadians, Distance) +

Provides a Bearing / Range string

+
POINT_VEC3:ToStringLL(AngleRadians, Distance, acc, DMS) +

Provides a Bearing / Range string

+
POINT_VEC3:Translate(Distance, Angle) +

Add a Distance in meters from the POINTVEC3 horizontal plane, with the given angle, and calculate the new POINTVEC3.

+
POINT_VEC3.x +

The x coordinate in 3D space.

+
POINT_VEC3.y +

The y coordinate in 3D space.

+
POINT_VEC3.z +

The z coordiante in 3D space.

+
+ +

Type POINT_VEC3.RoutePointAction

+ + + + + +
POINT_VEC3.RoutePointAction.TurningPoint +

"Turning Point"

+
+ +

Type POINT_VEC3.RoutePointAltType

+ + + + + +
POINT_VEC3.RoutePointAltType.BARO +

"BARO"

+
+ +

Type POINT_VEC3.RoutePointType

+ + + + + +
POINT_VEC3.RoutePointType.TurningPoint +

"Turning Point"

+
+ +

Global(s)

+
+
+ + #POINT_VEC2 + +POINT_VEC2 + +
+
+ + + +
+
+
+
+ + #POINT_VEC3 + +POINT_VEC3 + +
+
+ + + +
+
+

Type Point

+ +

Type POINT_VEC2

+ +

The POINT_VEC2 class

+ +

Field(s)

+
+
+ + #string + +POINT_VEC2.ClassName + +
+
+ + + +
+
+
+
+ + +POINT_VEC2:DistanceFromPointVec2(PointVec2Reference) + +
+
+ +

Calculate the distance from a reference #POINT_VEC2.

+ +

Parameter

+ +

Return value

+ +

Dcs.DCSTypes#Distance: +The distance from the reference #POINT_VEC2 in meters.

+ +
+
+
+
+ + +POINT_VEC2:DistanceFromVec2(Vec2Reference) + +
+
+ +

Calculate the distance from a reference Dcs.DCSTypes#Vec2.

+ +

Parameter

+ +

Return value

+ +

Dcs.DCSTypes#Distance: +The distance from the reference Dcs.DCSTypes#Vec2 in meters.

+ +
+
+
+
+ + +POINT_VEC2:GetAlt() + +
+
+ +

Return the altitude of the land at the POINT_VEC2.

+ +

Return value

+ +

#number: +The land altitude.

+ +
+
+
+
+ + +POINT_VEC2:GetAltitudeText() + +
+
+ +

Return no text for the altitude of the POINT_VEC2.

+ +

Return value

+ +

#string: +Empty string.

+ +
+
+
+
+ + +POINT_VEC2:GetX() + +
+
+ +

Return the x coordinate of the POINT_VEC2.

+ +

Return value

+ +

#number: +The x coodinate.

+ +
+
+
+
+ + +POINT_VEC2:GetY() + +
+
+ +

Return the y coordinate of the POINT_VEC2.

+ +

Return value

+ +

#number: +The y coodinate.

+ +
+
+
+
+ + +POINT_VEC2:New(x, y, LandHeightAdd) + +
+
+ +

POINT_VEC2 constructor.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Distance x : +The x coordinate of the Vec3 point, pointing to the North.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance y : +The y coordinate of the Vec3 point, pointing to the Right.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance LandHeightAdd : +(optional) The default height if required to be evaluated will be the land height of the x, y coordinate. You can specify an extra height to be added to the land height.

    + +
  • +
+

Return value

+ +

Core.Point#POINT_VEC2:

+ + +
+
+
+
+ + +POINT_VEC2:NewFromVec2(Vec2, LandHeightAdd) + +
+
+ +

Create a new POINT_VEC2 object from Vec2 coordinates.

+ +

Parameters

+ +

Return value

+ +

Core.Point#POINT_VEC2: +self

+ +
+
+
+
+ + +POINT_VEC2:NewFromVec3(Vec3) + +
+
+ +

Create a new POINT_VEC2 object from Vec3 coordinates.

+ +

Parameter

+ +

Return value

+ +

Core.Point#POINT_VEC2: +self

+ +
+
+
+
+ + +POINT_VEC2.SetX(x, self) + +
+
+ +

Set the x coordinate of the POINT_VEC2.

+ +

Parameters

+
    +
  • + +

    #number x : +The x coordinate.

    + +
  • +
  • + +

    self :

    + +
  • +
+
+
+
+
+ + +POINT_VEC2.SetY(y, self) + +
+
+ +

Set the y coordinate of the POINT_VEC2.

+ +

Parameters

+
    +
  • + +

    #number y : +The y coordinate.

    + +
  • +
  • + +

    self :

    + +
  • +
+
+
+
+
+ + +POINT_VEC2:Translate(Distance, Angle) + +
+
+ +

Add a Distance in meters from the POINTVEC2 orthonormal plane, with the given angle, and calculate the new POINTVEC2.

+ +

Parameters

+ +

Return value

+ +

#POINT_VEC2: +The new calculated POINT_VEC2.

+ +
+
+
+
+ + Dcs.DCSTypes#Distance + +POINT_VEC2.x + +
+
+ +

The x coordinate in meters.

+ +
+
+
+
+ + Dcs.DCSTypes#Distance + +POINT_VEC2.y + +
+
+ +

the y coordinate in meters.

+ +
+
+ +

Type POINT_VEC3

+ +

The POINT_VEC3 class

+ +

Field(s)

+
+
+ + #string + +POINT_VEC3.ClassName + +
+
+ + + +
+
+
+
+ + +POINT_VEC3:Flare(FlareColor, (, Azimuth) + +
+
+ +

Flares the point in a color.

+ +

Parameters

+ +
+
+
+
+ + Utilities.Utils#FLARECOLOR + +POINT_VEC3.FlareColor + +
+
+ + + +
+
+
+
+ + +POINT_VEC3:FlareGreen((, Azimuth) + +
+
+ +

Flare the POINT_VEC3 Green.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Azimuth ( : +ptional) Azimuth The azimuth of the flare direction. The default azimuth is 0.

    + +
  • +
  • + +

    Azimuth :

    + +
  • +
+
+
+
+
+ + +POINT_VEC3:FlareRed(Azimuth) + +
+
+ +

Flare the POINT_VEC3 Red.

+ +

Parameter

+
    +
  • + +

    Azimuth :

    + +
  • +
+
+
+
+
+ + +POINT_VEC3:FlareWhite((, Azimuth) + +
+
+ +

Flare the POINT_VEC3 White.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Azimuth ( : +ptional) Azimuth The azimuth of the flare direction. The default azimuth is 0.

    + +
  • +
  • + +

    Azimuth :

    + +
  • +
+
+
+
+
+ + +POINT_VEC3:FlareYellow((, Azimuth) + +
+
+ +

Flare the POINT_VEC3 Yellow.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Azimuth ( : +ptional) Azimuth The azimuth of the flare direction. The default azimuth is 0.

    + +
  • +
  • + +

    Azimuth :

    + +
  • +
+
+
+
+
+ + +POINT_VEC3:Get2DDistance(TargetPointVec3) + +
+
+ +

Return the 2D distance in meters between the target POINTVEC3 and the POINTVEC3.

+ +

Parameter

+
    +
  • + +

    #POINT_VEC3 TargetPointVec3 : +The target POINT_VEC3.

    + +
  • +
+

Return value

+ +

Dcs.DCSTypes#Distance: +Distance The distance in meters.

+ +
+
+
+
+ + +POINT_VEC3:Get3DDistance(TargetPointVec3) + +
+
+ +

Return the 3D distance in meters between the target POINTVEC3 and the POINTVEC3.

+ +

Parameter

+
    +
  • + +

    #POINT_VEC3 TargetPointVec3 : +The target POINT_VEC3.

    + +
  • +
+

Return value

+ +

Dcs.DCSTypes#Distance: +Distance The distance in meters.

+ +
+
+
+
+ + +POINT_VEC3:GetAltitudeText() + +
+
+ +

Return the altitude text of the POINT_VEC3.

+ +

Return value

+ +

#string: +Altitude text.

+ +
+
+
+
+ + +POINT_VEC3:GetBRText(TargetPointVec3) + +
+
+ +

Return a BR string from a POINTVEC3 to the POINTVEC3.

+ +

Parameter

+
    +
  • + +

    #POINT_VEC3 TargetPointVec3 : +The target POINT_VEC3.

    + +
  • +
+

Return value

+ +

#string: +The BR text.

+ +
+
+
+
+ + +POINT_VEC3:GetDirectionRadians(DirectionVec3) + +
+
+ +

Return a direction in radians from the POINT_VEC3 using a direction vector in Vec3 format.

+ +

Parameter

+ +

Return value

+ +

#number: +DirectionRadians The direction in radians.

+ +
+
+
+
+ + +POINT_VEC3:GetDirectionVec3(TargetPointVec3) + +
+
+ +

Return a direction vector Vec3 from POINTVEC3 to the POINTVEC3.

+ +

Parameter

+
    +
  • + +

    #POINT_VEC3 TargetPointVec3 : +The target POINT_VEC3.

    + +
  • +
+

Return value

+ +

Dcs.DCSTypes#Vec3: +DirectionVec3 The direction vector in Vec3 format.

+ +
+
+
+
+ + +POINT_VEC3:GetNorthCorrectionRadians() + +
+
+ +

Get a correction in radians of the real magnetic north of the POINT_VEC3.

+ +

Return value

+ +

#number: +CorrectionRadians The correction in radians.

+ +
+
+
+
+ + +POINT_VEC3:GetRandomPointVec2InRadius(OuterRadius, InnerRadius) + +
+
+ +

Return a random POINTVEC2 within an Outer Radius and optionally NOT within an Inner Radius of the POINTVEC3.

+ +

Parameters

+ +

Return value

+ +

#POINT_VEC2:

+ + +
+
+
+
+ + +POINT_VEC3:GetRandomPointVec3InRadius(OuterRadius, InnerRadius) + +
+
+ +

Return a random POINTVEC3 within an Outer Radius and optionally NOT within an Inner Radius of the POINTVEC3.

+ +

Parameters

+ +

Return value

+ +

#POINT_VEC3:

+ + +
+
+
+
+ + +POINT_VEC3:GetRandomVec2InRadius(OuterRadius, InnerRadius) + +
+
+ +

Return a random Vec2 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.

+ +

Parameters

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +Vec2

+ +
+
+
+
+ + +POINT_VEC3:GetRandomVec3InRadius(OuterRadius, InnerRadius) + +
+
+ +

Return a random Vec3 within an Outer Radius and optionally NOT within an Inner Radius of the POINT_VEC3.

+ +

Parameters

+ +

Return value

+ +

Dcs.DCSTypes#Vec3: +Vec3

+ +
+
+
+
+ + +POINT_VEC3:GetVec2() + +
+
+ +

Return the coordinates of the POINT_VEC3 in Vec2 format.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The Vec2 coodinate.

+ +
+
+
+
+ + +POINT_VEC3:GetVec3() + +
+
+ +

Return the coordinates of the POINT_VEC3 in Vec3 format.

+ +

Return value

+ +

Dcs.DCSTypes#Vec3: +The Vec3 coodinate.

+ +
+
+
+
+ + +POINT_VEC3:GetX() + +
+
+ +

Return the x coordinate of the POINT_VEC3.

+ +

Return value

+ +

#number: +The x coodinate.

+ +
+
+
+
+ + +POINT_VEC3:GetY() + +
+
+ +

Return the y coordinate of the POINT_VEC3.

+ +

Return value

+ +

#number: +The y coodinate.

+ +
+
+
+
+ + +POINT_VEC3:GetZ() + +
+
+ +

Return the z coordinate of the POINT_VEC3.

+ +

Return value

+ +

#number: +The z coodinate.

+ +
+
+
+
+ + +POINT_VEC3:IsMetric() + +
+
+ +

Gets if the POINT_VEC3 is metric or NM.

+ +

Return value

+ +

#boolean: +Metric true means metric, false means NM.

+ +
+
+
+
+ + + +POINT_VEC3.Metric + +
+
+ + + +
+
+
+
+ + +POINT_VEC3:New(x, y, z) + +
+
+ +

Create a new POINT_VEC3 object.

+ +

Parameters

+ +

Return value

+ +

Core.Point#POINT_VEC3: +self

+ +
+
+
+
+ + +POINT_VEC3:NewFromVec3(Vec3) + +
+
+ +

Create a new POINT_VEC3 object from Vec3 coordinates.

+ +

Parameter

+ +

Return value

+ +

Core.Point#POINT_VEC3: +self

+ +
+
+
+
+ + #POINT_VEC3.RoutePointAction + +POINT_VEC3.RoutePointAction + +
+
+ + + +
+
+
+
+ + +POINT_VEC3:RoutePointAir(AltType, Type, Action, Speed, SpeedLocked) + +
+
+ +

Build an air type route point.

+ +

Parameters

+ +

Return value

+ +

#table: +The route point.

+ +
+
+
+
+ + #POINT_VEC3.RoutePointAltType + +POINT_VEC3.RoutePointAltType + +
+
+ + + +
+
+
+
+ + +POINT_VEC3:RoutePointGround(Speed, Formation) + +
+
+ +

Build an ground type route point.

+ +

Parameters

+ +

Return value

+ +

#table: +The route point.

+ +
+
+
+
+ + #POINT_VEC3.RoutePointType + +POINT_VEC3.RoutePointType + +
+
+ + + +
+
+
+
+ + +POINT_VEC3:SetMetric(Metric) + +
+
+ +

Sets the POINT_VEC3 metric or NM.

+ +

Parameter

+
    +
  • + +

    #boolean Metric : +true means metric, false means NM.

    + +
  • +
+
+
+
+
+ + +POINT_VEC3.SetX(x, self) + +
+
+ +

Set the x coordinate of the POINT_VEC3.

+ +

Parameters

+
    +
  • + +

    #number x : +The x coordinate.

    + +
  • +
  • + +

    self :

    + +
  • +
+
+
+
+
+ + +POINT_VEC3.SetY(y, self) + +
+
+ +

Set the y coordinate of the POINT_VEC3.

+ +

Parameters

+
    +
  • + +

    #number y : +The y coordinate.

    + +
  • +
  • + +

    self :

    + +
  • +
+
+
+
+
+ + +POINT_VEC3.SetZ(z, self) + +
+
+ +

Set the z coordinate of the POINT_VEC3.

+ +

Parameters

+
    +
  • + +

    #number z : +The z coordinate.

    + +
  • +
  • + +

    self :

    + +
  • +
+
+
+
+
+ + +POINT_VEC3:Smoke(SmokeColor) + +
+
+ +

Smokes the point in a color.

+ +

Parameter

+ +
+
+
+
+ + +POINT_VEC3:SmokeBlue() + +
+
+ +

Smoke the POINT_VEC3 Blue.

+ +
+
+
+
+ + Utilities.Utils#SMOKECOLOR + +POINT_VEC3.SmokeColor + +
+
+ + + +
+
+
+
+ + +POINT_VEC3:SmokeGreen() + +
+
+ +

Smoke the POINT_VEC3 Green.

+ +
+
+
+
+ + +POINT_VEC3:SmokeOrange() + +
+
+ +

Smoke the POINT_VEC3 Orange.

+ +
+
+
+
+ + +POINT_VEC3:SmokeRed() + +
+
+ +

Smoke the POINT_VEC3 Red.

+ +
+
+
+
+ + +POINT_VEC3:SmokeWhite() + +
+
+ +

Smoke the POINT_VEC3 White.

+ +
+
+
+
+ + +POINT_VEC3:ToStringBR(AngleRadians, Distance) + +
+
+ +

Provides a Bearing / Range string

+ +

Parameters

+
    +
  • + +

    #number AngleRadians : +The angle in randians

    + +
  • +
  • + +

    #number Distance : +The distance

    + +
  • +
+

Return value

+ +

#string: +The BR Text

+ +
+
+
+
+ + +POINT_VEC3:ToStringLL(AngleRadians, Distance, acc, DMS) + +
+
+ +

Provides a Bearing / Range string

+ +

Parameters

+
    +
  • + +

    #number AngleRadians : +The angle in randians

    + +
  • +
  • + +

    #number Distance : +The distance

    + +
  • +
  • + +

    acc :

    + +
  • +
  • + +

    DMS :

    + +
  • +
+

Return value

+ +

#string: +The BR Text

+ +
+
+
+
+ + +POINT_VEC3:Translate(Distance, Angle) + +
+
+ +

Add a Distance in meters from the POINTVEC3 horizontal plane, with the given angle, and calculate the new POINTVEC3.

+ +

Parameters

+ +

Return value

+ +

#POINT_VEC3: +The new calculated POINT_VEC3.

+ +
+
+
+
+ + #number + +POINT_VEC3.x + +
+
+ +

The x coordinate in 3D space.

+ +
+
+
+
+ + #number + +POINT_VEC3.y + +
+
+ +

The y coordinate in 3D space.

+ +
+
+
+
+ + #number + +POINT_VEC3.z + +
+
+ +

The z coordiante in 3D space.

+ +
+
+ +

Type POINT_VEC3.RoutePointAction

+ +

RoutePoint Actions

+ +

Field(s)

+
+
+ + +POINT_VEC3.RoutePointAction.TurningPoint + +
+
+ +

"Turning Point"

+ +
+
+ +

Type POINT_VEC3.RoutePointAltType

+ +

RoutePoint AltTypes

+ +

Field(s)

+
+
+ + +POINT_VEC3.RoutePointAltType.BARO + +
+
+ +

"BARO"

+ +
+
+ +

Type POINT_VEC3.RoutePointType

+ +

RoutePoint Types

+ +

Field(s)

+
+
+ + +POINT_VEC3.RoutePointType.TurningPoint + +
+
+ +

"Turning Point"

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Positionable.html b/docs/Documentation/Positionable.html new file mode 100644 index 000000000..6612d7f12 --- /dev/null +++ b/docs/Documentation/Positionable.html @@ -0,0 +1,995 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Positionable

+ +

This module contains the POSITIONABLE class.

+ + + +

1) Wrapper.Positionable#POSITIONABLE class, extends Wrapper.Identifiable#IDENTIFIABLE

+

The Wrapper.Positionable#POSITIONABLE class is a wrapper class to handle the POSITIONABLE objects:

+ +
    +
  • Support all DCS APIs.
  • +
  • Enhance with POSITIONABLE specific APIs not in the DCS API set.
  • +
  • Manage the "state" of the POSITIONABLE.
  • +
+ +

1.1) POSITIONABLE constructor:

+

The POSITIONABLE class provides the following functions to construct a POSITIONABLE instance:

+ + + +

1.2) POSITIONABLE methods:

+

The following methods can be used to identify an measurable object:

+ + + +
+ + +

Global(s)

+ + + + + +
POSITIONABLE + +
+

Type DCSPositionable

+ + + + + +
DCSPositionable.id_ +

The ID of the controllable in DCS

+
+ +

Type POSITIONABLE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
POSITIONABLE.ClassName + +
POSITIONABLE:GetAltitude() +

Returns the altitude of the POSITIONABLE.

+
POSITIONABLE:GetHeading() +

Returns the POSITIONABLE heading in degrees.

+
POSITIONABLE:GetMessage(Message, Duration, Name) +

Returns a message with the callsign embedded (if there is one).

+
POSITIONABLE:GetPointVec2() +

Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.

+
POSITIONABLE:GetPositionVec3() +

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

+
POSITIONABLE:GetRandomVec3(Radius) +

Returns a random Dcs.DCSTypes#Vec3 vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.

+
POSITIONABLE:GetVec2() +

Returns the Dcs.DCSTypes#Vec2 vector indicating the point in 2D of the POSITIONABLE within the mission.

+
POSITIONABLE:GetVec3() +

Returns the Dcs.DCSTypes#Vec3 vector indicating the 3D vector of the POSITIONABLE within the mission.

+
POSITIONABLE:GetVelocity() +

Returns the POSITIONABLE velocity vector.

+
POSITIONABLE:GetVelocityKMH() +

Returns the POSITIONABLE velocity in km/h.

+
POSITIONABLE:InAir() +

Returns true if the POSITIONABLE is in the air.

+
POSITIONABLE:IsAboveRunway() +

Returns if the Positionable is located above a runway.

+
POSITIONABLE:Message(Message, Duration, Name) +

Send a message to the players in the Group.

+
POSITIONABLE:MessageToAll(Message, Duration, Name) +

Send a message to all coalitions.

+
POSITIONABLE:MessageToBlue(Message, Duration, Name) +

Send a message to the blue coalition.

+
POSITIONABLE:MessageToClient(Message, Duration, Client, Name) +

Send a message to a client.

+
POSITIONABLE:MessageToCoalition(Message, Duration, Name, MessageCoalition) +

Send a message to a coalition.

+
POSITIONABLE:MessageToGroup(Message, Duration, MessageGroup, Name) +

Send a message to a Group.

+
POSITIONABLE:MessageToRed(Message, Duration, Name) +

Send a message to the red coalition.

+
POSITIONABLE:New(PositionableName) +

Create a new POSITIONABLE from a DCSPositionable

+
POSITIONABLE.PositionableName +

The name of the measurable.

+
+ +

Global(s)

+
+
+ + #POSITIONABLE + +POSITIONABLE + +
+
+ + + +
+
+

Type Positionable

+ +

Type DCSPositionable

+ +

A DCSPositionable

+ +

Field(s)

+
+
+ + +DCSPositionable.id_ + +
+
+ +

The ID of the controllable in DCS

+ +
+
+ +

Type POSITIONABLE

+ +

The POSITIONABLE class

+ +

Field(s)

+
+
+ + #string + +POSITIONABLE.ClassName + +
+
+ + + +
+
+
+
+ + +POSITIONABLE:GetAltitude() + +
+
+ +

Returns the altitude of the POSITIONABLE.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSTypes#Distance: +The altitude of the POSITIONABLE.

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:GetHeading() + +
+
+ +

Returns the POSITIONABLE heading in degrees.

+ +

Return value

+ +

#number: +The POSTIONABLE heading

+ +
+
+
+
+ + +POSITIONABLE:GetMessage(Message, Duration, Name) + +
+
+ +

Returns a message with the callsign embedded (if there is one).

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Dcs.DCSTypes#Duration Duration : +The duration of the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+

Return value

+ +

Core.Message#MESSAGE:

+ + +
+
+
+
+ + +POSITIONABLE:GetPointVec2() + +
+
+ +

Returns a POINT_VEC2 object indicating the point in 2D of the POSITIONABLE within the mission.

+ +

Return values

+
    +
  1. + +

    Core.Point#POINT_VEC2: +The 2D point vector of the POSITIONABLE.

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:GetPositionVec3() + +
+
+ +

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

+ +

Return values

+
    +
  1. + +

    Dcs.DCSTypes#Position: +The 3D position vectors of the POSITIONABLE.

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:GetRandomVec3(Radius) + +
+
+ +

Returns a random Dcs.DCSTypes#Vec3 vector within a range, indicating the point in 3D of the POSITIONABLE within the mission.

+ +

Parameter

+
    +
  • + +

    Radius :

    + +
  • +
+

Return values

+
    +
  1. + +

    Dcs.DCSTypes#Vec3: +The 3D point vector of the POSITIONABLE.

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:GetVec2() + +
+
+ +

Returns the Dcs.DCSTypes#Vec2 vector indicating the point in 2D of the POSITIONABLE within the mission.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSTypes#Vec2: +The 2D point vector of the POSITIONABLE.

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:GetVec3() + +
+
+ +

Returns the Dcs.DCSTypes#Vec3 vector indicating the 3D vector of the POSITIONABLE within the mission.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSTypes#Vec3: +The 3D point vector of the POSITIONABLE.

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:GetVelocity() + +
+
+ +

Returns the POSITIONABLE velocity vector.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSTypes#Vec3: +The velocity vector

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:GetVelocityKMH() + +
+
+ +

Returns the POSITIONABLE velocity in km/h.

+ +

Return values

+
    +
  1. + +

    #number: +The velocity in km/h

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:InAir() + +
+
+ +

Returns true if the POSITIONABLE is in the air.

+ +

Return values

+
    +
  1. + +

    #boolean: +true if in the air.

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:IsAboveRunway() + +
+
+ +

Returns if the Positionable is located above a runway.

+ +

Return values

+
    +
  1. + +

    #boolean: +true if Positionable is above a runway.

    + +
  2. +
  3. + +

    #nil: +The POSITIONABLE is not existing or alive.

    + +
  4. +
+
+
+
+
+ + +POSITIONABLE:Message(Message, Duration, Name) + +
+
+ +

Send a message to the players in the Group.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Dcs.DCSTypes#Duration Duration : +The duration of the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+
+
+
+
+ + +POSITIONABLE:MessageToAll(Message, Duration, Name) + +
+
+ +

Send a message to all coalitions.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Dcs.DCSTypes#Duration Duration : +The duration of the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+
+
+
+
+ + +POSITIONABLE:MessageToBlue(Message, Duration, Name) + +
+
+ +

Send a message to the blue coalition.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Dcs.DCSTypes#Duration Duration : +The duration of the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+
+
+
+
+ + +POSITIONABLE:MessageToClient(Message, Duration, Client, Name) + +
+
+ +

Send a message to a client.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Dcs.DCSTypes#Duration Duration : +The duration of the message.

    + +
  • +
  • + +

    Wrapper.Client#CLIENT Client : +The client object receiving the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+
+
+
+
+ + +POSITIONABLE:MessageToCoalition(Message, Duration, Name, MessageCoalition) + +
+
+ +

Send a message to a coalition.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Dcs.DCSTYpes#Duration Duration : +The duration of the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
  • + +

    MessageCoalition :

    + +
  • +
+
+
+
+
+ + +POSITIONABLE:MessageToGroup(Message, Duration, MessageGroup, Name) + +
+
+ +

Send a message to a Group.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Dcs.DCSTypes#Duration Duration : +The duration of the message.

    + +
  • +
  • + +

    Wrapper.Group#GROUP MessageGroup : +The GROUP object receiving the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+
+
+
+
+ + +POSITIONABLE:MessageToRed(Message, Duration, Name) + +
+
+ +

Send a message to the red coalition.

+ + +

The message will appear in the message area. The message will begin with the callsign of the group and the type of the first unit sending the message.

+ +

Parameters

+
    +
  • + +

    #string Message : +The message text

    + +
  • +
  • + +

    Dcs.DCSTYpes#Duration Duration : +The duration of the message.

    + +
  • +
  • + +

    #string Name : +(optional) The Name of the sender. If not provided, the Name is the type of the Positionable.

    + +
  • +
+
+
+
+
+ + +POSITIONABLE:New(PositionableName) + +
+
+ +

Create a new POSITIONABLE from a DCSPositionable

+ +

Parameter

+ +

Return value

+ +

#POSITIONABLE: +self

+ +
+
+
+
+ + #string + +POSITIONABLE.PositionableName + +
+
+ +

The name of the measurable.

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Process_JTAC.html b/docs/Documentation/Process_JTAC.html new file mode 100644 index 000000000..b17350670 --- /dev/null +++ b/docs/Documentation/Process_JTAC.html @@ -0,0 +1,602 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Process_JTAC

+ + + +

Global(s)

+ + + + + +
PROCESS_JTAC + +
+

Type PROCESS_JTAC

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PROCESS_JTAC.ClassName + +
PROCESS_JTAC.DisplayCategory + +
PROCESS_JTAC.DisplayCount + +
PROCESS_JTAC.DisplayInterval + +
PROCESS_JTAC.DisplayMessage + +
PROCESS_JTAC.DisplayTime + +
PROCESS_JTAC.FACUnit + +
PROCESS_JTAC.Fsm + +
PROCESS_JTAC:New(Task, ProcessUnit, TargetSetUnit, FACUnit) +

Creates a new DESTROY process.

+
PROCESS_JTAC:OnJTACMenuAwait(Fsm, Event, From, To) +

StateMachine callback function for a PROCESS

+
PROCESS_JTAC:OnJTACMenuCancel(Fsm, Event, From, To, TargetUnit) +

StateMachine callback function for a PROCESS

+
PROCESS_JTAC:OnJTACMenuSpot(Fsm, Event, From, To, TargetUnit) +

StateMachine callback function for a PROCESS

+
PROCESS_JTAC:OnJTACMenuUpdate(Fsm, Event, From, To) +

StateMachine callback function for a PROCESS

+
PROCESS_JTAC:OnStart(Fsm, Event, From, To) +

StateMachine callback function for a PROCESS

+
PROCESS_JTAC.ProcessUnit + +
PROCESS_JTAC.TargetSetUnit + +
+ +

Global(s)

+
+
+ + #PROCESS_JTAC + +PROCESS_JTAC + +
+
+ + + +
+
+

Type Process_JTAC

+ +

Type PROCESS_JTAC

+ +

PROCESS_JTAC class

+ +

Field(s)

+
+
+ + #string + +PROCESS_JTAC.ClassName + +
+
+ + + +
+
+
+
+ + #string + +PROCESS_JTAC.DisplayCategory + +
+
+ + + + +

Targets is the default display category

+ +
+
+
+
+ + #number + +PROCESS_JTAC.DisplayCount + +
+
+ + + +
+
+
+
+ + #number + +PROCESS_JTAC.DisplayInterval + +
+
+ + + +
+
+
+
+ + #boolean + +PROCESS_JTAC.DisplayMessage + +
+
+ + + +
+
+
+
+ + #number + +PROCESS_JTAC.DisplayTime + +
+
+ + + + +

10 seconds is the default

+ +
+
+
+
+ + + +PROCESS_JTAC.FACUnit + +
+
+ + + +
+
+
+
+ + + +PROCESS_JTAC.Fsm + +
+
+ + + +
+
+
+
+ + +PROCESS_JTAC:New(Task, ProcessUnit, TargetSetUnit, FACUnit) + +
+
+ +

Creates a new DESTROY process.

+ +

Parameters

+ +

Return value

+ +

#PROCESS_JTAC: +self

+ +
+
+
+
+ + +PROCESS_JTAC:OnJTACMenuAwait(Fsm, Event, From, To) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+
    +
  • + +

    Core.Fsm#FSM_PROCESS Fsm :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +PROCESS_JTAC:OnJTACMenuCancel(Fsm, Event, From, To, TargetUnit) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+ +
+
+
+
+ + +PROCESS_JTAC:OnJTACMenuSpot(Fsm, Event, From, To, TargetUnit) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+ +
+
+
+
+ + +PROCESS_JTAC:OnJTACMenuUpdate(Fsm, Event, From, To) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+
    +
  • + +

    Core.Fsm#FSM_PROCESS Fsm :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +PROCESS_JTAC:OnStart(Fsm, Event, From, To) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+
    +
  • + +

    Core.Fsm#FSM_PROCESS Fsm :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + Wrapper.Unit#UNIT + +PROCESS_JTAC.ProcessUnit + +
+
+ + + +
+
+
+
+ + Core.Set#SET_UNIT + +PROCESS_JTAC.TargetSetUnit + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Process_Pickup.html b/docs/Documentation/Process_Pickup.html new file mode 100644 index 000000000..818454873 --- /dev/null +++ b/docs/Documentation/Process_Pickup.html @@ -0,0 +1,693 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Process_Pickup

+ + + +

Global(s)

+ + + + + +
PROCESS_PICKUP + +
+

Type PROCESS_PICKUP

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PROCESS_PICKUP.ClassName + +
PROCESS_PICKUP.DisplayCategory + +
PROCESS_PICKUP.DisplayCount + +
PROCESS_PICKUP.DisplayInterval + +
PROCESS_PICKUP.DisplayMessage + +
PROCESS_PICKUP.DisplayTime + +
PROCESS_PICKUP:EventDead(Event) + +
PROCESS_PICKUP.Fsm + +
PROCESS_PICKUP:New(Task, ProcessUnit, TargetSetUnit, ProcessName) +

Creates a new DESTROY process.

+
PROCESS_PICKUP:OnDestroyed(Fsm, Event, From, To) +

StateMachine callback function for a PROCESS

+
PROCESS_PICKUP:OnHitTarget(Fsm, Event, From, To, Event) +

StateMachine callback function for a PROCESS

+
PROCESS_PICKUP:OnKilled(Fsm, Event, From, To, DCSEvent) +

StateMachine callback function for a PROCESS

+
PROCESS_PICKUP:OnMoreTargets(Fsm, Event, From, To) +

StateMachine callback function for a PROCESS

+
PROCESS_PICKUP:OnNavigating(Fsm, Event, From, To) +

StateMachine callback function for a PROCESS

+
PROCESS_PICKUP:OnRestart(Fsm, Event, From, To) +

StateMachine callback function for a PROCESS

+
PROCESS_PICKUP:OnStart(Fsm, Event, From, To) +

StateMachine callback function for a PROCESS

+
PROCESS_PICKUP.ProcessUnit + +
PROCESS_PICKUP.TargetSetUnit + +
+ +

Global(s)

+
+
+ + #PROCESS_PICKUP + +PROCESS_PICKUP + +
+
+ + + +
+
+

Type Process_Pickup

+ +

Type PROCESS_PICKUP

+ +

PROCESS_PICKUP class

+ +

Field(s)

+
+
+ + #string + +PROCESS_PICKUP.ClassName + +
+
+ + + +
+
+
+
+ + #string + +PROCESS_PICKUP.DisplayCategory + +
+
+ + + + +

Targets is the default display category

+ +
+
+
+
+ + #number + +PROCESS_PICKUP.DisplayCount + +
+
+ + + +
+
+
+
+ + #number + +PROCESS_PICKUP.DisplayInterval + +
+
+ + + +
+
+
+
+ + #boolean + +PROCESS_PICKUP.DisplayMessage + +
+
+ + + +
+
+
+
+ + #number + +PROCESS_PICKUP.DisplayTime + +
+
+ + + + +

10 seconds is the default

+ +
+
+
+
+ + +PROCESS_PICKUP:EventDead(Event) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + + +PROCESS_PICKUP.Fsm + +
+
+ + + +
+
+
+
+ + +PROCESS_PICKUP:New(Task, ProcessUnit, TargetSetUnit, ProcessName) + +
+
+ +

Creates a new DESTROY process.

+ +

Parameters

+ +

Return value

+ +

#PROCESS_PICKUP: +self

+ +
+
+
+
+ + +PROCESS_PICKUP:OnDestroyed(Fsm, Event, From, To) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+
    +
  • + +

    Core.Fsm#FSM_PROCESS Fsm :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +PROCESS_PICKUP:OnHitTarget(Fsm, Event, From, To, Event) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+ +
+
+
+
+ + +PROCESS_PICKUP:OnKilled(Fsm, Event, From, To, DCSEvent) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+ +
+
+
+
+ + +PROCESS_PICKUP:OnMoreTargets(Fsm, Event, From, To) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+
    +
  • + +

    Core.Fsm#FSM_PROCESS Fsm :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +PROCESS_PICKUP:OnNavigating(Fsm, Event, From, To) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+
    +
  • + +

    Core.Fsm#FSM_PROCESS Fsm :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +PROCESS_PICKUP:OnRestart(Fsm, Event, From, To) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+
    +
  • + +

    Core.Fsm#FSM_PROCESS Fsm :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +PROCESS_PICKUP:OnStart(Fsm, Event, From, To) + +
+
+ +

StateMachine callback function for a PROCESS

+ +

Parameters

+
    +
  • + +

    Core.Fsm#FSM_PROCESS Fsm :

    + +
  • +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + Wrapper.Unit#UNIT + +PROCESS_PICKUP.ProcessUnit + +
+
+ + + +
+
+
+
+ + Core.Set#SET_UNIT + +PROCESS_PICKUP.TargetSetUnit + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Route.html b/docs/Documentation/Route.html new file mode 100644 index 000000000..14e228e65 --- /dev/null +++ b/docs/Documentation/Route.html @@ -0,0 +1,780 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Route

+ +

(SP) (MP) (FSM) Route AI or players through waypoints or to zones.

+ + + +
+ +

#ACT_ROUTE FSM class, extends Core.Fsm#FSM_PROCESS

+ +

ACT_ROUTE state machine:

+ +

This class is a state machine: it manages a process that is triggered by events causing state transitions to occur. +All derived classes from this class will start with the class name, followed by a _. See the relevant derived class descriptions below. +Each derived class follows exactly the same process, using the same events and following the same state transitions, +but will have different implementation behaviour upon each event or state transition.

+ +

ACT_ROUTE Events:

+ +

These are the events defined in this class:

+ +
    +
  • Start: The process is started. The process will go into the Report state.
  • +
  • Report: The process is reporting to the player the route to be followed.
  • +
  • Route: The process is routing the controllable.
  • +
  • Pause: The process is pausing the route of the controllable.
  • +
  • Arrive: The controllable has arrived at a route point.
  • +
  • More: There are more route points that need to be followed. The process will go back into the Report state.
  • +
  • NoMore: There are no more route points that need to be followed. The process will go into the Success state.
  • +
+ +

ACT_ROUTE Event methods:

+ +

Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process. +There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:

+ +
    +
  • Immediate: The event method has exactly the name of the event.
  • +
  • Delayed: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed.
  • +
+ +

ACT_ROUTE States:

+ +
    +
  • None: The controllable did not receive route commands.
  • +
  • Arrived (*): The controllable has arrived at a route point.
  • +
  • Aborted (*): The controllable has aborted the route path.
  • +
  • Routing: The controllable is understay to the route point.
  • +
  • Pausing: The process is pausing the routing. AI air will go into hover, AI ground will stop moving. Players can fly around.
  • +
  • Success (*): All route points were reached.
  • +
  • Failed (*): The process has failed.
  • +
+ +

(*) End states of the process.

+ +

ACT_ROUTE state transition methods:

+ +

State transition functions can be set by the mission designer customizing or improving the behaviour of the state. +There are 2 moments when state transition methods will be called by the state machine:

+ +
    +
  • Before the state transition. + The state transition method needs to start with the name OnBefore + the name of the state. + If the state transition method returns false, then the processing of the state transition will not be done! + If you want to change the behaviour of the AIControllable at this event, return false, + but then you'll need to specify your own logic using the AIControllable!

  • +
  • After the state transition. + The state transition method needs to start with the name OnAfter + the name of the state. + These state transition methods need to provide a return value, which is specified at the function description.

  • +
+ +
+ +

1) #ACTROUTEZONE class, extends Fsm.Route#ACT_ROUTE

+ +

The ACTROUTEZONE class implements the core functions to route an AIR Controllable player Unit to a Zone. +The player receives on perioding times messages with the coordinates of the route to follow. +Upon arrival at the zone, a confirmation of arrival is sent, and the process will be ended.

+ +

1.1) ACTROUTEZONE constructor:

+ + + +
+ + +

Global(s)

+ + + + + + + + + +
ACT_ROUTE + +
ACT_ROUTE_ZONE + +
+

Type ACT_ROUTE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ACT_ROUTE.ClassName + +
ACT_ROUTE.DisplayCount + +
ACT_ROUTE:New() +

Creates a new routing state machine.

+
ACT_ROUTE.ProcessUnit + +
ACT_ROUTE.TASK + +
ACT_ROUTE.TargetZone + +
ACT_ROUTE:onafterStart(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ROUTE:onbeforeRoute(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ROUTE:onfuncHasArrived(ProcessUnit) +

Check if the controllable has arrived.

+
+ +

Type ACT_ROUTE_ZONE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ACT_ROUTE_ZONE.ClassName + +
ACT_ROUTE_ZONE.DisplayCount + +
ACT_ROUTE_ZONE.DisplayInterval + +
ACT_ROUTE_ZONE.DisplayMessage + +
ACT_ROUTE_ZONE.DisplayTime + +
ACT_ROUTE_ZONE:Init(FsmRoute) + +
ACT_ROUTE_ZONE:New(TargetZone) +

Creates a new routing state machine.

+
ACT_ROUTE_ZONE.ProcessUnit + +
ACT_ROUTE_ZONE.TASK + +
ACT_ROUTE_ZONE.TargetZone + +
ACT_ROUTE_ZONE:onenterReporting(ProcessUnit, Event, From, To) +

StateMachine callback function

+
ACT_ROUTE_ZONE:onfuncHasArrived(ProcessUnit) +

Method override to check if the controllable has arrived.

+
+ +

Global(s)

+
+
+ + #ACT_ROUTE + +ACT_ROUTE + +
+
+ + + +
+
+
+
+ + #ACT_ROUTE_ZONE + +ACT_ROUTE_ZONE + +
+
+ + + +
+
+

Type Route

+ +

Type ACT_ROUTE

+ +

ACT_ROUTE class

+ +

Field(s)

+
+
+ + #string + +ACT_ROUTE.ClassName + +
+
+ + + +
+
+
+
+ + #number + +ACT_ROUTE.DisplayCount + +
+
+ + + +
+
+
+
+ + +ACT_ROUTE:New() + +
+
+ +

Creates a new routing state machine.

+ + +

The process will route a CLIENT to a ZONE until the CLIENT is within that ZONE.

+ +

Return value

+ +

#ACT_ROUTE: +self

+ +
+
+
+
+ + Wrapper.Unit#UNIT + +ACT_ROUTE.ProcessUnit + +
+
+ + + +
+
+
+
+ + Tasking.Task#TASK + +ACT_ROUTE.TASK + +
+
+ + + +
+
+
+
+ + Core.Zone#ZONE_BASE + +ACT_ROUTE.TargetZone + +
+
+ + + +
+
+
+
+ + +ACT_ROUTE:onafterStart(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ROUTE:onbeforeRoute(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ROUTE:onfuncHasArrived(ProcessUnit) + +
+
+ +

Check if the controllable has arrived.

+ +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+ +

Type ACT_ROUTE_ZONE

+ +

ACTROUTEZONE class

+ +

Field(s)

+
+
+ + #string + +ACT_ROUTE_ZONE.ClassName + +
+
+ + + +
+
+
+
+ + #number + +ACT_ROUTE_ZONE.DisplayCount + +
+
+ + + +
+
+
+
+ + #number + +ACT_ROUTE_ZONE.DisplayInterval + +
+
+ + + +
+
+
+
+ + #boolean + +ACT_ROUTE_ZONE.DisplayMessage + +
+
+ + + +
+
+
+
+ + #number + +ACT_ROUTE_ZONE.DisplayTime + +
+
+ + + + +

10 seconds is the default

+ +
+
+
+
+ + +ACT_ROUTE_ZONE:Init(FsmRoute) + +
+
+ + + +

Parameter

+
    +
  • + +

    FsmRoute :

    + +
  • +
+
+
+
+
+ + +ACT_ROUTE_ZONE:New(TargetZone) + +
+
+ +

Creates a new routing state machine.

+ + +

The task will route a controllable to a ZONE until the controllable is within that ZONE.

+ +

Parameter

+ +
+
+
+
+ + Wrapper.Unit#UNIT + +ACT_ROUTE_ZONE.ProcessUnit + +
+
+ + + +
+
+
+
+ + Tasking.Task#TASK + +ACT_ROUTE_ZONE.TASK + +
+
+ + + +
+
+
+
+ + Core.Zone#ZONE_BASE + +ACT_ROUTE_ZONE.TargetZone + +
+
+ + + +
+
+
+
+ + +ACT_ROUTE_ZONE:onenterReporting(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+
+
+ + +ACT_ROUTE_ZONE:onfuncHasArrived(ProcessUnit) + +
+
+ +

Method override to check if the controllable has arrived.

+ +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/ScheduleDispatcher.html b/docs/Documentation/ScheduleDispatcher.html new file mode 100644 index 000000000..d731daee7 --- /dev/null +++ b/docs/Documentation/ScheduleDispatcher.html @@ -0,0 +1,448 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module ScheduleDispatcher

+ +

This module defines the SCHEDULEDISPATCHER class, which is used by a central object called _SCHEDULEDISPATCHER.

+ + + +
+ +

Takes care of the creation and dispatching of scheduled functions for SCHEDULER objects.

+ +

This class is tricky and needs some thorought explanation. +SCHEDULE classes are used to schedule functions for objects, or as persistent objects. +The SCHEDULEDISPATCHER class ensures that:

+ +
    +
  • Scheduled functions are planned according the SCHEDULER object parameters.
  • +
  • Scheduled functions are repeated when requested, according the SCHEDULER object parameters.
  • +
  • Scheduled functions are automatically removed when the schedule is finished, according the SCHEDULER object parameters.
  • +
+ +

The SCHEDULEDISPATCHER class will manage SCHEDULER object in memory during garbage collection: + - When a SCHEDULER object is not attached to another object (that is, it's first :Schedule() parameter is nil), then the SCHEDULER

+
object is _persistent_ within memory.
+
+

- When a SCHEDULER object is attached to another object, then the SCHEDULER object is not persistent within memory after a garbage collection! +The none persistency of SCHEDULERS attached to objects is required to allow SCHEDULER objects to be garbage collectged, when the parent object is also desroyed or nillified and garbage collected. +Even when there are pending timer scheduled functions to be executed for the SCHEDULER object,
+these will not be executed anymore when the SCHEDULER object has been destroyed.

+ +

The SCHEDULEDISPATCHER allows multiple scheduled functions to be planned and executed for one SCHEDULER object. +The SCHEDULER object therefore keeps a table of "CallID's", which are returned after each planning of a new scheduled function by the SCHEDULEDISPATCHER. +The SCHEDULER object plans new scheduled functions through the Core.Scheduler#SCHEDULER.Schedule() method. +The Schedule() method returns the CallID that is the reference ID for each planned schedule.

+ +
+ +
+ +

Contributions: -

+

Authors: FlightControl : Design & Programming

+ + +

Global(s)

+ + + + + +
SCHEDULEDISPATCHER + +
+

Type SCHEDULEDISPATCHER

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SCHEDULEDISPATCHER:AddSchedule(Scheduler, ScheduleFunction, ScheduleArguments, Start, Repeat, Randomize, Stop) +

Add a Schedule to the ScheduleDispatcher.

+
SCHEDULEDISPATCHER.CallID + +
SCHEDULEDISPATCHER.ClassName + +
SCHEDULEDISPATCHER:New() + +
SCHEDULEDISPATCHER.ObjectSchedulers + +
SCHEDULEDISPATCHER.PersistentSchedulers + +
SCHEDULEDISPATCHER:RemoveSchedule(Scheduler, CallID) + +
SCHEDULEDISPATCHER.Schedule + +
SCHEDULEDISPATCHER:Start(Scheduler, CallID) + +
SCHEDULEDISPATCHER:Stop(Scheduler, CallID) + +
+ +

Global(s)

+
+
+ + #SCHEDULEDISPATCHER + +SCHEDULEDISPATCHER + +
+
+ + + +
+
+

Type ScheduleDispatcher

+ +

Type SCHEDULEDISPATCHER

+ +

The SCHEDULEDISPATCHER structure

+ +

Field(s)

+
+
+ + +SCHEDULEDISPATCHER:AddSchedule(Scheduler, ScheduleFunction, ScheduleArguments, Start, Repeat, Randomize, Stop) + +
+
+ +

Add a Schedule to the ScheduleDispatcher.

+ + +

The development of this method was really tidy. +It is constructed as such that a garbage collection is executed on the weak tables, when the Scheduler is nillified. +Nothing of this code should be modified without testing it thoroughly.

+ +

Parameters

+
    +
  • + +

    Core.Scheduler#SCHEDULER Scheduler :

    + +
  • +
  • + +

    ScheduleFunction :

    + +
  • +
  • + +

    ScheduleArguments :

    + +
  • +
  • + +

    Start :

    + +
  • +
  • + +

    Repeat :

    + +
  • +
  • + +

    Randomize :

    + +
  • +
  • + +

    Stop :

    + +
  • +
+
+
+
+
+ + +SCHEDULEDISPATCHER.CallID + +
+
+ + + +
+
+
+
+ + #string + +SCHEDULEDISPATCHER.ClassName + +
+
+ + + +
+
+
+
+ + +SCHEDULEDISPATCHER:New() + +
+
+ + + +
+
+
+
+ + +SCHEDULEDISPATCHER.ObjectSchedulers + +
+
+ + + + +

Initialize the ObjectSchedulers array, which is a weakly coupled table. + If the object used as the key is nil, then the garbage collector will remove the item from the Functions array.

+ +
+
+
+
+ + +SCHEDULEDISPATCHER.PersistentSchedulers + +
+
+ + + + +

Initialize the ObjectSchedulers array, which is a weakly coupled table. + If the object used as the key is nil, then the garbage collector will remove the item from the Functions array.

+ +
+
+
+
+ + +SCHEDULEDISPATCHER:RemoveSchedule(Scheduler, CallID) + +
+
+ + + +

Parameters

+
    +
  • + +

    Scheduler :

    + +
  • +
  • + +

    CallID :

    + +
  • +
+
+
+
+
+ + +SCHEDULEDISPATCHER.Schedule + +
+
+ + + +
+
+
+
+ + +SCHEDULEDISPATCHER:Start(Scheduler, CallID) + +
+
+ + + +

Parameters

+
    +
  • + +

    Scheduler :

    + +
  • +
  • + +

    CallID :

    + +
  • +
+
+
+
+
+ + +SCHEDULEDISPATCHER:Stop(Scheduler, CallID) + +
+
+ + + +

Parameters

+
    +
  • + +

    Scheduler :

    + +
  • +
  • + +

    CallID :

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/Scheduler.html b/docs/Documentation/Scheduler.html new file mode 100644 index 000000000..507f577b5 --- /dev/null +++ b/docs/Documentation/Scheduler.html @@ -0,0 +1,497 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Scheduler

+ +

This module contains the SCHEDULER class.

+ + + +

1) Core.Scheduler#SCHEDULER class, extends Core.Base#BASE

+ +

The Core.Scheduler#SCHEDULER class creates schedule.

+ +

1.1) SCHEDULER constructor

+ +

The SCHEDULER class is quite easy to use, but note that the New constructor has variable parameters:

+ +
    +
  • Core.Scheduler#SCHEDULER.New( nil ): Setup a new SCHEDULER object, which is persistently executed after garbage collection.
  • +
  • Core.Scheduler#SCHEDULER.New( Object ): Setup a new SCHEDULER object, which is linked to the Object. When the Object is nillified or destroyed, the SCHEDULER object will also be destroyed and stopped after garbage collection.
  • +
  • Core.Scheduler#SCHEDULER.New( nil, Function, FunctionArguments, Start, ... ): Setup a new persistent SCHEDULER object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
  • +
  • Core.Scheduler#SCHEDULER.New( Object, Function, FunctionArguments, Start, ... ): Setup a new SCHEDULER object, linked to Object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.
  • +
+ +

1.2) SCHEDULER timer stopping and (re-)starting.

+ +

The SCHEDULER can be stopped and restarted with the following methods:

+ +
    +
  • Core.Scheduler#SCHEDULER.Start(): (Re-)Start the schedules within the SCHEDULER object. If a CallID is provided to :Start(), only the schedule referenced by CallID will be (re-)started.
  • +
  • Core.Scheduler#SCHEDULER.Stop(): Stop the schedules within the SCHEDULER object. If a CallID is provided to :Stop(), then only the schedule referenced by CallID will be stopped.
  • +
+ +

1.3) Create a new schedule

+ +

With Core.Scheduler#SCHEDULER.Schedule() a new time event can be scheduled. This function is used by the :New() constructor when a new schedule is planned.

+ +
+ +

Contributions:

+ +
    +
  • FlightControl : Concept & Testing
  • +
+ +

Authors:

+ +
    +
  • FlightControl : Design & Programming
  • +
+ +

Test Missions:

+ +
    +
  • SCH - Scheduler
  • +
+ +
+ + +

Global(s)

+ + + + + +
SCHEDULER + +
+

Type SCHEDULER

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SCHEDULER.ClassName + +
SCHEDULER:New(SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop) +

SCHEDULER constructor.

+
SCHEDULER:Remove(ScheduleID) +

Removes a specific schedule if a valid ScheduleID is provided.

+
SCHEDULER:Schedule(SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop) +

Schedule a new time event.

+
SCHEDULER.ScheduleID +

the ID of the scheduler.

+
SCHEDULER.SchedulerObject + +
SCHEDULER.Schedules + +
SCHEDULER:Start(ScheduleID) +

(Re-)Starts the schedules or a specific schedule if a valid ScheduleID is provided.

+
SCHEDULER:Stop(ScheduleID) +

Stops the schedules or a specific schedule if a valid ScheduleID is provided.

+
+ +

Global(s)

+
+
+ + #SCHEDULER + +SCHEDULER + +
+
+ + + +
+
+

Type Scheduler

+ +

Type SCHEDULER

+ +

The SCHEDULER class

+ +

Field(s)

+
+
+ + #string + +SCHEDULER.ClassName + +
+
+ + + +
+
+
+
+ + +SCHEDULER:New(SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop) + +
+
+ +

SCHEDULER constructor.

+ +

Parameters

+
    +
  • + +

    #table SchedulerObject : +Specified for which Moose object the timer is setup. If a value of nil is provided, a scheduler will be setup without an object reference.

    + +
  • +
  • + +

    #function SchedulerFunction : +The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

    + +
  • +
  • + +

    #table SchedulerArguments : +Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

    + +
  • +
  • + +

    #number Start : +Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

    + +
  • +
  • + +

    #number Repeat : +Specifies the interval in seconds when the scheduler will call the event function.

    + +
  • +
  • + +

    #number RandomizeFactor : +Specifies a randomization factor between 0 and 1 to randomize the Repeat.

    + +
  • +
  • + +

    #number Stop : +Specifies the amount of seconds when the scheduler will be stopped.

    + +
  • +
+

Return values

+
    +
  1. + +

    #SCHEDULER: +self

    + +
  2. +
  3. + +

    #number: +The ScheduleID of the planned schedule.

    + +
  4. +
+
+
+
+
+ + +SCHEDULER:Remove(ScheduleID) + +
+
+ +

Removes a specific schedule if a valid ScheduleID is provided.

+ +

Parameter

+
    +
  • + +

    #number ScheduleID : +(optional) The ScheduleID of the planned (repeating) schedule.

    + +
  • +
+
+
+
+
+ + +SCHEDULER:Schedule(SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop) + +
+
+ +

Schedule a new time event.

+ + +

Note that the schedule will only take place if the scheduler is started. Even for a single schedule event, the scheduler needs to be started also.

+ +

Parameters

+
    +
  • + +

    #table SchedulerObject : +Specified for which Moose object the timer is setup. If a value of nil is provided, a scheduler will be setup without an object reference.

    + +
  • +
  • + +

    #function SchedulerFunction : +The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

    + +
  • +
  • + +

    #table SchedulerArguments : +Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

    + +
  • +
  • + +

    #number Start : +Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

    + +
  • +
  • + +

    #number Repeat : +Specifies the interval in seconds when the scheduler will call the event function.

    + +
  • +
  • + +

    #number RandomizeFactor : +Specifies a randomization factor between 0 and 1 to randomize the Repeat.

    + +
  • +
  • + +

    #number Stop : +Specifies the amount of seconds when the scheduler will be stopped.

    + +
  • +
+

Return value

+ +

#number: +The ScheduleID of the planned schedule.

+ +
+
+
+
+ + #number + +SCHEDULER.ScheduleID + +
+
+ +

the ID of the scheduler.

+ +
+
+
+
+ + + +SCHEDULER.SchedulerObject + +
+
+ + + +
+
+
+
+ + + +SCHEDULER.Schedules + +
+
+ + + +
+
+
+
+ + +SCHEDULER:Start(ScheduleID) + +
+
+ +

(Re-)Starts the schedules or a specific schedule if a valid ScheduleID is provided.

+ +

Parameter

+
    +
  • + +

    #number ScheduleID : +(optional) The ScheduleID of the planned (repeating) schedule.

    + +
  • +
+
+
+
+
+ + +SCHEDULER:Stop(ScheduleID) + +
+
+ +

Stops the schedules or a specific schedule if a valid ScheduleID is provided.

+ +

Parameter

+
    +
  • + +

    #number ScheduleID : +(optional) The ScheduleID of the planned (repeating) schedule.

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/Scoring.html b/docs/Documentation/Scoring.html new file mode 100644 index 000000000..9b00982ed --- /dev/null +++ b/docs/Documentation/Scoring.html @@ -0,0 +1,825 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Scoring

+ +

Scoring system for MOOSE.

+ + +

This scoring class calculates the hits and kills that players make within a simulation session. +Scoring is calculated using a defined algorithm. +With a small change in MissionScripting.lua, the scoring can also be logged in a CSV file, that can then be uploaded +to a database or a BI tool to publish the scoring results to the player community.

+ +

Global(s)

+ + + + + + + + + + + + + + + + + + + + + +
ClientGroup + +
SCORING + +
nHours + +
nMins + +
nSecs + +
+

Type SCORING

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SCORING.AllScoresMenu + +
SCORING.ClassID + +
SCORING.ClassName + +
SCORING:CloseCSV() + +
SCORING.Menu + +
SCORING:New(GameName) +

Creates a new SCORING object to administer the scoring achieved by players.

+
SCORING:OpenCSV(ScoringCSV) +

Opens a score CSV file to log the scores.

+
SCORING.Players +

A collection of the current players that have joined the game.

+
SCORING:ReportScoreAll() + +
SCORING:ReportScorePlayer() + +
SCORING.RunTime + +
SCORING:ScoreCSV(PlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType) +

Registers a score for a player.

+
SCORING:ScoreMenu() +

Creates a score radio menu.

+
SCORING.ScoringCSV + +
SCORING:SecondsToClock(sSeconds) + +
SCORING:_AddMissionScore(Mission, PlayerUnit, Text, Score) +

Registers Mission Scores for possible multiple players that contributed in the Mission.

+
SCORING:_AddMissionTaskScore(Mission, PlayerUnit, Text, Score) +

Registers Scores the players completing a Mission Task.

+
SCORING:_AddPlayerFromUnit(UnitData) +

Add a new player entering a Unit.

+
SCORING:_EventOnDeadOrCrash(Event) +

Track DEAD or CRASH events for the scoring.

+
SCORING:_EventOnHit(Event) +

Handles the OnHit event for the scoring.

+
SCORING:_FollowPlayersScheduled() +

Follows new players entering Clients within the DCSRTE.

+
+ +

Global(s)

+
+
+ + + +ClientGroup + +
+
+ + + +
+
+
+
+ + #SCORING + +SCORING + +
+
+ + + +
+
+
+
+ + + +nHours + +
+
+ + + +
+
+
+
+ + + +nMins + +
+
+ + + +
+
+
+
+ + + +nSecs + +
+
+ + + +
+
+

Type Scoring

+ +

Type SCORING

+ +

The Scoring class

+ +

Field(s)

+
+
+ + + +SCORING.AllScoresMenu + +
+
+ + + +
+
+
+
+ + #number + +SCORING.ClassID + +
+
+ + + +
+
+
+
+ + #string + +SCORING.ClassName + +
+
+ + + +
+
+
+
+ + +SCORING:CloseCSV() + +
+
+ + + +
+
+
+
+ + + +SCORING.Menu + +
+
+ + + +
+
+
+
+ + +SCORING:New(GameName) + +
+
+ +

Creates a new SCORING object to administer the scoring achieved by players.

+ +

Parameter

+
    +
  • + +

    #string GameName : +The name of the game. This name is also logged in the CSV score file.

    + +
  • +
+

Return value

+ +

#SCORING: +self

+ +

Usage:

+
-- Define a new scoring object for the mission Gori Valley.
+ScoringObject = SCORING:New( "Gori Valley" )
+ +
+
+
+
+ + +SCORING:OpenCSV(ScoringCSV) + +
+
+ +

Opens a score CSV file to log the scores.

+ +

Parameter

+
    +
  • + +

    #string ScoringCSV :

    + +
  • +
+

Return value

+ +

#SCORING: +self

+ +

Usage:

+
-- Open a new CSV file to log the scores of the game Gori Valley. Let the name of the CSV file begin with "Player Scores".
+ScoringObject = SCORING:New( "Gori Valley" )
+ScoringObject:OpenCSV( "Player Scores" )
+ +
+
+
+
+ + +SCORING.Players + +
+
+ +

A collection of the current players that have joined the game.

+ +
+
+
+
+ + +SCORING:ReportScoreAll() + +
+
+ + + +
+
+
+
+ + +SCORING:ReportScorePlayer() + +
+
+ + + +
+
+
+
+ + + +SCORING.RunTime + +
+
+ + + +
+
+
+
+ + +SCORING:ScoreCSV(PlayerName, ScoreType, ScoreTimes, ScoreAmount, PlayerUnitName, PlayerUnitCoalition, PlayerUnitCategory, PlayerUnitType, TargetUnitName, TargetUnitCoalition, TargetUnitCategory, TargetUnitType) + +
+
+ +

Registers a score for a player.

+ +

Parameters

+
    +
  • + +

    #string PlayerName : +The name of the player.

    + +
  • +
  • + +

    #string ScoreType : +The type of the score.

    + +
  • +
  • + +

    #string ScoreTimes : +The amount of scores achieved.

    + +
  • +
  • + +

    #string ScoreAmount : +The score given.

    + +
  • +
  • + +

    #string PlayerUnitName : +The unit name of the player.

    + +
  • +
  • + +

    #string PlayerUnitCoalition : +The coalition of the player unit.

    + +
  • +
  • + +

    #string PlayerUnitCategory : +The category of the player unit.

    + +
  • +
  • + +

    #string PlayerUnitType : +The type of the player unit.

    + +
  • +
  • + +

    #string TargetUnitName : +The name of the target unit.

    + +
  • +
  • + +

    #string TargetUnitCoalition : +The coalition of the target unit.

    + +
  • +
  • + +

    #string TargetUnitCategory : +The category of the target unit.

    + +
  • +
  • + +

    #string TargetUnitType : +The type of the target unit.

    + +
  • +
+

Return value

+ +

#SCORING: +self

+ +
+
+
+
+ + +SCORING:ScoreMenu() + +
+
+ +

Creates a score radio menu.

+ + +

Can be accessed using Radio -> F10.

+ +

Return value

+ +

#SCORING: +self

+ +
+
+
+
+ + + +SCORING.ScoringCSV + +
+
+ + + +
+
+
+
+ + +SCORING:SecondsToClock(sSeconds) + +
+
+ + + +

Parameter

+
    +
  • + +

    sSeconds :

    + +
  • +
+
+
+
+
+ + +SCORING:_AddMissionScore(Mission, PlayerUnit, Text, Score) + +
+
+ +

Registers Mission Scores for possible multiple players that contributed in the Mission.

+ +

Parameters

+ +
+
+
+
+ + +SCORING:_AddMissionTaskScore(Mission, PlayerUnit, Text, Score) + +
+
+ +

Registers Scores the players completing a Mission Task.

+ +

Parameters

+ +
+
+
+
+ + +SCORING:_AddPlayerFromUnit(UnitData) + +
+
+ +

Add a new player entering a Unit.

+ +

Parameter

+
    +
  • + +

    UnitData :

    + +
  • +
+
+
+
+
+ + +SCORING:_EventOnDeadOrCrash(Event) + +
+
+ +

Track DEAD or CRASH events for the scoring.

+ +

Parameter

+ +
+
+
+
+ + +SCORING:_EventOnHit(Event) + +
+
+ +

Handles the OnHit event for the scoring.

+ +

Parameter

+ +
+
+
+
+ + +SCORING:_FollowPlayersScheduled() + +
+
+ +

Follows new players entering Clients within the DCSRTE.

+ + +

TODO: Need to see if i can catch this also with an event. It will eliminate the schedule ...

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Sead.html b/docs/Documentation/Sead.html new file mode 100644 index 000000000..7a23c59fb --- /dev/null +++ b/docs/Documentation/Sead.html @@ -0,0 +1,271 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Sead

+ +

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

+ +

Global(s)

+ + + + + +
SEAD + +
+

Type SEAD

+ + + + + + + + + + + + + + + + + + + + + +
SEAD.ClassName + +
SEAD:EventShot(Event) +

Detects if an SA site was shot with an anti radiation missile.

+
SEAD.New(table, self, SEADGroupPrefixes) +

Creates the main object which is handling defensive actions for SA sites or moving SA vehicles.

+
SEAD.SEADGroupPrefixes + +
SEAD.TargetSkill + +
+ +

Global(s)

+
+
+ + #SEAD + +SEAD + +
+
+ + + +
+
+

Type Sead

+ +

Type SEAD

+ +

The SEAD class

+ +

Field(s)

+
+
+ + #string + +SEAD.ClassName + +
+
+ + + +
+
+
+
+ + +SEAD:EventShot(Event) + +
+
+ +

Detects if an SA site was shot with an anti radiation missile.

+ + +

In this case, take evasive actions based on the skill level set within the ME.

+ +

Parameter

+
    +
  • + +

    Event :

    + +
  • +
+
+
+
+
+ + +SEAD.New(table, self, SEADGroupPrefixes) + +
+
+ +

Creates the main object which is handling defensive actions for SA sites or moving SA vehicles.

+ + +

When an anti radiation missile is fired (KH-58, KH-31P, KH-31A, KH-25MPU, HARM missiles), the SA will shut down their radars and will take evasive actions... +Chances are big that the missile will miss.

+ +

Parameters

+
    +
  • + +

    table : +string,...}|string SEADGroupPrefixes which is a table of Prefixes of the SA Groups in the DCSRTE on which evasive actions need to be taken.

    + +
  • +
  • + +

    self :

    + +
  • +
  • + +

    SEADGroupPrefixes :

    + +
  • +
+

Return value

+ + +

SEAD

+ +

Usage:

+
-- CCCP SEAD Defenses
+-- Defends the Russian SA installations from SEAD attacks.
+SEAD_RU_SAM_Defenses = SEAD:New( { 'RU SA-6 Kub', 'RU SA-6 Defenses', 'RU MI-26 Troops', 'RU Attack Gori' } )
+ +
+
+
+
+ + + +SEAD.SEADGroupPrefixes + +
+
+ + + +
+
+
+
+ + + +SEAD.TargetSkill + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Set.html b/docs/Documentation/Set.html new file mode 100644 index 000000000..648edd701 --- /dev/null +++ b/docs/Documentation/Set.html @@ -0,0 +1,4042 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Set

+ +

This module contains the SET classes.

+ + + +
+ +

1) Core.Set#SET_BASE class, extends Core.Base#BASE

+

The Core.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 Core.Set#SET_BASE.Add and Core.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 Core.Set#SET_BASE.SetInteratorIntervals method. +You can set the "yield interval", and the "time interval". (See above).

+ +
+ +

2) Core.Set#SET_GROUP class, extends Core.Set#SET_BASE

+

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

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

2.1) SET_GROUP construction method:

+

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

+ + + +

2.2) Add or Remove GROUP(s) from SET_GROUP:

+

GROUPS can be added and removed using the Core.Set#SET_GROUP.AddGroupsByName and Core.Set#SET_GROUP.RemoveGroupsByName respectively. +These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.

+ +

2.3) SET_GROUP filter criteria:

+

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

+ + + +

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

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

+ + + +

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

3) Core.Set#SET_UNIT class, extends Core.Set#SET_BASE

+

Mission designers can use the Core.Set#SET_UNIT class to build sets of units belonging to certain:

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

3.1) SET_UNIT construction method:

+

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 Core.Set#SET_UNIT.AddUnitsByName and Core.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):

+ + + +
+ +

4) Core.Set#SET_CLIENT class, extends Core.Set#SET_BASE

+

Mission designers can use the Core.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 construction method:

+

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 Core.Set#SET_CLIENT.AddClientsByName and Core.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:

+ + + +
+ +

5) Core.Set#SET_AIRBASE class, extends Core.Set#SET_BASE

+

Mission designers can use the Core.Set#SET_AIRBASE class to build sets of airbases optionally belonging to certain:

+ +
    +
  • Coalitions
  • +
+ +

5.1) SET_AIRBASE construction

+

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 Core.Set#SET_AIRBASE.AddAirbasesByName and Core.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:

+ + + +
+ +

Authors:

+ +
    +
  • FlightControl : Design & Programming
  • +
+ +

Contributions:

+ + + +

Global(s)

+ + + + + + + + + + + + + + + + + + + + + +
SET_AIRBASE + +
SET_BASE + +
SET_CLIENT + +
SET_GROUP + +
SET_UNIT + +
+

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.Airbases + +
SET_AIRBASE.ClassName + +
SET_AIRBASE.Filter + +
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.FilterMeta + +
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 Wrapper.Airbase#AIRBASE from a Core.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:RemoveAirbasesByName(RemoveAirbaseNames) +

Remove AIRBASEs from SET_AIRBASE.

+
+ +

Type SET_BASE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SET_BASE:Add(ObjectName, Object) +

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

+
SET_BASE:AddObject(Object) +

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

+
SET_BASE.ClassName + +
SET_BASE:Count() +

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

+
SET_BASE.Database + +
SET_BASE.Filter + +
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 Core.Point#POINT_VEC2.

+
SET_BASE:Flush() +

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 Core.Base#BASE object from the Core.Set#SET_BASE and derived classes, based on the Object Name.

+
SET_BASE:GetSet() +

Gets 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:Remove(ObjectName) +

Removes a Core.Base#BASE object from the Core.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:_EventOnPlayerEnterUnit(Event) +

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

+
SET_BASE:_EventOnPlayerLeaveUnit(Event) +

Handles the OnPlayerLeaveUnit event to clean the active players table.

+
SET_BASE:_FilterStart() +

Starts the filtering for the defined collection.

+
SET_BASE:_Find(ObjectName) +

Finds an Core.Base#BASE object based on the object Name.

+
+ +

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.ClassName + +
SET_CLIENT.Clients + +
SET_CLIENT.Filter + +
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.FilterMeta + +
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.ClassName + +
SET_GROUP.Filter + +
SET_GROUP:FilterCategories(Categories) +

Builds a set of groups out of categories.

+
SET_GROUP:FilterCoalitions(Coalitions) +

Builds a set of groups of coalitions.

+
SET_GROUP:FilterCountries(Countries) +

Builds a set of groups of defined countries.

+
SET_GROUP.FilterMeta + +
SET_GROUP:FilterPrefixes(Prefixes) +

Builds a set of groups of defined GROUP prefixes.

+
SET_GROUP:FilterStart() +

Starts the filtering.

+
SET_GROUP:FindGroup(GroupName) +

Finds a Group based on the Group Name.

+
SET_GROUP:FindInDatabase(Event) +

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

+
SET_GROUP:ForEachGroup(IteratorFunction, ...) +

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

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

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

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

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

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

Iterate the SET_GROUP and call an iterator function for each alive GROUP presence partly in a Zone, providing the GROUP and optional parameters to the called function.

+
SET_GROUP:IsIncludeObject(MooseGroup) + +
SET_GROUP:New() +

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

+
SET_GROUP:RemoveGroupsByName(RemoveGroupNames) +

Remove GROUP(s) from SET_GROUP.

+
+ +

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.ClassName + +
SET_UNIT.Filter + +
SET_UNIT:FilterCategories(Categories) +

Builds a set of units out of categories.

+
SET_UNIT:FilterCoalitions(Coalitions) +

Builds a set of units of coalitions.

+
SET_UNIT:FilterCountries(Countries) +

Builds a set of units of defined countries.

+
SET_UNIT:FilterHasRadar(RadarTypes) +

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

+
SET_UNIT:FilterHasSEAD() +

Builds a set of SEADable units.

+
SET_UNIT.FilterMeta + +
SET_UNIT:FilterPrefixes(Prefixes) +

Builds a set of units of defined unit prefixes.

+
SET_UNIT:FilterStart() +

Starts the filtering.

+
SET_UNIT:FilterTypes(Types) +

Builds a set of units of defined unit types.

+
SET_UNIT:FindInDatabase(Event) +

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

+
SET_UNIT:FindUnit(UnitName) +

Finds a Unit based on the Unit Name.

+
SET_UNIT:ForEachUnit(IteratorFunction, ...) +

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

+
SET_UNIT.Units + +
+ +

Global(s)

+
+
+ + #SET_AIRBASE + +SET_AIRBASE + +
+
+ + + +
+
+
+
+ + #SET_BASE + +SET_BASE + +
+
+ + + +
+
+
+
+ + #SET_CLIENT + +SET_CLIENT + +
+
+ + + +
+
+
+
+ + #SET_GROUP + +SET_GROUP + +
+
+ + + +
+
+
+
+ + #SET_UNIT + +SET_UNIT + +
+
+ + + +
+
+

Type Set

+ +

Type SET_AIRBASE

+ +

SET_AIRBASE class

+ +

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. +
  3. + +

    #table: +The AIRBASE

    + +
  4. +
+
+
+
+
+ + + +SET_AIRBASE.Airbases + +
+
+ + + +
+
+
+
+ + #string + +SET_AIRBASE.ClassName + +
+
+ + + +
+
+
+
+ + + +SET_AIRBASE.Filter + +
+
+ + + +
+
+
+
+ + +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.FilterMeta + +
+
+ + + +
+
+
+
+ + +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. +
  3. + +

    #table: +The AIRBASE

    + +
  4. +
+
+
+
+
+ + +SET_AIRBASE:FindNearestAirbaseFromPointVec2(PointVec2) + +
+
+ +

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

+ +

Parameter

+ +

Return value

+ +

Wrapper.Airbase#AIRBASE: +The closest Wrapper.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:RemoveAirbasesByName(RemoveAirbaseNames) + +
+
+ +

Remove AIRBASEs from SET_AIRBASE.

+ +

Parameter

+ +

Return value

+ + +

self

+ +
+
+ +

Type SET_BASE

+ +

SET_BASE class

+ +

Field(s)

+
+
+ + +SET_BASE:Add(ObjectName, Object) + +
+
+ +

Adds a Core.Base#BASE object in the Core.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 Core.Base#BASE object in the Core.Set#SET_BASE, using the Object Name as the index.

+ +

Parameter

+ +

Return value

+ +

Core.Base#BASE: +The added BASE Object.

+ +
+
+
+
+ + #string + +SET_BASE.ClassName + +
+
+ + + +
+
+
+
+ + +SET_BASE:Count() + +
+
+ +

Retrieves the amount of objects in the Core.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: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 Core.Point#POINT_VEC2.

+ +

Parameter

+ +

Return value

+ +

Core.Base#BASE: +The closest object.

+ +
+
+
+
+ + +SET_BASE:Flush() + +
+
+ +

Flushes the current SET_BASE contents in the log ...

+ + +

(for debugging reasons).

+ +

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 Core.Base#BASE object from the Core.Set#SET_BASE and derived classes, based on the Object Name.

+ +

Parameter

+
    +
  • + +

    #string ObjectName :

    + +
  • +
+

Return value

+ +

Core.Base#BASE:

+ + +
+
+
+
+ + +SET_BASE:GetSet() + +
+
+ +

Gets 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:Remove(ObjectName) + +
+
+ +

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

+ +

Parameter

+
    +
  • + +

    #string ObjectName :

    + +
  • +
+
+
+
+
+ + #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:_EventOnPlayerEnterUnit(Event) + +
+
+ +

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

+ +

Parameter

+ +
+
+
+
+ + +SET_BASE:_EventOnPlayerLeaveUnit(Event) + +
+
+ +

Handles the OnPlayerLeaveUnit event to clean the active players table.

+ +

Parameter

+ +
+
+
+
+ + +SET_BASE:_FilterStart() + +
+
+ +

Starts the filtering for the defined collection.

+ +

Return value

+ +

#SET_BASE: +self

+ +
+
+
+
+ + +SET_BASE:_Find(ObjectName) + +
+
+ +

Finds an Core.Base#BASE object based on the object Name.

+ +

Parameter

+
    +
  • + +

    #string ObjectName :

    + +
  • +
+

Return value

+ +

Core.Base#BASE: +The Object found.

+ +
+
+ +

Type SET_CLIENT

+ +

SET_CLIENT class

+ +

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. +
  3. + +

    #table: +The CLIENT

    + +
  4. +
+
+
+
+
+ + #string + +SET_CLIENT.ClassName + +
+
+ + + +
+
+
+
+ + + +SET_CLIENT.Clients + +
+
+ + + +
+
+
+
+ + + +SET_CLIENT.Filter + +
+
+ + + +
+
+
+
+ + +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.FilterMeta + +
+
+ + + +
+
+
+
+ + +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. +
  3. + +

    #table: +The CLIENT

    + +
  4. +
+
+
+
+
+ + +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

+ +

SET_GROUP class

+ +

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. +
  3. + +

    #table: +The GROUP

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

Builds a set of groups out of categories.

+ + +

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

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_GROUP: +self

+ +
+
+
+
+ + +SET_GROUP:FilterCoalitions(Coalitions) + +
+
+ +

Builds a set of groups of coalitions.

+ + +

Possible current coalitions are red, blue and neutral.

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_GROUP: +self

+ +
+
+
+
+ + +SET_GROUP:FilterCountries(Countries) + +
+
+ +

Builds a set of groups of defined countries.

+ + +

Possible current countries are those known within DCS world.

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_GROUP: +self

+ +
+
+
+
+ + + +SET_GROUP.FilterMeta + +
+
+ + + +
+
+
+
+ + +SET_GROUP:FilterPrefixes(Prefixes) + +
+
+ +

Builds a set of groups of defined GROUP prefixes.

+ + +

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

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_GROUP: +self

+ +
+
+
+
+ + +SET_GROUP:FilterStart() + +
+
+ +

Starts the filtering.

+ +

Return value

+ +

#SET_GROUP: +self

+ +
+
+
+
+ + +SET_GROUP:FindGroup(GroupName) + +
+
+ +

Finds a Group based on the Group Name.

+ +

Parameter

+
    +
  • + +

    #string GroupName :

    + +
  • +
+

Return value

+ +

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. +
  3. + +

    #table: +The GROUP

    + +
  4. +
+
+
+
+
+ + +SET_GROUP:ForEachGroup(IteratorFunction, ...) + +
+
+ +

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

+ +

Parameters

+
    +
  • + +

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

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#SET_GROUP: +self

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

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

+ +

Parameters

+
    +
  • + +

    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: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:RemoveGroupsByName(RemoveGroupNames) + +
+
+ +

Remove GROUP(s) from SET_GROUP.

+ +

Parameter

+ +

Return value

+ + +

self

+ +
+
+ +

Type SET_UNIT

+ +

SET_UNIT class

+ +

Field(s)

+
+
+ + +SET_UNIT:AddInDatabase(Event) + +
+
+ +

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

+ + +

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

+ +

Parameter

+ +

Return values

+
    +
  1. + +

    #string: +The name of the UNIT

    + +
  2. +
  3. + +

    #table: +The UNIT

    + +
  4. +
+
+
+
+
+ + +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.

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

Builds a set of units out of categories.

+ + +

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

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_UNIT: +self

+ +
+
+
+
+ + +SET_UNIT:FilterCoalitions(Coalitions) + +
+
+ +

Builds a set of units of coalitions.

+ + +

Possible current coalitions are red, blue and neutral.

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_UNIT: +self

+ +
+
+
+
+ + +SET_UNIT:FilterCountries(Countries) + +
+
+ +

Builds a set of units of defined countries.

+ + +

Possible current countries are those known within DCS world.

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_UNIT: +self

+ +
+
+
+
+ + +SET_UNIT: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.FilterMeta + +
+
+ + + +
+
+
+
+ + +SET_UNIT:FilterPrefixes(Prefixes) + +
+
+ +

Builds a set of units of defined unit prefixes.

+ + +

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

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_UNIT: +self

+ +
+
+
+
+ + +SET_UNIT:FilterStart() + +
+
+ +

Starts the filtering.

+ +

Return value

+ +

#SET_UNIT: +self

+ +
+
+
+
+ + +SET_UNIT:FilterTypes(Types) + +
+
+ +

Builds a set of units of defined unit types.

+ + +

Possible current types are those types known within DCS world.

+ +

Parameter

+
    +
  • + +

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

    + +
  • +
+

Return value

+ +

#SET_UNIT: +self

+ +
+
+
+
+ + +SET_UNIT:FindInDatabase(Event) + +
+
+ +

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

+ + +

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

+ +

Parameter

+ +

Return values

+
    +
  1. + +

    #string: +The name of the UNIT

    + +
  2. +
  3. + +

    #table: +The UNIT

    + +
  4. +
+
+
+
+
+ + +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: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: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: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: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

+
    +
  • + +

    Wrapper.Unit#UNIT RemoveUnitNames : +A single name or an array of UNIT names.

    + +
  • +
+

Return value

+ + +

self

+ +
+
+
+
+ + + +SET_UNIT.Units + +
+
+ + + +
+
+ +

Type map

+ +
+ +
+ + diff --git a/docs/Documentation/Smoke.html b/docs/Documentation/Smoke.html new file mode 100644 index 000000000..ed6cf2736 --- /dev/null +++ b/docs/Documentation/Smoke.html @@ -0,0 +1,648 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Smoke

+ +

(SP) (MP) (FSM) Route AI or players through waypoints or to zones.

+ + + +
+ +

#ACT_ASSIST FSM class, extends Core.Fsm#FSM_PROCESS

+ +

ACT_ASSIST state machine:

+ +

This class is a state machine: it manages a process that is triggered by events causing state transitions to occur. +All derived classes from this class will start with the class name, followed by a _. See the relevant derived class descriptions below. +Each derived class follows exactly the same process, using the same events and following the same state transitions, +but will have different implementation behaviour upon each event or state transition.

+ +

ACT_ASSIST Events:

+ +

These are the events defined in this class:

+ +
    +
  • Start: The process is started.
  • +
  • Next: The process is smoking the targets in the given zone.
  • +
+ +

ACT_ASSIST Event methods:

+ +

Event methods are available (dynamically allocated by the state machine), that accomodate for state transitions occurring in the process. +There are two types of event methods, which you can use to influence the normal mechanisms in the state machine:

+ +
    +
  • Immediate: The event method has exactly the name of the event.
  • +
  • Delayed: The event method starts with a __ + the name of the event. The first parameter of the event method is a number value, expressing the delay in seconds when the event will be executed.
  • +
+ +

ACT_ASSIST States:

+ +
    +
  • None: The controllable did not receive route commands.
  • +
  • AwaitSmoke (*): The process is awaiting to smoke the targets in the zone.
  • +
  • Smoking (*): The process is smoking the targets in the zone.
  • +
  • Failed (*): The process has failed.
  • +
+ +

(*) End states of the process.

+ +

ACT_ASSIST state transition methods:

+ +

State transition functions can be set by the mission designer customizing or improving the behaviour of the state. +There are 2 moments when state transition methods will be called by the state machine:

+ +
    +
  • Before the state transition. + The state transition method needs to start with the name OnBefore + the name of the state. + If the state transition method returns false, then the processing of the state transition will not be done! + If you want to change the behaviour of the AIControllable at this event, return false, + but then you'll need to specify your own logic using the AIControllable!

  • +
  • After the state transition. + The state transition method needs to start with the name OnAfter + the name of the state. + These state transition methods need to provide a return value, which is specified at the function description.

  • +
+ +
+ +

1) #ACTASSISTSMOKETARGETSZONE class, extends Fsm.Route#ACT_ASSIST

+ +

The ACTASSISTSMOKETARGETSZONE class implements the core functions to smoke targets in a Zone. +The targets are smoked within a certain range around each target, simulating a realistic smoking behaviour. +At random intervals, a new target is smoked.

+ +

1.1) ACTASSISTSMOKETARGETSZONE constructor:

+ + + +
+ + +

Global(s)

+ + + + + + + + + +
ACT_ASSIST + +
ACT_ASSIST_SMOKE_TARGETS_ZONE + +
+

Type ACT_ASSIST

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ACT_ASSIST.ClassName + +
ACT_ASSIST.Menu + +
ACT_ASSIST.MenuSmokeBlue + +
ACT_ASSIST.MenuSmokeGreen + +
ACT_ASSIST.MenuSmokeOrange + +
ACT_ASSIST.MenuSmokeRed + +
ACT_ASSIST.MenuSmokeWhite + +
ACT_ASSIST:New() +

Creates a new target smoking state machine.

+
ACT_ASSIST.TargetSetUnit + +
ACT_ASSIST.TargetZone + +
ACT_ASSIST:onafterStart(ProcessUnit, Event, From, To) +

StateMachine callback function

+
+ +

Type ACT_ASSIST_SMOKE_TARGETS_ZONE

+ + + + + + + + + + + + + + + + + + + + + + + + + +
ACT_ASSIST_SMOKE_TARGETS_ZONE.ClassName + +
ACT_ASSIST_SMOKE_TARGETS_ZONE:Init(FsmSmoke) + +
ACT_ASSIST_SMOKE_TARGETS_ZONE:New(TargetSetUnit, TargetZone) +

Creates a new target smoking state machine.

+
ACT_ASSIST_SMOKE_TARGETS_ZONE.TargetSetUnit + +
ACT_ASSIST_SMOKE_TARGETS_ZONE.TargetZone + +
ACT_ASSIST_SMOKE_TARGETS_ZONE:onenterSmoking(ProcessUnit, Event, From, To) +

StateMachine callback function

+
+ +

Global(s)

+
+
+ + #ACT_ASSIST + +ACT_ASSIST + +
+
+ + + +
+
+
+
+ + #ACT_ASSIST_SMOKE_TARGETS_ZONE + +ACT_ASSIST_SMOKE_TARGETS_ZONE + +
+
+ + + +
+
+

Type Smoke

+ +

Type ACT_ASSIST

+ +

ACT_ASSIST class

+ +

Field(s)

+
+
+ + #string + +ACT_ASSIST.ClassName + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIST.Menu + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIST.MenuSmokeBlue + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIST.MenuSmokeGreen + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIST.MenuSmokeOrange + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIST.MenuSmokeRed + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIST.MenuSmokeWhite + +
+
+ + + +
+
+
+
+ + +ACT_ASSIST:New() + +
+
+ +

Creates a new target smoking state machine.

+ + +

The process will request from the menu if it accepts the task, if not, the unit is removed from the simulator.

+ +

Return value

+ +

#ACT_ASSIST:

+ + +
+
+
+
+ + + +ACT_ASSIST.TargetSetUnit + +
+
+ + + +
+
+
+
+ + + +ACT_ASSIST.TargetZone + +
+
+ + + +
+
+
+
+ + +ACT_ASSIST:onafterStart(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+ +

Type ACT_ASSIST_SMOKE_TARGETS_ZONE

+ +

ACTASSISTSMOKETARGETSZONE class

+ +

Field(s)

+
+
+ + #string + +ACT_ASSIST_SMOKE_TARGETS_ZONE.ClassName + +
+
+ + + +
+
+
+
+ + +ACT_ASSIST_SMOKE_TARGETS_ZONE:Init(FsmSmoke) + +
+
+ + + +

Parameter

+
    +
  • + +

    FsmSmoke :

    + +
  • +
+
+
+
+
+ + +ACT_ASSIST_SMOKE_TARGETS_ZONE:New(TargetSetUnit, TargetZone) + +
+
+ +

Creates a new target smoking state machine.

+ + +

The process will request from the menu if it accepts the task, if not, the unit is removed from the simulator.

+ +

Parameters

+ +
+
+
+
+ + Set#SET_UNIT + +ACT_ASSIST_SMOKE_TARGETS_ZONE.TargetSetUnit + +
+
+ + + +
+
+
+
+ + Core.Zone#ZONE_BASE + +ACT_ASSIST_SMOKE_TARGETS_ZONE.TargetZone + +
+
+ + + +
+
+
+
+ + +ACT_ASSIST_SMOKE_TARGETS_ZONE:onenterSmoking(ProcessUnit, Event, From, To) + +
+
+ +

StateMachine callback function

+ +

Parameters

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Spawn.html b/docs/Documentation/Spawn.html new file mode 100644 index 000000000..f2c75b964 --- /dev/null +++ b/docs/Documentation/Spawn.html @@ -0,0 +1,3150 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Spawn

+ +

This module contains the SPAWN class.

+ + + +

1) Functional.Spawn#SPAWN class, extends Core.Base#BASE

+

The #SPAWN class allows to spawn dynamically new groups, based on pre-defined initialization settings, modifying the behaviour when groups are spawned. +For each group to be spawned, within the mission editor, a group has to be created with the "late activation flag" set. We call this group the "Spawn Template" of the SPAWN object. +A reference to this Spawn Template needs to be provided when constructing the SPAWN object, by indicating the name of the group within the mission editor in the constructor methods.

+ +

Within the SPAWN object, there is an internal index that keeps track of which group from the internal group list was spawned. +When new groups get spawned by using the SPAWN methods (see below), it will be validated whether the Limits (SPAWN.Limit) of the SPAWN object are not reached. +When all is valid, a new group will be created by the spawning methods, and the internal index will be increased with 1.

+ +

Regarding the name of new spawned groups, a SpawnPrefix will be assigned for each new group created. +If you want to have the Spawn Template name to be used as the SpawnPrefix name, use the SPAWN.New constructor. +However, when the SPAWN.NewWithAlias constructor was used, the Alias name will define the SpawnPrefix name. +Groups will follow the following naming structure when spawned at run-time:

+ +
    +
  1. Spawned groups will have the name SpawnPrefix#ggg, where ggg is a counter from 0 to 999.
  2. +
  3. Spawned units will have the name SpawnPrefix#ggg-uu, where uu is a counter from 0 to 99 for each new spawned unit belonging to the group.
  4. +
+ +

Some additional notes that need to be remembered:

+ +
    +
  • Templates are actually groups defined within the mission editor, with the flag "Late Activation" set. As such, these groups are never used within the mission, but are used by the #SPAWN module.
  • +
  • It is important to defined BEFORE you spawn new groups, a proper initialization of the SPAWN instance is done with the options you want to use.
  • +
  • When designing a mission, NEVER name groups using a "#" within the name of the group Spawn Template(s), or the SPAWN module logic won't work anymore.
  • +
+ +

1.1) SPAWN construction methods

+

Create a new SPAWN object with the SPAWN.New() or the SPAWN.NewWithAlias() methods:

+ +
    +
  • SPAWN.New(): Creates a new SPAWN object taking the name of the group that represents the GROUP Template (definition).
  • +
  • SPAWN.NewWithAlias(): Creates a new SPAWN object taking the name of the group that represents the GROUP Template (definition), and gives each spawned Group an different name.
  • +
+ +

It is important to understand how the SPAWN class works internally. The SPAWN object created will contain internally a list of groups that will be spawned and that are already spawned. +The initialization methods will modify this list of groups so that when a group gets spawned, ALL information is already prepared when spawning. This is done for performance reasons. +So in principle, the group list will contain all parameters and configurations after initialization, and when groups get actually spawned, this spawning can be done quickly and efficient.

+ +

1.2) SPAWN initialization methods

+

A spawn object will behave differently based on the usage of initialization methods, which all start with the Init prefix:

+ + + +

1.3) SPAWN spawning methods

+

Groups can be spawned at different times and methods:

+ + + +

Note that SPAWN.Spawn and SPAWN.ReSpawn return a GROUP#GROUP.New object, that contains a reference to the DCSGroup object. +You can use the GROUP object to do further actions with the DCSGroup.

+ +

1.4) Retrieve alive GROUPs spawned by the SPAWN object

+

The SPAWN class administers which GROUPS it has reserved (in stock) or has created during mission execution. +Every time a SPAWN object spawns a new GROUP object, a reference to the GROUP object is added to an internal table of GROUPS. +SPAWN provides methods to iterate through that internal GROUP object reference table:

+ +
    +
  • SPAWN.GetFirstAliveGroup(): Will find the first alive GROUP it has spawned, and return the alive GROUP object and the first Index where the first alive GROUP object has been found.
  • +
  • SPAWN.GetNextAliveGroup(): Will find the next alive GROUP object from a given Index, and return a reference to the alive GROUP object and the next Index where the alive GROUP has been found.
  • +
  • SPAWN.GetLastAliveGroup(): Will find the last alive GROUP object, and will return a reference to the last live GROUP object and the last Index where the last alive GROUP object has been found.
  • +
+ +

You can use the methods SPAWN.GetFirstAliveGroup() and sequently SPAWN.GetNextAliveGroup() to iterate through the alive GROUPS within the SPAWN object, and to actions... See the respective methods for an example. +The method SPAWN.GetGroupFromIndex() will return the GROUP object reference from the given Index, dead or alive...

+ +

1.5) SPAWN object cleaning

+

Sometimes, it will occur during a mission run-time, that ground or especially air objects get damaged, and will while being damged stop their activities, while remaining alive. +In such cases, the SPAWN object will just sit there and wait until that group gets destroyed, but most of the time it won't, +and it may occur that no new groups are or can be spawned as limits are reached. +To prevent this, a SPAWN.InitCleanUp() initialization method has been defined that will silently monitor the status of each spawned group. +Once a group has a velocity = 0, and has been waiting for a defined interval, that group will be cleaned or removed from run-time. +There is a catch however :-) If a damaged group has returned to an airbase within the coalition, that group will not be considered as "lost"... +In such a case, when the inactive group is cleaned, a new group will Re-spawned automatically. +This models AI that has succesfully returned to their airbase, to restart their combat activities. +Check the SPAWN.InitCleanUp() for further info.

+ +

1.6) Catch the Group spawn event in a callback function!

+

When using the SpawnScheduled method, new Groups are created following the schedule timing parameters. +When a new Group is spawned, you maybe want to execute actions with that group spawned at the spawn event. +To SPAWN class supports this functionality through the SPAWN.OnSpawnGroup( *function( SpawnedGroup ) end * ) method, which takes a function as a parameter that you can define locally. +Whenever a new Group is spawned, the given function is called, and the Group that was just spawned, is given as a parameter. +As a result, your spawn event handling function requires one parameter to be declared, which will contain the spawned Group object. +A coding example is provided at the description of the SPAWN.OnSpawnGroup( *function( SpawnedGroup ) end * ) method.

+ +
+ +

API CHANGE HISTORY

+ +

The underlying change log documents the API changes. Please read this carefully. The following notation is used:

+ +
    +
  • Added parts are expressed in bold type face.
  • +
  • Removed parts are expressed in italic type face.
  • +
+ +

Hereby the change log:

+ +

2016-08-15: SPAWN:InitCleanUp( SpawnCleanUpInterval ) replaces SPAWN:CleanUp( SpawnCleanUpInterval )

+ +
    +
  • Want to ensure that the methods starting with Init are the first called methods before any Spawn method is called!
  • +
  • This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
  • +
+ +

2016-08-15: SPAWN:InitRandomizeZones( SpawnZones ) added.

+ +
    +
  • This method provides the functionality to randomize the spawning of the Groups at a given list of zones of different types.
  • +
+ +

2016-08-14: SPAWN:OnSpawnGroup( SpawnCallBackFunction, ... ) replaces SPAWN:SpawnFunction( SpawnCallBackFunction, ... ).

+ +

2016-08-14: SPAWN.SpawnInZone( Zone, RandomizeGroup, SpawnIndex ) replaces SpawnInZone( Zone, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ).

+ +
    +
  • The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method SPAWN.InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius ).
  • +
  • A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned Group.
  • +
+ +

2016-08-14: SPAWN.SpawnFromVec3( Vec3, SpawnIndex ) replaces SpawnFromVec3( Vec3, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ):

+ +
    +
  • The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method SPAWN.InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius ).
  • +
  • A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned Group.
  • +
+ +

2016-08-14: SPAWN.SpawnFromVec2( Vec2, SpawnIndex ) replaces SpawnFromVec2( Vec2, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ):

+ +
    +
  • The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method SPAWN.InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius ).
  • +
  • A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned Group.
  • +
+ +

2016-08-14: SPAWN.SpawnFromUnit( SpawnUnit, SpawnIndex ) replaces SpawnFromUnit( SpawnUnit, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ):

+ +
    +
  • The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method SPAWN.InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius ).
  • +
  • A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned Group.
  • +
+ +

2016-08-14: SPAWN.SpawnFromUnit( SpawnUnit, SpawnIndex ) replaces SpawnFromStatic( SpawnStatic, RandomizeUnits, OuterRadius, InnerRadius, SpawnIndex ):

+ +
    +
  • The RandomizeUnits, OuterRadius and InnerRadius have been replaced with a new method SPAWN.InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius ).
  • +
  • A new parameter RandomizeGroup to reflect the randomization of the starting position of the Spawned Group.
  • +
+ +

2016-08-14: SPAWN.InitRandomizeUnits( RandomizeUnits, OuterRadius, InnerRadius ) added:

+ +
    +
  • This method enables the randomization of units at the first route point in a radius band at a spawn event.
  • +
+ +

2016-08-14: SPAWN.InitLimit( SpawnMaxUnitsAlive, SpawnMaxGroups ) replaces SPAWN.Limit( SpawnMaxUnitsAlive, SpawnMaxGroups ):

+ +
    +
  • Want to ensure that the methods starting with Init are the first called methods before any Spawn method is called!
  • +
  • This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
  • +
+ +

2016-08-14: SPAWN.InitArray( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY ) replaces SPAWN.Array( SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY ).

+ +
    +
  • Want to ensure that the methods starting with Init are the first called methods before any Spawn method is called!
  • +
  • This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
  • +
+ +

2016-08-14: SPAWN.InitRandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight ) replaces SPAWN.RandomizeRoute( SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight ).

+ +
    +
  • Want to ensure that the methods starting with Init are the first called methods before any Spawn method is called!
  • +
  • This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
  • +
+ +

2016-08-14: SPAWN.InitRandomizeTemplate( SpawnTemplatePrefixTable ) replaces SPAWN.RandomizeTemplate( SpawnTemplatePrefixTable ).

+ +
    +
  • Want to ensure that the methods starting with Init are the first called methods before any Spawn method is called!
  • +
  • This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
  • +
+ +

2016-08-14: SPAWN.InitUnControlled() replaces SPAWN.UnControlled().

+ +
    +
  • Want to ensure that the methods starting with Init are the first called methods before any Spawn method is called!
  • +
  • This notation makes it now more clear which methods are initialization methods and which methods are Spawn enablement methods.
  • +
+ +
+ +

AUTHORS and CONTRIBUTIONS

+ +

Contributions:

+ +
    +
  • Aaron: Posed the idea for Group position randomization at SpawnInZone and make the Unit randomization separate from the Group randomization.
  • +
+ +

Authors:

+ +
    +
  • FlightControl: Design & Programming
  • +
+ + + +

Global(s)

+ + + + + +
SPAWN + +
+

Type SPAWN

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SPAWN.AliveUnits + +
SPAWN.ClassName + +
SPAWN.CleanUpScheduler + +
SPAWN:GetFirstAliveGroup() +

Will find the first alive Group it has spawned, and return the alive Group object and the first Index where the first alive Group object has been found.

+
SPAWN:GetGroupFromIndex(SpawnIndex) +

Get the group from an index.

+
SPAWN:GetLastAliveGroup() +

Will find the last alive Group object, and will return a reference to the last live Group object and the last Index where the last alive Group object has been found.

+
SPAWN:GetNextAliveGroup(SpawnIndexStart) +

Will find the next alive Group object from a given Index, and return a reference to the alive Group object and the next Index where the alive Group has been found.

+
SPAWN:GetSpawnIndexFromGroup(SpawnGroup) +

Get the index from a given group.

+
SPAWN:InitArray(SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY) +

Makes the groups visible before start (like a batallion).

+
SPAWN:InitCleanUp(SpawnCleanUpInterval) +

CleanUp groups when they are still alive, but inactive.

+
SPAWN:InitLimit(SpawnMaxUnitsAlive, SpawnMaxGroups) +

Limits the Maximum amount of Units that can be alive at the same time, and the maximum amount of groups that can be spawned.

+
SPAWN:InitRandomizeRoute(SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight) +

Randomizes the defined route of the SpawnTemplatePrefix group in the ME.

+
SPAWN:InitRandomizeTemplate(SpawnTemplatePrefixTable) +

This method is rather complicated to understand.

+
SPAWN:InitRandomizeUnits(RandomizeUnits, OuterRadius, InnerRadius) +

Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.

+
SPAWN:InitRandomizeZones(SpawnZoneTable) + +
SPAWN:InitRepeat() +

For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.

+
SPAWN:InitRepeatOnEngineShutDown() +

Respawn after landing when its engines have shut down.

+
SPAWN:InitRepeatOnLanding() +

Respawn group after landing.

+
SPAWN:InitUnControlled() +

(AIR) Will spawn a plane group in uncontrolled mode...

+
SPAWN.MaxAliveGroups + +
SPAWN.MaxAliveUnits + +
SPAWN:New(SpawnTemplatePrefix) +

Creates the main object to spawn a Group defined in the DCS ME.

+
SPAWN:NewWithAlias(SpawnTemplatePrefix, SpawnAliasPrefix) +

Creates a new SPAWN instance to create new groups based on the defined template and using a new alias for each new group.

+
SPAWN:OnSpawnGroup(SpawnCallBackFunction, SpawnFunctionArguments, ...) +

Allows to place a CallFunction hook when a new group spawns.

+
SPAWN:ReSpawn(SpawnIndex) +

Will re-spawn a group based on a given index.

+
SPAWN.Repeat + +
SPAWN.RepeatOnEngineShutDown + +
SPAWN.RepeatOnLanding + +
SPAWN:Spawn() +

Will spawn a group based on the internal index.

+
SPAWN.SpawnAliasPrefix + +
SPAWN.SpawnCleanUpInterval + +
SPAWN.SpawnCleanUpTimeStamps + +
SPAWN.SpawnCount + +
SPAWN:SpawnFromStatic(HostStatic, SpawnIndex) +

Will spawn a group from a hosting static.

+
SPAWN:SpawnFromUnit(HostUnit, SpawnIndex) +

Will spawn a group from a hosting unit.

+
SPAWN:SpawnFromVec2(Vec2, SpawnIndex) +

Will spawn a group from a Vec2 in 3D space.

+
SPAWN:SpawnFromVec3(Vec3, SpawnIndex) +

Will spawn a group from a Vec3 in 3D space.

+
SPAWN.SpawnFunctionArguments + +
SPAWN.SpawnFunctionHook + +
SPAWN:SpawnGroupName(SpawnIndex) +

Will return the SpawnGroupName either with with a specific count number or without any count.

+
SPAWN.SpawnGroups + +
SPAWN:SpawnInZone(Zone, RandomizeGroup, SpawnIndex) +

Will spawn a Group within a given Zone.

+
SPAWN.SpawnIndex + +
SPAWN.SpawnInnerRadius + +
SPAWN.SpawnIsScheduled + +
SPAWN.SpawnMaxGroups + +
SPAWN.SpawnMaxUnitsAlive + +
SPAWN.SpawnOuterRadius + +
SPAWN.SpawnRandomize + +
SPAWN.SpawnRandomizeRoute + +
SPAWN.SpawnRandomizeRouteEndPoint + +
SPAWN.SpawnRandomizeRouteHeight + +
SPAWN.SpawnRandomizeRouteRadius + +
SPAWN.SpawnRandomizeRouteStartPoint + +
SPAWN.SpawnRandomizeTemplate + +
SPAWN.SpawnRandomizeUnits + +
SPAWN:SpawnScheduleStart() +

Will re-start the spawning scheduler.

+
SPAWN:SpawnScheduleStop() +

Will stop the scheduled spawning scheduler.

+
SPAWN:SpawnScheduled(SpawnTime, SpawnTimeVariation) +

Spawns new groups at varying time intervals.

+
SPAWN.SpawnScheduler + +
SPAWN.SpawnTemplate + +
SPAWN.SpawnTemplatePrefix + +
SPAWN.SpawnTemplatePrefixTable + +
SPAWN.SpawnUnControlled + +
SPAWN.SpawnVisible + +
SPAWN:SpawnWithIndex(SpawnIndex) +

Will spawn a group with a specified index number.

+
SPAWN.SpawnZoneTable + +
SPAWN.UnControlled + +
SPAWN:_GetGroupCategoryID(SpawnPrefix) +

Gets the CategoryID of the Group with the given SpawnPrefix

+
SPAWN:_GetGroupCoalitionID(SpawnPrefix) +

Gets the CoalitionID of the Group with the given SpawnPrefix

+
SPAWN:_GetGroupCountryID(SpawnPrefix) +

Gets the CountryID of the Group with the given SpawnPrefix

+
SPAWN:_GetGroupFromDCSUnit(DCSUnit) +

Return the group within the SpawnGroups collection with input a DCSUnit.

+
SPAWN:_GetGroupIndexFromDCSUnit(DCSUnit) +

Get the group index from a DCSUnit.

+
SPAWN:_GetLastIndex() +

Return the last maximum index that can be used.

+
SPAWN:_GetPrefixFromDCSUnit(DCSUnit) +

Return the prefix of a SpawnUnit.

+
SPAWN:_GetSpawnIndex(SpawnIndex) +

Get the next index of the groups to be spawned.

+
SPAWN:_GetTemplate(SpawnTemplatePrefix) +

Gets the Group Template from the ME environment definition.

+
SPAWN:_InitializeSpawnGroups(SpawnIndex) +

Initalize the SpawnGroups collection.

+
SPAWN:_OnBirth(Event) + +
SPAWN:_OnDeadOrCrash(Event) + +
SPAWN:_OnEngineShutDown(event) +

Will detect AIR Units shutting down their engines ...

+
SPAWN:_OnLand(event) +

Will detect AIR Units landing...

+
SPAWN:_OnTakeOff(event) +

Will detect AIR Units taking off...

+
SPAWN:_Prepare(SpawnTemplatePrefix, SpawnIndex) +

Prepares the new Group Template.

+
SPAWN:_RandomizeRoute(SpawnIndex) +

Private method randomizing the routes.

+
SPAWN:_RandomizeTemplate(SpawnIndex) +

Private method that randomizes the template of the group.

+
SPAWN:_RandomizeZones(SpawnIndex) +

Private method that randomizes the Zones where the Group will be spawned.

+
SPAWN:_Scheduler() +

This function is called automatically by the Spawning scheduler.

+
SPAWN:_SpawnCleanUpScheduler() +

Schedules the CleanUp of Groups

+
SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) + +
+ +

Global(s)

+
+
+ + #SPAWN + +SPAWN + +
+
+ + + +
+
+

Type Spawn

+ +

Type SPAWN

+ +

SPAWN Class

+ +

Field(s)

+
+
+ + #number + +SPAWN.AliveUnits + +
+
+ + + +
+
+
+
+ + +SPAWN.ClassName + +
+
+ + + +
+
+
+
+ + + +SPAWN.CleanUpScheduler + +
+
+ + + + +

self.CleanUpFunction = routines.scheduleFunction( self._SpawnCleanUpScheduler, { self }, timer.getTime() + 1, SpawnCleanUpInterval )

+ +
+
+
+
+ + +SPAWN:GetFirstAliveGroup() + +
+
+ +

Will find the first alive Group it has spawned, and return the alive Group object and the first Index where the first alive Group object has been found.

+ +

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP, #number: +The Group object found, the new Index where the group was found.

    + +
  2. +
  3. + +

    #nil, #nil: +When no group is found, #nil is returned.

    + +
  4. +
+

Usage:

+
-- Find the first alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
+local GroupPlane, Index = SpawnPlanes:GetFirstAliveGroup()
+while GroupPlane ~= nil do
+  -- Do actions with the GroupPlane object.
+  GroupPlane, Index = SpawnPlanes:GetNextAliveGroup( Index )
+end
+ +
+
+
+
+ + +SPAWN:GetGroupFromIndex(SpawnIndex) + +
+
+ +

Get the group from an index.

+ + +

Returns the group from the SpawnGroups list. +If no index is given, it will return the first group in the list.

+ +

Parameter

+
    +
  • + +

    #number SpawnIndex : +The index of the group to return.

    + +
  • +
+

Return value

+ +

Wrapper.Group#GROUP: +self

+ +
+
+
+
+ + +SPAWN:GetLastAliveGroup() + +
+
+ +

Will find the last alive Group object, and will return a reference to the last live Group object and the last Index where the last alive Group object has been found.

+ +

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP, #number: +The last alive Group object found, the last Index where the last alive Group object was found.

    + +
  2. +
  3. + +

    #nil, #nil: +When no alive Group object is found, #nil is returned.

    + +
  4. +
+

Usage:

+
-- Find the last alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
+local GroupPlane, Index = SpawnPlanes:GetLastAliveGroup()
+if GroupPlane then -- GroupPlane can be nil!!!
+  -- Do actions with the GroupPlane object.
+end
+ +
+
+
+
+ + +SPAWN:GetNextAliveGroup(SpawnIndexStart) + +
+
+ +

Will find the next alive Group object from a given Index, and return a reference to the alive Group object and the next Index where the alive Group has been found.

+ +

Parameter

+
    +
  • + +

    #number SpawnIndexStart : +A Index holding the start position to search from. This method can also be used to find the first alive Group object from the given Index.

    + +
  • +
+

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP, #number: +The next alive Group object found, the next Index where the next alive Group object was found.

    + +
  2. +
  3. + +

    #nil, #nil: +When no alive Group object is found from the start Index position, #nil is returned.

    + +
  4. +
+

Usage:

+
-- Find the first alive @{Group} object of the SpawnPlanes SPAWN object @{Group} collection that it has spawned during the mission.
+local GroupPlane, Index = SpawnPlanes:GetFirstAliveGroup()
+while GroupPlane ~= nil do
+  -- Do actions with the GroupPlane object.
+  GroupPlane, Index = SpawnPlanes:GetNextAliveGroup( Index )
+end
+ +
+
+
+
+ + +SPAWN:GetSpawnIndexFromGroup(SpawnGroup) + +
+
+ +

Get the index from a given group.

+ + +

The function will search the name of the group for a #, and will return the number behind the #-mark.

+ +

Parameter

+
    +
  • + +

    SpawnGroup :

    + +
  • +
+
+
+
+
+ + +SPAWN:InitArray(SpawnAngle, SpawnWidth, SpawnDeltaX, SpawnDeltaY) + +
+
+ +

Makes the groups visible before start (like a batallion).

+ + +

The method will take the position of the group as the first position in the array.

+ +

Parameters

+
    +
  • + +

    #number SpawnAngle :

    +
        The angle in degrees how the groups and each unit of the group will be positioned.
    +
    + +
  • +
  • + +

    #number SpawnWidth :

    +
         The amount of Groups that will be positioned on the X axis.
    +
    + +
  • +
  • + +

    #number SpawnDeltaX :

    +
       The space between each Group on the X-axis.
    +
    + +
  • +
  • + +

    #number SpawnDeltaY :

    +
         The space between each Group on the Y-axis.
    +
    + +
  • +
+

Return value

+ +

#SPAWN: +self

+ +

Usage:

+
-- Define an array of Groups.
+Spawn_BE_Ground = SPAWN:New( 'BE Ground' ):InitLimit( 2, 24 ):InitArray( 90, "Diamond", 10, 100, 50 )
+ +
+
+
+
+ + +SPAWN:InitCleanUp(SpawnCleanUpInterval) + +
+
+ +

CleanUp groups when they are still alive, but inactive.

+ + +

When groups are still alive and have become inactive due to damage and are unable to contribute anything, then this group will be removed at defined intervals in seconds.

+ +

Parameter

+
    +
  • + +

    #string SpawnCleanUpInterval : +The interval to check for inactive groups within seconds.

    + +
  • +
+

Return value

+ +

#SPAWN: +self

+ +

Usage:

+
Spawn_Helicopter:CleanUp( 20 )  -- CleanUp the spawning of the helicopters every 20 seconds when they become inactive.
+ +
+
+
+
+ + +SPAWN:InitLimit(SpawnMaxUnitsAlive, SpawnMaxGroups) + +
+
+ +

Limits the Maximum amount of Units that can be alive at the same time, and the maximum amount of groups that can be spawned.

+ + +

Note that this method is exceptionally important to balance the performance of the mission. Depending on the machine etc, a mission can only process a maximum amount of units. +If the time interval must be short, but there should not be more Units or Groups alive than a maximum amount of units, then this method should be used... +When a SPAWN.New is executed and the limit of the amount of units alive is reached, then no new spawn will happen of the group, until some of these units of the spawn object will be destroyed.

+ +

Parameters

+
    +
  • + +

    #number SpawnMaxUnitsAlive : +The maximum amount of units that can be alive at runtime.

    + +
  • +
  • + +

    #number SpawnMaxGroups : +The maximum amount of groups that can be spawned. When the limit is reached, then no more actual spawns will happen of the group. +This parameter is useful to define a maximum amount of airplanes, ground troops, helicopters, ships etc within a supply area. +This parameter accepts the value 0, which defines that there are no maximum group limits, but there are limits on the maximum of units that can be alive at the same time.

    + +
  • +
+

Return value

+ +

#SPAWN: +self

+ +

Usage:

+
-- NATO helicopters engaging in the battle field.
+-- This helicopter group consists of one Unit. So, this group will SPAWN maximum 2 groups simultaneously within the DCSRTE.
+-- There will be maximum 24 groups spawned during the whole mission lifetime. 
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):InitLimit( 2, 24 )
+ +
+
+
+
+ + +SPAWN:InitRandomizeRoute(SpawnStartPoint, SpawnEndPoint, SpawnRadius, SpawnHeight) + +
+
+ +

Randomizes the defined route of the SpawnTemplatePrefix group in the ME.

+ + +

This is very useful to define extra variation of the behaviour of groups.

+ +

Parameters

+
    +
  • + +

    #number SpawnStartPoint : +is the waypoint where the randomization begins. +Note that the StartPoint = 0 equaling the point where the group is spawned.

    + +
  • +
  • + +

    #number SpawnEndPoint : +is the waypoint where the randomization ends counting backwards. +This parameter is useful to avoid randomization to end at a waypoint earlier than the last waypoint on the route.

    + +
  • +
  • + +

    #number SpawnRadius : +is the radius in meters in which the randomization of the new waypoints, with the original waypoint of the original template located in the middle ...

    + +
  • +
  • + +

    #number SpawnHeight : +(optional) Specifies the additional height in meters that can be added to the base height specified at each waypoint in the ME.

    + +
  • +
+

Return value

+ +

#SPAWN:

+ + +

Usage:

+
-- NATO helicopters engaging in the battle field. 
+-- The KA-50 has waypoints Start point ( =0 or SP ), 1, 2, 3, 4, End point (= 5 or DP). 
+-- Waypoints 2 and 3 will only be randomized. The others will remain on their original position with each new spawn of the helicopter.
+-- The randomization of waypoint 2 and 3 will take place within a radius of 2000 meters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):InitRandomizeRoute( 2, 2, 2000 )
+ +
+
+
+
+ + +SPAWN:InitRandomizeTemplate(SpawnTemplatePrefixTable) + +
+
+ +

This method is rather complicated to understand.

+ + +

But I'll try to explain. +This method becomes useful when you need to spawn groups with random templates of groups defined within the mission editor, +but they will all follow the same Template route and have the same prefix name. +In other words, this method randomizes between a defined set of groups the template to be used for each new spawn of a group.

+ +

Parameter

+
    +
  • + +

    #string SpawnTemplatePrefixTable : +A table with the names of the groups defined within the mission editor, from which one will be choosen when a new group will be spawned.

    + +
  • +
+

Return value

+ +

#SPAWN:

+ + +

Usage:

+
-- NATO Tank Platoons invading Gori.
+-- Choose between 13 different 'US Tank Platoon' configurations for each new SPAWN the Group to be spawned for the 
+-- 'US Tank Platoon Left', 'US Tank Platoon Middle' and 'US Tank Platoon Right' SpawnTemplatePrefixes.
+-- Each new SPAWN will randomize the route, with a defined time interval of 200 seconds with 40% time variation (randomization) and 
+-- with a limit set of maximum 12 Units alive simulteneously  and 150 Groups to be spawned during the whole mission.
+Spawn_US_Platoon = { 'US Tank Platoon 1', 'US Tank Platoon 2', 'US Tank Platoon 3', 'US Tank Platoon 4', 'US Tank Platoon 5', 
+                     'US Tank Platoon 6', 'US Tank Platoon 7', 'US Tank Platoon 8', 'US Tank Platoon 9', 'US Tank Platoon 10', 
+                     'US Tank Platoon 11', 'US Tank Platoon 12', 'US Tank Platoon 13' }
+Spawn_US_Platoon_Left = SPAWN:New( 'US Tank Platoon Left' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplate( Spawn_US_Platoon ):InitRandomizeRoute( 3, 3, 2000 )
+Spawn_US_Platoon_Middle = SPAWN:New( 'US Tank Platoon Middle' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplate( Spawn_US_Platoon ):InitRandomizeRoute( 3, 3, 2000 )
+Spawn_US_Platoon_Right = SPAWN:New( 'US Tank Platoon Right' ):InitLimit( 12, 150 ):Schedule( 200, 0.4 ):InitRandomizeTemplate( Spawn_US_Platoon ):InitRandomizeRoute( 3, 3, 2000 )
+ +
+
+
+
+ + +SPAWN:InitRandomizeUnits(RandomizeUnits, OuterRadius, InnerRadius) + +
+
+ +

Randomizes the UNITs that are spawned within a radius band given an Outer and Inner radius.

+ +

Parameters

+
    +
  • + +

    #boolean RandomizeUnits : +If true, SPAWN will perform the randomization of the UNITs position within the group between a given outer and inner radius.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance OuterRadius : +(optional) The outer radius in meters where the new group will be spawned.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance InnerRadius : +(optional) The inner radius in meters where the new group will NOT be spawned.

    + +
  • +
+

Return value

+ +

#SPAWN:

+ + +

Usage:

+
-- NATO helicopters engaging in the battle field. 
+-- The KA-50 has waypoints Start point ( =0 or SP ), 1, 2, 3, 4, End point (= 5 or DP). 
+-- Waypoints 2 and 3 will only be randomized. The others will remain on their original position with each new spawn of the helicopter.
+-- The randomization of waypoint 2 and 3 will take place within a radius of 2000 meters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):InitRandomizeRoute( 2, 2, 2000 )
+ +
+
+
+
+ + +SPAWN:InitRandomizeZones(SpawnZoneTable) + +
+
+ + + + +

TODO: Add example. +- This method provides the functionality to randomize the spawning of the Groups at a given list of zones of different types. + @param #SPAWN self + @param #table SpawnZoneTable A table with Zone objects. If this table is given, then each spawn will be executed within the given list of Zones objects. + @return #SPAWN + @usage + -- NATO Tank Platoons invading Gori. + -- Choose between 3 different zones for each new SPAWN the Group to be executed, regardless of the zone type.

+ +

Parameter

+
    +
  • + +

    SpawnZoneTable :

    + +
  • +
+
+
+
+
+ + +SPAWN:InitRepeat() + +
+
+ +

For planes and helicopters, when these groups go home and land on their home airbases and farps, they normally would taxi to the parking spot, shut-down their engines and wait forever until the Group is removed by the runtime environment.

+ + +

This method is used to re-spawn automatically (so no extra call is needed anymore) the same group after it has landed. +This will enable a spawned group to be re-spawned after it lands, until it is destroyed... +Note: When the group is respawned, it will re-spawn from the original airbase where it took off. +So ensure that the routes for groups that respawn, always return to the original airbase, or players may get confused ...

+ +

Return value

+ +

#SPAWN: +self

+ +

Usage:

+
-- RU Su-34 - AI Ship Attack
+-- Re-SPAWN the Group(s) after each landing and Engine Shut-Down automatically. 
+SpawnRU_SU34 = SPAWN:New( 'TF1 RU Su-34 Krymsk@AI - Attack Ships' ):Schedule( 2, 3, 1800, 0.4 ):SpawnUncontrolled():InitRandomizeRoute( 1, 1, 3000 ):RepeatOnEngineShutDown()
+ +
+
+
+
+ + +SPAWN:InitRepeatOnEngineShutDown() + +
+
+ +

Respawn after landing when its engines have shut down.

+ +

Return value

+ +

#SPAWN: +self

+ +
+
+
+
+ + +SPAWN:InitRepeatOnLanding() + +
+
+ +

Respawn group after landing.

+ +

Return value

+ +

#SPAWN: +self

+ +
+
+
+
+ + +SPAWN:InitUnControlled() + +
+
+ +

(AIR) Will spawn a plane group in uncontrolled mode...

+ + +

This will be similar to the uncontrolled flag setting in the ME.

+ +

Return value

+ +

#SPAWN: +self

+ +
+
+
+
+ + #number + +SPAWN.MaxAliveGroups + +
+
+ + + +
+
+
+
+ + #number + +SPAWN.MaxAliveUnits + +
+
+ + + +
+
+
+
+ + +SPAWN:New(SpawnTemplatePrefix) + +
+
+ +

Creates the main object to spawn a Group defined in the DCS ME.

+ +

Parameter

+
    +
  • + +

    #string SpawnTemplatePrefix : +is the name of the Group in the ME that defines the Template. Each new group will have the name starting with SpawnTemplatePrefix.

    + +
  • +
+

Return value

+ +

#SPAWN:

+ + +

Usages:

+
    +
  • -- NATO helicopters engaging in the battle field.
    +Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' )
  • +
  • local Plane = SPAWN:New( "Plane" ) -- Creates a new local variable that can initiate new planes with the name "Plane#ddd" using the template "Plane" as defined within the ME.
  • +
+ +
+
+
+
+ + +SPAWN:NewWithAlias(SpawnTemplatePrefix, SpawnAliasPrefix) + +
+
+ +

Creates a new SPAWN instance to create new groups based on the defined template and using a new alias for each new group.

+ +

Parameters

+
    +
  • + +

    #string SpawnTemplatePrefix : +is the name of the Group in the ME that defines the Template.

    + +
  • +
  • + +

    #string SpawnAliasPrefix : +is the name that will be given to the Group at runtime.

    + +
  • +
+

Return value

+ +

#SPAWN:

+ + +

Usages:

+
    +
  • -- NATO helicopters engaging in the battle field.
    +Spawn_BE_KA50 = SPAWN:NewWithAlias( 'BE KA-50@RAMP-Ground Defense', 'Helicopter Attacking a City' )
  • +
  • local PlaneWithAlias = SPAWN:NewWithAlias( "Plane", "Bomber" ) -- Creates a new local variable that can instantiate new planes with the name "Bomber#ddd" using the template "Plane" as defined within the ME.
  • +
+ +
+
+
+
+ + +SPAWN:OnSpawnGroup(SpawnCallBackFunction, SpawnFunctionArguments, ...) + +
+
+ +

Allows to place a CallFunction hook when a new group spawns.

+ + +

The provided method will be called when a new group is spawned, including its given parameters. +The first parameter of the SpawnFunction is the Wrapper.Group#GROUP that was spawned.

+ +

Parameters

+
    +
  • + +

    #function SpawnCallBackFunction : +The function to be called when a group spawns.

    + +
  • +
  • + +

    SpawnFunctionArguments : +A random amount of arguments to be provided to the function when the group spawns.

    + +
  • +
  • + +

    ... :

    + +
  • +
+

Return value

+ +

#SPAWN:

+ + +

Usage:

+
-- Declare SpawnObject and call a function when a new Group is spawned.
+local SpawnObject = SPAWN
+  :New( "SpawnObject" )
+  :InitLimit( 2, 10 )
+  :OnSpawnGroup(
+    function( SpawnGroup )
+      SpawnGroup:E( "I am spawned" )
+    end 
+    )
+  :SpawnScheduled( 300, 0.3 )
+ +
+
+
+
+ + +SPAWN:ReSpawn(SpawnIndex) + +
+
+ +

Will re-spawn a group based on a given index.

+ + +

Note: Uses DATABASE module defined in MOOSE.

+ +

Parameter

+
    +
  • + +

    #string SpawnIndex : +The index of the group to be spawned.

    + +
  • +
+

Return value

+ +

Wrapper.Group#GROUP: +The group that was spawned. You can use this group for further actions.

+ +
+
+
+
+ + #boolean + +SPAWN.Repeat + +
+
+ + + + +

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

+ +
+
+
+
+ + #boolean + +SPAWN.RepeatOnEngineShutDown + +
+
+ + + +
+
+
+
+ + #boolean + +SPAWN.RepeatOnLanding + +
+
+ + + +
+
+
+
+ + +SPAWN:Spawn() + +
+
+ +

Will spawn a group based on the internal index.

+ + +

Note: Uses DATABASE module defined in MOOSE.

+ +

Return value

+ +

Wrapper.Group#GROUP: +The group that was spawned. You can use this group for further actions.

+ +
+
+
+
+ + #string + +SPAWN.SpawnAliasPrefix + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnCleanUpInterval + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnCleanUpTimeStamps + +
+
+ + + +
+
+
+
+ + #number + +SPAWN.SpawnCount + +
+
+ + + + +

The internal counter of the amount of spawning the has happened since SpawnStart.

+ +
+
+
+
+ + +SPAWN:SpawnFromStatic(HostStatic, SpawnIndex) + +
+
+ +

Will spawn a group from a hosting static.

+ + +

This method is mostly advisable to be used if you want to simulate spawning from buldings and structures (static buildings). +You can use the returned group to further define the route to be followed.

+ +

Parameters

+
    +
  • + +

    Wrapper.Static#STATIC HostStatic : +The static dropping or unloading the group.

    + +
  • +
  • + +

    #number SpawnIndex : +(optional) The index which group to spawn within the given zone.

    + +
  • +
+

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP: +that was spawned.

    + +
  2. +
  3. + +

    #nil: +Nothing was spawned.

    + +
  4. +
+
+
+
+
+ + +SPAWN:SpawnFromUnit(HostUnit, SpawnIndex) + +
+
+ +

Will spawn a group from a hosting unit.

+ + +

This method is mostly advisable to be used if you want to simulate spawning from air units, like helicopters, which are dropping infantry into a defined Landing Zone. +Note that each point in the route assigned to the spawning group is reset to the point of the spawn. +You can use the returned group to further define the route to be followed.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT HostUnit : +The air or ground unit dropping or unloading the group.

    + +
  • +
  • + +

    #number SpawnIndex : +(optional) The index which group to spawn within the given zone.

    + +
  • +
+

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP: +that was spawned.

    + +
  2. +
  3. + +

    #nil: +Nothing was spawned.

    + +
  4. +
+
+
+
+
+ + +SPAWN:SpawnFromVec2(Vec2, SpawnIndex) + +
+
+ +

Will spawn a group from a Vec2 in 3D space.

+ + +

This method is mostly advisable to be used if you want to simulate spawning groups on the ground from air units, like vehicles. +Note that each point in the route assigned to the spawning group is reset to the point of the spawn. +You can use the returned group to further define the route to be followed.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec2 Vec2 : +The Vec2 coordinates where to spawn the group.

    + +
  • +
  • + +

    #number SpawnIndex : +(optional) The index which group to spawn within the given zone.

    + +
  • +
+

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP: +that was spawned.

    + +
  2. +
  3. + +

    #nil: +Nothing was spawned.

    + +
  4. +
+
+
+
+
+ + +SPAWN:SpawnFromVec3(Vec3, SpawnIndex) + +
+
+ +

Will spawn a group from a Vec3 in 3D space.

+ + +

This method is mostly advisable to be used if you want to simulate spawning units in the air, like helicopters or airplanes. +Note that each point in the route assigned to the spawning group is reset to the point of the spawn. +You can use the returned group to further define the route to be followed.

+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec3 Vec3 : +The Vec3 coordinates where to spawn the group.

    + +
  • +
  • + +

    #number SpawnIndex : +(optional) The index which group to spawn within the given zone.

    + +
  • +
+

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP: +that was spawned.

    + +
  2. +
  3. + +

    #nil: +Nothing was spawned.

    + +
  4. +
+
+
+
+
+ + + +SPAWN.SpawnFunctionArguments + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnFunctionHook + +
+
+ + + +
+
+
+
+ + +SPAWN:SpawnGroupName(SpawnIndex) + +
+
+ +

Will return the SpawnGroupName either with with a specific count number or without any count.

+ +

Parameter

+
    +
  • + +

    #number SpawnIndex : +Is the number of the Group that is to be spawned.

    + +
  • +
+

Return value

+ +

#string: +SpawnGroupName

+ +
+
+
+
+ + + +SPAWN.SpawnGroups + +
+
+ + + + +

Array containing the descriptions of each Group to be Spawned.

+ +
+
+
+
+ + +SPAWN:SpawnInZone(Zone, RandomizeGroup, SpawnIndex) + +
+
+ +

Will spawn a Group within a given Zone.

+ + +

The Zone can be of any type derived from Core.Zone#ZONE_BASE. +Once the Group is spawned within the zone, the Group will continue on its route. +The first waypoint (where the group is spawned) is replaced with the zone location coordinates.

+ +

Parameters

+
    +
  • + +

    Core.Zone#ZONE Zone : +The zone where the group is to be spawned.

    + +
  • +
  • + +

    #boolean RandomizeGroup : +(optional) Randomization of the Group position in the zone.

    + +
  • +
  • + +

    #number SpawnIndex : +(optional) The index which group to spawn within the given zone.

    + +
  • +
+

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP: +that was spawned.

    + +
  2. +
  3. + +

    #nil: +when nothing was spawned.

    + +
  4. +
+
+
+
+
+ + #number + +SPAWN.SpawnIndex + +
+
+ + + +
+
+
+
+ + +SPAWN.SpawnInnerRadius + +
+
+ + + +
+
+
+
+ + #boolean + +SPAWN.SpawnIsScheduled + +
+
+ + + + +

Reflects if the spawning for this SpawnTemplatePrefix is going to be scheduled or not.

+ +
+
+
+
+ + + +SPAWN.SpawnMaxGroups + +
+
+ + + + +

The maximum amount of groups that can be spawned.

+ +
+
+
+
+ + + +SPAWN.SpawnMaxUnitsAlive + +
+
+ + + + +

The maximum amount of groups that can be alive of SpawnTemplatePrefix at the same time.

+ +
+
+
+
+ + +SPAWN.SpawnOuterRadius + +
+
+ + + +
+
+
+
+ + #boolean + +SPAWN.SpawnRandomize + +
+
+ + + + +

Sets the randomization flag of new Spawned units to false.

+ +
+
+
+
+ + #boolean + +SPAWN.SpawnRandomizeRoute + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnRandomizeRouteEndPoint + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnRandomizeRouteHeight + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnRandomizeRouteRadius + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnRandomizeRouteStartPoint + +
+
+ + + +
+
+
+
+ + #boolean + +SPAWN.SpawnRandomizeTemplate + +
+
+ + + +
+
+
+
+ + +SPAWN.SpawnRandomizeUnits + +
+
+ + + +
+
+
+
+ + +SPAWN:SpawnScheduleStart() + +
+
+ +

Will re-start the spawning scheduler.

+ + +

Note: This method is only required to be called when the schedule was stopped.

+ +
+
+
+
+ + +SPAWN:SpawnScheduleStop() + +
+
+ +

Will stop the scheduled spawning scheduler.

+ +
+
+
+
+ + +SPAWN:SpawnScheduled(SpawnTime, SpawnTimeVariation) + +
+
+ +

Spawns new groups at varying time intervals.

+ + +

This is useful if you want to have continuity within your missions of certain (AI) groups to be present (alive) within your missions.

+ +

Parameters

+
    +
  • + +

    #number SpawnTime : +The time interval defined in seconds between each new spawn of new groups.

    + +
  • +
  • + +

    #number SpawnTimeVariation : +The variation to be applied on the defined time interval between each new spawn. +The variation is a number between 0 and 1, representing the %-tage of variation to be applied on the time interval.

    + +
  • +
+

Return value

+ +

#SPAWN: +self

+ +

Usage:

+
-- NATO helicopters engaging in the battle field.
+-- The time interval is set to SPAWN new helicopters between each 600 seconds, with a time variation of 50%.
+-- The time variation in this case will be between 450 seconds and 750 seconds. 
+-- This is calculated as follows: 
+--      Low limit:   600 * ( 1 - 0.5 / 2 ) = 450 
+--      High limit:  600 * ( 1 + 0.5 / 2 ) = 750
+-- Between these two values, a random amount of seconds will be choosen for each new spawn of the helicopters.
+Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
+ +
+
+
+
+ + + +SPAWN.SpawnScheduler + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnTemplate + +
+
+ + + + +

Contains the template structure for a Group Spawn from the Mission Editor. Note that this group must have lateActivation always on!!!

+ +
+
+
+
+ + #string + +SPAWN.SpawnTemplatePrefix + +
+
+ + + +
+
+
+
+ + + +SPAWN.SpawnTemplatePrefixTable + +
+
+ + + +
+
+
+
+ + #boolean + +SPAWN.SpawnUnControlled + +
+
+ + + +
+
+
+
+ + #boolean + +SPAWN.SpawnVisible + +
+
+ + + + +

When the first Spawn executes, all the Groups need to be made visible before start.

+ +
+
+
+
+ + +SPAWN:SpawnWithIndex(SpawnIndex) + +
+
+ +

Will spawn a group with a specified index number.

+ + +

Uses DATABASE global object defined in MOOSE.

+ +

Parameter

+
    +
  • + +

    #string SpawnIndex : +The index of the group to be spawned.

    + +
  • +
+

Return value

+ +

Wrapper.Group#GROUP: +The group that was spawned. You can use this group for further actions.

+ +
+
+
+
+ + #SPAWN.SpawnZoneTable + +SPAWN.SpawnZoneTable + +
+
+ + + +
+
+
+
+ + #boolean + +SPAWN.UnControlled + +
+
+ + + + +

When working in UnControlled mode, all planes are Spawned in UnControlled mode before the scheduler starts.

+ +
+
+
+
+ + +SPAWN:_GetGroupCategoryID(SpawnPrefix) + +
+
+ +

Gets the CategoryID of the Group with the given SpawnPrefix

+ +

Parameter

+
    +
  • + +

    SpawnPrefix :

    + +
  • +
+
+
+
+
+ + +SPAWN:_GetGroupCoalitionID(SpawnPrefix) + +
+
+ +

Gets the CoalitionID of the Group with the given SpawnPrefix

+ +

Parameter

+
    +
  • + +

    SpawnPrefix :

    + +
  • +
+
+
+
+
+ + +SPAWN:_GetGroupCountryID(SpawnPrefix) + +
+
+ +

Gets the CountryID of the Group with the given SpawnPrefix

+ +

Parameter

+
    +
  • + +

    SpawnPrefix :

    + +
  • +
+
+
+
+
+ + +SPAWN:_GetGroupFromDCSUnit(DCSUnit) + +
+
+ +

Return the group within the SpawnGroups collection with input a DCSUnit.

+ +

Parameter

+ +

Return values

+
    +
  1. + +

    Wrapper.Group#GROUP: +The Group

    + +
  2. +
  3. + +

    #nil: +Nothing found

    + +
  4. +
+
+
+
+
+ + +SPAWN:_GetGroupIndexFromDCSUnit(DCSUnit) + +
+
+ +

Get the group index from a DCSUnit.

+ + +

The method will search for a #-mark, and will return the index behind the #-mark of the DCSUnit. +It will return nil of no prefix was found.

+ +

Parameter

+ +

Return values

+
    +
  1. + +

    #string: +The prefix

    + +
  2. +
  3. + +

    #nil: +Nothing found

    + +
  4. +
+
+
+
+
+ + +SPAWN:_GetLastIndex() + +
+
+ +

Return the last maximum index that can be used.

+ +
+
+
+
+ + +SPAWN:_GetPrefixFromDCSUnit(DCSUnit) + +
+
+ +

Return the prefix of a SpawnUnit.

+ + +

The method will search for a #-mark, and will return the text before the #-mark. +It will return nil of no prefix was found.

+ +

Parameter

+ +

Return values

+
    +
  1. + +

    #string: +The prefix

    + +
  2. +
  3. + +

    #nil: +Nothing found

    + +
  4. +
+
+
+
+
+ + +SPAWN:_GetSpawnIndex(SpawnIndex) + +
+
+ +

Get the next index of the groups to be spawned.

+ + +

This method is complicated, as it is used at several spaces.

+ +

Parameter

+
    +
  • + +

    SpawnIndex :

    + +
  • +
+
+
+
+
+ + +SPAWN:_GetTemplate(SpawnTemplatePrefix) + +
+
+ +

Gets the Group Template from the ME environment definition.

+ + +

This method used the DATABASE object, which contains ALL initial and new spawned object in MOOSE.

+ +

Parameter

+
    +
  • + +

    #string SpawnTemplatePrefix :

    + +
  • +
+

Return value

+ + +

@SPAWN self

+ +
+
+
+
+ + +SPAWN:_InitializeSpawnGroups(SpawnIndex) + +
+
+ +

Initalize the SpawnGroups collection.

+ +

Parameter

+
    +
  • + +

    SpawnIndex :

    + +
  • +
+
+
+
+
+ + +SPAWN:_OnBirth(Event) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +SPAWN:_OnDeadOrCrash(Event) + +
+
+ + + +

Parameter

+ +
+
+
+
+ + +SPAWN:_OnEngineShutDown(event) + +
+
+ +

Will detect AIR Units shutting down their engines ...

+ + +

When the event takes place, and the method RepeatOnEngineShutDown was called, the spawned Group will Re-SPAWN. +But only when the Unit was registered to have landed.

+ +

Parameter

+
    +
  • + +

    event :

    + +
  • +
+
+
+
+
+ + +SPAWN:_OnLand(event) + +
+
+ +

Will detect AIR Units landing...

+ + +

When the event takes place, the spawned Group is registered as landed. +This is needed to ensure that Re-SPAWNing is only done for landed AIR Groups.

+ +

Parameter

+
    +
  • + +

    event :

    + +
  • +
+
+
+
+
+ + +SPAWN:_OnTakeOff(event) + +
+
+ +

Will detect AIR Units taking off...

+ + +

When the event takes place, the spawned Group is registered as airborne... +This is needed to ensure that Re-SPAWNing only is done for landed AIR Groups.

+ +

Parameter

+
    +
  • + +

    event :

    + +
  • +
+
+
+
+
+ + +SPAWN:_Prepare(SpawnTemplatePrefix, SpawnIndex) + +
+
+ +

Prepares the new Group Template.

+ +

Parameters

+
    +
  • + +

    #string SpawnTemplatePrefix :

    + +
  • +
  • + +

    #number SpawnIndex :

    + +
  • +
+

Return value

+ +

#SPAWN: +self

+ +
+
+
+
+ + +SPAWN:_RandomizeRoute(SpawnIndex) + +
+
+ +

Private method randomizing the routes.

+ +

Parameter

+
    +
  • + +

    #number SpawnIndex : +The index of the group to be spawned.

    + +
  • +
+

Return value

+ +

#SPAWN:

+ + +
+
+
+
+ + +SPAWN:_RandomizeTemplate(SpawnIndex) + +
+
+ +

Private method that randomizes the template of the group.

+ +

Parameter

+
    +
  • + +

    #number SpawnIndex :

    + +
  • +
+

Return value

+ +

#SPAWN: +self

+ +
+
+
+
+ + +SPAWN:_RandomizeZones(SpawnIndex) + +
+
+ +

Private method that randomizes the Zones where the Group will be spawned.

+ +

Parameter

+
    +
  • + +

    #number SpawnIndex :

    + +
  • +
+

Return value

+ +

#SPAWN: +self

+ +
+
+
+
+ + +SPAWN:_Scheduler() + +
+
+ +

This function is called automatically by the Spawning scheduler.

+ + +

It is the internal worker method SPAWNing new Groups on the defined time intervals.

+ +
+
+
+
+ + +SPAWN:_SpawnCleanUpScheduler() + +
+
+ +

Schedules the CleanUp of Groups

+ +

Return value

+ +

#boolean: +True = Continue Scheduler

+ +
+
+
+
+ + +SPAWN:_TranslateRotate(SpawnIndex, SpawnRootX, SpawnRootY, SpawnX, SpawnY, SpawnAngle) + +
+
+ + + +

Parameters

+
    +
  • + +

    SpawnIndex :

    + +
  • +
  • + +

    SpawnRootX :

    + +
  • +
  • + +

    SpawnRootY :

    + +
  • +
  • + +

    SpawnX :

    + +
  • +
  • + +

    SpawnY :

    + +
  • +
  • + +

    SpawnAngle :

    + +
  • +
+
+
+ +

Type SPAWN.SpawnZoneTable

+ +
+ +
+ + diff --git a/docs/Documentation/Static.html b/docs/Documentation/Static.html new file mode 100644 index 000000000..2ee619d85 --- /dev/null +++ b/docs/Documentation/Static.html @@ -0,0 +1,284 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Static

+ +

This module contains the STATIC class.

+ + + +

1) Wrapper.Static#STATIC class, extends Wrapper.Positionable#POSITIONABLE

+

Statics are Static Units defined within the Mission Editor. +Note that Statics are almost the same as Units, but they don't have a controller. +The Wrapper.Static#STATIC class is a wrapper class to handle the DCS Static objects:

+ +
    +
  • Wraps the DCS Static objects.
  • +
  • Support all DCS Static APIs.
  • +
  • Enhance with Static specific APIs not in the DCS API set.
  • +
+ +

1.1) STATIC reference methods

+

For each DCS Static will have a STATIC wrapper object (instance) within the _DATABASE object. +This is done at the beginning of the mission (when the mission starts).

+ +

The STATIC class does not contain a :New() method, rather it provides :Find() methods to retrieve the object reference +using the Static Name.

+ +

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

+ +

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

+ +
    +
  • STATIC.FindByName(): Find a STATIC instance from the _DATABASE object using a DCS Static name.
  • +
+ +

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

+ + +

Global(s)

+ + + + + +
STATIC + +
+

Type STATIC

+ + + + + + + + + + + + + + + + + + + + + +
STATIC.ClassName + +
STATIC:FindByName(StaticName) +

Finds a STATIC from the _DATABASE using the relevant Static Name.

+
STATIC:GetDCSObject() + +
STATIC:Register(StaticName) + +
STATIC.StaticName + +
+ +

Global(s)

+
+
+ + #STATIC + +STATIC + +
+
+ + + +
+
+

Type Static

+ +

Type STATIC

+ +

The STATIC class

+ +

Field(s)

+
+
+ + #string + +STATIC.ClassName + +
+
+ + + +
+
+
+
+ + +STATIC:FindByName(StaticName) + +
+
+ +

Finds a STATIC from the _DATABASE using the relevant Static Name.

+ + +

As an optional parameter, a briefing text can be given also.

+ +

Parameter

+
    +
  • + +

    #string StaticName : +Name of the DCS Static as defined within the Mission Editor.

    + +
  • +
+

Return value

+ +

#STATIC:

+ + +
+
+
+
+ + +STATIC:GetDCSObject() + +
+
+ + + +
+
+
+
+ + +STATIC:Register(StaticName) + +
+
+ + + +

Parameter

+
    +
  • + +

    StaticName :

    + +
  • +
+
+
+
+
+ + + +STATIC.StaticName + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/StaticObject.html b/docs/Documentation/StaticObject.html new file mode 100644 index 000000000..dcecd0cf0 --- /dev/null +++ b/docs/Documentation/StaticObject.html @@ -0,0 +1,263 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module StaticObject

+ + + +

Global(s)

+ + + + + +
StaticObject + +
+

Type StaticObject

+ + + + + + + + + + + + + + + + + + + + + +
StaticObject.Desc +

Descriptor of StaticObject and Unit are equal. StaticObject is just a passive variant of Unit.

+
StaticObject.ID +

Identifier of a StaticObject. It assigned to an StaticObject by the Mission Editor automatically.

+
StaticObject.getByName(name) +

Returns static object by its name.

+
StaticObject:getDesc() +

Returns descriptor of the StaticObject.

+
StaticObject:getID() +

returns identifier of the static object.

+
+ +

Global(s)

+
+
+ + #StaticObject + +StaticObject + +
+
+ + + +
+
+

Type DCSStaticObject

+ +

Type StaticObject

+ +

Represents static object added in the Mission Editor.

+ +

Field(s)

+
+
+ + #StaticObject.Desc + +StaticObject.Desc + +
+
+ +

Descriptor of StaticObject and Unit are equal. StaticObject is just a passive variant of Unit.

+ +
+
+
+
+ + #StaticObject.ID + +StaticObject.ID + +
+
+ +

Identifier of a StaticObject. It assigned to an StaticObject by the Mission Editor automatically.

+ +
+
+
+
+ + +StaticObject.getByName(name) + +
+
+ +

Returns static object by its name.

+ + +

If no static object found nil will be returned.

+ +

Parameter

+
    +
  • + +

    #string name : +Name of static object to find.

    + +
  • +
+

Return value

+ +

#StaticObject:

+ + +
+
+
+
+ + +StaticObject:getDesc() + +
+
+ +

Returns descriptor of the StaticObject.

+ +

Return value

+ +

#StaticObject.Desc:

+ + +
+
+
+
+ + +StaticObject:getID() + +
+
+ +

returns identifier of the static object.

+ +

Return value

+ +

#StaticObject.ID:

+ + +
+
+ +

Type StaticObject.Desc

+ +

StaticObject descriptor.

+ + +

Airdromes are unique and their types are unique, but helipads and ships are not always unique and may have the same type.

+ + +

Type StaticObject.ID

+ +
+ +
+ + diff --git a/docs/Documentation/Task.html b/docs/Documentation/Task.html new file mode 100644 index 000000000..030b965eb --- /dev/null +++ b/docs/Documentation/Task.html @@ -0,0 +1,2485 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Task

+ +

This module contains the TASK class.

+ + + +

1) #TASK class, extends Core.Base#BASE

+

1.1) The #TASK class implements the methods for task orchestration within MOOSE.

+

The class provides a couple of methods to:

+ + + +

1.2) Set and enquire task status (beyond the task state machine processing).

+

A task needs to implement as a minimum the following task states:

+ +
    +
  • Success: Expresses the successful execution and finalization of the task.
  • +
  • Failed: Expresses the failure of a task.
  • +
  • Planned: Expresses that the task is created, but not yet in execution and is not assigned yet.
  • +
  • Assigned: Expresses that the task is assigned to a Group of players, and that the task is in execution mode.
  • +
+ +

A task may also implement the following task states:

+ +
    +
  • Rejected: Expresses that the task is rejected by a player, who was requested to accept the task.
  • +
  • Cancelled: Expresses that the task is cancelled by HQ or through a logical situation where a cancellation of the task is required.
  • +
+ +

A task can implement more statusses than the ones outlined above. Please consult the documentation of the specific tasks to understand the different status modelled.

+ +

The status of tasks can be set by the methods State followed by the task status. An example is StateAssigned(). +The status of tasks can be enquired by the methods IsState followed by the task status name. An example is if IsStateAssigned() then.

+ +

1.3) Add scoring when reaching a certain task status:

+

Upon reaching a certain task status in a task, additional scoring can be given. If the Mission has a scoring system attached, the scores will be added to the mission scoring. +Use the method TASK.AddScore() to add scores when a status is reached.

+ +

1.4) Task briefing:

+

A task briefing can be given that is shown to the player when he is assigned to the task.

+ +
+ +

Authors: FlightControl - Design and Programming

+ + +

Global(s)

+ + + + + +
TASK + +
+

Type TASK

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TASK:Abort() +

FSM Abort synchronous event function for TASK.

+
TASK:AbortUnit(PlayerUnit) +

Abort a PlayerUnit from a Task.

+
TASK:AssignToGroup(TaskGroup) +

Assign the Taskto a Group.

+
TASK:AssignToUnit(TaskUnit) +

Assign the Task to an alive Unit.

+
TASK:Cancel() +

FSM Cancel synchronous event function for TASK.

+
TASK.ClassName + +
TASK.CommandCenter + +
TASK:CrashUnit(PlayerUnit) +

A PlayerUnit crashed in a Task.

+
TASK:Fail() +

FSM Fail synchronous event function for TASK.

+
TASK:FailProcesses(TaskUnitName) + +
TASK.FsmTemplate + +
TASK:GetGroups() +

Gets the SET_GROUP assigned to the TASK.

+
TASK:GetID() +

Gets the ID of the Task

+
TASK:GetMission() +

Gets the Mission to where the TASK belongs.

+
TASK:GetName() +

Gets the Name of the Task

+
TASK:GetProcessTemplate(ProcessName) +

Get the default or currently assigned Process template with key ProcessName.

+
TASK:GetScoring() +

Gets the Scoring of the task

+
TASK:GetStateString() +

Gets the Task status.

+
TASK:GetTaskIndex() +

Gets the Task Index, which is a combination of the Task type, the Task name.

+
TASK:GetTaskName() +

Returns the Task name.

+
TASK:GetType() +

Gets the Type of the Task

+
TASK:GetUnitProcess() +

Get the Task FSM Process Template

+
TASK:HasAliveUnits() +

Returns if the Task has still alive and assigned Units.

+
TASK:HasGroup(FindGroup) + +
TASK:HasStateMachine(TaskUnit) +

Checks if there is a FiniteStateMachine assigned to TaskUnit for Task

+
TASK:IsAssignedToGroup(TaskGroup) +

Returns if the Task is assigned to the Group.

+
TASK:IsStateAssigned() +

Is the Task status Assigned.

+
TASK:IsStateFailed() +

Is the Task status Failed.

+
TASK:IsStateHold() +

Is the Task status Hold.

+
TASK:IsStatePlanned() +

Is the Task status Planned.

+
TASK:IsStateReplanned() +

Is the Task status Replanned.

+
TASK:IsStateSuccess() +

Is the Task status Success.

+
TASK:JoinUnit(PlayerUnit) +

Add a PlayerUnit to join the Task.

+
TASK.Menu + +
TASK.MenuAssignToGroup(MenuParam) + +
TASK.MenuTaskAbort(MenuParam) + +
TASK.MenuTaskStatus(MenuParam) + +
TASK:MessageToGroups(Message) +

Send a message of the Task to the assigned Groups.

+
TASK.Mission + +
TASK:New(Mission, SetGroupAssign, TaskName, TaskType) +

Instantiates a new TASK.

+
TASK:OnAfterPlayerAborted(PlayerUnit, PlayerName) +

FSM PlayerAborted event handler prototype for TASK.

+
TASK:OnAfterPlayerCrashed(PlayerUnit, PlayerName) +

FSM PlayerCrashed event handler prototype for TASK.

+
TASK:OnAfterPlayerDead(PlayerUnit, PlayerName) +

FSM PlayerDead event handler prototype for TASK.

+
TASK.Players + +
TASK.ProcessClasses + +
TASK.Processes + +
TASK:RemoveMenu() +

Remove the menu options of the Task to all the groups in the SetGroup.

+
TASK:RemoveMenuForGroup(TaskGroup) +

Remove the menu option of the Task for a Group.

+
TASK:RemoveStateMachine(TaskUnit) +

Remove FiniteStateMachines from Task with key TaskUnit

+
TASK:Replan() +

FSM Replan synchronous event function for TASK.

+
TASK:ReportDetails() +

Create a detailed report of the Task.

+
TASK:ReportSummary() +

Create a summary report of the Task.

+
TASK.Scores + +
TASK:SendBriefingToAssignedGroups() +

Send the briefng message of the Task to the assigned Groups.

+
TASK:SetAssignedMenuForGroup(TaskGroup) +

Set the assigned menu options of the Task.

+
TASK:SetBriefing(TaskBriefing) +

Sets a Task briefing.

+
TASK.SetGroup +

The Set of Groups assigned to the Task

+
TASK:SetID(TaskID) +

Sets the ID of the Task

+
TASK:SetMenu() +

Set the menu options of the Task to all the groups in the SetGroup.

+
TASK:SetMenuForGroup(TaskGroup) +

Set the Menu for a Group

+
TASK:SetName(TaskName) +

Sets the Name of the Task

+
TASK:SetPlannedMenuForGroup(TaskGroup, MenuText) +

Set the planned menu option of the Task.

+
TASK:SetStateMachine(TaskUnit, Fsm) +

Add a FiniteStateMachine to Task with key TaskUnit

+
TASK:SetType(TaskType) +

Sets the Type of the Task

+
TASK:SetUnitProcess(Core, FsmTemplate) +

Sets the Task FSM Process Template

+
TASK:StateAssigned() +

Sets a Task to status Assigned.

+
TASK:StateFailed() +

Sets a Task to status Failed.

+
TASK:StateHold() +

Sets a Task to status Hold.

+
TASK:StatePlanned() +

Sets a Task to status Planned.

+
TASK:StateReplanned() +

Sets a Task to status Replanned.

+
TASK:StateSuccess() +

Sets a Task to status Success.

+
TASK:Success() +

FSM Success synchronous event function for TASK.

+
TASK.TaskBriefing + +
TASK.TaskID + +
TASK.TaskName + +
TASK.TaskScheduler + +
TASK.TaskType + +
TASK:UnAssignFromGroups() +

Assign the Task from the Groups.

+
TASK:UnAssignFromUnit(TaskUnit) +

UnAssign the Task from an alive Unit.

+
TASK:__Abort() +

FSM Abort asynchronous event function for TASK.

+
TASK:__Cancel() +

FSM Cancel asynchronous event function for TASK.

+
TASK:__Fail() +

FSM Fail asynchronous event function for TASK.

+
TASK:__Replan() +

FSM Replan asynchronous event function for TASK.

+
TASK:__Success() +

FSM Success asynchronous event function for TASK.

+
TASK:onenterAborted(Event, From, To) +

FSM function for a TASK

+
TASK:onenterAssigned(Event, From, To) +

FSM function for a TASK

+
TASK:onenterFailed(Event, From, To) +

FSM function for a TASK

+
TASK:onenterSuccess(Event, From, To) +

FSM function for a TASK

+
TASK:onstatechange(Event, From, To) +

FSM function for a TASK

+
+ +

Global(s)

+
+
+ + #TASK + +TASK + +
+
+ + + +
+
+

Type Task

+ +

Type TASK

+ +

The TASK class

+ +

Field(s)

+
+
+ + +TASK:Abort() + +
+
+ +

FSM Abort synchronous event function for TASK.

+ + +

Use this event to Abort the Task.

+ +
+
+
+
+ + +TASK:AbortUnit(PlayerUnit) + +
+
+ +

Abort a PlayerUnit from a Task.

+ + +

If the Unit was not part of the Task, false is returned. +If the Unit is part of the Task, true is returned.

+ +

Parameter

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The CLIENT or UNIT of the Player aborting the Task.

    + +
  • +
+

Return value

+ +

#boolean: +true if Unit is part of the Task.

+ +
+
+
+
+ + +TASK:AssignToGroup(TaskGroup) + +
+
+ +

Assign the Taskto a Group.

+ +

Parameter

+ +

Return value

+ +

#TASK:

+ + +
+
+
+
+ + +TASK:AssignToUnit(TaskUnit) + +
+
+ +

Assign the Task to an alive Unit.

+ +

Parameter

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:Cancel() + +
+
+ +

FSM Cancel synchronous event function for TASK.

+ + +

Use this event to Cancel the Task.

+ +
+
+
+
+ + #string + +TASK.ClassName + +
+
+ + + +
+
+
+
+ + Tasking.CommandCenter#COMMANDCENTER + +TASK.CommandCenter + +
+
+ + + +
+
+
+
+ + +TASK:CrashUnit(PlayerUnit) + +
+
+ +

A PlayerUnit crashed in a Task.

+ + +

Abort the Player. +If the Unit was not part of the Task, false is returned. +If the Unit is part of the Task, true is returned.

+ +

Parameter

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The CLIENT or UNIT of the Player aborting the Task.

    + +
  • +
+

Return value

+ +

#boolean: +true if Unit is part of the Task.

+ +
+
+
+
+ + +TASK:Fail() + +
+
+ +

FSM Fail synchronous event function for TASK.

+ + +

Use this event to Fail the Task.

+ +
+
+
+
+ + +TASK:FailProcesses(TaskUnitName) + +
+
+ + + + +

TODO: Obscolete? +- Fail processes from Task with key Unit + @param #TASK self + @param #string TaskUnitName + @return #TASK self

+ +

Parameter

+
    +
  • + +

    TaskUnitName :

    + +
  • +
+
+
+
+
+ + Core.Fsm#FSM_PROCESS + +TASK.FsmTemplate + +
+
+ + + +
+
+
+
+ + +TASK:GetGroups() + +
+
+ +

Gets the SET_GROUP assigned to the TASK.

+ +

Return value

+ +

Core.Set#SET_GROUP:

+ + +
+
+
+
+ + +TASK:GetID() + +
+
+ +

Gets the ID of the Task

+ +

Return value

+ +

#string: +TaskID

+ +
+
+
+
+ + +TASK:GetMission() + +
+
+ +

Gets the Mission to where the TASK belongs.

+ +

Return value

+ +

Tasking.Mission#MISSION:

+ + +
+
+
+
+ + +TASK:GetName() + +
+
+ +

Gets the Name of the Task

+ +

Return value

+ +

#string: +The Task Name

+ +
+
+
+
+ + +TASK:GetProcessTemplate(ProcessName) + +
+
+ +

Get the default or currently assigned Process template with key ProcessName.

+ +

Parameter

+
    +
  • + +

    #string ProcessName :

    + +
  • +
+

Return value

+ +

Core.Fsm#FSM_PROCESS:

+ + +
+
+
+
+ + +TASK:GetScoring() + +
+
+ +

Gets the Scoring of the task

+ +

Return value

+ +

Functional.Scoring#SCORING: +Scoring

+ +
+
+
+
+ + +TASK:GetStateString() + +
+
+ +

Gets the Task status.

+ +
+
+
+
+ + +TASK:GetTaskIndex() + +
+
+ +

Gets the Task Index, which is a combination of the Task type, the Task name.

+ +

Return value

+ +

#string: +The Task ID

+ +
+
+
+
+ + +TASK:GetTaskName() + +
+
+ +

Returns the Task name.

+ +

Return value

+ +

#string: +TaskName

+ +
+
+
+
+ + +TASK:GetType() + +
+
+ +

Gets the Type of the Task

+ +

Return value

+ +

#string: +TaskType

+ +
+
+
+
+ + +TASK:GetUnitProcess() + +
+
+ +

Get the Task FSM Process Template

+ +

Return value

+ +

Core.Fsm#FSM_PROCESS:

+ + +
+
+
+
+ + +TASK:HasAliveUnits() + +
+
+ +

Returns if the Task has still alive and assigned Units.

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +TASK:HasGroup(FindGroup) + +
+
+ + + +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +TASK:HasStateMachine(TaskUnit) + +
+
+ +

Checks if there is a FiniteStateMachine assigned to TaskUnit for Task

+ +

Parameter

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:IsAssignedToGroup(TaskGroup) + +
+
+ +

Returns if the Task is assigned to the Group.

+ +

Parameter

+ +

Return value

+ +

#boolean:

+ + +
+
+
+
+ + +TASK:IsStateAssigned() + +
+
+ +

Is the Task status Assigned.

+ +
+
+
+
+ + +TASK:IsStateFailed() + +
+
+ +

Is the Task status Failed.

+ +
+
+
+
+ + +TASK:IsStateHold() + +
+
+ +

Is the Task status Hold.

+ +
+
+
+
+ + +TASK:IsStatePlanned() + +
+
+ +

Is the Task status Planned.

+ +
+
+
+
+ + +TASK:IsStateReplanned() + +
+
+ +

Is the Task status Replanned.

+ +
+
+
+
+ + +TASK:IsStateSuccess() + +
+
+ +

Is the Task status Success.

+ +
+
+
+
+ + +TASK:JoinUnit(PlayerUnit) + +
+
+ +

Add a PlayerUnit to join the Task.

+ + +

For each Group within the Task, the Unit is check if it can join the Task. +If the Unit was not part of the Task, false is returned. +If the Unit is part of the Task, true is returned.

+ +

Parameter

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The CLIENT or UNIT of the Player joining the Mission.

    + +
  • +
+

Return value

+ +

#boolean: +true if Unit is part of the Task.

+ +
+
+
+
+ + + +TASK.Menu + +
+
+ + + +
+
+
+
+ + +TASK.MenuAssignToGroup(MenuParam) + +
+
+ + + +

Parameter

+
    +
  • + +

    MenuParam :

    + +
  • +
+
+
+
+
+ + +TASK.MenuTaskAbort(MenuParam) + +
+
+ + + +

Parameter

+
    +
  • + +

    MenuParam :

    + +
  • +
+
+
+
+
+ + +TASK.MenuTaskStatus(MenuParam) + +
+
+ + + +

Parameter

+
    +
  • + +

    MenuParam :

    + +
  • +
+
+
+
+
+ + +TASK:MessageToGroups(Message) + +
+
+ +

Send a message of the Task to the assigned Groups.

+ +

Parameter

+
    +
  • + +

    Message :

    + +
  • +
+
+
+
+
+ + Tasking.Mission#MISSION + +TASK.Mission + +
+
+ + + +
+
+
+
+ + +TASK:New(Mission, SetGroupAssign, TaskName, TaskType) + +
+
+ +

Instantiates a new TASK.

+ + +

Should never be used. Interface Class.

+ +

Parameters

+
    +
  • + +

    Tasking.Mission#MISSION Mission : +The mission wherein the Task is registered.

    + +
  • +
  • + +

    Core.Set#SET_GROUP SetGroupAssign : +The set of groups for which the Task can be assigned.

    + +
  • +
  • + +

    #string TaskName : +The name of the Task

    + +
  • +
  • + +

    #string TaskType : +The type of the Task

    + +
  • +
+

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:OnAfterPlayerAborted(PlayerUnit, PlayerName) + +
+
+ +

FSM PlayerAborted event handler prototype for TASK.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The Unit of the Player when he went back to spectators or left the mission.

    + +
  • +
  • + +

    #string PlayerName : +The name of the Player.

    + +
  • +
+
+
+
+
+ + +TASK:OnAfterPlayerCrashed(PlayerUnit, PlayerName) + +
+
+ +

FSM PlayerCrashed event handler prototype for TASK.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The Unit of the Player when he crashed in the mission.

    + +
  • +
  • + +

    #string PlayerName : +The name of the Player.

    + +
  • +
+
+
+
+
+ + +TASK:OnAfterPlayerDead(PlayerUnit, PlayerName) + +
+
+ +

FSM PlayerDead event handler prototype for TASK.

+ +

Parameters

+
    +
  • + +

    Wrapper.Unit#UNIT PlayerUnit : +The Unit of the Player when he died in the mission.

    + +
  • +
  • + +

    #string PlayerName : +The name of the Player.

    + +
  • +
+
+
+
+
+ + +TASK.Players + +
+
+ + + +
+
+
+
+ + + +TASK.ProcessClasses + +
+
+ + + +
+
+
+
+ + + +TASK.Processes + +
+
+ + + +
+
+
+
+ + +TASK:RemoveMenu() + +
+
+ +

Remove the menu options of the Task to all the groups in the SetGroup.

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:RemoveMenuForGroup(TaskGroup) + +
+
+ +

Remove the menu option of the Task for a Group.

+ +

Parameter

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:RemoveStateMachine(TaskUnit) + +
+
+ +

Remove FiniteStateMachines from Task with key TaskUnit

+ +

Parameter

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:Replan() + +
+
+ +

FSM Replan synchronous event function for TASK.

+ + +

Use this event to Replan the Task.

+ +
+
+
+
+ + +TASK:ReportDetails() + +
+
+ +

Create a detailed report of the Task.

+ + +

List the Task Status, and the Players assigned to the Task.

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + +TASK:ReportSummary() + +
+
+ +

Create a summary report of the Task.

+ + +

List the Task Name and Status

+ +

Return value

+ +

#string:

+ + +
+
+
+
+ + + +TASK.Scores + +
+
+ + + +
+
+
+
+ + +TASK:SendBriefingToAssignedGroups() + +
+
+ +

Send the briefng message of the Task to the assigned Groups.

+ +
+
+
+
+ + +TASK:SetAssignedMenuForGroup(TaskGroup) + +
+
+ +

Set the assigned menu options of the Task.

+ +

Parameter

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:SetBriefing(TaskBriefing) + +
+
+ +

Sets a Task briefing.

+ +

Parameter

+
    +
  • + +

    #string TaskBriefing :

    + +
  • +
+

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + Core.Set#SET_GROUP + +TASK.SetGroup + +
+
+ +

The Set of Groups assigned to the Task

+ +
+
+
+
+ + +TASK:SetID(TaskID) + +
+
+ +

Sets the ID of the Task

+ +

Parameter

+
    +
  • + +

    #string TaskID :

    + +
  • +
+
+
+
+
+ + +TASK:SetMenu() + +
+
+ +

Set the menu options of the Task to all the groups in the SetGroup.

+ +
+
+
+
+ + +TASK:SetMenuForGroup(TaskGroup) + +
+
+ +

Set the Menu for a Group

+ +

Parameter

+
    +
  • + +

    TaskGroup :

    + +
  • +
+
+
+
+
+ + +TASK:SetName(TaskName) + +
+
+ +

Sets the Name of the Task

+ +

Parameter

+
    +
  • + +

    #string TaskName :

    + +
  • +
+
+
+
+
+ + +TASK:SetPlannedMenuForGroup(TaskGroup, MenuText) + +
+
+ +

Set the planned menu option of the Task.

+ +

Parameters

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:SetStateMachine(TaskUnit, Fsm) + +
+
+ +

Add a FiniteStateMachine to Task with key TaskUnit

+ +

Parameters

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:SetType(TaskType) + +
+
+ +

Sets the Type of the Task

+ +

Parameter

+
    +
  • + +

    #string TaskType :

    + +
  • +
+
+
+
+
+ + +TASK:SetUnitProcess(Core, FsmTemplate) + +
+
+ +

Sets the Task FSM Process Template

+ +

Parameters

+
    +
  • + +

    Core : +Fsm#FSM_PROCESS

    + +
  • +
  • + +

    FsmTemplate :

    + +
  • +
+
+
+
+
+ + +TASK:StateAssigned() + +
+
+ +

Sets a Task to status Assigned.

+ +
+
+
+
+ + +TASK:StateFailed() + +
+
+ +

Sets a Task to status Failed.

+ +
+
+
+
+ + +TASK:StateHold() + +
+
+ +

Sets a Task to status Hold.

+ +
+
+
+
+ + +TASK:StatePlanned() + +
+
+ +

Sets a Task to status Planned.

+ +
+
+
+
+ + +TASK:StateReplanned() + +
+
+ +

Sets a Task to status Replanned.

+ +
+
+
+
+ + +TASK:StateSuccess() + +
+
+ +

Sets a Task to status Success.

+ +
+
+
+
+ + +TASK:Success() + +
+
+ +

FSM Success synchronous event function for TASK.

+ + +

Use this event to make the Task a Success.

+ +
+
+
+
+ + + +TASK.TaskBriefing + +
+
+ + + +
+
+
+
+ + + +TASK.TaskID + +
+
+ + + +
+
+
+
+ + + +TASK.TaskName + +
+
+ + + +
+
+
+
+ + Core.Scheduler#SCHEDULER + +TASK.TaskScheduler + +
+
+ + + +
+
+
+
+ + + +TASK.TaskType + +
+
+ + + +
+
+
+
+ + +TASK:UnAssignFromGroups() + +
+
+ +

Assign the Task from the Groups.

+ +
+
+
+
+ + +TASK:UnAssignFromUnit(TaskUnit) + +
+
+ +

UnAssign the Task from an alive Unit.

+ +

Parameter

+ +

Return value

+ +

#TASK: +self

+ +
+
+
+
+ + +TASK:__Abort() + +
+
+ +

FSM Abort asynchronous event function for TASK.

+ + +

Use this event to Abort the Task.

+ +
+
+
+
+ + +TASK:__Cancel() + +
+
+ +

FSM Cancel asynchronous event function for TASK.

+ + +

Use this event to Cancel the Task.

+ +
+
+
+
+ + +TASK:__Fail() + +
+
+ +

FSM Fail asynchronous event function for TASK.

+ + +

Use this event to Fail the Task.

+ +
+
+
+
+ + +TASK:__Replan() + +
+
+ +

FSM Replan asynchronous event function for TASK.

+ + +

Use this event to Replan the Task.

+ +
+
+
+
+ + +TASK:__Success() + +
+
+ +

FSM Success asynchronous event function for TASK.

+ + +

Use this event to make the Task a Success.

+ +
+
+
+
+ + +TASK:onenterAborted(Event, From, To) + +
+
+ +

FSM function for a TASK

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +TASK:onenterAssigned(Event, From, To) + +
+
+ +

FSM function for a TASK

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +TASK:onenterFailed(Event, From, To) + +
+
+ +

FSM function for a TASK

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +TASK:onenterSuccess(Event, From, To) + +
+
+ +

FSM function for a TASK

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+
+
+ + +TASK:onstatechange(Event, From, To) + +
+
+ +

FSM function for a TASK

+ +

Parameters

+
    +
  • + +

    #string Event :

    + +
  • +
  • + +

    #string From :

    + +
  • +
  • + +

    #string To :

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/Task_A2G.html b/docs/Documentation/Task_A2G.html new file mode 100644 index 000000000..307c0556c --- /dev/null +++ b/docs/Documentation/Task_A2G.html @@ -0,0 +1,258 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Task_A2G

+ +

(AI) (SP) (MP) Tasking for Air to Ground Processes.

+ + + +

1) #TASK_A2G class, extends Tasking.Task#TASK

+

The #TASK_A2G class defines a CAS or BAI task of a Set of Target Units, +located at a Target Zone, based on the tasking capabilities defined in Tasking.Task#TASK. +The TASK_A2G is implemented using a Statemachine#FSM_TASK, and has the following statuses:

+ +
    +
  • None: Start of the process
  • +
  • Planned: The SEAD task is planned. Upon Planned, the sub-process ProcessFsm.Assign#ACTASSIGN_ACCEPT is started to accept the task.
  • +
  • Assigned: The SEAD task is assigned to a Wrapper.Group#GROUP. Upon Assigned, the sub-process ProcessFsm.Route#ACTROUTE is started to route the active Units in the Group to the attack zone.
  • +
  • Success: The SEAD task is successfully completed. Upon Success, the sub-process ProcessSEAD#PROCESSSEAD is started to follow-up successful SEADing of the targets assigned in the task.
  • +
  • Failed: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
  • +
+ +
+ +

Authors: FlightControl - Design and Programming

+ + +

Global(s)

+ + + + + +
TASK_A2G + +
+

Type TASK_A2G

+ + + + + + + + + + + + + +
TASK_A2G.ClassName + +
TASK_A2G:GetPlannedMenuText() + +
TASK_A2G:New(Mission, SetGroup, TaskName, TaskType, UnitSetTargets, TargetZone, TargetSetUnit, FACUnit) +

Instantiates a new TASK_A2G.

+
+ +

Global(s)

+
+
+ + #TASK_A2G + +TASK_A2G + +
+
+ + + +
+
+

Type Task_A2G

+ +

Type TASK_A2G

+ +

The TASK_A2G class

+ +

Field(s)

+
+
+ + #string + +TASK_A2G.ClassName + +
+
+ + + +
+
+
+
+ + +TASK_A2G:GetPlannedMenuText() + +
+
+ + + +
+
+
+
+ + +TASK_A2G:New(Mission, SetGroup, TaskName, TaskType, UnitSetTargets, TargetZone, TargetSetUnit, FACUnit) + +
+
+ +

Instantiates a new TASK_A2G.

+ +

Parameters

+
    +
  • + +

    Tasking.Mission#MISSION Mission :

    + +
  • +
  • + +

    Set#SET_GROUP SetGroup : +The set of groups for which the Task can be assigned.

    + +
  • +
  • + +

    #string TaskName : +The name of the Task.

    + +
  • +
  • + +

    #string TaskType : +BAI or CAS

    + +
  • +
  • + +

    Set#SET_UNIT UnitSetTargets :

    + +
  • +
  • + +

    Core.Zone#ZONE_BASE TargetZone :

    + +
  • +
  • + +

    TargetSetUnit :

    + +
  • +
  • + +

    FACUnit :

    + +
  • +
+

Return value

+ +

#TASK_A2G: +self

+ +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Task_PICKUP.html b/docs/Documentation/Task_PICKUP.html new file mode 100644 index 000000000..2aa2277c8 --- /dev/null +++ b/docs/Documentation/Task_PICKUP.html @@ -0,0 +1,409 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Task_PICKUP

+ +

This module contains the TASK_PICKUP classes.

+ + + +

1) #TASK_PICKUP class, extends Tasking.Task#TASK

+

The #TASK_PICKUP class defines a pickup task of a Set of CARGO objects defined within the mission. +based on the tasking capabilities defined in Tasking.Task#TASK. +The TASK_PICKUP is implemented using a Statemachine#FSM_TASK, and has the following statuses:

+ +
    +
  • None: Start of the process
  • +
  • Planned: The SEAD task is planned. Upon Planned, the sub-process ProcessFsm.Assign#ACTASSIGN_ACCEPT is started to accept the task.
  • +
  • Assigned: The SEAD task is assigned to a Wrapper.Group#GROUP. Upon Assigned, the sub-process ProcessFsm.Route#ACTROUTE is started to route the active Units in the Group to the attack zone.
  • +
  • Success: The SEAD task is successfully completed. Upon Success, the sub-process ProcessSEAD#PROCESSSEAD is started to follow-up successful SEADing of the targets assigned in the task.
  • +
  • Failed: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
  • +
+ +
+ +

Authors: FlightControl - Design and Programming

+ + +

Global(s)

+ + + + + +
TASK_PICKUP + +
+

Type TASK_PICKUP

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TASK_PICKUP:AssignToUnit(TaskUnit) +

Assign the Task to a Unit.

+
TASK_PICKUP.ClassName + +
TASK_PICKUP:CleanUp() +

Removes a TASK_PICKUP.

+
TASK_PICKUP:GetPlannedMenuText() + +
TASK_PICKUP:New(Mission, AssignedSetGroup, TaskName, TaskType, UnitSetTargets, TargetZone) +

Instantiates a new TASK_PICKUP.

+
TASK_PICKUP:OnNext(Fsm, Event, From, To, Event) +

StateMachine callback function for a TASK

+
TASK_PICKUP.TaskScheduler + +
TASK_PICKUP:_Schedule() + +
TASK_PICKUP:_Scheduler() + +
+ +

Global(s)

+
+
+ + #TASK_PICKUP + +TASK_PICKUP + +
+
+ + + +
+
+

Type Task_PICKUP

+ +

Type TASK_PICKUP

+ +

The TASK_PICKUP class

+ +

Field(s)

+
+
+ + +TASK_PICKUP:AssignToUnit(TaskUnit) + +
+
+ +

Assign the Task to a Unit.

+ +

Parameter

+ +

Return value

+ +

#TASK_PICKUP: +self

+ +
+
+
+
+ + #string + +TASK_PICKUP.ClassName + +
+
+ + + +
+
+
+
+ + +TASK_PICKUP:CleanUp() + +
+
+ +

Removes a TASK_PICKUP.

+ +

Return value

+ +

#nil:

+ + +
+
+
+
+ + +TASK_PICKUP:GetPlannedMenuText() + +
+
+ + + +
+
+
+
+ + +TASK_PICKUP:New(Mission, AssignedSetGroup, TaskName, TaskType, UnitSetTargets, TargetZone) + +
+
+ +

Instantiates a new TASK_PICKUP.

+ +

Parameters

+ +

Return value

+ +

#TASK_PICKUP: +self

+ +
+
+
+
+ + +TASK_PICKUP:OnNext(Fsm, Event, From, To, Event) + +
+
+ +

StateMachine callback function for a TASK

+ +

Parameters

+ +
+
+
+
+ + + +TASK_PICKUP.TaskScheduler + +
+
+ + + +
+
+
+
+ + +TASK_PICKUP:_Schedule() + +
+
+ + + +
+
+
+
+ + +TASK_PICKUP:_Scheduler() + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Task_SEAD.html b/docs/Documentation/Task_SEAD.html new file mode 100644 index 000000000..df536f1da --- /dev/null +++ b/docs/Documentation/Task_SEAD.html @@ -0,0 +1,267 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Task_SEAD

+ +

This module contains the TASK_SEAD classes.

+ + + +

1) #TASK_SEAD class, extends Tasking.Task#TASK

+

The #TASK_SEAD class defines a SEAD task for a Set of Target Units, located at a Target Zone, +based on the tasking capabilities defined in Tasking.Task#TASK. +The TASK_SEAD is implemented using a Statemachine#FSM_TASK, and has the following statuses:

+ +
    +
  • None: Start of the process
  • +
  • Planned: The SEAD task is planned. Upon Planned, the sub-process ProcessFsm.Assign#ACTASSIGN_ACCEPT is started to accept the task.
  • +
  • Assigned: The SEAD task is assigned to a Wrapper.Group#GROUP. Upon Assigned, the sub-process ProcessFsm.Route#ACTROUTE is started to route the active Units in the Group to the attack zone.
  • +
  • Success: The SEAD task is successfully completed. Upon Success, the sub-process ProcessSEAD#PROCESSSEAD is started to follow-up successful SEADing of the targets assigned in the task.
  • +
  • Failed: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
  • +
+ +
+ +

Authors: FlightControl - Design and Programming

+ + +

Global(s)

+ + + + + +
TASK_SEAD + +
+

Type TASK_SEAD

+ + + + + + + + + + + + + + + + + +
TASK_SEAD.ClassName + +
TASK_SEAD:GetPlannedMenuText() + +
TASK_SEAD:New(Mission, SetGroup, TaskName, UnitSetTargets, TargetZone, TargetSetUnit) +

Instantiates a new TASK_SEAD.

+
TASK_SEAD.TargetSetUnit + +
+ +

Global(s)

+
+
+ + #TASK_SEAD + +TASK_SEAD + +
+
+ + + +
+
+

Type Task_SEAD

+ +

Type TASK_SEAD

+ +

The TASK_SEAD class

+ +

Field(s)

+
+
+ + #string + +TASK_SEAD.ClassName + +
+
+ + + +
+
+
+
+ + +TASK_SEAD:GetPlannedMenuText() + +
+
+ + + +
+
+
+
+ + +TASK_SEAD:New(Mission, SetGroup, TaskName, UnitSetTargets, TargetZone, TargetSetUnit) + +
+
+ +

Instantiates a new TASK_SEAD.

+ +

Parameters

+ +

Return value

+ +

#TASK_SEAD: +self

+ +
+
+
+
+ + Set#SET_UNIT + +TASK_SEAD.TargetSetUnit + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Unit.html b/docs/Documentation/Unit.html new file mode 100644 index 000000000..792f9b166 --- /dev/null +++ b/docs/Documentation/Unit.html @@ -0,0 +1,1528 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Unit

+ +

This module contains the UNIT class.

+ + + +

1) #UNIT class, extends Wrapper.Controllable#CONTROLLABLE

+

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 DCS Unit.
  • +
+ + +

1.1) 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 name.
  • +
+ +

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

+ +

1.2) DCS UNIT APIs

+

The DCS Unit APIs are used extensively within MOOSE. The UNIT class has for each DCS Unit API a corresponding method. +To be able to distinguish easily in your code the difference between a UNIT API call and a DCS Unit API call, +the first letter of the method is also capitalized. So, by example, the DCS Unit method Dcs.DCSWrapper.Unit#Unit.getName() +is implemented in the UNIT class as UNIT.GetName().

+ +

1.3) Smoke, Flare Units

+

The UNIT class provides methods to smoke or flare units easily. +The UNIT.SmokeBlue(), UNIT.SmokeGreen(),UNIT.SmokeOrange(), UNIT.SmokeRed(), UNIT.SmokeRed() methods +will smoke the unit in the corresponding color. Note that smoking a unit is done at the current position of the DCS Unit. +When the DCS Unit moves for whatever reason, the smoking will still continue! +The UNIT.FlareGreen(), UNIT.FlareRed(), UNIT.FlareWhite(), UNIT.FlareYellow() +methods will fire off a flare in the air with the corresponding color. Note that a flare is a one-off shot and its effect is of very short duration.

+ +

1.4) Location Position, Point

+

The UNIT class provides methods to obtain the current point or position of the DCS Unit. +The UNIT.GetPointVec2(), UNIT.GetVec3() will obtain the current location of the DCS Unit in a Vec2 (2D) or a point in a Vec3 (3D) vector respectively. +If you want to obtain the complete 3D position including ori�ntation and direction vectors, consult the UNIT.GetPositionVec3() method respectively.

+ +

1.5) Test if alive

+

The UNIT.IsAlive(), UNIT.IsActive() methods determines if the DCS Unit is alive, meaning, it is existing and active.

+ +

1.6) Test for proximity

+

The UNIT class contains methods to test the location or proximity against zones or other objects.

+ +

1.6.1) Zones

+

To test whether the Unit is within a zone, use the UNIT.IsInZone() or the UNIT.IsNotInZone() methods. Any zone can be tested on, but the zone must be derived from Core.Zone#ZONE_BASE.

+ +

1.6.2) Units

+

Test if another DCS Unit is within a given radius of the current DCS Unit, use the UNIT.OtherUnitInRadius() method.

+ + +

Global(s)

+ + + + + + + + + +
UNIT + +
i + +
+

Type UNIT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
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:Flare(FlareColor) +

Signal a flare at the position of the UNIT.

+
UNIT:FlareGreen() +

Signal a green flare at the position of the UNIT.

+
UNIT:FlareRed() +

Signal a red flare at the position of the UNIT.

+
UNIT:FlareWhite() +

Signal a white flare at the position of the UNIT.

+
UNIT:FlareYellow() +

Signal a yellow flare at the position of the UNIT.

+
UNIT:GetAmmo() +

Returns the Unit's ammunition.

+
UNIT:GetCallsign() +

Returns the Unit's callsign - the localized string.

+
UNIT:GetDCSObject() + +
UNIT:GetFuel() +

Returns relative amount of fuel (from 0.0 to 1.0) the unit has in its internal tanks.

+
UNIT:GetGroup() +

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

+
UNIT:GetLife() +

Returns the unit's health.

+
UNIT:GetLife0() +

Returns the Unit's initial health.

+
UNIT:GetNumber() +

Returns the unit's number in the group.

+
UNIT:GetPlayerName() +

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

+
UNIT:GetPrefix() +

Returns the prefix name of the DCS Unit.

+
UNIT:GetRadar() +

Returns two values:

+ +
    +
  • First value indicates if at least one of the unit's radar(s) is on.
  • +
+
UNIT:GetSensors() +

Returns the unit sensors.

+
UNIT:GetThreatLevel() +

Returns the Unit's A2G threat level on a scale from 1 to 10 ...

+
UNIT:HasSEAD() +

Returns if the unit is SEADable.

+
UNIT:HasSensors(...) +

Returns if the unit has sensors of a certain type.

+
UNIT:IsActive() +

Returns if the unit is activated.

+
UNIT:IsAir() +

Returns if the unit is of an air category.

+
UNIT:IsFriendly(FriendlyCoalition) +

Returns if the unit is a friendly unit.

+
UNIT:IsGround() +

Returns if the unit is of an ground category.

+
UNIT:IsInZone(Zone) +

Returns true if the unit is within a Zone.

+
UNIT:IsNotInZone(Zone) +

Returns true if the unit is not within a Zone.

+
UNIT:IsShip() +

Returns if the unit is of a ship category.

+
UNIT:Name() +

Return the name of the UNIT.

+
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:ReSpawn(SpawnVec3, Heading) +

Respawn the Unit using a (tweaked) template of the parent Group.

+
UNIT:Register(UnitName) +

Create a new UNIT from DCSUnit.

+
UNIT:Smoke(SmokeColor, Range) +

Smoke the UNIT.

+
UNIT:SmokeBlue() +

Smoke the UNIT Blue.

+
UNIT:SmokeGreen() +

Smoke the UNIT Green.

+
UNIT:SmokeOrange() +

Smoke the UNIT Orange.

+
UNIT:SmokeRed() +

Smoke the UNIT Red.

+
UNIT:SmokeWhite() +

Smoke the UNIT White.

+
+ +

Type Unit.SensorType

+ + + + + + + + + + + + + + + + + +
Unit.SensorType.IRST + +
Unit.SensorType.OPTIC + +
Unit.SensorType.RADAR + +
Unit.SensorType.RWR + +
+ +

Global(s)

+
+
+ + #UNIT + +UNIT + +
+
+ + + +
+
+
+
+ + #number + +i + +
+
+ + + + +

Remove obscolete units from the group structure

+ +
+
+

Type Unit

+ +

Type UNIT

+ +

The UNIT class

+ +

Field(s)

+
+
+ + #string + +UNIT.ClassName + +
+
+ + + +
+
+
+
+ + +UNIT:Find(DCSUnit) + +
+
+ +

Finds a UNIT from the _DATABASE using a DCSUnit object.

+ +

Parameter

+ +

Return value

+ +

#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: +self

+ +
+
+
+
+ + +UNIT:Flare(FlareColor) + +
+
+ +

Signal a flare at the position of the UNIT.

+ +

Parameter

+ +
+
+
+
+ + +UNIT:FlareGreen() + +
+
+ +

Signal a green flare at the position of the UNIT.

+ +
+
+
+
+ + +UNIT:FlareRed() + +
+
+ +

Signal a red flare at the position of the UNIT.

+ +
+
+
+
+ + +UNIT:FlareWhite() + +
+
+ +

Signal a white flare at the position of the UNIT.

+ +
+
+
+
+ + +UNIT:FlareYellow() + +
+
+ +

Signal a yellow flare at the position of the UNIT.

+ +
+
+
+
+ + +UNIT:GetAmmo() + +
+
+ +

Returns the Unit's ammunition.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSWrapper.Unit#Unit.Ammo:

    + + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:GetCallsign() + +
+
+ +

Returns the Unit's callsign - the localized string.

+ +

Return values

+
    +
  1. + +

    #string: +The Callsign of the Unit.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:GetDCSObject() + +
+
+ + + +

Return value

+ +

Dcs.DCSWrapper.Unit#Unit:

+ + +
+
+
+
+ + +UNIT:GetFuel() + +
+
+ +

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.

+ +

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. +
+
+
+
+
+ + +UNIT:GetGroup() + +
+
+ +

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

+ +

Return values

+
    +
  1. + +

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

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:GetLife() + +
+
+ +

Returns the unit's health.

+ + +

Dead units has health <= 1.0.

+ +

Return values

+
    +
  1. + +

    #number: +The Unit's health value.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:GetLife0() + +
+
+ +

Returns the Unit's initial health.

+ +

Return values

+
    +
  1. + +

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

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:GetNumber() + +
+
+ +

Returns the unit's number in the group.

+ + +

The number is the same number the unit has in ME. +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 values

+
    +
  1. + +

    #number: +The Unit number.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:GetPlayerName() + +
+
+ +

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

+ +

Return values

+
    +
  1. + +

    #string: +Player Name

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:GetPrefix() + +
+
+ +

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. +
+
+
+
+
+ + +UNIT:GetRadar() + +
+
+ +

Returns two values:

+ +
    +
  • First value indicates if at least one of the unit's radar(s) is on.
  • +
+ + +
    +
  • Second value is the object of the radar's interest. Not nil only if at least one radar of the unit is tracking a target.
  • +
+ +

Return values

+
    +
  1. + +

    #boolean: + Indicates if at least one of the unit's radar(s) is on.

    + +
  2. +
  3. + +

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

    + +
  4. +
  5. + +

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

    + +
  6. +
+
+
+
+
+ + +UNIT:GetSensors() + +
+
+ +

Returns the unit sensors.

+ +

Return values

+
    +
  1. + +

    Dcs.DCSWrapper.Unit#Unit.Sensors:

    + + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:GetThreatLevel() + +
+
+ +

Returns the Unit's A2G threat level on a scale from 1 to 10 ...

+ + +

The following threat levels are foreseen:

+ +
    +
  • Threat level 0: Unit is unarmed.
  • +
  • Threat level 1: Unit is infantry.
  • +
  • Threat level 2: Unit is an infantry vehicle.
  • +
  • Threat level 3: Unit is ground artillery.
  • +
  • Threat level 4: Unit is a tank.
  • +
  • Threat level 5: Unit is a modern tank or ifv with ATGM.
  • +
  • Threat level 6: Unit is a AAA.
  • +
  • Threat level 7: Unit is a SAM or manpad, IR guided.
  • +
  • Threat level 8: Unit is a Short Range SAM, radar guided.
  • +
  • Threat level 9: Unit is a Medium Range SAM, radar guided.
  • +
  • Threat level 10: Unit is a Long Range SAM, radar guided.
  • +
+ +
+
+
+
+ + +UNIT:HasSEAD() + +
+
+ +

Returns if the unit is SEADable.

+ +

Return values

+
    +
  1. + +

    #boolean: +returns true if the unit is SEADable.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:HasSensors(...) + +
+
+ +

Returns if the unit has sensors of a certain type.

+ +

Parameter

+
    +
  • + +

    ... :

    + +
  • +
+

Return values

+
    +
  1. + +

    #boolean: +returns true if the unit has specified types of sensors. This function is more preferable than Unit.getSensors() if you don't want to get information about all the unit's sensors, and just want to check if the unit has specified types of sensors.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:IsActive() + +
+
+ +

Returns if the unit is activated.

+ +

Return values

+
    +
  1. + +

    #boolean: +true if Unit is activated.

    + +
  2. +
  3. + +

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

    + +
  4. +
+
+
+
+
+ + +UNIT:IsAir() + +
+
+ +

Returns if the unit is of an air category.

+ + +

If the unit is a helicopter or a plane, then this method will return true, otherwise false.

+ +

Return value

+ +

#boolean: +Air category evaluation result.

+ +
+
+
+
+ + +UNIT:IsFriendly(FriendlyCoalition) + +
+
+ +

Returns if the unit is a friendly unit.

+ +

Parameter

+
    +
  • + +

    FriendlyCoalition :

    + +
  • +
+

Return value

+ +

#boolean: +IsFriendly evaluation result.

+ +
+
+
+
+ + +UNIT:IsGround() + +
+
+ +

Returns if the unit is of an ground category.

+ + +

If the unit is a ground vehicle or infantry, this method will return true, otherwise false.

+ +

Return value

+ +

#boolean: +Ground category evaluation result.

+ +
+
+
+
+ + +UNIT:IsInZone(Zone) + +
+
+ +

Returns true if the unit is within a Zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +Returns true if the unit is within the Core.Zone#ZONE_BASE

+ +
+
+
+
+ + +UNIT:IsNotInZone(Zone) + +
+
+ +

Returns true if the unit is not within a Zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +Returns true if the unit is not within the Core.Zone#ZONE_BASE

+ +
+
+
+
+ + +UNIT:IsShip() + +
+
+ +

Returns if the unit is of a ship category.

+ + +

If the unit is a ship, this method will return true, otherwise false.

+ +

Return value

+ +

#boolean: +Ship category evaluation result.

+ +
+
+
+
+ + +UNIT:Name() + +
+
+ +

Return the name of the UNIT.

+ +

Return value

+ +

#string: +The 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.

+ +

Parameters

+
    +
  • + +

    #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:ReSpawn(SpawnVec3, Heading) + +
+
+ +

Respawn the Unit using a (tweaked) template of the parent Group.

+ + + +

This function will:

+ +
    +
  • Get the current position and heading of the group.
  • +
  • When the unit is alive, it will tweak the template x, y and heading coordinates of the group and the embedded units to the current units positions.
  • +
  • Then it will respawn the re-modelled group. +
  • +
+ +

Parameters

+
    +
  • + +

    Dcs.DCSTypes#Vec3 SpawnVec3 : +The position where to Spawn the new Unit at.

    + +
  • +
  • + +

    #number Heading : +The heading of the unit respawn.

    + +
  • +
+
+
+
+
+ + +UNIT:Register(UnitName) + +
+
+ +

Create a new UNIT from DCSUnit.

+ +

Parameter

+
    +
  • + +

    #string UnitName : +The name of the DCS unit.

    + +
  • +
+

Return value

+ +

#UNIT:

+ + +
+
+
+
+ + +UNIT:Smoke(SmokeColor, Range) + +
+
+ +

Smoke the UNIT.

+ +

Parameters

+
    +
  • + +

    SmokeColor :

    + +
  • +
  • + +

    Range :

    + +
  • +
+
+
+
+
+ + +UNIT:SmokeBlue() + +
+
+ +

Smoke the UNIT Blue.

+ +
+
+
+
+ + +UNIT:SmokeGreen() + +
+
+ +

Smoke the UNIT Green.

+ +
+
+
+
+ + +UNIT:SmokeOrange() + +
+
+ +

Smoke the UNIT Orange.

+ +
+
+
+
+ + +UNIT:SmokeRed() + +
+
+ +

Smoke the UNIT Red.

+ +
+
+
+
+ + +UNIT:SmokeWhite() + +
+
+ +

Smoke the UNIT White.

+ +
+
+ +

Type Unit.SensorType

+ +

Unit.SensorType

+ +

Field(s)

+
+
+ + +Unit.SensorType.IRST + +
+
+ + + +
+
+
+
+ + +Unit.SensorType.OPTIC + +
+
+ + + +
+
+
+
+ + +Unit.SensorType.RADAR + +
+
+ + + +
+
+
+
+ + +Unit.SensorType.RWR + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/Utils.html b/docs/Documentation/Utils.html new file mode 100644 index 000000000..260e3c08b --- /dev/null +++ b/docs/Documentation/Utils.html @@ -0,0 +1,865 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Utils

+ +

This module contains derived utilities taken from the MIST framework, +which are excellent tools to be reused in an OO environment!.

+ + + +

Authors:

+ +
    +
  • Grimes : Design & Programming of the MIST framework.
  • +
+ +

Contributions:

+ +
    +
  • FlightControl : Rework to OO framework
  • +
+ + +

Global(s)

+ + + + + + + + + + + + + + + + + +
FLARECOLOR + +
SMOKECOLOR + +
UTILS + +
lookup_table + +
+

Type FLARECOLOR

+ + + + + + + + + + + + + + + + + +
FLARECOLOR.Green + +
FLARECOLOR.Red + +
FLARECOLOR.White + +
FLARECOLOR.Yellow + +
+ +

Type SMOKECOLOR

+ + + + + + + + + + + + + + + + + + + + + +
SMOKECOLOR.Blue + +
SMOKECOLOR.Green + +
SMOKECOLOR.Orange + +
SMOKECOLOR.Red + +
SMOKECOLOR.White + +
+ +

Type UTILS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UTILS.BasicSerialize(s) + +
UTILS.DeepCopy(object) + +
UTILS.DoString(s) + +
UTILS.FeetToMeters(feet) + +
UTILS.KmphToMps(kmph) + +
UTILS.KnotsToMps(knots) + +
UTILS.MetersToFeet(meters) + +
UTILS.MetersToNM(meters) + +
UTILS.MpsToKmph(mps) + +
UTILS.MpsToKnots(mps) + +
UTILS.NMToMeters(NM) + +
UTILS.OneLineSerialize(tbl) + +
UTILS.Round(num, idp) +

From http://lua-users.org/wiki/SimpleRound +use negative idp for rounding ahead of decimal place, positive for rounding after decimal place

+
UTILS.ToDegree(angle) + +
UTILS.ToRadian(angle) + +
UTILS.tostringLL(lat, lon, acc, DMS) + +
+ +

Global(s)

+
+
+ + #FLARECOLOR + +FLARECOLOR + +
+
+ + + +
+
+
+
+ + #SMOKECOLOR + +SMOKECOLOR + +
+
+ + + +
+
+
+
+ + #UTILS + +UTILS + +
+
+ + + +
+
+
+
+ + + +lookup_table + +
+
+ + + +
+
+

Type Utils

+ +

Type FLARECOLOR

+

Field(s)

+
+
+ + +FLARECOLOR.Green + +
+
+ + + +
+
+
+
+ + +FLARECOLOR.Red + +
+
+ + + +
+
+
+
+ + +FLARECOLOR.White + +
+
+ + + +
+
+
+
+ + +FLARECOLOR.Yellow + +
+
+ + + +
+
+ +

Type SMOKECOLOR

+

Field(s)

+
+
+ + +SMOKECOLOR.Blue + +
+
+ + + +
+
+
+
+ + +SMOKECOLOR.Green + +
+
+ + + +
+
+
+
+ + +SMOKECOLOR.Orange + +
+
+ + + +
+
+
+
+ + +SMOKECOLOR.Red + +
+
+ + + +
+
+
+
+ + +SMOKECOLOR.White + +
+
+ + + +
+
+ +

Type UTILS

+ +

Utilities static class.

+ +

Field(s)

+
+
+ + +UTILS.BasicSerialize(s) + +
+
+ + + + +

porting in Slmod's "safestring" basic serialize

+ +

Parameter

+
    +
  • + +

    s :

    + +
  • +
+
+
+
+
+ + +UTILS.DeepCopy(object) + +
+
+ + + + +

from http://lua-users.org/wiki/CopyTable

+ +

Parameter

+
    +
  • + +

    object :

    + +
  • +
+
+
+
+
+ + +UTILS.DoString(s) + +
+
+ + + + +

porting in Slmod's dostring

+ +

Parameter

+
    +
  • + +

    s :

    + +
  • +
+
+
+
+
+ + +UTILS.FeetToMeters(feet) + +
+
+ + + +

Parameter

+
    +
  • + +

    feet :

    + +
  • +
+
+
+
+
+ + +UTILS.KmphToMps(kmph) + +
+
+ + + +

Parameter

+
    +
  • + +

    kmph :

    + +
  • +
+
+
+
+
+ + +UTILS.KnotsToMps(knots) + +
+
+ + + +

Parameter

+
    +
  • + +

    knots :

    + +
  • +
+
+
+
+
+ + +UTILS.MetersToFeet(meters) + +
+
+ + + +

Parameter

+
    +
  • + +

    meters :

    + +
  • +
+
+
+
+
+ + +UTILS.MetersToNM(meters) + +
+
+ + + +

Parameter

+
    +
  • + +

    meters :

    + +
  • +
+
+
+
+
+ + +UTILS.MpsToKmph(mps) + +
+
+ + + +

Parameter

+
    +
  • + +

    mps :

    + +
  • +
+
+
+
+
+ + +UTILS.MpsToKnots(mps) + +
+
+ + + +

Parameter

+
    +
  • + +

    mps :

    + +
  • +
+
+
+
+
+ + +UTILS.NMToMeters(NM) + +
+
+ + + +

Parameter

+
    +
  • + +

    NM :

    + +
  • +
+
+
+
+
+ + +UTILS.OneLineSerialize(tbl) + +
+
+ + + + +

porting in Slmod's serialize_slmod2

+ +

Parameter

+
    +
  • + +

    tbl :

    + +
  • +
+
+
+
+
+ + +UTILS.Round(num, idp) + +
+
+ +

From http://lua-users.org/wiki/SimpleRound +use negative idp for rounding ahead of decimal place, positive for rounding after decimal place

+ +

Parameters

+
    +
  • + +

    num :

    + +
  • +
  • + +

    idp :

    + +
  • +
+
+
+
+
+ + +UTILS.ToDegree(angle) + +
+
+ + + +

Parameter

+
    +
  • + +

    angle :

    + +
  • +
+
+
+
+
+ + +UTILS.ToRadian(angle) + +
+
+ + + +

Parameter

+
    +
  • + +

    angle :

    + +
  • +
+
+
+
+
+ + +UTILS.tostringLL(lat, lon, acc, DMS) + +
+
+ + + + +

acc: +in DM: decimal point of minutes. +In DMS: decimal point of seconds. +position after the decimal of the least significant digit: +So: +42.32 - acc of 2.

+ + +

Parameters

+
    +
  • + +

    lat :

    + +
  • +
  • + +

    lon :

    + +
  • +
  • + +

    acc :

    + +
  • +
  • + +

    DMS :

    + +
  • +
+
+
+ +
+ +
+ + diff --git a/docs/Documentation/Zone.html b/docs/Documentation/Zone.html new file mode 100644 index 000000000..25bf67e39 --- /dev/null +++ b/docs/Documentation/Zone.html @@ -0,0 +1,2019 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module Zone

+ +

This module contains the ZONE classes, inherited from Core.Zone#ZONE_BASE.

+ + +

There are essentially two core functions that zones accomodate:

+ +
    +
  • Test if an object is within the zone boundaries.
  • +
  • Provide the zone behaviour. Some zones are static, while others are moveable.
  • +
+ +

The object classes are using the zone classes to test the zone boundaries, which can take various forms:

+ +
    +
  • Test if completely within the zone.
  • +
  • Test if partly within the zone (for Wrapper.Group#GROUP objects).
  • +
  • Test if not in the zone.
  • +
  • Distance to the nearest intersecting point of the zone.
  • +
  • Distance to the center of the zone.
  • +
  • ...
  • +
+ +

Each of these ZONE classes have a zone name, and specific parameters defining the zone type:

+ + + +
+ +

1) Core.Zone#ZONE_BASE class, extends Core.Base#BASE

+

This class is an abstract BASE class for derived classes, and is not meant to be instantiated.

+ +

1.1) Each zone has a name:

+ + + +

1.2) Each zone implements two polymorphic functions defined in Core.Zone#ZONE_BASE:

+ + + +

1.3) A zone has a probability factor that can be set to randomize a selection between zones:

+ +
    +
  • ZONE_BASE.SetRandomizeProbability(): Set the randomization probability of a zone to be selected, taking a value between 0 and 1 ( 0 = 0%, 1 = 100% )
  • +
  • ZONE_BASE.GetRandomizeProbability(): Get the randomization probability of a zone to be selected, passing a value between 0 and 1 ( 0 = 0%, 1 = 100% )
  • +
  • ZONE_BASE.GetZoneMaybe(): Get the zone taking into account the randomization probability. nil is returned if this zone is not a candidate.
  • +
+ +

1.4) A zone manages Vectors:

+ + + +

1.5) A zone has a bounding square:

+ + + +

1.6) A zone can be marked:

+ + + +
+ +

2) Core.Zone#ZONE_RADIUS class, extends Core.Zone#ZONE_BASE

+

The ZONERADIUS class defined by a zone name, a location and a radius. +This class implements the inherited functions from Core.Zone#ZONEBASE taking into account the own zone format and properties.

+ +

2.1) Core.Zone#ZONE_RADIUS constructor:

+ + + +

2.2) Manage the radius of the zone:

+ + + +

2.3) Manage the location of the zone:

+ + + +
+ +

3) Core.Zone#ZONE class, extends Core.Zone#ZONE_RADIUS

+

The ZONE class, defined by the zone name as defined within the Mission Editor. +This class implements the inherited functions from {Core.Zone#ZONE_RADIUS} taking into account the own zone format and properties.

+ +
+ +

4) Core.Zone#ZONE_UNIT class, extends Core.Zone#ZONE_RADIUS

+

The ZONE_UNIT class defined by a zone around a Wrapper.Unit#UNIT with a radius. +This class implements the inherited functions from Core.Zone#ZONE_RADIUS taking into account the own zone format and properties.

+ +
+ +

5) Core.Zone#ZONE_GROUP class, extends Core.Zone#ZONE_RADIUS

+

The ZONE_GROUP class defines by a zone around a Wrapper.Group#GROUP with a radius. The current leader of the group defines the center of the zone. +This class implements the inherited functions from Core.Zone#ZONE_RADIUS taking into account the own zone format and properties.

+ +
+ +

6) Core.Zone#ZONEPOLYGONBASE class, extends Core.Zone#ZONE_BASE

+

The ZONEPOLYGONBASE class defined by a sequence of Wrapper.Group#GROUP waypoints within the Mission Editor, forming a polygon. +This class implements the inherited functions from Core.Zone#ZONE_RADIUS taking into account the own zone format and properties. +This class is an abstract BASE class for derived classes, and is not meant to be instantiated.

+ +
+ +

7) Core.Zone#ZONE_POLYGON class, extends Core.Zone#ZONEPOLYGONBASE

+

The ZONE_POLYGON class defined by a sequence of Wrapper.Group#GROUP waypoints within the Mission Editor, forming a polygon. +This class implements the inherited functions from Core.Zone#ZONE_RADIUS taking into account the own zone format and properties.

+ +
+ +

API CHANGE HISTORY

+ +

The underlying change log documents the API changes. Please read this carefully. The following notation is used:

+ +
    +
  • Added parts are expressed in bold type face.
  • +
  • Removed parts are expressed in italic type face.
  • +
+ +

Hereby the change log:

+ +

2016-08-15: ZONE_BASE:GetName() added.

+ +

2016-08-15: ZONE_BASE:SetZoneProbability( ZoneProbability ) added.

+ +

2016-08-15: ZONE_BASE:GetZoneProbability() added.

+ +

2016-08-15: ZONE_BASE:GetZoneMaybe() added.

+ +
+ + +

Global(s)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZONE + +
ZONE_BASE + +
ZONE_GROUP + +
ZONE_POLYGON + +
ZONE_POLYGON_BASE + +
ZONE_RADIUS + +
ZONE_UNIT + +
+

Type ZONE

+ + + + + + + + + +
ZONE.ClassName + +
ZONE:New(ZoneName) +

Constructor of ZONE, taking the zone name.

+
+ +

Type ZONE_BASE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZONE_BASE.ClassName + +
ZONE_BASE:GetBoundingSquare() +

Get the bounding square the zone.

+
ZONE_BASE:GetName() +

Returns the name of the zone.

+
ZONE_BASE:GetRandomVec2() +

Define a random Dcs.DCSTypes#Vec2 within the zone.

+
ZONE_BASE:GetVec2() +

Returns the Dcs.DCSTypes#Vec2 coordinate of the zone.

+
ZONE_BASE:GetZoneMaybe() +

Get the zone taking into account the randomization probability of a zone to be selected.

+
ZONE_BASE:GetZoneProbability() +

Get the randomization probability of a zone to be selected.

+
ZONE_BASE:IsPointVec2InZone(Vec2) +

Returns if a location is within the zone.

+
ZONE_BASE:IsPointVec3InZone(Vec3) +

Returns if a point is within the zone.

+
ZONE_BASE:New(ZoneName) +

ZONE_BASE constructor

+
ZONE_BASE:SetZoneProbability(ZoneProbability) +

Set the randomization probability of a zone to be selected.

+
ZONE_BASE:SmokeZone(SmokeColor) +

Smokes the zone boundaries in a color.

+
ZONE_BASE.ZoneName +

Name of the zone.

+
ZONE_BASE.ZoneProbability +

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

+
+ +

Type ZONE_BASE.BoundingSquare

+ + + + + + + + + + + + + + + + + +
ZONE_BASE.BoundingSquare.x1 +

The lower x coordinate (left down)

+
ZONE_BASE.BoundingSquare.x2 +

The higher x coordinate (right up)

+
ZONE_BASE.BoundingSquare.y1 +

The lower y coordinate (left down)

+
ZONE_BASE.BoundingSquare.y2 +

The higher y coordinate (right up)

+
+ +

Type ZONE_GROUP

+ + + + + + + + + + + + + + + + + + + + + +
ZONE_GROUP.ClassName + +
ZONE_GROUP:GetRandomVec2() +

Returns a random location within the zone of the Group.

+
ZONE_GROUP:GetVec2() +

Returns the current location of the Group.

+
ZONE_GROUP:New(ZoneName, ZoneGROUP, Radius) +

Constructor to create a ZONE_GROUP instance, taking the zone name, a zone Wrapper.Group#GROUP and a radius.

+
ZONE_GROUP.ZoneGROUP + +
+ +

Type ZONE_POLYGON

+ + + + + + + + + +
ZONE_POLYGON.ClassName + +
ZONE_POLYGON:New(ZoneName, ZoneGroup) +

Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the Wrapper.Group#GROUP defined within the Mission Editor.

+
+ +

Type ZONE_POLYGON_BASE

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZONE_POLYGON_BASE.ClassName + +
ZONE_POLYGON_BASE:Flush() +

Flush polygon coordinates as a table in DCS.log.

+
ZONE_POLYGON_BASE:GetBoundingSquare() +

Get the bounding square the zone.

+
ZONE_POLYGON_BASE:GetRandomVec2() +

Define a random Dcs.DCSTypes#Vec2 within the zone.

+
ZONE_POLYGON_BASE:IsPointVec2InZone(Vec2) +

Returns if a location is within the zone.

+
ZONE_POLYGON_BASE:New(ZoneName, PointsArray) +

Constructor to create a ZONEPOLYGONBASE instance, taking the zone name and an array of Dcs.DCSTypes#Vec2, forming a polygon.

+
ZONE_POLYGON_BASE.Polygon +

The polygon defined by an array of Dcs.DCSTypes#Vec2.

+
ZONE_POLYGON_BASE:SmokeZone(SmokeColor) +

Smokes the zone boundaries in a color.

+
+ +

Type ZONE_RADIUS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZONE_RADIUS.ClassName + +
ZONE_RADIUS:FlareZone(FlareColor, Points, Azimuth) +

Flares the zone boundaries in a color.

+
ZONE_RADIUS:GetRadius() +

Returns the radius of the zone.

+
ZONE_RADIUS:GetRandomVec2() +

Returns a random location within the zone.

+
ZONE_RADIUS:GetVec2() +

Returns the Dcs.DCSTypes#Vec2 of the zone.

+
ZONE_RADIUS:GetVec3(Height) +

Returns the Dcs.DCSTypes#Vec3 of the ZONE_RADIUS.

+
ZONE_RADIUS:IsPointVec2InZone(Vec2) +

Returns if a location is within the zone.

+
ZONE_RADIUS:IsPointVec3InZone(Vec3) +

Returns if a point is within the zone.

+
ZONE_RADIUS:New(ZoneName, Vec2, Radius) +

Constructor of #ZONE_RADIUS, taking the zone name, the zone location and a radius.

+
ZONE_RADIUS.Radius +

The radius of the zone.

+
ZONE_RADIUS:SetRadius(Radius) +

Sets the radius of the zone.

+
ZONE_RADIUS:SetVec2(Vec2) +

Sets the Dcs.DCSTypes#Vec2 of the zone.

+
ZONE_RADIUS:SmokeZone(SmokeColor, Points) +

Smokes the zone boundaries in a color.

+
ZONE_RADIUS.Vec2 +

The current location of the zone.

+
+ +

Type ZONE_UNIT

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ZONE_UNIT.ClassName + +
ZONE_UNIT:GetRandomVec2() +

Returns a random location within the zone.

+
ZONE_UNIT:GetVec2() +

Returns the current location of the Wrapper.Unit#UNIT.

+
ZONE_UNIT:GetVec3(Height) +

Returns the Dcs.DCSTypes#Vec3 of the ZONE_UNIT.

+
ZONE_UNIT.LastVec2 + +
ZONE_UNIT:New(ZoneName, ZoneUNIT, Radius) +

Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius.

+
ZONE_UNIT.ZoneUNIT + +
+ +

Global(s)

+
+
+ + #ZONE + +ZONE + +
+
+ + + +
+
+
+
+ + #ZONE_BASE + +ZONE_BASE + +
+
+ + + +
+
+
+
+ + #ZONE_GROUP + +ZONE_GROUP + +
+
+ + + +
+
+
+
+ + #ZONE_POLYGON + +ZONE_POLYGON + +
+
+ + + +
+
+
+
+ + #ZONE_POLYGON_BASE + +ZONE_POLYGON_BASE + +
+
+ + + +
+
+
+
+ + #ZONE_RADIUS + +ZONE_RADIUS + +
+
+ + + +
+
+
+
+ + #ZONE_UNIT + +ZONE_UNIT + +
+
+ + + +
+
+

Type Zone

+ +

Type ZONE

+ +

The ZONE class, defined by the zone name as defined within the Mission Editor.

+ + +

The location and the radius are automatically collected from the mission settings.

+ +

Field(s)

+
+
+ + #string + +ZONE.ClassName + +
+
+ + + +
+
+
+
+ + +ZONE:New(ZoneName) + +
+
+ +

Constructor of ZONE, taking the zone name.

+ +

Parameter

+
    +
  • + +

    #string ZoneName : +The name of the zone as defined within the mission editor.

    + +
  • +
+

Return value

+ +

#ZONE:

+ + +
+
+ +

Type ZONE_BASE

+ +

The ZONE_BASE class

+ +

Field(s)

+
+
+ + #string + +ZONE_BASE.ClassName + +
+
+ + + +
+
+
+
+ + +ZONE_BASE:GetBoundingSquare() + +
+
+ +

Get the bounding square the zone.

+ +

Return value

+ +

#nil: +The bounding square.

+ +
+
+
+
+ + +ZONE_BASE:GetName() + +
+
+ +

Returns the name of the zone.

+ +

Return value

+ +

#string: +The name of the zone.

+ +
+
+
+
+ + +ZONE_BASE:GetRandomVec2() + +
+
+ +

Define a random Dcs.DCSTypes#Vec2 within the zone.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The Vec2 coordinates.

+ +
+
+
+
+ + +ZONE_BASE:GetVec2() + +
+
+ +

Returns the Dcs.DCSTypes#Vec2 coordinate of the zone.

+ +

Return value

+ +

#nil:

+ + +
+
+
+
+ + +ZONE_BASE:GetZoneMaybe() + +
+
+ +

Get the zone taking into account the randomization probability of a zone to be selected.

+ +

Return values

+
    +
  1. + +

    #ZONE_BASE: +The zone is selected taking into account the randomization probability factor.

    + +
  2. +
  3. + +

    #nil: +The zone is not selected taking into account the randomization probability factor.

    + +
  4. +
+
+
+
+
+ + +ZONE_BASE:GetZoneProbability() + +
+
+ +

Get the randomization probability of a zone to be selected.

+ +

Return value

+ +

#number: +A value between 0 and 1. 0 = 0% and 1 = 100% probability.

+ +
+
+
+
+ + +ZONE_BASE:IsPointVec2InZone(Vec2) + +
+
+ +

Returns if a location is within the zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +true if the location is within the zone.

+ +
+
+
+
+ + +ZONE_BASE:IsPointVec3InZone(Vec3) + +
+
+ +

Returns if a point is within the zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +true if the point is within the zone.

+ +
+
+
+
+ + +ZONE_BASE:New(ZoneName) + +
+
+ +

ZONE_BASE constructor

+ +

Parameter

+
    +
  • + +

    #string ZoneName : +Name of the zone.

    + +
  • +
+

Return value

+ +

#ZONE_BASE: +self

+ +
+
+
+
+ + +ZONE_BASE:SetZoneProbability(ZoneProbability) + +
+
+ +

Set the randomization probability of a zone to be selected.

+ +

Parameter

+
    +
  • + +

    ZoneProbability : +A value between 0 and 1. 0 = 0% and 1 = 100% probability.

    + +
  • +
+
+
+
+
+ + +ZONE_BASE:SmokeZone(SmokeColor) + +
+
+ +

Smokes the zone boundaries in a color.

+ +

Parameter

+ +
+
+
+
+ + #string + +ZONE_BASE.ZoneName + +
+
+ +

Name of the zone.

+ +
+
+
+
+ + #number + +ZONE_BASE.ZoneProbability + +
+
+ +

A value between 0 and 1. 0 = 0% and 1 = 100% probability.

+ +
+
+ +

Type ZONE_BASE.BoundingSquare

+ +

The ZONE_BASE.BoundingSquare

+ +

Field(s)

+
+
+ + Dcs.DCSTypes#Distance + +ZONE_BASE.BoundingSquare.x1 + +
+
+ +

The lower x coordinate (left down)

+ +
+
+
+
+ + Dcs.DCSTypes#Distance + +ZONE_BASE.BoundingSquare.x2 + +
+
+ +

The higher x coordinate (right up)

+ +
+
+
+
+ + Dcs.DCSTypes#Distance + +ZONE_BASE.BoundingSquare.y1 + +
+
+ +

The lower y coordinate (left down)

+ +
+
+
+
+ + Dcs.DCSTypes#Distance + +ZONE_BASE.BoundingSquare.y2 + +
+
+ +

The higher y coordinate (right up)

+ +
+
+ +

Type ZONE_GROUP

+ +

The ZONE_GROUP class defined by a zone around a Group, taking the average center point of all the units within the Group, with a radius.

+ +

Field(s)

+
+
+ + #string + +ZONE_GROUP.ClassName + +
+
+ + + +
+
+
+
+ + +ZONE_GROUP:GetRandomVec2() + +
+
+ +

Returns a random location within the zone of the Group.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The random location of the zone based on the Group location.

+ +
+
+
+
+ + +ZONE_GROUP:GetVec2() + +
+
+ +

Returns the current location of the Group.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The location of the zone based on the Group location.

+ +
+
+
+
+ + +ZONE_GROUP:New(ZoneName, ZoneGROUP, Radius) + +
+
+ +

Constructor to create a ZONE_GROUP instance, taking the zone name, a zone Wrapper.Group#GROUP and a radius.

+ +

Parameters

+ +

Return value

+ +

#ZONE_GROUP: +self

+ +
+
+
+
+ + Wrapper.Group#GROUP + +ZONE_GROUP.ZoneGROUP + +
+
+ + + +
+
+ +

Type ZONE_POLYGON

+ +

The ZONE_POLYGON class defined by a sequence of Wrapper.Group#GROUP waypoints within the Mission Editor, forming a polygon.

+ +

Field(s)

+
+
+ + #string + +ZONE_POLYGON.ClassName + +
+
+ + + +
+
+
+
+ + +ZONE_POLYGON:New(ZoneName, ZoneGroup) + +
+
+ +

Constructor to create a ZONE_POLYGON instance, taking the zone name and the name of the Wrapper.Group#GROUP defined within the Mission Editor.

+ + +

The Wrapper.Group#GROUP waypoints define the polygon corners. The first and the last point are automatically connected by ZONE_POLYGON.

+ +

Parameters

+
    +
  • + +

    #string ZoneName : +Name of the zone.

    + +
  • +
  • + +

    Wrapper.Group#GROUP ZoneGroup : +The GROUP waypoints as defined within the Mission Editor define the polygon shape.

    + +
  • +
+

Return value

+ +

#ZONE_POLYGON: +self

+ +
+
+ +

Type ZONE_POLYGON_BASE

+ +

The ZONEPOLYGONBASE class defined by an array of Dcs.DCSTypes#Vec2, forming a polygon.

+ +

Field(s)

+
+
+ + #string + +ZONE_POLYGON_BASE.ClassName + +
+
+ + + +
+
+
+
+ + +ZONE_POLYGON_BASE:Flush() + +
+
+ +

Flush polygon coordinates as a table in DCS.log.

+ +

Return value

+ +

#ZONEPOLYGONBASE: +self

+ +
+
+
+
+ + +ZONE_POLYGON_BASE:GetBoundingSquare() + +
+
+ +

Get the bounding square the zone.

+ +

Return value

+ +

#ZONEPOLYGONBASE.BoundingSquare: +The bounding square.

+ +
+
+
+
+ + +ZONE_POLYGON_BASE:GetRandomVec2() + +
+
+ +

Define a random Dcs.DCSTypes#Vec2 within the zone.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The Vec2 coordinate.

+ +
+
+
+
+ + +ZONE_POLYGON_BASE:IsPointVec2InZone(Vec2) + +
+
+ +

Returns if a location is within the zone.

+ + +

Source learned and taken from: https://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html

+ +

Parameter

+ +

Return value

+ +

#boolean: +true if the location is within the zone.

+ +
+
+
+
+ + +ZONE_POLYGON_BASE:New(ZoneName, PointsArray) + +
+
+ +

Constructor to create a ZONEPOLYGONBASE instance, taking the zone name and an array of Dcs.DCSTypes#Vec2, forming a polygon.

+ + +

The Wrapper.Group#GROUP waypoints define the polygon corners. The first and the last point are automatically connected.

+ +

Parameters

+ +

Return value

+ +

#ZONEPOLYGONBASE: +self

+ +
+
+
+
+ + #ZONE_POLYGON_BASE.ListVec2 + +ZONE_POLYGON_BASE.Polygon + +
+
+ +

The polygon defined by an array of Dcs.DCSTypes#Vec2.

+ +
+
+
+
+ + +ZONE_POLYGON_BASE:SmokeZone(SmokeColor) + +
+
+ +

Smokes the zone boundaries in a color.

+ +

Parameter

+ +

Return value

+ +

#ZONEPOLYGONBASE: +self

+ +
+
+ +

Type ZONE_POLYGON_BASE.BoundingSquare

+ +

Type ZONE_POLYGON_BASE.ListVec2

+ +

A points array.

+ + +

Type ZONE_RADIUS

+ +

The ZONE_RADIUS class, defined by a zone name, a location and a radius.

+ +

Field(s)

+
+
+ + #string + +ZONE_RADIUS.ClassName + +
+
+ + + +
+
+
+
+ + +ZONE_RADIUS:FlareZone(FlareColor, Points, Azimuth) + +
+
+ +

Flares the zone boundaries in a color.

+ +

Parameters

+
    +
  • + +

    Utilities.Utils#FLARECOLOR FlareColor : +The flare color.

    + +
  • +
  • + +

    #number Points : +(optional) The amount of points in the circle.

    + +
  • +
  • + +

    Dcs.DCSTypes#Azimuth Azimuth : +(optional) Azimuth The azimuth of the flare.

    + +
  • +
+

Return value

+ +

#ZONE_RADIUS: +self

+ +
+
+
+
+ + +ZONE_RADIUS:GetRadius() + +
+
+ +

Returns the radius of the zone.

+ +

Return value

+ +

Dcs.DCSTypes#Distance: +The radius of the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:GetRandomVec2() + +
+
+ +

Returns a random location within the zone.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The random location within the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:GetVec2() + +
+
+ +

Returns the Dcs.DCSTypes#Vec2 of the zone.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The location of the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:GetVec3(Height) + +
+
+ +

Returns the Dcs.DCSTypes#Vec3 of the ZONE_RADIUS.

+ +

Parameter

+
    +
  • + +

    Dcs.DCSTypes#Distance Height : +The height to add to the land height where the center of the zone is located.

    + +
  • +
+

Return value

+ +

Dcs.DCSTypes#Vec3: +The point of the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:IsPointVec2InZone(Vec2) + +
+
+ +

Returns if a location is within the zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +true if the location is within the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:IsPointVec3InZone(Vec3) + +
+
+ +

Returns if a point is within the zone.

+ +

Parameter

+ +

Return value

+ +

#boolean: +true if the point is within the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:New(ZoneName, Vec2, Radius) + +
+
+ +

Constructor of #ZONE_RADIUS, taking the zone name, the zone location and a radius.

+ +

Parameters

+ +

Return value

+ +

#ZONE_RADIUS: +self

+ +
+
+
+
+ + Dcs.DCSTypes#Distance + +ZONE_RADIUS.Radius + +
+
+ +

The radius of the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:SetRadius(Radius) + +
+
+ +

Sets the radius of the zone.

+ +

Parameter

+ +

Return value

+ +

Dcs.DCSTypes#Distance: +The radius of the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:SetVec2(Vec2) + +
+
+ +

Sets the Dcs.DCSTypes#Vec2 of the zone.

+ +

Parameter

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The new location of the zone.

+ +
+
+
+
+ + +ZONE_RADIUS:SmokeZone(SmokeColor, Points) + +
+
+ +

Smokes the zone boundaries in a color.

+ +

Parameters

+
    +
  • + +

    Utilities.Utils#SMOKECOLOR SmokeColor : +The smoke color.

    + +
  • +
  • + +

    #number Points : +(optional) The amount of points in the circle.

    + +
  • +
+

Return value

+ +

#ZONE_RADIUS: +self

+ +
+
+
+
+ + Dcs.DCSTypes#Vec2 + +ZONE_RADIUS.Vec2 + +
+
+ +

The current location of the zone.

+ +
+
+ +

Type ZONE_UNIT

+ +

The ZONE_UNIT class defined by a zone around a Wrapper.Unit#UNIT with a radius.

+ +

Field(s)

+
+
+ + #string + +ZONE_UNIT.ClassName + +
+
+ + + +
+
+
+
+ + +ZONE_UNIT:GetRandomVec2() + +
+
+ +

Returns a random location within the zone.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The random location within the zone.

+ +
+
+
+
+ + +ZONE_UNIT:GetVec2() + +
+
+ +

Returns the current location of the Wrapper.Unit#UNIT.

+ +

Return value

+ +

Dcs.DCSTypes#Vec2: +The location of the zone based on the Wrapper.Unit#UNITlocation.

+ +
+
+
+
+ + +ZONE_UNIT:GetVec3(Height) + +
+
+ +

Returns the Dcs.DCSTypes#Vec3 of the ZONE_UNIT.

+ +

Parameter

+
    +
  • + +

    Dcs.DCSTypes#Distance Height : +The height to add to the land height where the center of the zone is located.

    + +
  • +
+

Return value

+ +

Dcs.DCSTypes#Vec3: +The point of the zone.

+ +
+
+
+
+ + + +ZONE_UNIT.LastVec2 + +
+
+ + + +
+
+
+
+ + +ZONE_UNIT:New(ZoneName, ZoneUNIT, Radius) + +
+
+ +

Constructor to create a ZONE_UNIT instance, taking the zone name, a zone unit and a radius.

+ +

Parameters

+
    +
  • + +

    #string ZoneName : +Name of the zone.

    + +
  • +
  • + +

    Wrapper.Unit#UNIT ZoneUNIT : +The unit as the center of the zone.

    + +
  • +
  • + +

    Dcs.DCSTypes#Distance Radius : +The radius of the zone.

    + +
  • +
+

Return value

+ +

#ZONE_UNIT: +self

+ +
+
+
+
+ + Wrapper.Unit#UNIT + +ZONE_UNIT.ZoneUNIT + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/env.html b/docs/Documentation/env.html new file mode 100644 index 000000000..985b449dc --- /dev/null +++ b/docs/Documentation/env.html @@ -0,0 +1,119 @@ + + + + + + +
+
+ +
+
+
+ + + diff --git a/docs/Documentation/index.html b/docs/Documentation/index.html new file mode 100644 index 000000000..27ad96c3c --- /dev/null +++ b/docs/Documentation/index.html @@ -0,0 +1,465 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AI_Balancer +

This module contains the AI_BALANCER class.

+
Account +

(SP) (MP) (FSM) Account for (Detect, count and report) DCS events occuring on DCS objects (units).

+
Airbase +

This module contains the AIRBASE classes.

+
AirbasePolice +

This module contains the AIRBASEPOLICE classes.

+
Assign +

(SP) (MP) (FSM) Accept or reject process for player (task) assignments.

+
Base +

This module contains the BASE class.

+
Cargo +

Management of logical cargo objects, that can be transported from and to transportation carriers.

+
CleanUp +

The CLEANUP class keeps an area clean of crashing or colliding airplanes.

+
Client +

This module contains the CLIENT class.

+
CommandCenter +

A COMMANDCENTER is the owner of multiple missions within MOOSE.

+
Controllable +

This module contains the CONTROLLABLE class.

+
DCSAirbase + +
DCSCoalitionObject + +
DCSCommand + +
DCSController + +
DCSGroup + +
DCSObject + +
DCSTask + +
DCSTypes + +
DCSUnit + +
DCSWorld + +
DCScountry + +
DCStimer + +
DCStrigger + +
Database +

This module contains the DATABASE class, managing the database of mission objects.

+
Detection +

This module contains the DETECTION classes.

+
Escort +

Taking the lead of AI escorting your flight.

+
Event +

This module contains the EVENT class.

+
Fsm +

This module contains the FSM class.

+
Group +

This module contains the GROUP class.

+
Identifiable +

This module contains the IDENTIFIABLE class.

+
MOVEMENT +

Limit the simultaneous movement of Groups within a running Mission.

+
Menu +

This module contains the MENU classes.

+
Message +

This module contains the MESSAGE class.

+
MissileTrainer +

This module contains the MISSILETRAINER class.

+
Mission +

A MISSION is the main owner of a Mission orchestration within MOOSE .

+
Object +

This module contains the OBJECT class.

+
Patrol +

(AI) (FSM) Make AI patrol routes or zones.

+
Point +

This module contains the POINT classes.

+
Positionable +

This module contains the POSITIONABLE class.

+
Process_JTAC + +
Process_Pickup + +
Route +

(SP) (MP) (FSM) Route AI or players through waypoints or to zones.

+
ScheduleDispatcher +

This module defines the SCHEDULEDISPATCHER class, which is used by a central object called _SCHEDULEDISPATCHER.

+
Scheduler +

This module contains the SCHEDULER class.

+
Scoring +

Scoring system for MOOSE.

+
Sead +

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

+
Set +

This module contains the SET classes.

+
Smoke +

(SP) (MP) (FSM) Route AI or players through waypoints or to zones.

+
Spawn +

This module contains the SPAWN class.

+
Static +

This module contains the STATIC class.

+
StaticObject + +
Task +

This module contains the TASK class.

+
Task_A2G +

(AI) (SP) (MP) Tasking for Air to Ground Processes.

+
Task_PICKUP +

This module contains the TASK_PICKUP classes.

+
Task_SEAD +

This module contains the TASK_SEAD classes.

+
Unit +

This module contains the UNIT class.

+
Utils +

This module contains derived utilities taken from the MIST framework, +which are excellent tools to be reused in an OO environment!.

+
Zone +

This module contains the ZONE classes, inherited from Core.Zone#ZONE_BASE.

+
env + +
land + +
routines +

Various routines

+
+
+ +
+ + diff --git a/docs/Documentation/land.html b/docs/Documentation/land.html new file mode 100644 index 000000000..4861ee69b --- /dev/null +++ b/docs/Documentation/land.html @@ -0,0 +1,314 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module land

+ + + +

Global(s)

+ + + + + +
land + +
+

Type land

+ + + + + + + + + + + + + +
land.SurfaceType + +
land.getHeight(point) +

Returns altitude MSL of the point.

+
land.getSurfaceType(point) +

returns surface type at the given point.

+
+ +

Type land.SurfaceType

+ + + + + + + + + + + + + + + + + + + + + +
land.SurfaceType.LAND + +
land.SurfaceType.ROAD + +
land.SurfaceType.RUNWAY + +
land.SurfaceType.SHALLOW_WATER + +
land.SurfaceType.WATER + +
+ +

Global(s)

+
+
+ + #land + +land + +
+
+ + + +
+
+

Type land

+

Field(s)

+
+
+ + #land.SurfaceType + +land.SurfaceType + +
+
+ + + +
+
+
+
+ + +land.getHeight(point) + +
+
+ +

Returns altitude MSL of the point.

+ +

Parameter

+
    +
  • + +

    #Vec2 point : +point on the ground.

    + +
  • +
+

Return value

+ +

Dcs.DCSTypes#Distance:

+ + +
+
+
+
+ + +land.getSurfaceType(point) + +
+
+ +

returns surface type at the given point.

+ +

Parameter

+
    +
  • + +

    #Vec2 point : +Point on the land.

    + +
  • +
+

Return value

+ +

#land.SurfaceType:

+ + +
+
+ +

Type Vec2

+ +

Type land.SurfaceType

+

Field(s)

+
+
+ + +land.SurfaceType.LAND + +
+
+ + + +
+
+
+
+ + +land.SurfaceType.ROAD + +
+
+ + + +
+
+
+
+ + +land.SurfaceType.RUNWAY + +
+
+ + + +
+
+
+
+ + +land.SurfaceType.SHALLOW_WATER + +
+
+ + + +
+
+
+
+ + +land.SurfaceType.WATER + +
+
+ + + +
+
+ +
+ +
+ + diff --git a/docs/Documentation/routines.html b/docs/Documentation/routines.html new file mode 100644 index 000000000..34c841e1e --- /dev/null +++ b/docs/Documentation/routines.html @@ -0,0 +1,1223 @@ + + + + + + +
+
+ +
+
+
+
+ +
+

Module routines

+ +

Various routines

+ +

Global(s)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Alive + +
ChooseInfantry(TeleportPrefixTable, TeleportMax) + +
EscortCarrier(CarrierGroup, EscortPrefix, EscortLastWayPoint, EscortEngagementDistanceMax, EscortTargetTypes) + +
EscortCount + +
EscortMissionName + +
GetUnitHeight(CheckUnit) + +
GroupAlive(groupName) + +
LandCarrier(CarrierGroup, LandingZonePrefix) + +
MessageToAll(MsgText, MsgTime, MsgName) + +
MessageToBlue(MsgText, MsgTime, MsgName) + +
MessageToUnit(UnitName, MsgText, MsgTime, MsgName) + +
MusicRegister(SndRef, SndFile, SndTime) + +
MusicReset(flg) + +
MusicToPlayer(SndRef, PlayerName, SndContinue) + +
PlaneActivate(groupNameFormat, flg) + +
PlayerGroup + +
SendMessageToCarrier(CarrierGroup, CarrierMessage) + +
SpawnSettings + +
SpawnedInfantry + +
Su34AttackCarlVinson(groupName) + +
Su34AttackNorth(groupName) + +
Su34AttackWest(groupName) + +
Su34Destroyed(groupName) + +
Su34Hold(groupName) + +
Su34IsDead() + +
Su34Menu(groupName) + +
Su34MenuPath + +
Su34Menus + +
Su34Orbit(groupName) + +
Su34OverviewStatus() + +
Su34RTB(groupName) + +
Su34Status + +
Su34TakeOff(groupName) + +
TeleportPrefixTableCount + +
TeleportPrefixTableIndex + +
UpdateBoardMsg() + +
_MusicTable + +
boardMsgAll + +
boardMsgRed + +
getCarrierHeight(CarrierGroup) + +
lookup_table + +
routines + +
spairs(t, order) + +
+

Global(s)

+
+
+ + + +Alive + +
+
+ + + +
+
+
+
+ + +ChooseInfantry(TeleportPrefixTable, TeleportMax) + +
+
+ + + +

Parameters

+
    +
  • + +

    TeleportPrefixTable :

    + +
  • +
  • + +

    TeleportMax :

    + +
  • +
+
+
+
+
+ + +EscortCarrier(CarrierGroup, EscortPrefix, EscortLastWayPoint, EscortEngagementDistanceMax, EscortTargetTypes) + +
+
+ + + +

Parameters

+
    +
  • + +

    CarrierGroup :

    + +
  • +
  • + +

    EscortPrefix :

    + +
  • +
  • + +

    EscortLastWayPoint :

    + +
  • +
  • + +

    EscortEngagementDistanceMax :

    + +
  • +
  • + +

    EscortTargetTypes :

    + +
  • +
+
+
+
+
+ + #number + +EscortCount + +
+
+ + + +
+
+
+
+ + + +EscortMissionName + +
+
+ + + +
+
+
+
+ + +GetUnitHeight(CheckUnit) + +
+
+ + + +

Parameter

+
    +
  • + +

    CheckUnit :

    + +
  • +
+
+
+
+
+ + +GroupAlive(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + +LandCarrier(CarrierGroup, LandingZonePrefix) + +
+
+ + + +

Parameters

+
    +
  • + +

    CarrierGroup :

    + +
  • +
  • + +

    LandingZonePrefix :

    + +
  • +
+
+
+
+
+ + +MessageToAll(MsgText, MsgTime, MsgName) + +
+
+ + + +

Parameters

+
    +
  • + +

    MsgText :

    + +
  • +
  • + +

    MsgTime :

    + +
  • +
  • + +

    MsgName :

    + +
  • +
+
+
+
+
+ + +MessageToBlue(MsgText, MsgTime, MsgName) + +
+
+ + + +

Parameters

+
    +
  • + +

    MsgText :

    + +
  • +
  • + +

    MsgTime :

    + +
  • +
  • + +

    MsgName :

    + +
  • +
+
+
+
+
+ + +MessageToUnit(UnitName, MsgText, MsgTime, MsgName) + +
+
+ + + +

Parameters

+
    +
  • + +

    UnitName :

    + +
  • +
  • + +

    MsgText :

    + +
  • +
  • + +

    MsgTime :

    + +
  • +
  • + +

    MsgName :

    + +
  • +
+
+
+
+
+ + +MusicRegister(SndRef, SndFile, SndTime) + +
+
+ + + +

Parameters

+
    +
  • + +

    SndRef :

    + +
  • +
  • + +

    SndFile :

    + +
  • +
  • + +

    SndTime :

    + +
  • +
+
+
+
+
+ + +MusicReset(flg) + +
+
+ + + +

Parameter

+
    +
  • + +

    flg :

    + +
  • +
+
+
+
+
+ + +MusicToPlayer(SndRef, PlayerName, SndContinue) + +
+
+ + + +

Parameters

+
    +
  • + +

    SndRef :

    + +
  • +
  • + +

    PlayerName :

    + +
  • +
  • + +

    SndContinue :

    + +
  • +
+
+
+
+
+ + +PlaneActivate(groupNameFormat, flg) + +
+
+ + + +

Parameters

+
    +
  • + +

    groupNameFormat :

    + +
  • +
  • + +

    flg :

    + +
  • +
+
+
+
+
+ + + +PlayerGroup + +
+
+ + + +
+
+
+
+ + +SendMessageToCarrier(CarrierGroup, CarrierMessage) + +
+
+ + + +

Parameters

+
    +
  • + +

    CarrierGroup :

    + +
  • +
  • + +

    CarrierMessage :

    + +
  • +
+
+
+
+
+ + + +SpawnSettings + +
+
+ + + +
+
+
+
+ + #number + +SpawnedInfantry + +
+
+ + + +
+
+
+
+ + +Su34AttackCarlVinson(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + +Su34AttackNorth(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + +Su34AttackWest(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + +Su34Destroyed(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + +Su34Hold(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + +Su34IsDead() + +
+
+ + + +
+
+
+
+ + +Su34Menu(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + + +Su34MenuPath + +
+
+ + + +
+
+
+
+ + #number + +Su34Menus + +
+
+ + + +
+
+
+
+ + +Su34Orbit(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + +Su34OverviewStatus() + +
+
+ + + +
+
+
+
+ + +Su34RTB(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + + +Su34Status + +
+
+ + + +
+
+
+
+ + +Su34TakeOff(groupName) + +
+
+ + + +

Parameter

+
    +
  • + +

    groupName :

    + +
  • +
+
+
+
+
+ + +TeleportPrefixTableCount + +
+
+ + + +
+
+
+
+ + + +TeleportPrefixTableIndex + +
+
+ + + +
+
+
+
+ + +UpdateBoardMsg() + +
+
+ + + +
+
+
+
+ + + +_MusicTable + +
+
+ + + +
+
+
+
+ + + +boardMsgAll + +
+
+ + + +
+
+
+
+ + + +boardMsgRed + +
+
+ + + +
+
+
+
+ + +getCarrierHeight(CarrierGroup) + +
+
+ + + +

Parameter

+
    +
  • + +

    CarrierGroup :

    + +
  • +
+
+
+
+
+ + + +lookup_table + +
+
+ + + +
+
+
+
+ + + +routines + +
+
+ + + +
+
+
+
+ + +spairs(t, order) + +
+
+ + + +

Parameters

+
    +
  • + +

    t :

    + +
  • +
  • + +

    order :

    + +
  • +
+
+
+

Type routines

+ +
+ +
+ + diff --git a/docs/Documentation/stylesheet.css b/docs/Documentation/stylesheet.css new file mode 100644 index 000000000..3477e7fe8 --- /dev/null +++ b/docs/Documentation/stylesheet.css @@ -0,0 +1,1035 @@ +/*! normalize.css v3.0.2 | MIT License | git.io/normalize */ + +/** + * 1. Set default font family to sans-serif. + * 2. Prevent iOS text size adjust after orientation change, without disabling + * user zoom. + */ + +@import url('https://fonts.googleapis.com/css?family=Architects+Daughter'); + +html { + font-family: sans-serif; /* 1 */ + -webkit-text-size-adjust: 100%; /* 2 */ + -ms-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove default margin. + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Correct `block` display not defined for any HTML5 element in IE 8/9. + * Correct `block` display not defined for `details` or `summary` in IE 10/11 + * and Firefox. + * Correct `block` display not defined for `main` in IE 11. + */ + +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +main, +menu, +nav, +section, +summary { + display: block; +} + +/** + * 1. Correct `inline-block` display not defined in IE 8/9. + * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera. + */ + +audio, +canvas, +progress, +video { + display: inline-block; /* 1 */ + vertical-align: baseline; /* 2 */ +} + +/** + * Prevent modern browsers from displaying `audio` without controls. + * Remove excess height in iOS 5 devices. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Address `[hidden]` styling not present in IE 8/9/10. + * Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22. + */ + +[hidden], +template { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * Remove the gray background color from active links in IE 10. + */ + +a { + background-color: transparent; +} + +/** + * Improve readability when focused and also mouse hovered in all browsers. + */ + +a:active, +a:hover { + outline: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * Address styling not present in IE 8/9/10/11, Safari, and Chrome. + */ + +abbr[title] { + border-bottom: 1px dotted; +} + +/** + * Address style set to `bolder` in Firefox 4+, Safari, and Chrome. + */ + +b, +strong { + font-weight: bold; +} + +/** + * Address styling not present in Safari and Chrome. + */ + +dfn { + font-style: italic; +} + +/** + * Address variable `h1` font-size and margin within `section` and `article` + * contexts in Firefox 4+, Safari, and Chrome. + */ + +h1 { + margin: 0.67em 0; + font-size: 2em; +} + +/** + * Address styling not present in IE 8/9. + */ + +mark { + color: #000; + background: #ff0; +} + +/** + * Address inconsistent and variable font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers. + */ + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sup { + top: -0.5em; +} + +sub { + bottom: -0.25em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove border when inside `a` element in IE 8/9/10. + */ + +img { + border: 0; +} + +/** + * Correct overflow not hidden in IE 9/10/11. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * Address margin not present in IE 8/9 and Safari. + */ + +figure { + margin: 1em 40px; +} + +/** + * Address differences between Firefox and other browsers. + */ + +hr { + height: 0; + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +/** + * Contain overflow in all browsers. + */ + +pre { + overflow: auto; +} + +/** + * Address odd `em`-unit font size rendering in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +/* Forms + ========================================================================== */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ + +/** + * 1. Correct color not being inherited. + * Known issue: affects color of disabled elements. + * 2. Correct font properties not being inherited. + * 3. Address margins set differently in Firefox 4+, Safari, and Chrome. + */ + +button, +input, +optgroup, +select, +textarea { + margin: 0; /* 3 */ + font: inherit; /* 2 */ + color: inherit; /* 1 */ +} + +/** + * Address `overflow` set to `hidden` in IE 8/9/10/11. + */ + +button { + overflow: visible; +} + +/** + * Address inconsistent `text-transform` inheritance for `button` and `select`. + * All other form control elements do not inherit `text-transform` values. + * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera. + * Correct `select` style inheritance in Firefox. + */ + +button, +select { + text-transform: none; +} + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ + +button, +html input[type="button"], /* 1 */ +input[type="reset"], +input[type="submit"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ +} + +/** + * Re-set default cursor for disabled elements. + */ + +button[disabled], +html input[disabled] { + cursor: default; +} + +/** + * Remove inner padding and border in Firefox 4+. + */ + +button::-moz-focus-inner, +input::-moz-focus-inner { + padding: 0; + border: 0; +} + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ + +input { + line-height: normal; +} + +/** + * It's recommended that you don't attempt to style these elements. + * Firefox's implementation doesn't respect box-sizing, padding, or width. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10. + * 2. Remove excess padding in IE 8/9/10. + */ + +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ + +input[type="number"]::-webkit-inner-spin-button, +input[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome. + * 2. Address `box-sizing` set to `border-box` in Safari and Chrome + * (include `-moz` to future-proof). + */ + +input[type="search"] { + -webkit-box-sizing: content-box; /* 2 */ + -moz-box-sizing: content-box; + box-sizing: content-box; + -webkit-appearance: textfield; /* 1 */ +} + +/** + * Remove inner padding and search cancel button in Safari and Chrome on OS X. + * Safari (but not Chrome) clips the cancel button when the search input has + * padding (and `textfield` appearance). + */ + +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Define consistent border, margin, and padding. + */ + +fieldset { + padding: 0.35em 0.625em 0.75em; + margin: 0 2px; + border: 1px solid #c0c0c0; +} + +/** + * 1. Correct `color` not being inherited in IE 8/9/10/11. + * 2. Remove padding so people aren't caught out if they zero out fieldsets. + */ + +legend { + padding: 0; /* 2 */ + border: 0; /* 1 */ +} + +/** + * Remove default vertical scrollbar in IE 8/9/10/11. + */ + +textarea { + overflow: auto; +} + +/** + * Don't inherit the `font-weight` (applied by a rule above). + * NOTE: the default cannot safely be changed in Chrome and Safari on OS X. + */ + +optgroup { + font-weight: bold; +} + +/* Tables + ========================================================================== */ + +/** + * Remove most spacing between table cells. + */ + +table { + border-spacing: 0; + border-collapse: collapse; +} + +td, +th { + padding: 0; +} + +/* LAYOUT STYLES */ +body { + font-family: 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 15px; + font-weight: 400; + line-height: 1.5; + color: #666; + background: #fafafa url(../../images/body-bg.jpg) 0 0 repeat; + margin-left: 1em; + margin-right: 1em; + margin: 0px; +} + +p { + margin-top: 0; +} + + +a { + color: #2879d0; +} +a:hover { + color: #2268b2; +} + +header { + padding-top: 40px; + padding-bottom: 40px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + background: #2e7bcf url(../images/header-bg.jpg) 0 0 repeat-x; + border-bottom: solid 1px #275da1; +} + +h1 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 32px; + font-weight: normal; + line-height: 1.5; +} + +h2 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 26px; + font-weight: normal; + line-height: 1.3; +} + +h3 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 22px; + font-weight: normal; + line-height: 1.1; +} + +.inner { + position: relative; + width: 940px; + margin: 0 auto; +} + +#content-wrapper { + padding-top: 30px; + border-top: solid 1px #fff; +} + +#main-content { + float: left; + width: 690px; +} + +#main-content img { + max-width: 100%; +} + +aside#sidebar { + float: right; + width: 200px; + min-height: 504px; + padding-left: 20px; + font-size: 12px; + line-height: 1.3; + background: transparent url(../../images/sidebar-bg.jpg) 0 0 no-repeat; +} + +aside#sidebar p.repo-owner, +aside#sidebar p.repo-owner a { + font-weight: bold; +} + +#downloads { + margin-bottom: 40px; +} + +a.button { + width: 134px; + height: 58px; + padding-top: 22px; + padding-left: 68px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 23px; + line-height: 1.2; + color: #fff; +} +a.button small { + display: block; + font-size: 11px; +} +header a.button { + position: absolute; + top: 0; + right: 0; + background: transparent url(../images/github-button.png) 0 0 no-repeat; +} +aside a.button { + display: block; + width: 138px; + padding-left: 64px; + margin-bottom: 20px; + font-size: 21px; + background: transparent url(../images/download-button.png) 0 0 no-repeat; +} + +code, pre { + margin-bottom: 30px; + font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace; + font-size: 13px; + color: #222; +} + +code { + padding: 0 3px; + background-color: #f2f8fc; + border: solid 1px #dbe7f3; +} + +pre { + padding: 20px; + overflow: auto; + text-shadow: none; + background: #fff; + border: solid 1px #f2f2f2; +} +pre code { + padding: 0; + color: #2879d0; + background-color: #fff; + border: none; +} + +ul, ol, dl { + margin-bottom: 20px; +} + + +/* COMMON STYLES */ + +hr { + height: 0; + margin-top: 1em; + margin-bottom: 1em; + border: 0; + border-top: solid 1px #ddd; +} + +table { + width: 100%; + border: 1px solid #ebebeb; +} + +th { + font-weight: 500; +} + +td { + font-weight: 300; + text-align: center; + border: 1px solid #ebebeb; +} + +form { + padding: 20px; + background: #f2f2f2; + +} + + +/* GENERAL ELEMENT TYPE STYLES */ + +#main-content h1 { + margin-top: 0; + margin-bottom: 0; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 2.8em; + font-weight: normal; + color: #474747; + text-indent: 6px; + letter-spacing: -1px; +} + +#main-content h1:before { + padding-right: 0.3em; + margin-left: -0.9em; + color: #9ddcff; + content: "/"; +} + +#main-content h2 { + margin-bottom: 8px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 22px; + font-weight: bold; + color: #474747; + text-indent: 4px; +} +#main-content h2:before { + padding-right: 0.3em; + margin-left: -1.5em; + content: "//"; + color: #9ddcff; +} + +#main-content h3 { + margin-top: 24px; + margin-bottom: 8px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 18px; + font-weight: bold; + color: #474747; + text-indent: 3px; +} + +#main-content h3:before { + padding-right: 0.3em; + margin-left: -2em; + content: "///"; + color: #9ddcff; +} + +#main-content h4 { + margin-bottom: 8px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 15px; + font-weight: bold; + color: #474747; + text-indent: 3px; +} + +h4:before { + padding-right: 0.3em; + margin-left: -2.8em; + content: "////"; + color: #9ddcff; +} + +#main-content h5 { + margin-bottom: 8px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: 14px; + color: #474747; + text-indent: 3px; +} +h5:before { + padding-right: 0.3em; + margin-left: -3.2em; + content: "/////"; + color: #9ddcff; +} + +#main-content h6 { + margin-bottom: 8px; + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + font-size: .8em; + color: #474747; + text-indent: 3px; +} +h6:before { + padding-right: 0.3em; + margin-left: -3.7em; + content: "//////"; + color: #9ddcff; +} + +p { + margin-bottom: 20px; +} + +a { + text-decoration: none; +} + +p a { + font-weight: 400; +} + +blockquote { + padding: 0 0 0 30px; + margin-bottom: 20px; + font-size: 1.6em; + border-left: 10px solid #e9e9e9; +} + +ul { + list-style-position: inside; + list-style: disc; + padding-left: 20px; +} + +ol { + list-style-position: inside; + list-style: decimal; + padding-left: 3px; +} + +footer { + padding-top: 20px; + padding-bottom: 30px; + margin-top: 40px; + font-size: 13px; + color: #aaa; + background: transparent url('../../images/hr.png') 0 0 no-repeat; +} + +footer a { + color: #666; +} +footer a:hover { + color: #444; +} + +/* MISC */ +.clearfix:after { + display: block; + height: 0; + clear: both; + visibility: hidden; + content: '.'; +} + +.clearfix {display: inline-block;} +* html .clearfix {height: 1%;} +.clearfix {display: block;} + +/* #Media Queries +================================================== */ + +/* Smaller than standard 960 (devices and browsers) */ +@media only screen and (max-width: 959px) { } + +/* Tablet Portrait size to standard 960 (devices and browsers) */ +@media only screen and (min-width: 768px) and (max-width: 959px) { + .inner { + width: 740px; + } + header h1, header h2 { + width: 340px; + } + header h1 { + font-size: 60px; + } + header h2 { + font-size: 30px; + } + #main-content { + width: 490px; + } + #main-content h1:before, + #main-content h2:before, + #main-content h3:before, + #main-content h4:before, + #main-content h5:before, + #main-content h6:before { + padding-right: 0; + margin-left: 0; + content: none; + } +} + +/* All Mobile Sizes (devices and browser) */ +@media only screen and (max-width: 767px) { + .inner { + width: 93%; + } + header { + padding: 20px 0; + } + header .inner { + position: relative; + } + header h1, header h2 { + width: 100%; + } + header h1 { + font-size: 48px; + } + header h2 { + font-size: 24px; + } + header a.button { + position: relative; + display: inline-block; + width: auto; + height: auto; + padding: 5px 10px; + margin-top: 15px; + font-size: 13px; + line-height: 1; + color: #2879d0; + text-align: center; + background-color: #9ddcff; + background-image: none; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + header a.button small { + display: inline; + font-size: 13px; + } + #main-content, + aside#sidebar { + float: none; + width: 100% ! important; + } + aside#sidebar { + min-height: 0; + padding: 20px 0; + margin-top: 20px; + background-image: none; + border-top: solid 1px #ddd; + } + aside#sidebar a.button { + display: none; + } + #main-content h1:before, + #main-content h2:before, + #main-content h3:before, + #main-content h4:before, + #main-content h5:before, + #main-content h6:before { + padding-right: 0; + margin-left: 0; + content: none; + } +} + +/* Mobile Landscape Size to Tablet Portrait (devices and browsers) */ +@media only screen and (min-width: 480px) and (max-width: 767px) { } + +/* Mobile Portrait Size to Mobile Landscape Size (devices and browsers) */ +@media only screen and (max-width: 479px) { } + + +#container { + margin-left: 1em; + margin-right: 1em; + background-color: #f0f0f0; +} + +#product { + text-align: center; + border-bottom: 1px solid #cccccc; + background-color: #ffffff; +} + +#product big { + font-size: 2em; +} + +#main { + color: #666; + background: #fafafa url(../../images/body-bg.jpg) 0 0 repeat; + border-left: 2px solid #cccccc; +} + +#navigation { + float: left; + width: 18em; + vertical-align: top; + overflow: scroll; + position: fixed; + height:100%; + background: #2e7bcf url(../../images/header-bg.jpg) 0 0 repeat-x; + color: #fff; +} + +#navigation h2 { + font-family: 'Architects Daughter', 'Helvetica Neue', Helvetica, Arial, serif; + background: #2e7bcf url(../images/header-bg.jpg) 0 0 repeat-x; + border-bottom: solid 1px #275da1; + width: 540px; + margin-top: 0; + margin-bottom: 0.2em; + font-size: 36px; + font-weight: normal; + line-height: 1; + color: #fff; + letter-spacing: -1px; + text-align: left; + padding:0.2em; + border-top:1px solid #dddddd; +} + +#navigation ul +{ + font-size:1em; + list-style-type: none; + margin: 1px 1px 10px 1px; + color: #fff; +} + +#navigation li { + text-indent: -1em; + display: block; + margin: 3px 0px 0px 22px; + color: #fff; +} + +#navigation ul li a { + color: #fff; +} + + +#navigation li li a { + margin: 0px 3px 0px -1em; + color: #fff; +} + +#content { + margin-left: 18em; + padding: 1em; + border-left: 2px solid #cccccc; + border-right: 2px solid #cccccc; + background-color: #ffffff; +} + + +#content h2 a { + color: #000; + border-bottom: 1px solid #000; +} + +#content h2 a code { +font-size: 22px; +font-weight: 400; +background-color: transparent; +color: #2879d0; +border: none; +} + +#content h1 code { +font-size: 26px; +font-weight: 400; +background-color: transparent; +border: none; +} + +#about { + clear: both; + padding: 5px; + border-top: 2px solid #cccccc; + background-color: #ffffff; +} + +table.function_list { + border-width: 1px; + border-style: solid; + border-color: #cccccc; + border-collapse: collapse; +} + +table.function_list td { + border-width: 1px; + padding: 3px; + border-style: solid; + border-color: #cccccc; + word-wrap:break-word; +} + +table.function_list td.name { font-weight: 400; width:50%; white-space: normal; text-align:left;} +table.function_list td.summary { width: 50%; } + + +dl.table dt, dl.function { + border-left: 1px solid #ccc; + border-right: 1px solid #ccc; + border-bottom: 1px solid #ccc; +} + +dl.table dt, dl.function dt { + border-top: 1px solid #000; + padding-top: 0.5em; + padding-bottom: 0.5em; + border-bottom: 1px solid #ccc; +} + +dl.table dd, dl.function dd { + padding-bottom: 0.5em; + margin: 20px 0 0 20px; +} + +dl.table dd, dl.function dd p { + font-weight : normal; +} + +dl.table h3, dl.function h3 {font-size: 1.5em;}