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. |
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.
- COMMANDCENTER.New(): Creates a new COMMANDCENTER 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.
- COMMANDCENTER.AddMission(): Adds a mission to the commandcenter control.
- COMMANDCENTER.RemoveMission(): Removes a mission to the commandcenter control.
- COMMANDCENTER.GetMissions(): Retrieves the missions table controlled by the commandcenter.
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:
- Use the method Tasking.CommandCenter#COMMANDCENTER.MessageToCoalition() to send a specific message to the coalition, with a given message display duration.
- You can send a specific type of message using the method Tasking.CommandCenter#COMMANDCENTER.MessageTypeToCoalition(). This will send a message of a specific type to the coalition, and as a result its display duration will be flexible according the message display time selection by the human player.
To send messages to the group of human players, there are also two methods available:
- Use the method Tasking.CommandCenter#COMMANDCENTER.MessageToGroup() to send a specific message to a group, with a given message display duration.
- You can send a specific type of message using the method Tasking.CommandCenter#COMMANDCENTER.MessageTypeToGroup(). This will send a message of a specific type to the group, and as a result its display duration will be flexible according the message display time selection by the human player .
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:
- Use the method Tasking.CommandCenter#COMMANDCENTER.GetName() to retrieve the name of the command center. This is the name given as part of the Tasking.CommandCenter#COMMANDCENTER.New() constructor. The returned name using this method, is not to be used for message communication.
A textual description can be retrieved that provides the command center name to be used within message communication:
- Tasking.CommandCenter#COMMANDCENTER.GetShortText() returns the command center name as
CC [CommandCenterName]
. - Tasking.CommandCenter#COMMANDCENTER.GetText() returns the command center name as
Command Center [CommandCenterName]
.
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:
- Tasking.CommandCenter#COMMANDCENTER.ReportSummary(): Creates a summary report of all missions governed by the command center.
- Tasking.CommandCenter#COMMANDCENTER.ReportDetails(): Creates a detailed report of all missions governed by the command center.
- Tasking.CommandCenter#COMMANDCENTER.ReportMissionPlayers(): Creates a report listing the players active at the missions governed by the command center.
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.
Developer Note
Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE Therefore, this class is considered to be deprecated
Type(s)
Fields and Methods inherited from COMMANDCENTER | Description |
---|---|
Get all the Groups active within the command center. |
|
Add a MISSION to be governed by the HQ command center. |
|
Assigns a random task to a TaskGroup. |
|
Automatically assigns tasks to all TaskGroups. |
|
Gets the coalition of the command center. |
|
Gets the commandcenter menu structure governed by the HQ command center. |
|
Get the Missions governed by the HQ command center. |
|
Gets the name of the HQ command center. |
|
Gets the POSITIONABLE of the HQ command center. |
|
Gets the short text string of the HQ command center. |
|
Gets the text string of the HQ command center. |
|
Checks of the command center has the given MissionGroup. |
|
Checks of the TaskGroup has a Task. |
|
Returns if the commandcenter operations is in WWII mode |
|
Let the command center send a Message to all players. |
|
Let the command center send a message to the coalition of the command center. |
|
Let the command center send a message to the MessageGroup. |
|
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:New(CommandCenterPositionable, CommandCenterName) |
The constructor takes an IDENTIFIABLE as the HQ command center. |
Removes a MISSION to be governed by the HQ command center. |
|
Let the command center send a report of the status of a task to a group. |
|
Let the command center send a report of the players of all missions to a group. |
|
Let the command center send a report of the status of all missions to a group. |
|
Automatically accept tasks for all TaskGroups. |
|
Define the method to be used to assign automatically a task from the available tasks in the mission. |
|
Automatically assigns tasks to all TaskGroups. |
|
Sets the menu of the command center. |
|
Let the command center flash a report of the status of the subscribed task to a group. |
|
Sets the menu structure of the Missions governed by the HQ command center. |
|
Duration a command center message is shown. |
|
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. |
|
Set special Reference Zones known by the Command Center to guide airborne pilots during WWII. |
|
Fields and Methods inherited from BASE | Description |
---|---|
The ID number of the class. |
|
The name of the class. |
|
The name of the class concatenated with the ID number of the class. |
|
Clear the state of an object. |
|
COMMANDCENTER:CreateEventBirth(EventTime, Initiator, IniUnitName, place, subplace) |
Creation of a Birth Event. |
COMMANDCENTER:CreateEventCrash(EventTime, Initiator, IniObjectCategory) |
Creation of a Crash Event. |
COMMANDCENTER:CreateEventDead(EventTime, Initiator, IniObjectCategory) |
Creation of a Dead Event. |
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event. |
|
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event. |
|
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event. |
|
Creation of a |
|
Creation of a Remove Unit Event. |
|
Creation of a Takeoff Event. |
|
Creation of a Crash Event. |
|
Log an exception which will be traced always. |
|
Returns the event dispatcher |
|
Remove all subscribed events |
|
Trace a function call. |
|
Trace a function call level 2. |
|
Trace a function call level 3. |
|
Get the ClassID of the class instance. |
|
Get the ClassName of the class instance. |
|
Get the ClassName + ClassID of the class instance. |
|
Get the Class Core.Event processing Priority. |
|
This is the worker method to retrieve the Parent class. |
|
Get a Value given a Key from the Object. |
|
Subscribe to a DCS Event. |
|
Log an information which will be traced always. |
|
This is the worker method to inherit from a parent class. |
|
This is the worker method to check if an object is an (sub)instance of a class. |
|
Enquires if tracing is on (for the class). |
|
BASE constructor. |
|
Occurs when an Event for an object is triggered. |
|
BDA. |
|
Occurs when a ground unit captures either an airbase or a farp. |
|
Occurs when any object is spawned into the mission. |
|
Occurs when any aircraft crashes into the ground and is completely destroyed. |
|
Occurs when an object is dead. |
|
Unknown precisely what creates this event, likely tied into newer damage model. |
|
Discard chair after ejection. |
|
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo. |
|
Occurs when a dynamic cargo crate is removed. |
|
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo. |
|
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when any aircraft shuts down its engines. |
|
Occurs when any aircraft starts its engines. |
|
Occurs whenever an object is hit by a weapon. |
|
Occurs when any system fails on a human controlled aircraft. |
|
Occurs on the death of a unit. |
|
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up. |
|
Landing quality mark. |
|
Occurs when a new mark was added. |
|
Occurs when a mark text was changed. |
|
Occurs when a mark was removed. |
|
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes. |
|
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu. |
|
Weapon add. |
|
Occurs when the pilot of an aircraft is killed. |
|
Occurs when a player enters a slot and takes control of an aircraft. |
|
Occurs when any player assumes direct control of a unit. |
|
Occurs when any player relieves control of a unit to the AI. |
|
Occurs when an aircraft connects with a tanker and begins taking on fuel. |
|
Occurs when an aircraft is finished taking fuel. |
|
Occurs when any modification to the "Score" as seen on the debrief menu would occur. |
|
Occurs when any unit stops firing its weapon. |
|
Occurs when any unit begins firing a weapon that has a high rate of fire. |
|
Occurs whenever any unit in a mission fires a weapon. |
|
Occurs when an aircraft takes off from an airbase, farp, or ship. |
|
Trigger zone. |
|
Occurs when the game thinks an object is destroyed. |
|
Schedule a new time event. |
|
COMMANDCENTER:ScheduleRepeat(Start, Repeat, RandomizeFactor, Stop, SchedulerFunction, ...) |
Schedule a new time event. |
Stops the Schedule. |
|
Set the Class Core.Event processing Priority. |
|
Set a state or property of the Object given a Key and a Value. |
|
Trace a function logic level 1. |
|
Trace a function logic level 2. |
|
Trace a function logic level 3. |
|
Trace all methods in MOOSE |
|
Set tracing for a class |
|
Set tracing for a specific method of class |
|
Set trace level |
|
Set trace off. |
|
Set trace on. |
|
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. |
|
UnSubscribe to a DCS event. |
|
COMMANDCENTER:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function call. |
(Internal) Serialize arguments |
|
COMMANDCENTER:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam) |
Trace a function logic. |
The main event handling function... |
Fields and Methods inherited from COMMANDCENTER.AutoAssignMethods | Description |
---|---|
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.
Assigns a random task to a TaskGroup.
Automatically assigns tasks to all TaskGroups.
Defined in:
COMMANDCENTER
Gets the coalition of the command center.
Defined in:
COMMANDCENTER
Return value:
#number:
Coalition of the command center.
Gets the commandcenter menu structure governed by the HQ command center.
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.
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.
Core.Message#MESSAGE.MessageType MessageType
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.
Core.Message#MESSAGE.MessageType MessageType
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.
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.
Tasking.Task#TASK Task
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:
- Random - assigns a random task in the mission to the player.
- Distance - assigns a task based on a distance evaluation from the player. The closest are to be assigned first.
- 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:
#COMMANDCENTER.AutoAssignMethods AutoAssignMethod
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
boolean
Sets the menu structure of the Missions governed by the HQ command center.
Defined in:
COMMANDCENTER
Duration a command center message is shown.
Defined in:
COMMANDCENTER
Parameter:
seconds
number
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.
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.
IniObjectCategory
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.
IniObjectCategory
Creation of a S_EVENT_DYNAMIC_CARGO_LOADED event.
Creation of a S_EVENT_DYNAMIC_CARGO_REMOVED event.
Creation of a S_EVENT_DYNAMIC_CARGO_UNLOADED event.
Creation of a S_EVENT_NEW_DYNAMIC_CARGO event.
Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT
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.
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.
Log an exception which will be traced always.
Can be anywhere within the function logic.
Returns the event dispatcher
Remove all subscribed events
Trace a function call.
Must be at the beginning of the function logic.
Trace a function call level 2.
Must be at the beginning of the function logic.
Trace a function call level 3.
Must be at the beginning of the function logic.
Get the ClassID of the class instance.
Get the ClassName of the class instance.
Get the ClassName + ClassID of the class instance.
The ClassName + ClassID is formatted as '%s#%09d'.
Get the Class Core.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.
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()
Get a Value given a Key from the Object.
Note that if the Object is destroyed, set to nil, 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:
Core.Event#EVENTS EventID
Event ID.
#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.
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).
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
Occurs when an Event for an object is triggered.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that triggered the event.
Occurs when a ground unit captures either an airbase or a farp.
Have a look at the class Core.Event#EVENT as these are just the prototypes. 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.
Occurs when any object is spawned into the mission.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was spawned
Occurs when any aircraft crashes into the ground and is completely destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that has crashed
Occurs when an object is dead.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is dead.
Unknown precisely what creates this event, likely tied into newer damage model.
Will update this page when new information become available.
- initiator: The unit that had the failure.
Discard chair after ejection.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player loads a dynamic cargo object with the F8 ground crew menu into a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a dynamic cargo crate is removed.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a player unloads a dynamic cargo object with the F8 ground crew menu from a helo.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Occurs when a pilot ejects from an aircraft Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has ejected
Occurs when any aircraft shuts down its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is stopping its engines.
Occurs when any aircraft starts its engines.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is starting its engines.
Occurs whenever an object is hit by a weapon.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit object the fired the weapon weapon: Weapon object that hit the target target: The Object that was hit.
Occurs when any system fails on a human controlled aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that had the failure
Occurs on the death of a unit.
Contains more and different information. Similar to unit_lost it will occur for aircraft before the aircraft crash event occurs. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that killed the target
- target: Target Object
- weapon: Weapon Object
Occurs when an aircraft lands at an airbase, farp or ship Have a look at the class Core.Event#EVENT as these are just the prototypes.
initiator : The unit that has landed place: Object that the unit landed on. Can be an Airbase Object, FARP, or Ships
Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.
Event does not occur if the pilot lands in the water and sub combs to Davey Jones Locker. Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: Static object representing the ejected pilot. Place : Aircraft that the pilot ejected from.
- place: may not return as a valid object if the aircraft has crashed into the ground and no longer exists.
- subplace: is always 0 for unknown reasons.
Occurs when a new mark was added.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark text was changed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mark was removed.
Have a look at the class Core.Event#EVENT as these are just the prototypes. MarkID: ID of the mark.
Occurs when a mission ends Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a mission starts Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when a player creates a dynamic cargo object from the F8 ground crew menu.
* NOTE * this is a workarounf for DCS not creating these events as of Aug 2024.
Weapon add.
Fires when entering a mission per pylon with the name of the weapon (double pylons not counted, infinite wep reload not counted. Have a look at the class Core.Event#EVENT as these are just the prototypes.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.
Occurs when a player enters a slot and takes control of an aircraft.
Have a look at the class Core.Event#EVENT as these are just the prototypes. NOTE: This is a workaround of a long standing DCS bug with the PLAYER_ENTER_UNIT event. initiator : The unit that is being taken control of.
Occurs when any player assumes direct control of a unit.
Note - not Mulitplayer safe. Use PlayerEnterAircraft. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is being taken control of.
Occurs when any player relieves control of a unit to the AI.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that the player left.
Occurs when an aircraft connects with a tanker and begins taking on fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is receiving fuel.
Occurs when an aircraft is finished taking fuel.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was receiving fuel.
Occurs when any modification to the "Score" as seen on the debrief menu would occur.
There is no information on what values the score was changed to. Event is likely similar to player_comment in this regard. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when any unit stops firing its weapon.
Event will always correspond with a shooting start event. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that was doing the shooting.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that is doing the shooting. target: The unit that is being targeted.
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. Have a look at the class Core.Event#EVENT as these are just the prototypes.
Occurs when an aircraft takes off from an airbase, farp, or ship.
Have a look at the class Core.Event#EVENT as these are just the prototypes. initiator : The unit that tookoff place: Object from where the AI took-off from. Can be an Airbase Object, FARP, or Ships
Occurs when the game thinks an object is destroyed.
Have a look at the class Core.Event#EVENT as these are just the prototypes.
- initiator: The unit that is was destroyed.
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:
#string:
The Schedule ID 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:
#string:
The Schedule ID of the planned schedule.
Stops the Schedule.
Defined in:
Parameter:
#string SchedulerID
(Optional) Scheduler ID to be stopped. If nil, all pending schedules are stopped.
Set the Class Core.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.
Set a state or property of the Object given a Key and a Value.
Note that if the Object is destroyed, set to nil, 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.
Trace a function logic level 2.
Can be anywhere within the function logic.
Trace a function logic level 3.
Can be anywhere within the function logic.
Trace all methods in MOOSE
Set tracing for a class
Set tracing for a specific method of class
Set trace off.
Set trace on.
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.
Trace a function call.
This function is private.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
(Internal) Serialize arguments
Trace a function logic.
Defined in:
Parameters:
Arguments
A #table or any field.
DebugInfoCurrentParam
DebugInfoFromParam
The main event handling function...
This function captures all events generated for the class.