Banner Image

Module Tasking.CommandCenter

Tasking -- A command center governs multiple missions, and takes care of the reporting and communications.

Features:

  • Govern multiple missions.
  • Communicate to coalitions, groups.
  • Assign tasks.
  • Manage the menus.
  • Manage reference zones.

Author: FlightControl

Contributions:


Global(s)

Global COMMANDCENTER

Governs multiple missions, the tasking and the reporting.

#COMMANDCENTER COMMANDCENTER

Governs multiple missions, the tasking and the reporting.

Command centers govern missions, communicates the task assignments between human players of the coalition, and manages the menu flow. It can assign a random task to a player when requested. The commandcenter provides the facilitites to communicate between human players online, executing a task.

1. Create a command center object.

2. Command center mission management.

Command centers manage missions. These can be added, removed and provides means to retrieve missions. These methods are heavily used by the task dispatcher classes.

3. Communication management between players.

Command center provide means of communication between players. Because a command center is a central object governing multiple missions,
there are several levels at which communication needs to be done. Within MOOSE, communication is facilitated using the message system within the DCS simulator.

Messages can be sent between players at various levels:

  • On a global level, to all players.
  • On a coalition level, only to the players belonging to the same coalition.
  • On a group level, to the players belonging to the same group.

Messages can be sent to all players by the command center using the method Tasking.CommandCenter#COMMANDCENTER.MessageToAll().

To send messages to the coalition of the command center, there are two methods available:

To send messages to the group of human players, there are also two methods available:

Messages are considered to be sometimes disturbing for human players, therefore, the settings menu provides the means to activate or deactivate messages. For more information on the message types and display timings that can be selected and configured using the menu, refer to the Core.Settings menu description.

4. Command center detailed methods.

Various methods are added to manage command centers.

4.1. Naming and description.

There are 3 methods that can be used to retrieve the description of a command center:

A textual description can be retrieved that provides the command center name to be used within message communication:

4.2. The coalition of the command center.

The method Tasking.CommandCenter#COMMANDCENTER.GetCoalition() returns the coalition of the command center. The return value is an enumeration of the type DCS#coalition.side, which contains the RED, BLUE and NEUTRAL coalition.

4.3. The command center is a real object.

The command center must be represented by a live object within the DCS simulator. As a result, the command center
can be a Wrapper.Unit, a Wrapper.Group, an Wrapper.Airbase or a Wrapper.Static object.

Using the method Tasking.CommandCenter#COMMANDCENTER.GetPositionable() you retrieve the polymorphic positionable object representing the command center, but just be aware that you should be able to use the representable object derivation methods.

5. Command center reports.

Because a command center giverns multiple missions, there are several reports available that are generated by command centers. These reports are generated using the following methods:

6. Reference Zones.

Command Centers may be aware of certain Reference Zones within the battleground. These Reference Zones can refer to known areas, recognizable buildings or sites, or any other point of interest. Command Centers will use these Reference Zones to help pilots with defining coordinates in terms of navigation during the WWII era. The Reference Zones are related to the WWII mode that the Command Center will operate in. Use the method COMMANDCENTER.SetModeWWII() to set the mode of communication to the WWII mode.

In WWII mode, the Command Center will receive detected targets, and will select for each target the closest nearby Reference Zone. This allows pilots to navigate easier through the battle field readying for combat.

The Reference Zones need to be set by the Mission Designer in the Mission Editor. Reference Zones are set by normal trigger zones. One can color the zones in a specific color, and the radius of the zones doesn't matter, only the point is important. Place the center of these Reference Zones at specific scenery objects or points of interest (like cities, rivers, hills, crossing etc). The trigger zones indicating a Reference Zone need to follow a specific syntax. The name of each trigger zone expressing a Reference Zone need to start with a classification name of the object, followed by a #, followed by a symbolic name of the Reference Zone. A few examples:

  • A church at Tskinvali would be indicated as: Church#Tskinvali
  • A train station near Kobuleti would be indicated as: Station#Kobuleti

The COMMANDCENTER class contains a method to indicate which trigger zones need to be used as Reference Zones. This is done by using the method COMMANDCENTER.SetReferenceZones(). For the moment, only one Reference Zone class can be specified, but in the future, more classes will become possible.

7. Tasks.

7.1. Automatically assign tasks.

One of the most important roles of the command center is the management of tasks. The command center can assign automatically tasks to the players using the Tasking.CommandCenter#COMMANDCENTER.SetAutoAssignTasks() method. When this method is used with a parameter true; the command center will scan at regular intervals which players in a slot are not having a task assigned. For those players; the tasking is enabled to assign automatically a task. An Assign Menu will be accessible for the player under the command center menu, to configure the automatic tasking to switched on or off.

7.2. Automatically accept assigned tasks.

When a task is assigned; the mission designer can decide if players are immediately assigned to the task; or they can accept/reject the assigned task. Use the method Tasking.CommandCenter#COMMANDCENTER.SetAutoAcceptTasks() to configure this behaviour. If the tasks are not automatically accepted; the player will receive a message that he needs to access the command center menu and choose from 2 added menu options either to accept or reject the assigned task within 30 seconds. If the task is not accepted within 30 seconds; the task will be cancelled and a new task will be assigned.

Type(s)

Fields and Methods inherited from COMMANDCENTER Description

COMMANDCENTER:AddGroups()

Get all the Groups active within the command center.

COMMANDCENTER:AddMission(Mission)

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

COMMANDCENTER:AssignTask(TaskGroup)

Assigns a random task to a TaskGroup.

COMMANDCENTER:AssignTasks()

Automatically assigns tasks to all TaskGroups.

COMMANDCENTER.AutoAcceptTasks

COMMANDCENTER.AutoAssignMethod

COMMANDCENTER.AutoAssignMethods

COMMANDCENTER.AutoAssignTasks

COMMANDCENTER.CommandCenterCoalition

COMMANDCENTER.CommandCenterMenus

COMMANDCENTER.CommandCenterName

COMMANDCENTER.CommandCenterPositionable

COMMANDCENTER.CommunicationMode

COMMANDCENTER.FlashStatus

COMMANDCENTER:GetCoalition()

Gets the coalition of the command center.

COMMANDCENTER:GetMenu(TaskGroup)

Gets the commandcenter menu structure governed by the HQ command center.

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

Gets the short text string of the HQ command center.

COMMANDCENTER:GetText()

Gets the text string of the HQ command center.

COMMANDCENTER.HQ

COMMANDCENTER:HasGroup(MissionGroup)

Checks of the command center has the given MissionGroup.

COMMANDCENTER:IsGroupAssigned(TaskGroup)

Checks of the TaskGroup has a Task.

COMMANDCENTER:IsModeWWII()

Returns if the commandcenter operations is in WWII mode

COMMANDCENTER:MessageToAll(Message)

Let the command center send a Message to all players.

COMMANDCENTER:MessageToCoalition(Message)

Let the command center send a message to the coalition of the command center.

COMMANDCENTER:MessageToGroup(Message, MessageGroup)

Let the command center send a message to the MessageGroup.

COMMANDCENTER:MessageTypeToCoalition(Message, MessageType)

Let the command center send a message of a specified type to the coalition of the command center.

COMMANDCENTER:MessageTypeToGroup(Message, MessageGroup, MessageType)

Let the command center send a message to the MessageGroup.

COMMANDCENTER.Missions

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)

Let the command center send a report of the status of a task to a group.

COMMANDCENTER:ReportMissionsPlayers(ReportGroup)

Let the command center send a report of the players of all missions to a group.

COMMANDCENTER:ReportSummary(ReportGroup)

Let the command center send a report of the status of all missions to a group.

COMMANDCENTER:SetAutoAcceptTasks(AutoAccept)

Automatically accept tasks for all TaskGroups.

COMMANDCENTER:SetAutoAssignMethod(AutoAssignMethod)

Define the method to be used to assign automatically a task from the available tasks in the mission.

COMMANDCENTER:SetAutoAssignTasks(AutoAssign)

Automatically assigns tasks to all TaskGroups.

COMMANDCENTER:SetCommandMenu()

Sets the menu of the command center.

COMMANDCENTER:SetFlashStatus(Flash)

Let the command center flash a report of the status of the subscribed task to a group.

COMMANDCENTER:SetMenu()

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

COMMANDCENTER:SetModeWWII()

Set the commandcenter operations in WWII mode This will disable LL, MGRS, BRA, BULLS navigatin messages sent by the Command Center, and will be replaced by a navigation using Reference Zones.

COMMANDCENTER:SetReferenceZones(ReferenceZonePrefix)

Set special Reference Zones known by the Command Center to guide airborne pilots during WWII.

Fields and Methods inherited from BASE Description

COMMANDCENTER.ClassID

The ID number of the class.

COMMANDCENTER.ClassName

The name of the class.

COMMANDCENTER.ClassNameAndID

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

COMMANDCENTER:ClearState(Object, StateName)

Clear the state of an object.

COMMANDCENTER:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace)

Creation of a Birth Event.

COMMANDCENTER:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

COMMANDCENTER:CreateEventDead(EventTime, Initiator)

Creation of a Dead Event.

COMMANDCENTER:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

COMMANDCENTER:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

COMMANDCENTER:E(Arguments)

Log an exception which will be traced always.

COMMANDCENTER:EventDispatcher()

Returns the event dispatcher

COMMANDCENTER:EventRemoveAll()

Remove all subscribed events

COMMANDCENTER:F(Arguments)

Trace a function call.

COMMANDCENTER:F2(Arguments)

Trace a function call level 2.

COMMANDCENTER:F3(Arguments)

Trace a function call level 3.

COMMANDCENTER:GetClassID()

Get the ClassID of the class instance.

COMMANDCENTER:GetClassName()

Get the ClassName of the class instance.

COMMANDCENTER:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

COMMANDCENTER:GetEventPriority()

Get the Class Event processing Priority.

COMMANDCENTER:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

COMMANDCENTER:GetState(Object, Key)

Get a Value given a Key from the Object.

COMMANDCENTER:HandleEvent(Event, EventFunction)

Subscribe to a DCS Event.

COMMANDCENTER:I(Arguments)

Log an information which will be traced always.

COMMANDCENTER:Inherit(Child, Parent)

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

COMMANDCENTER:IsInstanceOf(ClassName)

This is the worker method to check if an object is an (sub)instance of a class.

COMMANDCENTER:IsTrace()

Enquires if tracing is on (for the class).

COMMANDCENTER:New()

BASE constructor.

COMMANDCENTER:OnEvent(EventData)

Occurs when an object is completely destroyed.

COMMANDCENTER:OnEventBaseCaptured(EventData)

Occurs when a ground unit captures either an airbase or a farp.

COMMANDCENTER:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

COMMANDCENTER:OnEventCrash(EventData)

Occurs when any aircraft crashes into the ground and is completely destroyed.

COMMANDCENTER:OnEventDead(EventData)

Occurs when an object is dead.

COMMANDCENTER:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

COMMANDCENTER:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

COMMANDCENTER:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

COMMANDCENTER:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

COMMANDCENTER:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

COMMANDCENTER:OnEventLand(EventData)

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

COMMANDCENTER:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

COMMANDCENTER:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

COMMANDCENTER:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

COMMANDCENTER:OnEventMissionEnd(EventData)

Occurs when a mission ends

COMMANDCENTER:OnEventMissionStart(EventData)

Occurs when a mission starts

COMMANDCENTER:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

COMMANDCENTER:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

COMMANDCENTER:OnEventPlayerLeaveUnit(EventData)

Occurs when any player relieves control of a unit to the AI.

COMMANDCENTER:OnEventRefueling(EventData)

Occurs when an aircraft connects with a tanker and begins taking on fuel.

COMMANDCENTER:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

COMMANDCENTER:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

COMMANDCENTER:OnEventShootingStart(EventData)

Occurs when any unit begins firing a weapon that has a high rate of fire.

COMMANDCENTER:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

COMMANDCENTER:OnEventTakeoff(EventData)

Occurs when an aircraft takes off from an airbase, farp, or ship.

COMMANDCENTER:ScheduleOnce(Start, SchedulerFunction, ...)

Schedule a new time event.

COMMANDCENTER:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...)

Schedule a new time event.

COMMANDCENTER:ScheduleStop(SchedulerFunction)

Stops the Schedule.

COMMANDCENTER.Scheduler

COMMANDCENTER:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

COMMANDCENTER:SetState(Object, Key, Value)

Set a state or property of the Object given a Key and a Value.

COMMANDCENTER:T(Arguments)

Trace a function logic level 1.

COMMANDCENTER:T2(Arguments)

Trace a function logic level 2.

COMMANDCENTER:T3(Arguments)

Trace a function logic level 3.

COMMANDCENTER:TraceAll(TraceAll)

Trace all methods in MOOSE

COMMANDCENTER:TraceClass(Class)

Set tracing for a class

COMMANDCENTER:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

COMMANDCENTER:TraceLevel(Level)

Set trace level

COMMANDCENTER:TraceOff()

Set trace off.

COMMANDCENTER:TraceOn()

Set trace on.

COMMANDCENTER:TraceOnOff(TraceOnOff)

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

COMMANDCENTER:UnHandleEvent(Event)

UnSubscribe to a DCS event.

COMMANDCENTER._

COMMANDCENTER:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

COMMANDCENTER:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

COMMANDCENTER.__

COMMANDCENTER:onEvent(event)

Fields and Methods inherited from COMMANDCENTER.AutoAssignMethods Description

COMMANDCENTER.AutoAssignMethods.Distance

COMMANDCENTER.AutoAssignMethods.Priority

COMMANDCENTER.AutoAssignMethods.Random

The COMMANDCENTER class

COMMANDCENTER is a list of Tasking.Mission#MISSION. Missions

Field(s)

Function(s)

Get all the Groups active within the command center.

Defined in:

COMMANDCENTER

Return value:

The set of groups active within the command center.

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

Defined in:

COMMANDCENTER

Parameter:

Return value:

Assigns a random task to a TaskGroup.

Defined in:

COMMANDCENTER

Parameter:

TaskGroup

Return value:

Automatically assigns tasks to all TaskGroups.

Defined in:

COMMANDCENTER

Gets the coalition of the command center.

Defined in:

COMMANDCENTER

Return value:

Gets the commandcenter menu structure governed by the HQ command center.

Defined in:

COMMANDCENTER

Parameter:

Task Group.

Return value:

Get the Missions governed by the HQ command center.

Defined in:

COMMANDCENTER

Return value:

#list<Tasking.Mission#MISSION>:

Gets the name of the HQ command center.

Defined in:

COMMANDCENTER

Return value:

#string:

Gets the POSITIONABLE of the HQ command center.

Defined in:

COMMANDCENTER

Return value:

Gets the short text string of the HQ command center.

Defined in:

COMMANDCENTER

Return value:

#string:

Gets the text string of the HQ command center.

Defined in:

COMMANDCENTER

Return value:

#string:

Checks of the command center has the given MissionGroup.

Defined in:

COMMANDCENTER

Parameter:

Wrapper.Group#GROUP MissionGroup

The group active within one of the missions governed by the command center.

Return value:

#boolean:

Checks of the TaskGroup has a Task.

Defined in:

COMMANDCENTER

Parameter:

TaskGroup

Return value:

#boolean:

When true, the TaskGroup has a Task, otherwise the returned value will be false.

Returns if the commandcenter operations is in WWII mode

Defined in:

COMMANDCENTER

Return value:

#boolean:

true if in WWII mode.

Let the command center send a Message to all players.

Defined in:

COMMANDCENTER

Parameter:

#string Message

The message text.

Let the command center send a message to the coalition of the command center.

Defined in:

COMMANDCENTER

Parameter:

#string Message

The message text.

Let the command center send a message to the MessageGroup.

Defined in:

COMMANDCENTER

Parameters:

#string Message

The message text.

Wrapper.Group#GROUP MessageGroup

The group to receive the message.

Let the command center send a message of a specified type to the coalition of the command center.

Defined in:

COMMANDCENTER

Parameters:

#string Message

The message text.

The type of the message, resulting in automatic time duration and prefix of the message.

Let the command center send a message to the MessageGroup.

Defined in:

COMMANDCENTER

Parameters:

#string Message

The message text.

Wrapper.Group#GROUP MessageGroup

The group to receive the message.

The type of the message, resulting in automatic time duration and prefix of the message.

The constructor takes an IDENTIFIABLE as the HQ command center.

Defined in:

COMMANDCENTER

Parameters:

Wrapper.Positionable#POSITIONABLE CommandCenterPositionable

#string CommandCenterName

Return value:

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

The given Mission is not nilified.

Defined in:

COMMANDCENTER

Parameter:

Return value:

Let the command center send a report of the status of a task to a group.

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

Defined in:

COMMANDCENTER

Parameters:

Wrapper.Group#GROUP ReportGroup

The group to receive the report.

The task to be reported.

Let the command center send a report of the players of all missions to a group.

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

Defined in:

COMMANDCENTER

Parameter:

Wrapper.Group#GROUP ReportGroup

The group to receive the report.

Let the command center send a report of the status of all missions to a group.

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

Defined in:

COMMANDCENTER

Parameter:

Wrapper.Group#GROUP ReportGroup

The group to receive the report.

Automatically accept tasks for all TaskGroups.

When a task is assigned; the mission designer can decide if players are immediately assigned to the task; or they can accept/reject the assigned task. If the tasks are not automatically accepted; the player will receive a message that he needs to access the command center menu and choose from 2 added menu options either to accept or reject the assigned task within 30 seconds. If the task is not accepted within 30 seconds; the task will be cancelled and a new task will be assigned.

Defined in:

COMMANDCENTER

Parameter:

#boolean AutoAccept

true for ON and false or nil for OFF.

Define the method to be used to assign automatically a task from the available tasks in the mission.

There are 3 types of methods that can be applied for the moment:

  1. Random - assigns a random task in the mission to the player.
  2. Distance - assigns a task based on a distance evaluation from the player. The closest are to be assigned first.
  3. Priority - assigns a task based on the priority as defined by the mission designer, using the SetTaskPriority parameter.

The different task classes implement the logic to determine the priority of automatic task assignment to a player, depending on one of the above methods. The method Tasking.Task#TASK.GetAutoAssignPriority calculate the priority of the tasks to be assigned.

Defined in:

COMMANDCENTER

Parameter:

A selection of an assign method from the COMMANDCENTER.AutoAssignMethods enumeration.

Automatically assigns tasks to all TaskGroups.

One of the most important roles of the command center is the management of tasks. When this method is used with a parameter true; the command center will scan at regular intervals which players in a slot are not having a task assigned. For those players; the tasking is enabled to assign automatically a task. An Assign Menu will be accessible for the player under the command center menu, to configure the automatic tasking to switched on or off.

Defined in:

COMMANDCENTER

Parameter:

#boolean AutoAssign

true for ON and false or nil for OFF.

Sets the menu of the command center.

This command is called within the :New() method.

Defined in:

COMMANDCENTER

Let the command center flash a report of the status of the subscribed task to a group.

Defined in:

COMMANDCENTER

Parameter:

Flash

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

Defined in:

COMMANDCENTER

Set the commandcenter operations in WWII mode This will disable LL, MGRS, BRA, BULLS navigatin messages sent by the Command Center, and will be replaced by a navigation using Reference Zones.

It will also disable the settings at the settings menu for these.

Defined in:

COMMANDCENTER

Return value:

Set special Reference Zones known by the Command Center to guide airborne pilots during WWII.

These Reference Zones are normal trigger zones, with a special naming. The Reference Zones need to be set by the Mission Designer in the Mission Editor. Reference Zones are set by normal trigger zones. One can color the zones in a specific color, and the radius of the zones doesn't matter, only the center of the zone is important. Place the center of these Reference Zones at specific scenery objects or points of interest (like cities, rivers, hills, crossing etc). The trigger zones indicating a Reference Zone need to follow a specific syntax. The name of each trigger zone expressing a Reference Zone need to start with a classification name of the object, followed by a #, followed by a symbolic name of the Reference Zone. A few examples:

  • A church at Tskinvali would be indicated as: Church#Tskinvali
  • A train station near Kobuleti would be indicated as: Station#Kobuleti

Taking the above example, this is how this method would be used:

CC:SetReferenceZones( "Church" )
CC:SetReferenceZones( "Station" )

Defined in:

COMMANDCENTER

Parameter:

#string ReferenceZonePrefix

The name before the #-mark indicating the class of the Reference Zones.

Return value:

Field(s)

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Remove Unit Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Creation of a Takeoff Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

Log an exception which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Returns the event dispatcher

Defined in:

Return value:

Remove all subscribed events

Defined in:

Return value:

Trace a function call.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 2.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function call level 3.

Must be at the beginning of the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Get the ClassID of the class instance.

Defined in:

Return value:

#string:

The ClassID of the class instance.

Get the ClassName of the class instance.

Defined in:

Return value:

#string:

The ClassName of the class instance.

Get the ClassName + ClassID of the class instance.

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

Defined in:

Return value:

#string:

The ClassName + ClassID of the class instance.

Get the Class Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Return value:

#number:

The Event processing Priority.

This is the worker method to retrieve the Parent class.

Note that the Parent class must be passed to call the parent class method.

self:GetParent(self):ParentMethod()


Defined in:

Parameters:

#BASE Child

This is the Child class from which the Parent class needs to be retrieved.

#BASE FromClass

(Optional) The class from which to get the parent.

Return value:

Get a Value given a Key from the Object.

Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

The key that is used to retrieve the value. Note that the key can be a #string, but it can also be any other type!

Return value:

The Value retrieved or nil if the Key was not found and thus the Value could not be retrieved.

Subscribe to a DCS Event.

Defined in:

Parameters:

#function EventFunction

(optional) The function to be called when the event occurs for the unit.

Return value:

Log an information which will be traced always.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

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

Defined in:

Parameters:

Child

is the Child class that inherits.

#BASE Parent

is the Parent class that the Child inherits from.

Return value:

Child

This is the worker method to check if an object is an (sub)instance of a class.

Examples:

  • ZONE:New( 'some zone' ):IsInstanceOf( ZONE ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'ZONE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'zone' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'BASE' ) will return true

  • ZONE:New( 'some zone' ):IsInstanceOf( 'GROUP' ) will return false

Defined in:

Parameter:

ClassName

is the name of the class or the class itself to run the check against

Return value:

#boolean:

Enquires if tracing is on (for the class).

Defined in:

Return value:

#boolean:

BASE constructor.

This is an example how to use the BASE:New() constructor in a new class definition when inheriting from BASE.

function EVENT:New()
  local self = BASE:Inherit( self, BASE:New() ) -- #EVENT
  return self
end
  

Defined in:

Return value:

Occurs when an object is completely destroyed.

initiator : The unit that is was destroyed.

Defined in:

Parameter:

The EventData structure.

Occurs when a ground unit captures either an airbase or a farp.

initiator : The unit that captured the base place: The airbase that was captured, can be a FARP or Airbase. When calling place:getCoalition() the faction will already be the new owning faction.

Defined in:

Parameter:

The EventData structure.

Occurs when any object is spawned into the mission.

initiator : The unit that was spawned

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft crashes into the ground and is completely destroyed.

initiator : The unit that has crashed

Defined in:

Parameter:

The EventData structure.

Occurs when an object is dead.

initiator : The unit that is dead.

Defined in:

Parameter:

The EventData structure.

Occurs when a pilot ejects from an aircraft initiator : The unit that has ejected

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft shuts down its engines.

initiator : The unit that is stopping its engines.

Defined in:

Parameter:

The EventData structure.

Occurs when any aircraft starts its engines.

initiator : The unit that is starting its engines.

Defined in:

Parameter:

The EventData structure.

Occurs whenever an object is hit by a weapon.

initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.

Defined in:

Parameter:

The EventData structure.

Occurs when any system fails on a human controlled aircraft.

initiator : The unit that had the failure

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft lands at an airbase, farp or ship initiator : The unit that has landed place: Object that the unit landed on.

Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

Occurs when a new mark was added.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark text was changed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mark was removed.

MarkID: ID of the mark.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts

Defined in:

Parameter:

The EventData structure.

Occurs when the pilot of an aircraft is killed.

Can occur either if the player is alive and crashes or if a weapon kills the pilot without completely destroying the plane. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

Occurs when any player assumes direct control of a unit.

initiator : The unit that is being taken control of.

Defined in:

Parameter:

The EventData structure.

Occurs when any player relieves control of a unit to the AI.

initiator : The unit that the player left.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft connects with a tanker and begins taking on fuel.

initiator : The unit that is receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft is finished taking fuel.

initiator : The unit that was receiving fuel.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit stops firing its weapon.

Event will always correspond with a shooting start event. initiator : The unit that was doing the shooting.

Defined in:

Parameter:

The EventData structure.

Occurs when any unit begins firing a weapon that has a high rate of fire.

Most common with aircraft cannons (GAU-8), autocannons, and machine guns. initiator : The unit that is doing the shooting. target: The unit that is being targeted.

Defined in:

Parameter:

The EventData structure.

Occurs whenever any unit in a mission fires a weapon.

But not any machine gun or autocannon based weapon, those are handled by EVENT.ShootingStart.

Defined in:

Parameter:

The EventData structure.

Occurs when an aircraft takes off from an airbase, farp, or ship.

initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameters:

#number Start

Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.

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

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#number:

The ScheduleID of the planned schedule.

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.

Defined in:

Parameters:

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

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

Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.

Return value:

#number:

The ScheduleID of the planned schedule.

Stops the Schedule.

Defined in:

Parameter:

#function SchedulerFunction

The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.

Set the Class Event processing Priority.

The Event processing Priority is a number from 1 to 10, reflecting the order of the classes subscribed to the Event to be processed.

Defined in:

Parameter:

#number EventPriority

The Event processing Priority.

Return value:

self

Set a state or property of the Object given a Key and a Value.

Note that if the Object is destroyed, nillified or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that will hold the Value set by the Key.

Key

The key that is used as a reference of the value. Note that the key can be a #string, but it can also be any other type!

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 2.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace a function logic level 3.

Can be anywhere within the function logic.

Defined in:

Parameter:

Arguments

A #table or any field.

Trace all methods in MOOSE

Defined in:

Parameter:

#boolean TraceAll

true = trace all methods in MOOSE.

Set tracing for a class

Defined in:

Parameter:

#string Class

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

#string Method

Set trace level

Defined in:

Parameter:

#number Level

Set trace off.

Defined in:

Usage:

-- Switch the tracing Off
BASE:TraceOff()

Set trace on.

Defined in:

Usage:

-- Switch the tracing On
BASE:TraceOn()

Set trace on or off Note that when trace is off, no BASE.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.

Defined in:

Parameter:

#boolean TraceOnOff

Switch the tracing on or off.

Usage:

-- Switch the tracing On
BASE:TraceOnOff( true )

-- Switch the tracing Off
BASE:TraceOnOff( false )

UnSubscribe to a DCS event.

Defined in:

Parameter:

Return value:

Trace a function call.

This function is private.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

Trace a function logic.

Defined in:

Parameters:

Arguments

A #table or any field.

DebugInfoCurrentParam

DebugInfoFromParam

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

Defined in:

Parameter:

event