Typed dynamic-weather controls.
Registers an object that receives every simulator event through its
onEvent method. Register the same object only once and retain the object
if it may need to be removed later.
Object containing the callback DCS invokes for each event.
Nothing.
const handler: l_WorldEventHandler = {
onEvent(event) {
env.info(`DCS event ${event.id}`);
},
};
world.addEventHandler(handler);
Returns every airbase-like object in the mission, including map airfields, FARPs, and ships that provide airbase services.
Array of all available airbase objects.
Reads persistence data supplied by the host persistence system. DCS exposes the function but does not publish a stable value schema.
Registered persistence name.
Stored value when present.
Returns the mission's single Player-skill unit. Multiplayer client units are not returned.
Player unit, or undefined when unavailable.
Dispatches an event to every registered handler by calling each
handler's onEvent method. DCS uses this internally; mission scripts
normally register handlers instead of calling it directly.
Event payload to dispatch.
Nothing.
Removes a previously registered event handler. Removal uses object
identity, so pass the same object originally supplied to
addEventHandler.
Registered handler object to remove.
Nothing.
Removes wreckage, craters, and debris inside a volume; scenery wreckage is retained.
Search volume.
Number of removed junk objects.
Runs each persistence callback and passes its name and result to storage. The storage callback is invoked once for every registered handler.
Receives each registered name and its newly produced value.
Nothing.
Searches a volume and calls the handler for each matching object. Return false from the handler to stop early. DCS returns the number of matching objects visited; collect objects in the callback when their references are needed.
One or more values from Object.Category.
Search volume.
Callback receiving each object and optional data.
Optionaldata: T
Value forwarded to the callback.
Number of objects passed to the handler.
Registers a named persistence callback. The name may contain letters,
numbers, spaces, underscores, and hyphens.
Calling runPersistenceHandlers later invokes the callback and forwards
its result to the supplied storage function.
Stable key used when the value is stored.
Callback that produces the value to persist.
Nothing. Throws a Lua error if name contains unsupported characters.
No Self