Receives simulator events after registration with world.addEventHandler. DCS invokes the method with the handler object as self.
world.addEventHandler
self
const handler: l_WorldEventHandler = { onEvent(event) { if (event.id === world.event.S_EVENT_BIRTH) { env.info("A unit was born"); } },};world.addEventHandler(handler); Copy
const handler: l_WorldEventHandler = { onEvent(event) { if (event.id === world.event.S_EVENT_BIRTH) { env.info("A unit was born"); } },};world.addEventHandler(handler);
Handles one event dispatched by DCS.
Event table. Inspect event.id before using event-specific fields.
event.id
Nothing.
const handler: l_WorldEventHandler = { onEvent(event) { env.info(`DCS event ${event.id}`); },}; Copy
const handler: l_WorldEventHandler = { onEvent(event) { env.info(`DCS event ${event.id}`); },};
Receives simulator events after registration with
world.addEventHandler. DCS invokes the method with the handler object asself.Example