Banner Image

Module Core.ClientMenu

Core - Client Menu Management.

Main Features:

  • For complex, non-static menu structures
  • Lightweigt implementation as alternative to MENU
  • Separation of menu tree creation from menu on the clients's side
  • Works with a SET_CLIENT set of clients
  • Allow manipulation of the shadow tree in various ways
  • Push to all or only one client
  • Change entries' menu text
  • Option to make an entry usable once only across all clients
  • Auto appends GROUP and CLIENT objects to menu calls

Author: applevangelist


Global(s)

Global CLIENTMENU

Global CLIENTMENUMANAGER

As a child my family's menu consisted of two choices: take it, or leave it.


CLIENTMENU and CLIENTMENUMANAGER

Manage menu structures for a SET_CLIENT of clients.

#CLIENTMENUMANAGER CLIENTMENUMANAGER

As a child my family's menu consisted of two choices: take it, or leave it.


CLIENTMENU and CLIENTMENUMANAGER

Manage menu structures for a SET_CLIENT of clients.

Concept

Separate creation of a menu tree structure from pushing it to each client. Create a shadow "reference" menu structure tree for your client pilot's in a mission. This can then be propagated to all clients. Manipulate the entries in the structure with removing, clearing or changing single entries, create replacement sub-structures for entries etc, push to one or all clients.

Many functions can either change the tree for one client or for all clients.

Conceptual remarks

There's a couple of things to fully understand:

1) CLIENTMENUMANAGER manages a set of entries from CLIENTMENU, it's main purpose is to administer the shadow menu tree, ie. a menu structure which is not (yet) visible to any client
2) The entries are CLIENTMENU objects, which are linked in a tree form. There's two ways to create them:

     A) in the manager with ":NewEntry()" which initially 
         adds it to the shadow menu **only**   
     B) stand-alone directly as `CLIENTMENU:NewEntry()` - here it depends on whether or not you gave a CLIENT object if the entry is created as generic entry or pushed 
         a **specific** client. **Be aware** though that the entries are not managed by the CLIENTMANAGER before the next step!   

A generic entry can be added to the manager (and the shadow tree) with :AddEntry() - this will also push it to all clients(!) if no client is given, or a specific client only.
3) Pushing only works for alive clients.
4) Live and shadow tree entries are managed via the CLIENTMENUMANAGER object.
5) Propagate()refreshes the menu tree for all, or a single client.

Create a base reference tree and send to all clients

       local clientset = SET_CLIENT:New():FilterStart()

       local menumgr = CLIENTMENUMANAGER:New(clientset,"Dayshift")
       local mymenu = menumgr:NewEntry("Top")
       local mymenu_lv1a = menumgr:NewEntry("Level 1 a",mymenu)
       local mymenu_lv1b = menumgr:NewEntry("Level 1 b",mymenu)
       -- next one is a command menu entry, which can only be used once
       local mymenu_lv1c = menumgr:NewEntry("Action Level 1 c",mymenu, testfunction, "testtext"):SetOnce()

       local mymenu_lv2a = menumgr:NewEntry("Go here",mymenu_lv1a)
       local mymenu_lv2b = menumgr:NewEntry("Level 2 ab",mymenu_lv1a)
       local mymenu_lv2c = menumgr:NewEntry("Level 2 ac",mymenu_lv1a)

       local mymenu_lv2ba = menumgr:NewEntry("Level 2 ba",mymenu_lv1b)
       local mymenu_lv2bb = menumgr:NewEntry("Level 2 bb",mymenu_lv1b)
       local mymenu_lv2bc = menumgr:NewEntry("Level 2 bc",mymenu_lv1b)

       local mymenu_lv3a = menumgr:NewEntry("Level 3 aaa",mymenu_lv2a)
       local mymenu_lv3b = menumgr:NewEntry("Level 3 aab",mymenu_lv2a)
       local mymenu_lv3c = menumgr:NewEntry("Level 3 aac",mymenu_lv2a)

       menumgr:Propagate() -- propagate **once** to all clients in the SET_CLIENT

Remove a single entry's subtree

       menumgr:RemoveSubEntries(mymenu_lv3a)

Remove a single entry and also it's subtree

       menumgr:DeleteEntry(mymenu_lv3a)

Add a single entry

       local baimenu = menumgr:NewEntry("BAI",mymenu_lv1b)

       menumgr:AddEntry(baimenu)  

Add an entry with a function

       local baimenu = menumgr:NewEntry("Task Action", mymenu_lv1b, TestFunction, Argument1, Argument1)

Now, the class will automatically append the call with GROUP and CLIENT objects, as this is can only be done when pushing the entry to the clients. So, the actual function implementation needs to look like this:

       function TestFunction( Argument1, Argument2, Group, Client)

Caveat is, that you need to ensure your arguments are not nil or false, as LUA will optimize those away. You would end up having Group and Client in wrong places in the function call. Hence, if you need/ want to send nil or false, send a place holder instead and ensure your function can handle this, e.g.

       local baimenu = menumgr:NewEntry("Task Action", mymenu_lv1b, TestFunction, "nil", Argument1)

Change the text of a leaf entry in the menu tree

       menumgr:ChangeEntryTextForAll(mymenu_lv1b,"Attack")

Reset a single clients menu tree

       menumgr:ResetMenu(client)

Reset all and clear the reference tree

       menumgr:ResetMenuComplete()

Set to auto-propagate for CLIENTs joining the SET_CLIENT after the script is loaded - handy if you have a single menu tree.

       menumgr:InitAutoPropagation()

Global CLIENTMENU_ID

Type(s)

Fields and Methods inherited from CLIENTMENU Description

CLIENTMENU:AddChild(Child)

Link a child entry.

CLIENTMENU.CallHandler()

CLIENTMENU.Children

CLIENTMENU.ClassName

Class Name

CLIENTMENU:Clear()

Remove this entry and all subentries (children) from this entry.

CLIENTMENU.Controller

CLIENTMENU:CreateUUID(Parent, Text)

Create a UUID

CLIENTMENU.Function

CLIENTMENU.Functionargs

CLIENTMENU.Generic

CLIENTMENU:GetPath()

Get the menu path table.

CLIENTMENU:GetUUID()

Get the UUID.

CLIENTMENU.GroupID

Group ID

CLIENTMENU.ID

Entry ID

CLIENTMENU:NewEntry(Client, Text, Parent, Function, ...)

Create an new CLIENTMENU object.

CLIENTMENU.Once

CLIENTMENU.Parent

CLIENTMENU:RemoveChild(Child)

Remove a child entry.

CLIENTMENU:RemoveF10()

Remove the entry from the F10 menu.

CLIENTMENU:RemoveSubEntries()

Remove all subentries (children) from this entry.

CLIENTMENU:SetController(Controller)

Set the CLIENTMENUMANAGER for this entry.

CLIENTMENU:SetOnce()

The entry will be deleted after being used used - for menu entries with functions only.

CLIENTMENU.UUID

Unique ID based on path+name

CLIENTMENU.active

CLIENTMENU.boolean

CLIENTMENU.client

CLIENTMENU.debug

CLIENTMENU.group

CLIENTMENU.groupname

Group name

CLIENTMENU.lid

Lid for log entries

CLIENTMENU.name

Name

CLIENTMENU.parentpath

CLIENTMENU.path

CLIENTMENU.version

Version string

Fields and Methods inherited from BASE Description

CLIENTMENU.ClassID

The ID number of the class.

CLIENTMENU.ClassName

The name of the class.

CLIENTMENU.ClassNameAndID

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

CLIENTMENU:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

CLIENTMENU:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

CLIENTMENU:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

CLIENTMENU:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

CLIENTMENU:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

CLIENTMENU:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

CLIENTMENU:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

CLIENTMENU:E(Arguments)

Log an exception which will be traced always.

CLIENTMENU:EventDispatcher()

Returns the event dispatcher

CLIENTMENU:EventRemoveAll()

Remove all subscribed events

CLIENTMENU:F(Arguments)

Trace a function call.

CLIENTMENU:F2(Arguments)

Trace a function call level 2.

CLIENTMENU:F3(Arguments)

Trace a function call level 3.

CLIENTMENU:GetClassID()

Get the ClassID of the class instance.

CLIENTMENU:GetClassName()

Get the ClassName of the class instance.

CLIENTMENU:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

CLIENTMENU:GetEventPriority()

Get the Class Core.Event processing Priority.

CLIENTMENU:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

CLIENTMENU:GetState(Object, Key)

Get a Value given a Key from the Object.

CLIENTMENU:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

CLIENTMENU:I(Arguments)

Log an information which will be traced always.

CLIENTMENU:Inherit(Child, Parent)

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

CLIENTMENU:IsInstanceOf(ClassName)

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

CLIENTMENU:IsTrace()

Enquires if tracing is on (for the class).

CLIENTMENU:New()

BASE constructor.

CLIENTMENU:OnEvent(EventData)

Occurs when an Event for an object is triggered.

CLIENTMENU:OnEventBDA(EventData)

BDA.

CLIENTMENU:OnEventBaseCaptured(EventData)

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

CLIENTMENU:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

CLIENTMENU:OnEventCrash(EventData)

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

CLIENTMENU:OnEventDead(EventData)

Occurs when an object is dead.

CLIENTMENU:OnEventDetailedFailure(EventData)

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

CLIENTMENU:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

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

CLIENTMENU:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

CLIENTMENU:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

CLIENTMENU:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

CLIENTMENU:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

CLIENTMENU:OnEventKill(EventData)

Occurs on the death of a unit.

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

CLIENTMENU:OnEventLandingAfterEjection(EventData)

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

CLIENTMENU:OnEventLandingQualityMark(EventData)

Landing quality mark.

CLIENTMENU:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

CLIENTMENU:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

CLIENTMENU:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

CLIENTMENU:OnEventMissionEnd(EventData)

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

CLIENTMENU:OnEventMissionStart(EventData)

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

CLIENTMENU:OnEventParatrooperLanding(EventData)

Weapon add.

CLIENTMENU:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

CLIENTMENU:OnEventPlayerEnterAircraft(EventData)

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

CLIENTMENU:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

CLIENTMENU:OnEventPlayerLeaveUnit(EventData)

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

CLIENTMENU:OnEventRefueling(EventData)

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

CLIENTMENU:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

CLIENTMENU:OnEventScore(EventData)

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

CLIENTMENU:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

CLIENTMENU:OnEventShootingStart(EventData)

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

CLIENTMENU:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

CLIENTMENU:OnEventTakeoff(EventData)

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

CLIENTMENU:OnEventTriggerZone(EventData)

Trigger zone.

CLIENTMENU:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

CLIENTMENU:ScheduleStop(SchedulerID)

Stops the Schedule.

CLIENTMENU.Scheduler

CLIENTMENU:SetEventPriority(EventPriority)

Set the Class Core.Event processing Priority.

CLIENTMENU:SetState(Object, Key, Value)

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

CLIENTMENU:T(Arguments)

Trace a function logic level 1.

CLIENTMENU:T2(Arguments)

Trace a function logic level 2.

CLIENTMENU:T3(Arguments)

Trace a function logic level 3.

CLIENTMENU:TraceAll(TraceAll)

Trace all methods in MOOSE

CLIENTMENU:TraceClass(Class)

Set tracing for a class

CLIENTMENU:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

CLIENTMENU:TraceLevel(Level)

Set trace level

CLIENTMENU:TraceOff()

Set trace off.

CLIENTMENU:TraceOn()

Set trace on.

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

CLIENTMENU:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

CLIENTMENU._

CLIENTMENU:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

CLIENTMENU:_Serialize(Arguments)

(Internal) Serialize arguments

CLIENTMENU:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

CLIENTMENU.__

CLIENTMENU:onEvent(event)

The main event handling function...

Fields and Methods inherited from CLIENTMENUMANAGER Description

CLIENTMENUMANAGER:AddEntry(Entry, Client)

Push a single previously created entry into the F10 menu structure of all clients.

CLIENTMENUMANAGER:ChangeEntryText(Entry, Text, Client)

Alter the text of a leaf entry in the generic structure and push to one specific client's F10 menu.

CLIENTMENUMANAGER.ClassName

Class Name

CLIENTMENUMANAGER.Coalition

CLIENTMENUMANAGER:DeleteF10Entry(Entry, Client)

Remove the entry and all entries below the given entry from the client's F10 menus.

CLIENTMENUMANAGER:DeleteGenericEntry(Entry)

Remove the entry and all entries below the given entry from the generic tree.

CLIENTMENUMANAGER:EntryUUIDExists(UUID)

Check matching entry in the generic structure by UUID.

CLIENTMENUMANAGER:FindEntriesByParent(Parent)

Find matching entries in the generic structure under a parent.

CLIENTMENUMANAGER:FindEntriesByText(Text, Parent)

Find matching entries in the generic structure by the menu text.

CLIENTMENUMANAGER:FindEntryByUUID(UUID)

Find matching entry in the generic structure by UUID.

CLIENTMENUMANAGER:FindUUIDsByParent(Parent)

Find matching entries under a parent in the generic structure by UUID.

CLIENTMENUMANAGER:FindUUIDsByText(Text, Parent)

Find matching entries by text in the generic structure by UUID.

CLIENTMENUMANAGER:InitAutoPropagation()

Set this Client Manager to auto-propagate menus once to newly joined players.

CLIENTMENUMANAGER:New(ClientSet, Alias, Coalition)

Create a new ClientManager instance.

CLIENTMENUMANAGER:NewEntry(Text, Parent, Function, ...)

Create a new entry in the generic structure.

CLIENTMENUMANAGER.PlayerMenu

CLIENTMENUMANAGER:Propagate(Client)

Push the complete menu structure to each of the clients in the set - refresh the menu tree of the clients.

CLIENTMENUMANAGER:RemoveF10SubEntries(Entry, Client)

Remove all entries below the given entry from the client's F10 menus.

CLIENTMENUMANAGER:RemoveGenericSubEntries(Entry)

Remove all entries below the given entry from the generic tree.

CLIENTMENUMANAGER:ResetMenu(Client)

Blank out the menu - remove all root entries and all entries below from the client's F10 menus, leaving the generic structure untouched.

CLIENTMENUMANAGER:ResetMenuComplete()

Blank out the menu - remove all root entries and all entries below from all clients' F10 menus, and delete the generic structure.

CLIENTMENUMANAGER:_EventHandler(EventData)

[Internal] Event handling

CLIENTMENUMANAGER.clientset

The set of clients this menu manager is for

CLIENTMENUMANAGER.debug

CLIENTMENUMANAGER.entrycount

CLIENTMENUMANAGER.flattree

CLIENTMENUMANAGER.lid

Lid for log entries

CLIENTMENUMANAGER.menutree

CLIENTMENUMANAGER.name

Name

CLIENTMENUMANAGER.playertree

CLIENTMENUMANAGER.rootentries

CLIENTMENUMANAGER.version

Version string

Fields and Methods inherited from BASE Description

CLIENTMENUMANAGER.ClassID

The ID number of the class.

CLIENTMENUMANAGER.ClassName

The name of the class.

CLIENTMENUMANAGER.ClassNameAndID

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

CLIENTMENUMANAGER:ClearState(Object, StateName)

Clear the state of an object.

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

Creation of a Birth Event.

CLIENTMENUMANAGER:CreateEventCrash(EventTime, Initiator, IniObjectCategory)

Creation of a Crash Event.

CLIENTMENUMANAGER:CreateEventDead(EventTime, Initiator, IniObjectCategory)

Creation of a Dead Event.

CLIENTMENUMANAGER:CreateEventPlayerEnterAircraft(PlayerUnit)

Creation of a S_EVENT_PLAYER_ENTER_AIRCRAFT event.

CLIENTMENUMANAGER:CreateEventRemoveUnit(EventTime, Initiator)

Creation of a Remove Unit Event.

CLIENTMENUMANAGER:CreateEventTakeoff(EventTime, Initiator)

Creation of a Takeoff Event.

CLIENTMENUMANAGER:CreateEventUnitLost(EventTime, Initiator)

Creation of a Crash Event.

CLIENTMENUMANAGER:E(Arguments)

Log an exception which will be traced always.

CLIENTMENUMANAGER:EventDispatcher()

Returns the event dispatcher

CLIENTMENUMANAGER:EventRemoveAll()

Remove all subscribed events

CLIENTMENUMANAGER:F(Arguments)

Trace a function call.

CLIENTMENUMANAGER:F2(Arguments)

Trace a function call level 2.

CLIENTMENUMANAGER:F3(Arguments)

Trace a function call level 3.

CLIENTMENUMANAGER:GetClassID()

Get the ClassID of the class instance.

CLIENTMENUMANAGER:GetClassName()

Get the ClassName of the class instance.

CLIENTMENUMANAGER:GetClassNameAndID()

Get the ClassName + ClassID of the class instance.

CLIENTMENUMANAGER:GetEventPriority()

Get the Class Core.Event processing Priority.

CLIENTMENUMANAGER:GetParent(Child, FromClass)

This is the worker method to retrieve the Parent class.

CLIENTMENUMANAGER:GetState(Object, Key)

Get a Value given a Key from the Object.

CLIENTMENUMANAGER:HandleEvent(EventID, EventFunction)

Subscribe to a DCS Event.

CLIENTMENUMANAGER:I(Arguments)

Log an information which will be traced always.

CLIENTMENUMANAGER:Inherit(Child, Parent)

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

CLIENTMENUMANAGER:IsInstanceOf(ClassName)

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

CLIENTMENUMANAGER:IsTrace()

Enquires if tracing is on (for the class).

CLIENTMENUMANAGER:New()

BASE constructor.

CLIENTMENUMANAGER:OnEvent(EventData)

Occurs when an Event for an object is triggered.

CLIENTMENUMANAGER:OnEventBDA(EventData)

BDA.

CLIENTMENUMANAGER:OnEventBaseCaptured(EventData)

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

CLIENTMENUMANAGER:OnEventBirth(EventData)

Occurs when any object is spawned into the mission.

CLIENTMENUMANAGER:OnEventCrash(EventData)

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

CLIENTMENUMANAGER:OnEventDead(EventData)

Occurs when an object is dead.

CLIENTMENUMANAGER:OnEventDetailedFailure(EventData)

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

CLIENTMENUMANAGER:OnEventDiscardChairAfterEjection(EventData)

Discard chair after ejection.

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

CLIENTMENUMANAGER:OnEventEngineShutdown(EventData)

Occurs when any aircraft shuts down its engines.

CLIENTMENUMANAGER:OnEventEngineStartup(EventData)

Occurs when any aircraft starts its engines.

CLIENTMENUMANAGER:OnEventHit(EventData)

Occurs whenever an object is hit by a weapon.

CLIENTMENUMANAGER:OnEventHumanFailure(EventData)

Occurs when any system fails on a human controlled aircraft.

CLIENTMENUMANAGER:OnEventKill(EventData)

Occurs on the death of a unit.

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

CLIENTMENUMANAGER:OnEventLandingAfterEjection(EventData)

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

CLIENTMENUMANAGER:OnEventLandingQualityMark(EventData)

Landing quality mark.

CLIENTMENUMANAGER:OnEventMarkAdded(EventData)

Occurs when a new mark was added.

CLIENTMENUMANAGER:OnEventMarkChange(EventData)

Occurs when a mark text was changed.

CLIENTMENUMANAGER:OnEventMarkRemoved(EventData)

Occurs when a mark was removed.

CLIENTMENUMANAGER:OnEventMissionEnd(EventData)

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

CLIENTMENUMANAGER:OnEventMissionStart(EventData)

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

CLIENTMENUMANAGER:OnEventParatrooperLanding(EventData)

Weapon add.

CLIENTMENUMANAGER:OnEventPilotDead(EventData)

Occurs when the pilot of an aircraft is killed.

CLIENTMENUMANAGER:OnEventPlayerEnterAircraft(EventData)

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

CLIENTMENUMANAGER:OnEventPlayerEnterUnit(EventData)

Occurs when any player assumes direct control of a unit.

CLIENTMENUMANAGER:OnEventPlayerLeaveUnit(EventData)

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

CLIENTMENUMANAGER:OnEventRefueling(EventData)

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

CLIENTMENUMANAGER:OnEventRefuelingStop(EventData)

Occurs when an aircraft is finished taking fuel.

CLIENTMENUMANAGER:OnEventScore(EventData)

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

CLIENTMENUMANAGER:OnEventShootingEnd(EventData)

Occurs when any unit stops firing its weapon.

CLIENTMENUMANAGER:OnEventShootingStart(EventData)

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

CLIENTMENUMANAGER:OnEventShot(EventData)

Occurs whenever any unit in a mission fires a weapon.

CLIENTMENUMANAGER:OnEventTakeoff(EventData)

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

CLIENTMENUMANAGER:OnEventTriggerZone(EventData)

Trigger zone.

CLIENTMENUMANAGER:OnEventUnitLost(EventData)

Occurs when the game thinks an object is destroyed.

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

Schedule a new time event.

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

Schedule a new time event.

CLIENTMENUMANAGER:ScheduleStop(SchedulerID)

Stops the Schedule.

CLIENTMENUMANAGER.Scheduler

CLIENTMENUMANAGER:SetEventPriority(EventPriority)

Set the Class Core.Event processing Priority.

CLIENTMENUMANAGER:SetState(Object, Key, Value)

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

CLIENTMENUMANAGER:T(Arguments)

Trace a function logic level 1.

CLIENTMENUMANAGER:T2(Arguments)

Trace a function logic level 2.

CLIENTMENUMANAGER:T3(Arguments)

Trace a function logic level 3.

CLIENTMENUMANAGER:TraceAll(TraceAll)

Trace all methods in MOOSE

CLIENTMENUMANAGER:TraceClass(Class)

Set tracing for a class

CLIENTMENUMANAGER:TraceClassMethod(Class, Method)

Set tracing for a specific method of class

CLIENTMENUMANAGER:TraceLevel(Level)

Set trace level

CLIENTMENUMANAGER:TraceOff()

Set trace off.

CLIENTMENUMANAGER:TraceOn()

Set trace on.

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

CLIENTMENUMANAGER:UnHandleEvent(EventID)

UnSubscribe to a DCS event.

CLIENTMENUMANAGER._

CLIENTMENUMANAGER:_F(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function call.

CLIENTMENUMANAGER:_Serialize(Arguments)

(Internal) Serialize arguments

CLIENTMENUMANAGER:_T(Arguments, DebugInfoCurrentParam, DebugInfoFromParam)

Trace a function logic.

CLIENTMENUMANAGER.__

CLIENTMENUMANAGER:onEvent(event)

The main event handling function...

Field(s)

#string CLIENTMENU.ClassName

Class Name

#number CLIENTMENU.GroupID

Group ID

#number CLIENTMENU.ID

Entry ID

#boolean CLIENTMENU.Once
#string CLIENTMENU.UUID

Unique ID based on path+name

#boolean CLIENTMENU.debug
#string CLIENTMENU.groupname

Group name

#string CLIENTMENU.lid

Lid for log entries

#string CLIENTMENU.name

Name

#string CLIENTMENU.version

Version string

Function(s)

Link a child entry.

Defined in:

CLIENTMENU

Parameter:

#CLIENTMENU Child

The entry to link as a child.

Return value:

self

Defined in:

CLIENTMENU

Remove this entry and all subentries (children) from this entry.

Defined in:

CLIENTMENU

Return value:

self

Create a UUID

Defined in:

CLIENTMENU

Parameters:

#CLIENTMENU Parent

The parent object if any

#string Text

The menu entry text

Return value:

#string:

UUID

Get the menu path table.

Defined in:

CLIENTMENU

Return value:

#table:

Path

Get the UUID.

Defined in:

CLIENTMENU

Return value:

#string:

UUID

Create an new CLIENTMENU object.

Defined in:

CLIENTMENU

Parameters:

The client for whom this entry is. Leave as nil for a generic entry.

#string Text

Text of the F10 menu entry.

#CLIENTMENU Parent

The parent menu entry.

#string Function

(optional) Function to call when the entry is used.

...

(optional) Arguments for the Function, comma separated

Return value:

self

Remove a child entry.

Defined in:

CLIENTMENU

Parameter:

#CLIENTMENU Child

The entry to remove from the children.

Return value:

self

Remove the entry from the F10 menu.

Defined in:

CLIENTMENU

Return value:

self

Remove all subentries (children) from this entry.

Defined in:

CLIENTMENU

Return value:

self

Set the CLIENTMENUMANAGER for this entry.

Defined in:

CLIENTMENU

Parameter:

#CLIENTMENUMANAGER Controller

The controlling object.

Return value:

self

The entry will be deleted after being used used - for menu entries with functions only.

Defined in:

CLIENTMENU

Return value:

self

Field(s)

#string CLIENTMENU.ClassName

Class Name

#number CLIENTMENU.GroupID

Group ID

#number CLIENTMENU.ID

Entry ID

#boolean CLIENTMENU.Once
#string CLIENTMENU.UUID

Unique ID based on path+name

#boolean CLIENTMENU.debug
#string CLIENTMENU.groupname

Group name

#string CLIENTMENU.lid

Lid for log entries

#string CLIENTMENU.name

Name

#string CLIENTMENU.version

Version string

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a S_EVENT_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 Core.Event processing Priority.

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

Defined in:

Return value:

#number:

The Core.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, set to nil, or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

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

Return value:

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

Subscribe to a DCS Event.

Defined in:

Parameters:

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 Core.Event processing Priority.

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

Defined in:

Parameter:

#number EventPriority

The Core.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, set to nil, or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

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

Key

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

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

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

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

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

Class CLIENTMENUMANAGER

Field(s)

#string CLIENTMENUMANAGER.ClassName

Class Name

Core.Set#SET_CLIENT CLIENTMENUMANAGER.clientset

The set of clients this menu manager is for

#string CLIENTMENUMANAGER.lid

Lid for log entries

#string CLIENTMENUMANAGER.name

Name

#string CLIENTMENUMANAGER.version

Version string

Function(s)

Push a single previously created entry into the F10 menu structure of all clients.

Defined in:

CLIENTMENUMANAGER

Parameters:

#CLIENTMENU Entry

The entry to add.

(optional) If given, make this change only for this client.

Return value:

Alter the text of a leaf entry in the generic structure and push to one specific client's F10 menu.

Defined in:

CLIENTMENUMANAGER

Parameters:

#CLIENTMENU Entry

The menu entry.

#string Text

New Text of the F10 menu entry.

(optional) The client for whom to alter the entry, if nil done for all clients.

Return value:

Remove the entry and all entries below the given entry from the client's F10 menus.

Defined in:

CLIENTMENUMANAGER

Parameters:

#CLIENTMENU Entry

The entry to remove

(optional) If given, make this change only for this client.

Return value:

Remove the entry and all entries below the given entry from the generic tree.

Defined in:

CLIENTMENUMANAGER

Parameter:

#CLIENTMENU Entry

The entry to remove

Return value:

Check matching entry in the generic structure by UUID.

Defined in:

CLIENTMENUMANAGER

Parameter:

#string UUID

UUID of the menu entry.

Return value:

#boolean:

Exists

Find matching entries in the generic structure under a parent.

Defined in:

CLIENTMENUMANAGER

Parameter:

#CLIENTMENU Parent

Find entries under this parent entry.

Return values:

#table:

Table of matching #CLIENTMENU objects.

#number:

Number of matches

Find matching entries in the generic structure by the menu text.

Defined in:

CLIENTMENUMANAGER

Parameters:

#string Text

Text or partial text of the F10 menu entry.

#CLIENTMENU Parent

(Optional) Only find entries under this parent entry.

Return values:

#table:

Table of matching #CLIENTMENU objects.

#number:

Number of matches

Find matching entry in the generic structure by UUID.

Defined in:

CLIENTMENUMANAGER

Parameter:

#string UUID

UUID of the menu entry.

Return value:

Entry The #CLIENTMENU object found or nil.

Find matching entries under a parent in the generic structure by UUID.

Defined in:

CLIENTMENUMANAGER

Parameter:

#CLIENTMENU Parent

Find entries under this parent entry.

Return values:

#table:

Table of matching UUIDs of #CLIENTMENU objects

#table:

Table of matching #CLIENTMENU objects

#number:

Number of matches

Find matching entries by text in the generic structure by UUID.

Defined in:

CLIENTMENUMANAGER

Parameters:

#string Text

Text or partial text of the menu entry to find.

#CLIENTMENU Parent

(Optional) Only find entries under this parent entry.

Return values:

#table:

Table of matching UUIDs of #CLIENTMENU objects

#table:

Table of matching #CLIENTMENU objects

#number:

Number of matches

Set this Client Manager to auto-propagate menus once to newly joined players.

Useful if you have one menu structure only. Does not automatically push follow-up changes to the client(s).

Defined in:

CLIENTMENUMANAGER

Return value:

Create a new ClientManager instance.

Defined in:

CLIENTMENUMANAGER

Parameters:

The set of clients to manage.

#string Alias

The name of this manager.

#number Coalition

(Optional) Coalition of this Manager, defaults to coalition.side.BLUE

Return value:

Create a new entry in the generic structure.

Defined in:

CLIENTMENUMANAGER

Parameters:

#string Text

Text of the F10 menu entry.

#CLIENTMENU Parent

The parent menu entry.

#string Function

(optional) Function to call when the entry is used.

...

(optional) Arguments for the Function, comma separated.

Return value:

Entry

Push the complete menu structure to each of the clients in the set - refresh the menu tree of the clients.

Defined in:

CLIENTMENUMANAGER

Parameter:

(optional) If given, propagate only for this client.

Return value:

Entry

Remove all entries below the given entry from the client's F10 menus.

Defined in:

CLIENTMENUMANAGER

Parameters:

#CLIENTMENU Entry

The entry where to start. This entry stays.

(optional) If given, make this change only for this client. In this case the generic structure will not be touched.

Return value:

Remove all entries below the given entry from the generic tree.

Defined in:

CLIENTMENUMANAGER

Parameter:

#CLIENTMENU Entry

The entry where to start. This entry stays.

Return value:

Blank out the menu - remove all root entries and all entries below from the client's F10 menus, leaving the generic structure untouched.

Defined in:

CLIENTMENUMANAGER

Parameter:

(optional) If given, remove only for this client.

Return value:

Blank out the menu - remove all root entries and all entries below from all clients' F10 menus, and delete the generic structure.

Defined in:

CLIENTMENUMANAGER

Return value:

[Internal] Event handling

Defined in:

CLIENTMENUMANAGER

Parameter:

Return value:

Field(s)

#string CLIENTMENUMANAGER.ClassName

Class Name

Core.Set#SET_CLIENT CLIENTMENUMANAGER.clientset

The set of clients this menu manager is for

#string CLIENTMENUMANAGER.lid

Lid for log entries

#string CLIENTMENUMANAGER.name

Name

#string CLIENTMENUMANAGER.version

Version string

Function(s)

Clear the state of an object.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

StateName

The key that is should be cleared.

Creation of a Birth Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

#string IniUnitName

The initiating unit name.

place

subplace

Creation of a Crash Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a Dead Event.

Defined in:

Parameters:

DCS#Time EventTime

The time stamp of the event.

DCS#Object Initiator

The initiating object of the event.

IniObjectCategory

Creation of a S_EVENT_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 Core.Event processing Priority.

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

Defined in:

Return value:

#number:

The Core.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, set to nil, or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

The object that holds the Value set by the Key.

Key

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

Return value:

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

Subscribe to a DCS Event.

Defined in:

Parameters:

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 Core.Event processing Priority.

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

Defined in:

Parameter:

#number EventPriority

The Core.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, set to nil, or garbage collected, then the Values and Keys will also be gone.

Defined in:

Parameters:

Object

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

Key

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

Value

The value to is stored in the object.

Return value:

The Value set.

Trace a function logic level 1.

Can be anywhere within the function logic.

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

(Internal) Serialize arguments

Defined in:

Parameter:

#table Arguments

Return value:

#string:

Text

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