Module Event
The EVENT class models an efficient event handling process between other classes and its units, weapons.
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
-
DCSWorld#world.event EventID: -
#string EventClass:
Return value
-
- EVENT:OnBirth(EventFunction, EventSelf)
-
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 EventSelf:
Return value
-
- EVENT:OnBirthForTemplate(EventGroup, EventFunction, EventSelf, EventTemplate)
-
Create an OnBirth event handler for a group
Parameters
-
Group#GROUP EventGroup: -
#function EventFunction: The function to be called when the event occurs for the unit. -
EventSelf: The self instance of the class for which the event is. -
EventTemplate:
Return value
-
- EVENT:OnBirthForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf:
Return value
-
- EVENT:OnCrash(EventFunction, EventSelf)
-
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 EventSelf:
Return value
-
- EVENT:OnCrashForTemplate(EventGroup, EventFunction, EventSelf, EventTemplate)
-
Create an OnCrash event handler for a group
Parameters
-
Group#GROUP EventGroup: -
#function EventFunction: The function to be called when the event occurs for the unit. -
EventSelf: The self instance of the class for which the event is. -
EventTemplate:
Return value
-
- EVENT:OnCrashForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnDead(EventFunction, EventSelf)
-
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 EventSelf:
Return value
-
- EVENT:OnDeadForTemplate(EventGroup, EventFunction, EventSelf, EventTemplate)
-
Create an OnDead event handler for a group
Parameters
-
Group#GROUP EventGroup: -
#function EventFunction: The function to be called when the event occurs for the unit. -
EventSelf: The self instance of the class for which the event is. -
EventTemplate:
Return value
-
- EVENT:OnDeadForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnEngineShutDownForTemplate(EventTemplate, EventFunction, EventSelf)
-
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. -
EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnEngineShutDownForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnEngineStartUpForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnEventForTemplate(EventTemplate, EventFunction, EventSelf, 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. -
EventSelf: The self instance of the class for which the event is. -
#function OnEventFunction:
Return value
-
- EVENT:OnEventForUnit(EventDCSUnitName, EventFunction, EventSelf, 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. -
Base#BASE EventSelf: The self instance of the class for which the event is. -
EventID:
Return value
-
- EVENT:OnEventGeneric(EventFunction, EventSelf, 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. -
Base#BASE EventSelf: The self instance of the class for which the event is. -
EventID:
Return value
-
- EVENT:OnHit(EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnHitForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnLandForTemplate(EventTemplate, EventFunction, EventSelf)
-
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. -
EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnLandForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnPilotDeadForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnPlayerEnterUnit(EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnPlayerLeaveUnit(EventFunction, EventSelf)
-
Set a new listener for an SEVENTPLAYERLEAVEUNIT event.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnShot(EventFunction, EventSelf)
-
Set a new listener for an SEVENTSHOT event.
Parameters
-
#function EventFunction: The function to be called when the event occurs for the unit. -
Base#BASE EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnShotForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnTakeOffForTemplate(EventTemplate, EventFunction, EventSelf)
-
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. -
EventSelf: The self instance of the class for which the event is.
Return value
-
- EVENT:OnTakeOffForUnit(EventDCSUnitName, EventFunction, EventSelf)
-
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 EventSelf: The self instance of the class for which the event is.
Return value
-
- 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