Module Event
This module contains the EVENT class.
Takes care of EVENT dispatching between DCS events and event handling functions defined in MOOSE classes.
The above menus classes are derived from 2 main abstract classes defined within the MOOSE framework (so don't use these):
Contributions: -
Authors: FlightControl : Design & Programming
Global(s)
| EVENT |
Type EVENT
Type EVENT.Events
| EVENT.Events.IniUnit |
Type EVENTDATA
Global(s)
Type Event
Type EVENT
The EVENT structure
Field(s)
- #number EVENT.ClassID
- #string EVENT.ClassName
- EVENT:EventText(EventID)
-
Parameter
-
EventID:
-
- EVENT:Init(EventID, EventClass)
-
Initializes the Events structure for the event
Parameters
-
Dcs.DCSWorld#world.event EventID: -
Core.Base#BASE EventClass:
Return value
-
- EVENT:OnBirth(EventFunction, EventClass)
-
Set a new listener for an SEVENTBIRTH event, and registers the unit born.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass:
Return value
-
- EVENT:OnBirthForTemplate(EventGroup, EventFunction, EventClass, EventTemplate)
-
Create an OnBirth event handler for a group
Parameters
-
Wrapper.Group#GROUP EventGroup: -
#function EventFunction: The function to be called when the event occurs for the unit. -
EventClass: The self instance of the class for which the event is. -
EventTemplate:
Return value
-
- EVENT:OnBirthForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTBIRTH event.
Parameters
-
#string EventDCSUnitName: The id of the unit for the event to be handled. -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass:
Return value
-
- EVENT:OnBirthRemove(EventClass)
-
Stop listening to SEVENTBIRTH event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnCrash(EventFunction, EventClass)
-
Set a new listener for an SEVENTCRASH event.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass:
Return value
-
- EVENT:OnCrashForTemplate(EventGroup, EventFunction, EventClass, EventTemplate)
-
Create an OnCrash event handler for a group
Parameters
-
Wrapper.Group#GROUP EventGroup: -
#function EventFunction: The function to be called when the event occurs for the unit. -
EventClass: The self instance of the class for which the event is. -
EventTemplate:
Return value
-
- EVENT:OnCrashForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTCRASH event.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnCrashRemove(EventClass)
-
Stop listening to SEVENTCRASH event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnDead(EventFunction, EventClass)
-
Set a new listener for an SEVENTDEAD event.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass:
Return value
-
- EVENT:OnDeadForTemplate(EventGroup, EventFunction, EventClass, EventTemplate)
-
Create an OnDead event handler for a group
Parameters
-
Wrapper.Group#GROUP EventGroup: -
#function EventFunction: The function to be called when the event occurs for the unit. -
EventClass: The self instance of the class for which the event is. -
EventTemplate:
Return value
-
- EVENT:OnDeadForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTDEAD event.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnDeadRemove(EventClass)
-
Stop listening to SEVENTDEAD event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnEngineShutDownForTemplate(EventTemplate, EventFunction, EventClass)
-
Create an OnDead event handler for a group
Parameters
-
#table EventTemplate: -
#function EventFunction: The function to be called when the event occurs for the unit. -
EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnEngineShutDownForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTENGINE_SHUTDOWN event.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnEngineShutDownRemove(EventClass)
-
Stop listening to SEVENTENGINE_SHUTDOWN event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnEngineStartUpForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTENGINE_STARTUP event.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnEngineStartUpRemove(EventClass)
-
Stop listening to SEVENTENGINE_STARTUP event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnEventForTemplate(EventTemplate, EventFunction, EventClass, OnEventFunction)
-
Create an OnDead event handler for a group
Parameters
-
#table EventTemplate: -
#function EventFunction: The function to be called when the event occurs for the unit. -
EventClass: The instance of the class for which the event is. -
#function OnEventFunction:
Return value
-
- EVENT:OnEventForUnit(EventDCSUnitName, EventFunction, EventClass, EventID)
-
Set a new listener for an SEVENTX event
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Core.Base#BASE EventClass: The self instance of the class for which the event is. -
EventID:
Return value
-
- EVENT:OnEventGeneric(EventFunction, EventClass, EventID)
-
Set a new listener for an SEVENTX event independent from a unit or a weapon.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Core.Base#BASE EventClass: The self instance of the class for which the event is captured. When the event happens, the event process will be called in this class provided. -
EventID:
Return value
-
- EVENT:OnHit(EventFunction, EventClass)
-
Set a new listener for an SEVENTHIT event.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnHitForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTHIT event.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnHitRemove(EventClass)
-
Stop listening to SEVENTHIT event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnLandForTemplate(EventTemplate, EventFunction, EventClass)
-
Parameters
-
EventTemplate: -
EventFunction: -
EventClass:
-
- EVENT:OnLandForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTLAND event.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnLandRemove(EventClass)
-
Stop listening to SEVENTLAND event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnPilotDead(EventFunction, EventClass)
-
Set a new listener for an SEVENTPILOT_DEAD event.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass:
Return value
-
- EVENT:OnPilotDeadForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTPILOT_DEAD event.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnPilotDeadRemove(EventClass)
-
Stop listening to SEVENTPILOT_DEAD event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnPlayerEnterRemove(EventClass)
-
Stop listening to SEVENTPLAYERENTERUNIT event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnPlayerEnterUnit(EventFunction, EventClass)
-
Set a new listener for an SEVENTPLAYERENTERUNIT event.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnPlayerLeaveRemove(EventClass)
-
Stop listening to SEVENTPLAYERLEAVEUNIT event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnPlayerLeaveUnit(EventFunction, EventClass)
-
Parameters
-
EventFunction: -
EventClass:
-
- EVENT:OnShot(EventFunction, EventClass)
-
Parameters
-
EventFunction: -
EventClass:
-
- EVENT:OnShotForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTSHOT event for a unit.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnShotRemove(EventClass)
-
Stop listening to SEVENTSHOT event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:OnTakeOffForTemplate(EventTemplate, EventFunction, EventClass)
-
Parameters
-
EventTemplate: -
EventFunction: -
EventClass:
-
- EVENT:OnTakeOffForUnit(EventDCSUnitName, EventFunction, EventClass)
-
Set a new listener for an SEVENTTAKEOFF event.
Parameters
-
#string EventDCSUnitName: -
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventClass: The self instance of the class for which the event is.
Return value
-
- EVENT:OnTakeOffRemove(EventClass)
-
Stop listening to SEVENTTAKEOFF event.
Parameter
-
Base#BASE EventClass:
Return value
-
- EVENT:Remove(EventClass, EventID)
-
Removes an Events entry
Parameters
-
Core.Base#BASE EventClass: The self instance of the class for which the event is. -
Dcs.DCSWorld#world.event EventID:
Return value
-
- EVENT:RemoveAll(EventObject)
-
Clears all event subscriptions for a Core.Base#BASE derived object.
Parameter
-
Core.Base#BASE EventObject:
-
- EVENT:onEvent(Event)
-
Parameter
-
#EVENTDATA Event:
-
Type EVENT.Events
The Events structure
Field(s)
- #number EVENT.Events.IniUnit
Type EVENTDATA
The Event structure
Field(s)
- #string EVENTDATA.IniUnitName
- #string EVENTDATA.TgtUnitName