DCS World Typescript
    Preparing search index...
    interface l_land {
        SurfaceType: {
            LAND: number;
            ROAD: number;
            RUNWAY: number;
            SHALLOW_WATER: number;
            WATER: number;
        };
        findPathOnRoads(
            roadType: "roads" | "rails",
            x: number,
            y: number,
            destinationX: number,
            destinationY: number,
        ): l_Vec2[];
        getClosestPointOnRoads(
            roadType: "roads" | "railroads",
            x: number,
            y: number,
        ): LuaMultiReturn<[number, number]>;
        getHeight(point: l_Vec2): number;
        getIP(
            origin: l_Vec3,
            direction: l_Vec3,
            distance: number,
        ): l_Vec3 | undefined;
        getSurfaceHeightWithSeabed(point: l_Vec2): LuaMultiReturn<[number, number]>;
        getSurfaceType(point: l_Vec2): number;
        isVisible(origin: l_Vec3, destination: l_Vec3): boolean;
        profile(origin: l_Vec3, destination: l_Vec3): l_Vec3[];
    }

    Hierarchy (View Summary)

    Index
    SurfaceType: {
        LAND: number;
        ROAD: number;
        RUNWAY: number;
        SHALLOW_WATER: number;
        WATER: number;
    }
    • Finds a route through the map road or rail network. DCS currently expects "rails" for rail routes, unlike getClosestPointOnRoads.

      Parameters

      • roadType: "roads" | "rails"

        Network to follow.

      • x: number

        Start X/north coordinate.

      • y: number

        Start Y/east coordinate.

      • destinationX: number

        Destination X/north.

      • destinationY: number

        Destination Y/east.

      Returns l_Vec2[]

      Ordered route points.

      `const route = land.findPathOnRoads("roads", 0, 0, 10000, 10000);`
      
    • Returns the X and Y values of a coordinate on the nearest road from the given point. NOTE that this function does not use vec2 or vec3. It uses individual values representing a vec2 for x and y.

      Valid road type values: 'roads' and 'railroads'

      Parameters

      • roadType: "roads" | "railroads"

        Network to search: paved/unpaved roads or railways.

      • x: number

        Local X/north coordinate in metres.

      • y: number

        Local Y/east ground-plane coordinate (world Z) in metres.

      Returns LuaMultiReturn<[number, number]>

      X/north and Y/east coordinates of the nearest network point.

      const [roadX, roadY] = land.getClosestPointOnRoads("roads", 1000, 2000);
      
    • Returns the distance from sea level (y-axis) of a given vec2 point.

      Parameters

      • point: l_Vec2

        Ground-plane coordinate where x is north and y is east.

      Returns number

      Terrain elevation above sea level in metres.

      const elevation = land.getHeight({ x: 1000, y: 2000 });
      env.info(`Terrain elevation: ${elevation} m`);