DCS World Typescript
    Preparing search index...

    Global functions available to DCS Export.lua scripts.

    Export availability functions reflect the server's anti-cheat/export settings. Ownship and sensor functions can also return undefined when there is no player aircraft or supported cockpit device. Experimental functions can change between DCS releases.

    %DCS_INSTALL_DIR%/API/Sim_ControlAPI.md:500

    2.9.29.27468

    interface l_Export {
        GetClickableElements(): | Record<string, ExportClickableElement>
        | undefined;
        GetDevice(deviceId: number): ExportCockpitDevice | undefined;
        GetIndicator(indicatorId: number): ExportIndicator | undefined;
        LoCreateCameraRequest(): ExportCameraRequest | undefined;
        LoCreateUserBookmarkRequest(name: string): ExportCameraRequest | undefined;
        LoForceCamera(request: ExportCameraRequest): void;
        LoGeoCoordinatesToLoCoordinates(
            longitude: number,
            latitude: number,
        ): ExportVec3;
        LoGetAccelerationUnits(): ExportVec3 | undefined;
        LoGetADIPitchBankYaw(): LuaMultiReturn<
            [number | undefined, number | undefined, number | undefined],
        >;
        LoGetAircraftDrawArgumentValue(argument: number): number;
        LoGetAltitude(x: number, z: number): number;
        LoGetAltitudeAboveGroundLevel(): number | undefined;
        LoGetAltitudeAboveSeaLevel(): number | undefined;
        LoGetAngleOfAttack(): number | undefined;
        LoGetAngleOfSideSlip(): number | undefined;
        LoGetAngularVelocity(): ExportVec3 | undefined;
        LoGetBasicAtmospherePressure(): number | undefined;
        LoGetCameraPosition(): ExportPosition;
        LoGetControlPanel_HSI(): ExportHSI | undefined;
        LoGetEngineInfo(): ExportEngineInfo | undefined;
        LoGetF15_TWS_Contacts(): unknown[] | undefined;
        LoGetFMData(): Record<string, unknown> | undefined;
        LoGetGlideDeviation(): number | undefined;
        LoGetHeightWithObjects(x: number, z: number): number | undefined;
        LoGetHelicopterFMData(): ExportHelicopterFMData | undefined;
        LoGetInAir(): boolean;
        LoGetIndicatedAirSpeed(): number | undefined;
        LoGetLocalPlayer(): ExportPlayer | undefined;
        LoGetLockedTargetInformation(): ExportTarget[] | undefined;
        LoGetMachNumber(): number | undefined;
        LoGetMagneticYaw(): number | undefined;
        LoGetMCPState(): Record<string, boolean> | undefined;
        LoGetMechInfo(): ExportMechanizationInfo | undefined;
        LoGetMissionStartTime(): number;
        LoGetModelTime(): number;
        LoGetNameByType(
            level1: number,
            level2: number,
            level3: number,
            level4: number,
        ): string | undefined;
        LoGetNavigationInfo(): ExportNavigationInfo | undefined;
        LoGetObjectById(objectId: number): ExportObject | undefined;
        LoGetPayloadInfo(): ExportPayloadInfo | undefined;
        LoGetPilotName(): string | undefined;
        LoGetPlayerPlaneId(): number | undefined;
        LoGetPlayers(): ExportPlayer[] | undefined;
        LoGetPlayerUnitId(): number | undefined;
        LoGetRadarAltimeter(): number | undefined;
        LoGetRadioBeaconsStatus(): ExportRadioBeaconsStatus | undefined;
        LoGetRoute(): ExportRoute | undefined;
        LoGetSelfData(): ExportObject | undefined;
        LoGetShakeAmplitude(): number | undefined;
        LoGetSideDeviation(): number | undefined;
        LoGetSightingSystemInfo(): Record<string, unknown> | undefined;
        LoGetSlipBallPosition(): number | undefined;
        LoGetSnares(): ExportSnares | undefined;
        LoGetTargetInformation(): ExportTarget[] | undefined;
        LoGetTrueAirSpeed(): number | undefined;
        LoGetTWSInfo(): ExportTWSInfo | undefined;
        LoGetUserBookmarks(): ExportCameraBookmark[] | undefined;
        LoGetVectorVelocity(): ExportVec3 | undefined;
        LoGetVectorWindVelocity(): ExportVec3 | undefined;
        LoGetVersionInfo(): ExportVersionInfo;
        LoGetVerticalVelocity(): number | undefined;
        LoGetWindAtPoint(
            x: number,
            y: number,
            z: number,
            isRadioAltitude?: boolean,
        ): LuaMultiReturn<[number, number, number, number]>;
        LoGetWingInfo(): ExportWingmanInfo[] | undefined;
        LoGetWingTargets(): ExportVec3[] | undefined;
        LoGetWorldObjects(
            category?: "units" | "ballistic" | "airdromes",
        ): Record<number, ExportObject>;
        LoIsObjectExportAllowed(): boolean;
        LoIsOwnshipExportAllowed(): boolean;
        LoIsSensorExportAllowed(): boolean;
        LoLoCoordinatesToGeoCoordinates(x: number, z: number): ExportGeoCoordinates;
        LoSendForceCamera(hostId: number, request: ExportCameraRequest): void;
        LoSetAllowRemoteForceCameraRequests(allowed: boolean): void;
        LoSetCameraPosition(position: ExportPosition): void;
        LoSetCommand(command: number, value?: number): void;
        LoSimulationOnActivePause(): boolean;
        LoSimulationOnPause(): boolean;
    }

    Hierarchy (View Summary)

    Index
    • Returns a module-specific cockpit indicator.

      Parameters

      • indicatorId: number

        Indicator ID.

      Returns ExportIndicator | undefined

      Indicator, or undefined.

      `const mfd = GetIndicator(1);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:62

    • Creates a force-camera request from the current camera.

      Returns ExportCameraRequest | undefined

      Current camera request, or undefined when no camera/player context is available.

      `const request = Export.LoCreateCameraRequest(); if (request) Export.LoForceCamera(request);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:238

    • Creates a force-camera request for a named user bookmark.

      Parameters

      • name: string

        Bookmark name returned by LoGetUserBookmarks.

      Returns ExportCameraRequest | undefined

      Camera request, or undefined when the bookmark is absent.

      `const request = Export.LoCreateUserBookmarkRequest("Overhead");`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:293

    • Applies a force-camera request locally.

      Parameters

      Returns void

      Nothing.

      `const request = Export.LoCreateCameraRequest(); if (request) Export.LoForceCamera(request);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:243

    • Converts longitude/latitude to local DCS coordinates.

      Parameters

      • longitude: number

        Decimal degrees.

      • latitude: number

        Decimal degrees.

      Returns ExportVec3

      Local point in metres.

      `const point = LoGeoCoordinatesToLoCoordinates(41.5997, 41.6103);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:835

    • Returns body-axis acceleration in G units.

      Returns ExportVec3 | undefined

      {x, y, z} acceleration, or undefined without ownship data.

      `const loadFactor = LoGetAccelerationUnits()?.y;`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:442

    • Returns ADI pitch, bank, and yaw in radians. Without ownship data each value is undefined.

      Returns LuaMultiReturn<[number | undefined, number | undefined, number | undefined]>

      Three Lua values.

      `const [pitch, bank, yaw] = LoGetADIPitchBankYaw();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:445

    • Returns a normalized external-model draw argument.

      Parameters

      • argument: number

        Argument index.

      Returns number

      Current value.

      `const value = LoGetAircraftDrawArgumentValue(0);`
      
    • Returns terrain altitude at local X/Z coordinates.

      Parameters

      • x: number

        Local northing.

      • z: number

        Local easting.

      Returns number

      Altitude in metres.

      `const altitude = LoGetAltitude(point.x, point.z);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:633

    • Returns altitude above ground in metres.

      Returns number | undefined

      AGL altitude, or undefined without ownship data.

      `const agl = LoGetAltitudeAboveGroundLevel();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:440

    • Returns barometric altitude above sea level in metres.

      Returns number | undefined

      ASL altitude, or undefined without ownship data.

      `const altitude = LoGetAltitudeAboveSeaLevel();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:439

    • Returns angle of attack in radians.

      Returns number | undefined

      AOA, or undefined without ownship data.

      `const alpha = LoGetAngleOfAttack();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:441

    • Returns ownship sideslip angle in radians.

      Returns number | undefined

      Sideslip angle, or undefined without ownship data.

      `const beta = LoGetAngleOfSideSlip();`
      
    • Returns angular velocity in radians per second.

      Returns ExportVec3 | undefined

      Body angular rates, or undefined without ownship data.

      `const rates = LoGetAngularVelocity();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:839

    • Returns basic atmospheric pressure in mmHg.

      Returns number | undefined

      Pressure, or undefined without ownship data.

      `const pressure = LoGetBasicAtmospherePressure();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:450

    • Returns HSI bearings, heading, course, and deviation in radians.

      Returns ExportHSI | undefined

      Current HSI state, or undefined without supported ownship data.

      `const course = LoGetControlPanel_HSI()?.Course;`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:451

    • Returns engine, hydraulics, fuel-flow, and fuel data.

      Returns ExportEngineInfo | undefined

      Current engine information, or undefined without ownship data.

      `const leftRpm = LoGetEngineInfo()?.RPM.left;`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:462

    • Returns legacy F-15 TWS contacts. DCS publishes no stable record schema.

      Returns unknown[] | undefined

      Contact records, or undefined when unsupported.

      `const contacts = LoGetF15_TWS_Contacts() ?? [];`
      
    • Returns aircraft-specific fixed-wing flight-model data. DCS publishes no stable schema.

      Returns Record<string, unknown> | undefined

      FM table, or undefined.

      `const fm = LoGetFMData();`
      
    • Returns normalized glideslope deviation from -1 to 1.

      Returns number | undefined

      Deviation, or undefined without ownship data.

      `const glide = LoGetGlideDeviation();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:447

    • Returns surface height including world objects. The function can be unavailable outside a supported simulation context.

      Parameters

      • x: number

        Local northing in metres.

      • z: number

        Local easting in metres.

      Returns number | undefined

      Surface height, or undefined when unavailable.

      `const surface = Export.LoGetHeightWithObjects(point.x, point.z) ?? Export.LoGetAltitude(point.x, point.z);`
      
    • Reports whether ownship is airborne.

      Returns boolean

      In-air state.

      `const airborne = LoGetInAir();`
      
    • Returns indicated airspeed in metres per second.

      Returns number | undefined

      IAS, or undefined without ownship data.

      `const ias = LoGetIndicatedAirSpeed();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:437

    • Returns the local multiplayer player's host ID and name.

      Returns ExportPlayer | undefined

      Local player identity, or undefined outside multiplayer.

      `const localPlayer = Export.LoGetLocalPlayer();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:346

    • Returns targets currently locked by ownship.

      Returns ExportTarget[] | undefined

      Locked-target records, or undefined without sensor data.

      `const primary = Export.LoGetLockedTargetInformation()?.[0];`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:648

    • Returns ownship Mach number.

      Returns number | undefined

      Mach number, or undefined without ownship data.

      `const mach = LoGetMachNumber();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:444

    • Returns magnetic heading in radians.

      Returns number | undefined

      Heading, or undefined without ownship data.

      `const heading = LoGetMagneticYaw();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:446

    • Returns main-control-panel warning/failure flags.

      Returns Record<string, boolean> | undefined

      Boolean map keyed by DCS flag name, or undefined without ownship data.

      `const warning = LoGetMCPState()?.MasterWarning;`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:565

    • Returns mission start time in seconds.

      Returns number

      Start time.

      `const start = LoGetMissionStartTime();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:434

    • Returns simulation model time in seconds.

      Returns number

      Model time.

      `const now = LoGetModelTime();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:433

    • Resolves a four-level world type to a name.

      Parameters

      • level1: number

        First classification.

      • level2: number

        Second classification.

      • level3: number

        Third classification.

      • level4: number

        Fourth classification.

      Returns string | undefined

      Name, or undefined.

      `const name = LoGetNameByType(1, 1, 1, 1);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:645

    • Reads one exported object.

      Parameters

      • objectId: number

        Runtime world-object ID.

      Returns ExportObject | undefined

      Object data, or undefined when unavailable.

      `const object = LoGetObjectById(LoGetPlayerPlaneId());`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:595

    • Returns the player's display name.

      Returns string | undefined

      Pilot name, or undefined without a player.

      `const pilot = LoGetPilotName();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:435

    • Returns the player's runtime plane ID.

      Returns number | undefined

      Object ID, or undefined without a player aircraft.

      `const id = LoGetPlayerPlaneId();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:436

    • Returns all connected multiplayer players.

      Returns ExportPlayer[] | undefined

      Player identities, or undefined outside multiplayer.

      `const players = Export.LoGetPlayers() ?? [];`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:347

    • Returns the player's unit ID.

      Returns number | undefined

      Numeric unit ID, or undefined without a player unit.

      `const id = Export.LoGetPlayerUnitId();`
      
    • Returns radar-altimeter height in metres.

      Returns number | undefined

      Radar altitude, or undefined without ownship data.

      `const height = LoGetRadarAltimeter();`
      
    • Returns the current route and next waypoint.

      Returns ExportRoute | undefined

      Route, or undefined when unavailable.

      `const next = LoGetRoute()?.goto_point;`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:474

    • Returns ownship using the object-export schema regardless of world-object export settings.

      Returns ExportObject | undefined

      Ownship, or undefined without a player aircraft.

      `const ownshipName = Export.LoGetSelfData()?.Name;`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:631

    • Returns cockpit/camera shake amplitude.

      Returns number | undefined

      Shake amplitude, or undefined without ownship data.

      `const shake = LoGetShakeAmplitude();`
      
    • Returns normalized lateral deviation from -1 to 1.

      Returns number | undefined

      Deviation, or undefined without ownship data.

      `const deviation = LoGetSideDeviation();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:448

    • Returns aircraft-dependent radar/optical sight state. DCS publishes no stable cross-module schema.

      Returns Record<string, unknown> | undefined

      Sight table, or undefined.

      `const sight = LoGetSightingSystemInfo();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:686

    • Returns normalized slip-ball position from -1 to 1.

      Returns number | undefined

      Slip value, or undefined without ownship data.

      `const slip = LoGetSlipBallPosition();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:449

    • Returns remaining chaff and flares.

      Returns ExportSnares | undefined

      Countermeasure counts, or undefined without ownship data.

      `const flares = LoGetSnares()?.flare;`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:842

    • Returns contacts detected by the targeting system.

      Returns ExportTarget[] | undefined

      Current target records, or undefined without sensor data.

      `const targets = Export.LoGetTargetInformation() ?? [];`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:647

    • Returns true airspeed in metres per second.

      Returns number | undefined

      TAS, or undefined without ownship data.

      `const tas = LoGetTrueAirSpeed();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:438

    • Returns threat-warning mode and emitters.

      Returns ExportTWSInfo | undefined

      Current TWS state, or undefined without sensor data.

      `const threats = Export.LoGetTWSInfo()?.Emitters ?? [];`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:735

    • Returns ownship world-axis velocity in metres per second.

      Returns ExportVec3 | undefined

      Velocity, or undefined without ownship data.

      `const velocity = LoGetVectorVelocity();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:838

    • Returns ownship wind velocity in world axes, metres per second.

      Returns ExportVec3 | undefined

      Wind vector, or undefined without ownship data.

      `const wind = LoGetVectorWindVelocity();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:840

    • Returns vertical velocity in metres per second.

      Returns number | undefined

      Climb/descent rate, or undefined without ownship data.

      `const climbRate = LoGetVerticalVelocity();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:443

    • Returns the wind vector and absolute terrain height at a world point.

      DCS returns four Lua numbers rather than an ExportVec3 table. Set isRadioAltitude when y is height above the terrain instead of height above sea level.

      Parameters

      • x: number

        North/south local coordinate in metres.

      • y: number

        Height in metres, interpreted according to isRadioAltitude.

      • z: number

        East/west local coordinate in metres.

      • OptionalisRadioAltitude: boolean

        Whether y is height above terrain. Defaults to false.

      Returns LuaMultiReturn<[number, number, number, number]>

      Wind velocity components x, y, and z in metres per second, followed by absolute terrain height in metres.

      const [windX, windY, windZ, terrainHeight] = Export.LoGetWindAtPoint(
      0,
      1000,
      0,
      false,
      );
    • Returns wingman positions, targets, and tasks.

      Returns ExportWingmanInfo[] | undefined

      Wingman records, or undefined without ownship data.

      `const wingmen = LoGetWingInfo() ?? [];`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:791

    • Returns target positions assigned to wingmen.

      Returns ExportVec3[] | undefined

      World-space points, or undefined without sensor data.

      `const targets = LoGetWingTargets() ?? [];`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:841

    • Returns world objects keyed by runtime ID.

      Parameters

      • Optionalcategory: "units" | "ballistic" | "airdromes"

        Object set; defaults to "units".

      Returns Record<number, ExportObject>

      Exported objects.

      `const bases = LoGetWorldObjects("airdromes");`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:624

    • Reports whether world-object export is permitted.

      Returns boolean

      true when object data may be read.

      `if (LoIsObjectExportAllowed()) objects = LoGetWorldObjects();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:429

    • Reports whether ownship export is permitted.

      Returns boolean

      Permission state.

      `const allowed = LoIsOwnshipExportAllowed();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:431

    • Reports whether sensor/target export is permitted.

      Returns boolean

      Permission state.

      `if (LoIsSensorExportAllowed()) inspectTargets();`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:430

    • Converts local X/Z coordinates to latitude/longitude. DCS returns one table, not multiple Lua values.

      Parameters

      • x: number

        Local northing.

      • z: number

        Local easting.

      Returns ExportGeoCoordinates

      Geographic coordinate record.

      `const { latitude, longitude } = Export.LoLoCoordinatesToGeoCoordinates(point.x, point.z);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:836

    • Sends a force-camera request to another host, or to every other host when hostId is zero.

      Parameters

      • hostId: number

        Destination multiplayer host ID; use 0 to broadcast.

      • request: ExportCameraRequest

        Camera request to send.

      Returns void

      Nothing.

      `Export.LoSendForceCamera(0, Export.LoCreateCameraRequest());`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:349

    • Enables or disables processing remote force-camera requests locally. It is disabled by default.

      Parameters

      • allowed: boolean

        Whether remote requests may control this client's camera.

      Returns void

      Nothing.

      `Export.LoSetAllowRemoteForceCameraRequests(true);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:348

    • Sends an input command. Analog values normally range from -1 to 1; discrete commands omit value.

      Parameters

      • command: number

        DCS command number.

      • Optionalvalue: number

        Optional analog value.

      Returns void

      Nothing.

      `LoSetCommand(2001, 0.25);`
      

      %DCS_INSTALL_DIR%/Scripts/Export.lua:854

    • Reports whether active-pause mode is enabled.

      Returns boolean

      Active-pause state.

      `const activePause = LoSimulationOnActivePause();`
      
    • Reports whether simulation is paused.

      Returns boolean

      Pause state.

      `const paused = LoSimulationOnPause();`