Banner Image

Module Utils.FiFo

UTILS - ClassicFiFo Stack.


Main Features:

  • Build a simple multi-purpose FiFo (First-In, First-Out) stack for generic data.
  • [Wikipedia](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics)

Author: applevangelist

Global(s)

Global FIFO

Global LIFO

Type(s)

FIFO , extends Core.Base#BASE
Fields and Methods inherited from FIFO Description

FIFO.ClassName

Name of the class.

FIFO:Clear()

Empty FIFO Stack

FIFO:Count()

FIFO Get stack size

FIFO:Flatten()

FIFO Housekeeping

FIFO:Flush()

FIFO Print stacks to dcs.log

FIFO:ForEach(IteratorFunction, Arg, Function, FunctionArguments)

Iterate the FIFO and call an iterator function for the given FIFO data, providing the object for each element of the stack and optional parameters.

FIFO:GetDataTable()

FIFO Get table of data entries

FIFO:GetIDStack()

FIFO Get the data stack by UniqueID

FIFO:GetIDStackSorted()

FIFO Get table of UniqueIDs sorted smallest to largest

FIFO:GetPointerStack()

FIFO Get the data stack by pointer

FIFO:GetSize()

FIFO Get stack size

FIFO:GetSortedDataTable()

FIFO Get sorted table of data entries by UniqueIDs (must be numerical UniqueIDs only!)

FIFO:HasUniqueID(UniqueID)

FIFO Check if a certain UniqeID exists

FIFO:IsEmpty()

FIFO Check Stack is empty

FIFO:IsNotEmpty()

FIFO Check Stack is NOT empty

FIFO:New()

Instantiate a new FIFO Stack

FIFO:Pull()

FIFO Pull Object from Stack

FIFO:PullByID(UniqueID)

FIFO Pull Object from Stack by UniqueID

FIFO:PullByPointer(Pointer)

FIFO Pull Object from Stack by Pointer

FIFO:Push(Object, UniqueID)

FIFO Push Object to Stack

FIFO:ReadByID(UniqueID)

FIFO Read, not Pull, Object from Stack by UniqueID

FIFO:ReadByPointer(Pointer)

FIFO Read, not Pull, Object from Stack by Pointer

FIFO.counter

FIFO.lid

Class id string for output to DCS log file.

FIFO.pointer

FIFO.stackbyid

FIFO.stackbypointer

FIFO.uniquecounter

FIFO.version

Version of FiFo

Fields and Methods inherited from BASE Description

FIFO.ClassID

The ID number of the class.

FIFO.ClassName

The name of the class.

FIFO.ClassNameAndID

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

FIFO:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

FIFO:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

FIFO:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

FIFO:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

FIFO:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

FIFO:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

FIFO:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

FIFO:E(Arguments)

Log an exception which will be traced always.

FIFO:EventDispatcher()

Returns the event dispatcher

FIFO:EventRemoveAll()

Remove all subscribed events

FIFO:F(Arguments)

Trace a function call.

FIFO:F2(Arguments)

Trace a function call level 2.

FIFO:F3(Arguments)

Trace a function call level 3.

FIFO:GetClassID()

Get the ClassID of the class instance.

FIFO:GetClassName()

Get the ClassName of the class instance.

FIFO:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

FIFO:GetEventPriority()

Get the Class Event processing Priority.

FIFO:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

FIFO:GetState(Object, Key)

Get a Value given a Key from the Object.

FIFO:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

FIFO:I(Arguments)

Log an information which will be traced always.

FIFO:Inherit(Child, Parent)

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

FIFO:IsInstanceOf(ClassName)

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

FIFO:IsTrace()

Enquires if tracing is on (for the class).

FIFO:New()

BASE constructor.

FIFO:OnEvent(EventData)

Occurs when an Event for an object is triggered.

FIFO:OnEventBDA(EventData)

BDA.

FIFO:OnEventBaseCaptured(EventData)

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

FIFO:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

FIFO:OnEventCrash(EventData)

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

FIFO:OnEventDead(EventData)

Occurs when an object is dead.

FIFO:OnEventDetailedFailure(EventData)

Unknown precisely what creates this event, likely tied into newer damage model.

FIFO:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

FIFO:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

FIFO:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

FIFO:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

FIFO:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

FIFO:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

FIFO:OnEventKill(EventData)

Occurs on the death of a unit.

FIFO:OnEventLand(EventData)

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.

FIFO:OnEventLandingAfterEjection(EventData)

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

FIFO:OnEventLandingQualityMark(EventData)

Landing quality mark.

FIFO:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

FIFO:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

FIFO:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

FIFO:OnEventMissionEnd(EventData)

Occurs when a mission ends Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

FIFO:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

FIFO:OnEventParatrooperLanding(EventData)

Weapon add.

FIFO:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

FIFO:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

FIFO:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

FIFO:OnEventPlayerLeaveUnit(EventData)

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

FIFO:OnEventRefueling(EventData)

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

FIFO:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

FIFO:OnEventScore(EventData)

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

FIFO:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

FIFO:OnEventShootingStart(EventData)

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

FIFO:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

FIFO:OnEventTakeoff(EventData)

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

FIFO:OnEventTriggerZone(EventData)

Trigger zone.

FIFO:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

FIFO:ScheduleStop(SchedulerID)

Stops the Schedule.

FIFO.Scheduler

FIFO:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

FIFO:SetState(Object, Key, Value)

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

FIFO:T(Arguments)

Trace a function logic level 1.

FIFO:T2(Arguments)

Trace a function logic level 2.

FIFO:T3(Arguments)

Trace a function logic level 3.

FIFO:TraceAll(TraceAll)

Trace all methods in MOOSE

FIFO:TraceClass(Class)

Set tracing for a class

FIFO:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

FIFO:TraceLevel(Level)

Set trace level

FIFO:TraceOff()

Set trace off.

FIFO:TraceOn()

Set trace on.

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

FIFO:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

FIFO._

FIFO:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

FIFO:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

FIFO.__

FIFO:onEvent(event)

The main event handling function...

Fields and Methods inherited from FIFO.IDEntry Description

FIFO.IDEntry.data

FIFO.IDEntry.pointer

FIFO.IDEntry.uniqueID

LIFO , extends Core.Base#BASE
Fields and Methods inherited from LIFO Description

LIFO.ClassName

Name of the class.

LIFO:Clear()

Empty LIFO Stack

LIFO:Count()

LIFO Get stack size

LIFO:Flatten()

LIFO Housekeeping

LIFO:Flush()

LIFO Print stacks to dcs.log

LIFO:ForEach(IteratorFunction, Arg, Function, FunctionArguments)

Iterate the LIFO and call an iterator function for the given LIFO data, providing the object for each element of the stack and optional parameters.

LIFO:GetDataTable()

LIFO Get table of data entries

LIFO:GetIDStack()

LIFO Get the data stack by UniqueID

LIFO:GetIDStackSorted()

LIFO Get table of UniqueIDs sorted smallest to largest

LIFO:GetPointerStack()

LIFO Get the data stack by pointer

LIFO:GetSize()

LIFO Get stack size

LIFO:GetSortedDataTable()

LIFO Get sorted table of data entries by UniqueIDs (must be numerical UniqueIDs only!)

LIFO:HasUniqueID(UniqueID)

LIFO Check if a certain UniqeID exists

LIFO:IsEmpty()

LIFO Check Stack is empty

LIFO:IsNotEmpty()

LIFO Check Stack is NOT empty

LIFO:New()

Instantiate a new LIFO Stack

LIFO:Pull()

LIFO Pull Object from Stack

LIFO:PullByID(UniqueID)

LIFO Pull Object from Stack by UniqueID

LIFO:PullByPointer(Pointer)

LIFO Pull Object from Stack by Pointer

LIFO:Push(Object, UniqueID)

LIFO Push Object to Stack

LIFO:ReadByID(UniqueID)

LIFO Read, not Pull, Object from Stack by UniqueID

LIFO:ReadByPointer(Pointer)

LIFO Read, not Pull, Object from Stack by Pointer

LIFO.counter

LIFO.lid

Class id string for output to DCS log file.

LIFO.pointer

LIFO.stackbyid

LIFO.stackbypointer

LIFO.uniquecounter

LIFO.version

Version of LiFo

Fields and Methods inherited from BASE Description

LIFO.ClassID

The ID number of the class.

LIFO.ClassName

The name of the class.

LIFO.ClassNameAndID

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

LIFO:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

LIFO:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

LIFO:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

LIFO:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

LIFO:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

LIFO:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

LIFO:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

LIFO:E(Arguments)

Log an exception which will be traced always.

LIFO:EventDispatcher()

Returns the event dispatcher

LIFO:EventRemoveAll()

Remove all subscribed events

LIFO:F(Arguments)

Trace a function call.

LIFO:F2(Arguments)

Trace a function call level 2.

LIFO:F3(Arguments)

Trace a function call level 3.

LIFO:GetClassID()

Get the ClassID of the class instance.

LIFO:GetClassName()

Get the ClassName of the class instance.

LIFO:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

LIFO:GetEventPriority()

Get the Class Event processing Priority.

LIFO:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

LIFO:GetState(Object, Key)

Get a Value given a Key from the Object.

LIFO:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

LIFO:I(Arguments)

Log an information which will be traced always.

LIFO:Inherit(Child, Parent)

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

LIFO:IsInstanceOf(ClassName)

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

LIFO:IsTrace()

Enquires if tracing is on (for the class).

LIFO:New()

BASE constructor.

LIFO:OnEvent(EventData)

Occurs when an Event for an object is triggered.

LIFO:OnEventBDA(EventData)

BDA.

LIFO:OnEventBaseCaptured(EventData)

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

LIFO:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

LIFO:OnEventCrash(EventData)

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

LIFO:OnEventDead(EventData)

Occurs when an object is dead.

LIFO:OnEventDetailedFailure(EventData)

Unknown precisely what creates this event, likely tied into newer damage model.

LIFO:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

LIFO:OnEventEjection(EventData)

Occurs when a pilot ejects from an aircraft Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

LIFO:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

LIFO:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

LIFO:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

LIFO:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

LIFO:OnEventKill(EventData)

Occurs on the death of a unit.

LIFO:OnEventLand(EventData)

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.

LIFO:OnEventLandingAfterEjection(EventData)

Occurs shortly after the landing animation of an ejected pilot touching the ground and standing up.

LIFO:OnEventLandingQualityMark(EventData)

Landing quality mark.

LIFO:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

LIFO:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

LIFO:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

LIFO:OnEventMissionEnd(EventData)

Occurs when a mission ends Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

LIFO:OnEventMissionStart(EventData)

Occurs when a mission starts Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

LIFO:OnEventParatrooperLanding(EventData)

Weapon add.

LIFO:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

LIFO:OnEventPlayerEnterAircraft(EventData)

Occurs when a player enters a slot and takes control of an aircraft.

LIFO:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

LIFO:OnEventPlayerLeaveUnit(EventData)

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

LIFO:OnEventRefueling(EventData)

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

LIFO:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

LIFO:OnEventScore(EventData)

Occurs when any modification to the "Score" as seen on the debrief menu would occur.

LIFO:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

LIFO:OnEventShootingStart(EventData)

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

LIFO:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

LIFO:OnEventTakeoff(EventData)

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

LIFO:OnEventTriggerZone(EventData)

Trigger zone.

LIFO:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

LIFO:ScheduleStop(SchedulerID)

Stops the Schedule.

LIFO.Scheduler

LIFO:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

LIFO:SetState(Object, Key, Value)

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

LIFO:T(Arguments)

Trace a function logic level 1.

LIFO:T2(Arguments)

Trace a function logic level 2.

LIFO:T3(Arguments)

Trace a function logic level 3.

LIFO:TraceAll(TraceAll)

Trace all methods in MOOSE

LIFO:TraceClass(Class)

Set tracing for a class

LIFO:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

LIFO:TraceLevel(Level)

Set trace level

LIFO:TraceOff()

Set trace off.

LIFO:TraceOn()

Set trace on.

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

LIFO:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

LIFO._

LIFO:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

LIFO:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

LIFO.__

LIFO:onEvent(event)

The main event handling function...

Fields and Methods inherited from LIFO.IDEntry Description

LIFO.IDEntry.data

LIFO.IDEntry.pointer

LIFO.IDEntry.uniqueID

FIFO class.

Field(s)

#string FIFO.ClassName

Name of the class.

#number FIFO.counter
#string FIFO.lid

Class id string for output to DCS log file.

#number FIFO.pointer
#string FIFO.version

Version of FiFo

Function(s)

Empty FIFO Stack

Defined in:

FIFO

Return value:

self

FIFO Get stack size

Defined in:

FIFO

Return value:

#number:

size

FIFO Housekeeping

Defined in:

FIFO

Return value:

self

FIFO Print stacks to dcs.log

Defined in:

FIFO

Return value:

self

Iterate the FIFO and call an iterator function for the given FIFO data, providing the object for each element of the stack and optional parameters.

Defined in:

FIFO

Parameters:

#function IteratorFunction

The function that will be called.

#table Arg

(Optional) Further Arguments of the IteratorFunction.

#function Function

(Optional) A function returning a #boolean true/false. Only if true, the IteratorFunction is called.

#table FunctionArguments

(Optional) Function arguments.

Return value:

self

FIFO Get table of data entries

Defined in:

FIFO

Return value:

#table:

Raw table indexed [1] to [n] of object entries - might be empty!

FIFO Get the data stack by UniqueID

Defined in:

FIFO

Return value:

#table:

Table of #FIFO.IDEntry entries

FIFO Get table of UniqueIDs sorted smallest to largest

Defined in:

FIFO

Return value:

#table:

Table with index [1] to [n] of UniqueID entries

FIFO Get the data stack by pointer

Defined in:

FIFO

Return value:

#table:

Table of #FIFO.IDEntry entries

FIFO Get stack size

Defined in:

FIFO

Return value:

#number:

size

FIFO Get sorted table of data entries by UniqueIDs (must be numerical UniqueIDs only!)

Defined in:

FIFO

Return value:

#table:

Table indexed [1] to [n] of sorted object entries - might be empty!

FIFO Check if a certain UniqeID exists

Defined in:

FIFO

Parameter:

UniqueID

Return value:

#boolean:

exists

FIFO Check Stack is empty

Defined in:

FIFO

Return value:

#boolean:

empty

FIFO Check Stack is NOT empty

Defined in:

FIFO

Return value:

#boolean:

notempty

Instantiate a new FIFO Stack

Defined in:

FIFO

Return value:

self

FIFO Pull Object from Stack

Defined in:

FIFO

Return value:

#table:

Object or nil if stack is empty

FIFO Pull Object from Stack by UniqueID

Defined in:

FIFO

Parameter:

UniqueID

Return value:

#table:

Object or nil if stack is empty

FIFO Pull Object from Stack by Pointer

Defined in:

FIFO

Parameter:

#number Pointer

Return value:

#table:

Object or nil if stack is empty

FIFO Push Object to Stack

Defined in:

FIFO

Parameters:

#table Object

#string UniqueID

(optional) - will default to current pointer + 1. Note - if you intend to use FIFO:GetIDStackSorted() keep the UniqueID numerical!

Return value:

self

FIFO Read, not Pull, Object from Stack by UniqueID

Defined in:

FIFO

Parameter:

#number UniqueID

Return value:

#table:

Object data or nil if stack is empty or ID does not exist

FIFO Read, not Pull, Object from Stack by Pointer

Defined in:

FIFO

Parameter:

#number Pointer

Return value:

#table:

Object or nil if stack is empty or pointer does not exist

Field(s)

#string FIFO.ClassName

Name of the class.

#number FIFO.counter
#string FIFO.lid

Class id string for output to DCS log file.

#number FIFO.pointer
#string FIFO.version

Version of FiFo

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.

IniObjectCategory

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

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.

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:

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.

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

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Discard chair after ejection.

Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Landing quality mark.

Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

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. Have a look at the class Core.EVENT#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

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

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. Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

Trigger zone.

Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

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:

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

Class name.

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

Class name.

#string Method

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:

Event ID.

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

The main event handling function...

This function captures all events generated for the class.

Defined in:

Parameter:

DCS#Event event

Field(s)

Function(s)

LIFO class.

Field(s)

#string LIFO.ClassName

Name of the class.

#number LIFO.counter
#string LIFO.lid

Class id string for output to DCS log file.

#number LIFO.pointer
#string LIFO.version

Version of LiFo

Function(s)

Empty LIFO Stack

Defined in:

LIFO

Return value:

self

LIFO Get stack size

Defined in:

LIFO

Return value:

#number:

size

LIFO Housekeeping

Defined in:

LIFO

Return value:

self

LIFO Print stacks to dcs.log

Defined in:

LIFO

Return value:

self

Iterate the LIFO and call an iterator function for the given LIFO data, providing the object for each element of the stack and optional parameters.

Defined in:

LIFO

Parameters:

#function IteratorFunction

The function that will be called.

#table Arg

(Optional) Further Arguments of the IteratorFunction.

#function Function

(Optional) A function returning a #boolean true/false. Only if true, the IteratorFunction is called.

#table FunctionArguments

(Optional) Function arguments.

Return value:

self

LIFO Get table of data entries

Defined in:

LIFO

Return value:

#table:

Raw table indexed [1] to [n] of object entries - might be empty!

LIFO Get the data stack by UniqueID

Defined in:

LIFO

Return value:

#table:

Table of #LIFO.IDEntry entries

LIFO Get table of UniqueIDs sorted smallest to largest

Defined in:

LIFO

Return value:

#table:

Table of #LIFO.IDEntry entries

LIFO Get the data stack by pointer

Defined in:

LIFO

Return value:

#table:

Table of #LIFO.IDEntry entries

LIFO Get stack size

Defined in:

LIFO

Return value:

#number:

size

LIFO Get sorted table of data entries by UniqueIDs (must be numerical UniqueIDs only!)

Defined in:

LIFO

Return value:

#table:

Table indexed [1] to [n] of sorted object entries - might be empty!

LIFO Check if a certain UniqeID exists

Defined in:

LIFO

Parameter:

UniqueID

Return value:

#boolean:

exists

LIFO Check Stack is empty

Defined in:

LIFO

Return value:

#boolean:

empty

LIFO Check Stack is NOT empty

Defined in:

LIFO

Return value:

#boolean:

notempty

Instantiate a new LIFO Stack

Defined in:

LIFO

Return value:

self

LIFO Pull Object from Stack

Defined in:

LIFO

Return value:

#table:

Object or nil if stack is empty

LIFO Pull Object from Stack by UniqueID

Defined in:

LIFO

Parameter:

UniqueID

Return value:

#table:

Object or nil if stack is empty

LIFO Pull Object from Stack by Pointer

Defined in:

LIFO

Parameter:

#number Pointer

Return value:

#table:

Object or nil if stack is empty

LIFO Push Object to Stack

Defined in:

LIFO

Parameters:

#table Object

#string UniqueID

(optional) - will default to current pointer + 1

Return value:

self

LIFO Read, not Pull, Object from Stack by UniqueID

Defined in:

LIFO

Parameter:

#number UniqueID

Return value:

#table:

Object or nil if stack is empty or ID does not exist

LIFO Read, not Pull, Object from Stack by Pointer

Defined in:

LIFO

Parameter:

#number Pointer

Return value:

#table:

Object or nil if stack is empty or pointer does not exist

Field(s)

#string LIFO.ClassName

Name of the class.

#number LIFO.counter
#string LIFO.lid

Class id string for output to DCS log file.

#number LIFO.pointer
#string LIFO.version

Version of LiFo

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.

IniObjectCategory

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

Defined in:

Parameter:

Wrapper.Unit#UNIT PlayerUnit

The aircraft unit the player entered.

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.

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:

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.

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

Defined in:

Parameter:

The EventData structure.

BDA.

Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Discard chair after ejection.

Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Landing quality mark.

Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission ends Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

Occurs when a mission starts Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

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. Have a look at the class Core.EVENT#EVENT as these are just the prototypes. initiator : The unit that the pilot has died in.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

Defined in:

Parameter:

The EventData structure.

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.

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

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. Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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

Defined in:

Parameter:

The EventData structure.

Trigger zone.

Have a look at the class Core.EVENT#EVENT as these are just the prototypes.

Defined in:

Parameter:

The EventData structure.

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.

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:

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

Class name.

Set tracing for a specific method of class

Defined in:

Parameters:

#string Class

Class name.

#string Method

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:

Event ID.

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

The main event handling function...

This function captures all events generated for the class.

Defined in:

Parameter:

DCS#Event event

Field(s)

Function(s)