Banner Image

Module Sound.SoundOutput

Sound - Sound output classes.


Features:

  • Create a SOUNDFILE object (mp3 or ogg) to be played via DCS or SRS transmissions
  • Create a SOUNDTEXT object for text-to-speech output vis SRS Simple-Text-To-Speech (STTS)

Author: funkyfranky


There are two classes, SOUNDFILE and SOUNDTEXT, defined in this section that deal with playing sound files or arbitrary text (via SRS Simple-Text-To-Speech), respectively.

The SOUNDFILE and SOUNDTEXT objects can be defined and used in other MOOSE classes.

Global(s)

Global SOUNDBASE

Basic sound output inherited by other classes suche as SOUNDFILE and SOUNDTEXT.

#SOUNDBASE SOUNDBASE

Basic sound output inherited by other classes suche as SOUNDFILE and SOUNDTEXT.

This class is not meant to be used by "ordinary" users.

Global SOUNDFILE

Sound files used by other classes.

#SOUNDFILE SOUNDFILE

Sound files used by other classes.

The SOUNDFILE Concept

A SOUNDFILE object hold the important properties that are necessary to play the sound file, e.g. its file name, path, duration.

It can be created with the SOUNDFILE.New(FileName, Path, Duration) function:

local soundfile=SOUNDFILE:New("My Soundfile.ogg", "Sound File/", 3.5)

SRS

If sound files are supposed to be played via SRS, you need to use the SOUNDFILE.SetPlayWithSRS() function.

Location/Path

DCS

DCS can only play sound files that are located inside the mission (.miz) file. In particular, DCS cannot make use of files that are stored on your hard drive.

The default location where sound files are stored in DCS is the directory "l10n/DEFAULT/". This is where sound files are placed, if they are added via the mission editor (TRIGGERS-->ACTIONS-->SOUND TO ALL). Note however, that sound files which are not added with a trigger command, will be deleted each time the mission is saved! Therefore, this directory is not ideal to be used especially if many sound files are to be included since for each file a trigger action needs to be created. Which is cumbersome, to say the least.

The recommended way is to create a new folder inside the mission (.miz) file (a miz file is essentially zip file and can be opened, e.g., with 7-Zip) and to place the sound files in there. Sound files in these folders are not wiped out by DCS on the next save.

SRS

SRS sound files need to be located on your local drive (not inside the miz). Therefore, you need to specify the full path.

Global SOUNDTEXT

Text-to-speech objects for other classes.

#SOUNDTEXT SOUNDTEXT

Text-to-speech objects for other classes.

The SOUNDTEXT Concept

A SOUNDTEXT object holds all necessary information to play a general text via SRS Simple-Text-To-Speech.

It can be created with the SOUNDTEXT.New(Text, Duration) function.

Options

Gender

You can choose a gender ("male" or "femal") with the SOUNDTEXT.SetGender(Gender) function. Note that the gender voice needs to be installed on your windows machine for the used culture (see below).

Culture

You can choose a "culture" (accent) with the SOUNDTEXT.SetCulture(Culture) function, where the default (SRS) culture is "en-GB".

Other examples for culture are: "en-US" (US accent), "de-DE" (German), "it-IT" (Italian), "ru-RU" (Russian), "zh-CN" (Chinese).

Note that the chosen culture needs to be installed on your windows machine.

Specific Voice

You can use a specific voice for the transmission with the SOUNDTEXT.SetVoice(VoiceName) function. Here are some examples

  • Name: Microsoft Hazel Desktop, Culture: en-GB, Gender: Female, Age: Adult, Desc: Microsoft Hazel Desktop - English (Great Britain)
  • Name: Microsoft David Desktop, Culture: en-US, Gender: Male, Age: Adult, Desc: Microsoft David Desktop - English (United States)
  • Name: Microsoft Zira Desktop, Culture: en-US, Gender: Female, Age: Adult, Desc: Microsoft Zira Desktop - English (United States)
  • Name: Microsoft Hedda Desktop, Culture: de-DE, Gender: Female, Age: Adult, Desc: Microsoft Hedda Desktop - German
  • Name: Microsoft Helena Desktop, Culture: es-ES, Gender: Female, Age: Adult, Desc: Microsoft Helena Desktop - Spanish (Spain)
  • Name: Microsoft Hortense Desktop, Culture: fr-FR, Gender: Female, Age: Adult, Desc: Microsoft Hortense Desktop - French
  • Name: Microsoft Elsa Desktop, Culture: it-IT, Gender: Female, Age: Adult, Desc: Microsoft Elsa Desktop - Italian (Italy)
  • Name: Microsoft Irina Desktop, Culture: ru-RU, Gender: Female, Age: Adult, Desc: Microsoft Irina Desktop - Russian
  • Name: Microsoft Huihui Desktop, Culture: zh-CN, Gender: Female, Age: Adult, Desc: Microsoft Huihui Desktop - Chinese (Simplified)

Note that this must be installed on your windos machine. Also note that this overrides any culture and gender settings.

Type(s)

Fields and Methods inherited from SOUNDBASE Description

SOUNDBASE.ClassName

Name of the class.

SOUNDBASE.GetSpeechTime(Text, Speed, isGoogle, self, length, speed)

Function returns estimated speech time in seconds.

SOUNDBASE:New()

Constructor to create a new SOUNDBASE object.

Fields and Methods inherited from BASE Description

SOUNDBASE.ClassID

The ID number of the class.

SOUNDBASE.ClassName

The name of the class.

SOUNDBASE.ClassNameAndID

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

SOUNDBASE:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

SOUNDBASE:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

SOUNDBASE:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

SOUNDBASE:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

SOUNDBASE:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

SOUNDBASE:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

SOUNDBASE:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

SOUNDBASE:E(Arguments)

Log an exception which will be traced always.

SOUNDBASE:EventDispatcher()

Returns the event dispatcher

SOUNDBASE:EventRemoveAll()

Remove all subscribed events

SOUNDBASE:F(Arguments)

Trace a function call.

SOUNDBASE:F2(Arguments)

Trace a function call level 2.

SOUNDBASE:F3(Arguments)

Trace a function call level 3.

SOUNDBASE:GetClassID()

Get the ClassID of the class instance.

SOUNDBASE:GetClassName()

Get the ClassName of the class instance.

SOUNDBASE:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

SOUNDBASE:GetEventPriority()

Get the Class Event processing Priority.

SOUNDBASE:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

SOUNDBASE:GetState(Object, Key)

Get a Value given a Key from the Object.

SOUNDBASE:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

SOUNDBASE:I(Arguments)

Log an information which will be traced always.

SOUNDBASE:Inherit(Child, Parent)

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

SOUNDBASE:IsInstanceOf(ClassName)

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

SOUNDBASE:IsTrace()

Enquires if tracing is on (for the class).

SOUNDBASE:New()

BASE constructor.

SOUNDBASE:OnEvent(EventData)

Occurs when an Event for an object is triggered.

SOUNDBASE:OnEventBDA(EventData)

BDA.

SOUNDBASE:OnEventBaseCaptured(EventData)

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

SOUNDBASE:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

SOUNDBASE:OnEventCrash(EventData)

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

SOUNDBASE:OnEventDead(EventData)

Occurs when an object is dead.

SOUNDBASE:OnEventDetailedFailure(EventData)

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

SOUNDBASE:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

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

SOUNDBASE:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

SOUNDBASE:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

SOUNDBASE:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

SOUNDBASE:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

SOUNDBASE:OnEventKill(EventData)

Occurs on the death of a unit.

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

SOUNDBASE:OnEventLandingAfterEjection(EventData)

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

SOUNDBASE:OnEventLandingQualityMark(EventData)

Landing quality mark.

SOUNDBASE:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

SOUNDBASE:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

SOUNDBASE:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

SOUNDBASE:OnEventMissionEnd(EventData)

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

SOUNDBASE:OnEventMissionStart(EventData)

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

SOUNDBASE:OnEventParatrooperLanding(EventData)

Weapon add.

SOUNDBASE:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

SOUNDBASE:OnEventPlayerEnterAircraft(EventData)

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

SOUNDBASE:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

SOUNDBASE:OnEventPlayerLeaveUnit(EventData)

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

SOUNDBASE:OnEventRefueling(EventData)

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

SOUNDBASE:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

SOUNDBASE:OnEventScore(EventData)

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

SOUNDBASE:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

SOUNDBASE:OnEventShootingStart(EventData)

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

SOUNDBASE:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

SOUNDBASE:OnEventTakeoff(EventData)

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

SOUNDBASE:OnEventTriggerZone(EventData)

Trigger zone.

SOUNDBASE:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

SOUNDBASE:ScheduleStop(SchedulerID)

Stops the Schedule.

SOUNDBASE.Scheduler

SOUNDBASE:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

SOUNDBASE:SetState(Object, Key, Value)

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

SOUNDBASE:T(Arguments)

Trace a function logic level 1.

SOUNDBASE:T2(Arguments)

Trace a function logic level 2.

SOUNDBASE:T3(Arguments)

Trace a function logic level 3.

SOUNDBASE:TraceAll(TraceAll)

Trace all methods in MOOSE

SOUNDBASE:TraceClass(Class)

Set tracing for a class

SOUNDBASE:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

SOUNDBASE:TraceLevel(Level)

Set trace level

SOUNDBASE:TraceOff()

Set trace off.

SOUNDBASE:TraceOn()

Set trace on.

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

SOUNDBASE:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

SOUNDBASE._

SOUNDBASE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

SOUNDBASE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

SOUNDBASE.__

SOUNDBASE:onEvent(event)

The main event handling function...

Fields and Methods inherited from SOUNDFILE Description

SOUNDFILE.ClassName

Name of the class

SOUNDFILE:GetDuration()

Get duration how long the sound file takes to play.

SOUNDFILE:GetFileName()

Get the sound file name.

SOUNDFILE:GetName()

Get the complete sound file name inlcuding its path.

SOUNDFILE:GetPath()

Get path of the directory, where the sound file is located.

SOUNDFILE:New(FileName, Path, Duration)

Constructor to create a new SOUNDFILE object.

SOUNDFILE:SetDuration(Duration)

Set duration how long it takes to play the sound file.

SOUNDFILE:SetFileName(FileName)

Set sound file name.

SOUNDFILE:SetPath(Path)

Set path, where the sound file is located.

SOUNDFILE:SetPlayWithSRS(Switch)

Set whether sound files should be played via SRS.

SOUNDFILE.duration

Duration of the sound file in seconds.

SOUNDFILE.filename

Name of the flag.

SOUNDFILE.path

Directory path, where the sound file is located. This includes the final slash "/".

SOUNDFILE.subduration

Duration in seconds how long the subtitle is displayed.

SOUNDFILE.subtitle

Subtitle of the transmission.

SOUNDFILE.useSRS

If true, sound file is played via SRS. Sound file needs to be on local disk not inside the miz file!

Fields and Methods inherited from BASE Description

SOUNDFILE.ClassID

The ID number of the class.

SOUNDFILE.ClassName

The name of the class.

SOUNDFILE.ClassNameAndID

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

SOUNDFILE:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

SOUNDFILE:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

SOUNDFILE:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

SOUNDFILE:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

SOUNDFILE:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

SOUNDFILE:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

SOUNDFILE:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

SOUNDFILE:E(Arguments)

Log an exception which will be traced always.

SOUNDFILE:EventDispatcher()

Returns the event dispatcher

SOUNDFILE:EventRemoveAll()

Remove all subscribed events

SOUNDFILE:F(Arguments)

Trace a function call.

SOUNDFILE:F2(Arguments)

Trace a function call level 2.

SOUNDFILE:F3(Arguments)

Trace a function call level 3.

SOUNDFILE:GetClassID()

Get the ClassID of the class instance.

SOUNDFILE:GetClassName()

Get the ClassName of the class instance.

SOUNDFILE:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

SOUNDFILE:GetEventPriority()

Get the Class Event processing Priority.

SOUNDFILE:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

SOUNDFILE:GetState(Object, Key)

Get a Value given a Key from the Object.

SOUNDFILE:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

SOUNDFILE:I(Arguments)

Log an information which will be traced always.

SOUNDFILE:Inherit(Child, Parent)

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

SOUNDFILE:IsInstanceOf(ClassName)

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

SOUNDFILE:IsTrace()

Enquires if tracing is on (for the class).

SOUNDFILE:New()

BASE constructor.

SOUNDFILE:OnEvent(EventData)

Occurs when an Event for an object is triggered.

SOUNDFILE:OnEventBDA(EventData)

BDA.

SOUNDFILE:OnEventBaseCaptured(EventData)

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

SOUNDFILE:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

SOUNDFILE:OnEventCrash(EventData)

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

SOUNDFILE:OnEventDead(EventData)

Occurs when an object is dead.

SOUNDFILE:OnEventDetailedFailure(EventData)

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

SOUNDFILE:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

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

SOUNDFILE:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

SOUNDFILE:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

SOUNDFILE:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

SOUNDFILE:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

SOUNDFILE:OnEventKill(EventData)

Occurs on the death of a unit.

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

SOUNDFILE:OnEventLandingAfterEjection(EventData)

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

SOUNDFILE:OnEventLandingQualityMark(EventData)

Landing quality mark.

SOUNDFILE:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

SOUNDFILE:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

SOUNDFILE:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

SOUNDFILE:OnEventMissionEnd(EventData)

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

SOUNDFILE:OnEventMissionStart(EventData)

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

SOUNDFILE:OnEventParatrooperLanding(EventData)

Weapon add.

SOUNDFILE:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

SOUNDFILE:OnEventPlayerEnterAircraft(EventData)

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

SOUNDFILE:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

SOUNDFILE:OnEventPlayerLeaveUnit(EventData)

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

SOUNDFILE:OnEventRefueling(EventData)

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

SOUNDFILE:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

SOUNDFILE:OnEventScore(EventData)

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

SOUNDFILE:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

SOUNDFILE:OnEventShootingStart(EventData)

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

SOUNDFILE:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

SOUNDFILE:OnEventTakeoff(EventData)

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

SOUNDFILE:OnEventTriggerZone(EventData)

Trigger zone.

SOUNDFILE:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

SOUNDFILE:ScheduleStop(SchedulerID)

Stops the Schedule.

SOUNDFILE.Scheduler

SOUNDFILE:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

SOUNDFILE:SetState(Object, Key, Value)

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

SOUNDFILE:T(Arguments)

Trace a function logic level 1.

SOUNDFILE:T2(Arguments)

Trace a function logic level 2.

SOUNDFILE:T3(Arguments)

Trace a function logic level 3.

SOUNDFILE:TraceAll(TraceAll)

Trace all methods in MOOSE

SOUNDFILE:TraceClass(Class)

Set tracing for a class

SOUNDFILE:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

SOUNDFILE:TraceLevel(Level)

Set trace level

SOUNDFILE:TraceOff()

Set trace off.

SOUNDFILE:TraceOn()

Set trace on.

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

SOUNDFILE:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

SOUNDFILE._

SOUNDFILE:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

SOUNDFILE:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

SOUNDFILE.__

SOUNDFILE:onEvent(event)

The main event handling function...

Fields and Methods inherited from SOUNDTEXT Description

SOUNDTEXT.ClassName

Name of the class

SOUNDTEXT:New(Text, Duration)

Constructor to create a new SOUNDTEXT object.

SOUNDTEXT:SetCulture(Culture)

Set TTS culture - local for the voice.

SOUNDTEXT:SetDuration(Duration)

Set duration, how long it takes to speak the text.

SOUNDTEXT:SetGender(Gender)

Set gender.

SOUNDTEXT:SetText(Text)

Set text.

SOUNDTEXT:SetVoice(VoiceName)

Set to use a specific voice name.

SOUNDTEXT.culture

Culture, e.g. "en-GB".

SOUNDTEXT.duration

Duration in seconds.

SOUNDTEXT.gender

Gender: "male", "female".

SOUNDTEXT.text

Text to speak.

SOUNDTEXT.voice

Specific voice to use. Overrules gender and culture settings.

Fields and Methods inherited from BASE Description

SOUNDTEXT.ClassID

The ID number of the class.

SOUNDTEXT.ClassName

The name of the class.

SOUNDTEXT.ClassNameAndID

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

SOUNDTEXT:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

SOUNDTEXT:CreateEventCrash(EventTime, Initiator)

Creation of a Crash Event.

SOUNDTEXT:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

SOUNDTEXT:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

SOUNDTEXT:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

SOUNDTEXT:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

SOUNDTEXT:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

SOUNDTEXT:E(Arguments)

Log an exception which will be traced always.

SOUNDTEXT:EventDispatcher()

Returns the event dispatcher

SOUNDTEXT:EventRemoveAll()

Remove all subscribed events

SOUNDTEXT:F(Arguments)

Trace a function call.

SOUNDTEXT:F2(Arguments)

Trace a function call level 2.

SOUNDTEXT:F3(Arguments)

Trace a function call level 3.

SOUNDTEXT:GetClassID()

Get the ClassID of the class instance.

SOUNDTEXT:GetClassName()

Get the ClassName of the class instance.

SOUNDTEXT:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

SOUNDTEXT:GetEventPriority()

Get the Class Event processing Priority.

SOUNDTEXT:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

SOUNDTEXT:GetState(Object, Key)

Get a Value given a Key from the Object.

SOUNDTEXT:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

SOUNDTEXT:I(Arguments)

Log an information which will be traced always.

SOUNDTEXT:Inherit(Child, Parent)

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

SOUNDTEXT:IsInstanceOf(ClassName)

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

SOUNDTEXT:IsTrace()

Enquires if tracing is on (for the class).

SOUNDTEXT:New()

BASE constructor.

SOUNDTEXT:OnEvent(EventData)

Occurs when an Event for an object is triggered.

SOUNDTEXT:OnEventBDA(EventData)

BDA.

SOUNDTEXT:OnEventBaseCaptured(EventData)

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

SOUNDTEXT:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

SOUNDTEXT:OnEventCrash(EventData)

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

SOUNDTEXT:OnEventDead(EventData)

Occurs when an object is dead.

SOUNDTEXT:OnEventDetailedFailure(EventData)

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

SOUNDTEXT:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

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

SOUNDTEXT:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

SOUNDTEXT:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

SOUNDTEXT:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

SOUNDTEXT:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

SOUNDTEXT:OnEventKill(EventData)

Occurs on the death of a unit.

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

SOUNDTEXT:OnEventLandingAfterEjection(EventData)

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

SOUNDTEXT:OnEventLandingQualityMark(EventData)

Landing quality mark.

SOUNDTEXT:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

SOUNDTEXT:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

SOUNDTEXT:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

SOUNDTEXT:OnEventMissionEnd(EventData)

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

SOUNDTEXT:OnEventMissionStart(EventData)

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

SOUNDTEXT:OnEventParatrooperLanding(EventData)

Weapon add.

SOUNDTEXT:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

SOUNDTEXT:OnEventPlayerEnterAircraft(EventData)

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

SOUNDTEXT:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

SOUNDTEXT:OnEventPlayerLeaveUnit(EventData)

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

SOUNDTEXT:OnEventRefueling(EventData)

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

SOUNDTEXT:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

SOUNDTEXT:OnEventScore(EventData)

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

SOUNDTEXT:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

SOUNDTEXT:OnEventShootingStart(EventData)

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

SOUNDTEXT:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

SOUNDTEXT:OnEventTakeoff(EventData)

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

SOUNDTEXT:OnEventTriggerZone(EventData)

Trigger zone.

SOUNDTEXT:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

SOUNDTEXT:ScheduleStop(SchedulerID)

Stops the Schedule.

SOUNDTEXT.Scheduler

SOUNDTEXT:SetEventPriority(EventPriority)

Set the Class Event processing Priority.

SOUNDTEXT:SetState(Object, Key, Value)

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

SOUNDTEXT:T(Arguments)

Trace a function logic level 1.

SOUNDTEXT:T2(Arguments)

Trace a function logic level 2.

SOUNDTEXT:T3(Arguments)

Trace a function logic level 3.

SOUNDTEXT:TraceAll(TraceAll)

Trace all methods in MOOSE

SOUNDTEXT:TraceClass(Class)

Set tracing for a class

SOUNDTEXT:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

SOUNDTEXT:TraceLevel(Level)

Set trace level

SOUNDTEXT:TraceOff()

Set trace off.

SOUNDTEXT:TraceOn()

Set trace on.

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

SOUNDTEXT:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

SOUNDTEXT._

SOUNDTEXT:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

SOUNDTEXT:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

SOUNDTEXT.__

SOUNDTEXT:onEvent(event)

The main event handling function...

Field(s)

#string SOUNDBASE.ClassName

Name of the class.

Function(s)

Function returns estimated speech time in seconds.

Assumptions for time calc: 100 Words per min, avarage of 5 letters for english word so

  • 5 chars * 100wpm = 500 characters per min = 8.3 chars per second

So lengh of msg / 8.3 = number of seconds needed to read it. rounded down to 8 chars per sec map function:

  • (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min

Defined in:

SOUNDBASE

Parameters:

#string Text

The text string to analyze.

#number Speed

Speed factor. Default 1.

#boolean isGoogle

If true, google text-to-speech is used.

self

length

speed

Constructor to create a new SOUNDBASE object.

Defined in:

SOUNDBASE

Return value:

self

Field(s)

#string SOUNDBASE.ClassName

Name of the class.

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)

#string SOUNDFILE.ClassName

Name of the class

#string SOUNDFILE.duration

Duration of the sound file in seconds.

#string SOUNDFILE.filename

Name of the flag.

#string SOUNDFILE.path

Directory path, where the sound file is located. This includes the final slash "/".

#number SOUNDFILE.subduration

Duration in seconds how long the subtitle is displayed.

#string SOUNDFILE.subtitle

Subtitle of the transmission.

#boolean SOUNDFILE.useSRS

If true, sound file is played via SRS. Sound file needs to be on local disk not inside the miz file!

Function(s)

Get duration how long the sound file takes to play.

Defined in:

SOUNDFILE

Return value:

#number:

Duration in seconds.

Get the sound file name.

Defined in:

SOUNDFILE

Return value:

#string:

Name of the soud file. This does not include its path.

Get the complete sound file name inlcuding its path.

Defined in:

SOUNDFILE

Return value:

#string:

Name of the sound file.

Get path of the directory, where the sound file is located.

Defined in:

SOUNDFILE

Return value:

#string:

Path.

Constructor to create a new SOUNDFILE object.

Defined in:

SOUNDFILE

Parameters:

#string FileName

The name of the sound file, e.g. "Hello World.ogg".

#string Path

The path of the directory, where the sound file is located. Default is "l10n/DEFAULT/" within the miz file.

#number Duration

Duration in seconds, how long it takes to play the sound file. Default is 3 seconds.

Return value:

self

Set duration how long it takes to play the sound file.

Defined in:

SOUNDFILE

Parameter:

#string Duration

Duration in seconds. Default 3 seconds.

Return value:

self

Set sound file name.

This must be a .ogg or .mp3 file!

Defined in:

SOUNDFILE

Parameter:

#string FileName

Name of the file. Default is "Hello World.mp3".

Return value:

self

Set path, where the sound file is located.

Defined in:

SOUNDFILE

Parameter:

#string Path

Path to the directory, where the sound file is located. In case this is nil, it defaults to the DCS mission temp directory.

Return value:

self

Set whether sound files should be played via SRS.

Defined in:

SOUNDFILE

Parameter:

#boolean Switch

If true or nil, use SRS. If false, use DCS transmission.

Return value:

self

Field(s)

#string SOUNDFILE.ClassName

Name of the class

#string SOUNDFILE.duration

Duration of the sound file in seconds.

#string SOUNDFILE.filename

Name of the flag.

#string SOUNDFILE.path

Directory path, where the sound file is located. This includes the final slash "/".

#number SOUNDFILE.subduration

Duration in seconds how long the subtitle is displayed.

#string SOUNDFILE.subtitle

Subtitle of the transmission.

#boolean SOUNDFILE.useSRS

If true, sound file is played via SRS. Sound file needs to be on local disk not inside the miz file!

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)

#string SOUNDTEXT.ClassName

Name of the class

#string SOUNDTEXT.culture

Culture, e.g. "en-GB".

#number SOUNDTEXT.duration

Duration in seconds.

#string SOUNDTEXT.gender

Gender: "male", "female".

#string SOUNDTEXT.text

Text to speak.

#string SOUNDTEXT.voice

Specific voice to use. Overrules gender and culture settings.

Function(s)

Constructor to create a new SOUNDTEXT object.

Defined in:

SOUNDTEXT

Parameters:

#string Text

The text to speak.

#number Duration

Duration in seconds, how long it takes to play the text. Default is 3 seconds.

Return value:

self

Set TTS culture - local for the voice.

Defined in:

SOUNDTEXT

Parameter:

#string Culture

TTS culture. Default "en-GB".

Return value:

self

Set duration, how long it takes to speak the text.

Defined in:

SOUNDTEXT

Parameter:

#number Duration

Duration in seconds. Default 3 seconds.

Return value:

self

Set gender.

Defined in:

SOUNDTEXT

Parameter:

#string Gender

Gender: "male" or "female" (default).

Return value:

self

Set text.

Defined in:

SOUNDTEXT

Parameter:

#string Text

Text to speak. Default "Hello World!".

Return value:

self

Set to use a specific voice name.

See the list from DCS-SR-ExternalAudio.exe --help or if using google see google voices.

Defined in:

SOUNDTEXT

Parameter:

#string VoiceName

Voice name. Note that this will overrule Gender and Culture.

Return value:

self

Field(s)

#string SOUNDTEXT.ClassName

Name of the class

#string SOUNDTEXT.culture

Culture, e.g. "en-GB".

#number SOUNDTEXT.duration

Duration in seconds.

#string SOUNDTEXT.gender

Gender: "male", "female".

#string SOUNDTEXT.text

Text to speak.

#string SOUNDTEXT.voice

Specific voice to use. Overrules gender and culture settings.

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