DCS World Typescript
    Preparing search index...

    2.9.29.27468

    interface l_Controller {
        className_: string;
        Detection: {
            DLINK: number;
            IRST: number;
            OPTIC: number;
            RADAR: number;
            RWR: number;
            VISUAL: number;
        };
        parentClass_: { className_: string };
        getDetectedTargets(...detectionMethods: number[]): DetectedTarget[];
        hasTask(): boolean;
        isTargetDetected(
            target: l_Object,
            ...detectionMethods: number[],
        ): LuaMultiReturn<
            [boolean, boolean, number, boolean, boolean, l_Vec3, l_Vec3],
        >;
        knowTarget(object: l_Object, type: boolean, distance: boolean): boolean;
        popTask(): void;
        pushTask(task: ControllerAction): void;
        resetTask(): void;
        setAltitude(
            altitude: number,
            keep?: boolean,
            altitudeType?: "BARO" | "RADIO",
        ): void;
        setCommand(command: ControllerAction): void;
        setOnOff(value: boolean): void;
        setOption(
            optionId: number,
            optionValue: string | number | boolean,
        ): boolean;
        setSpeed(speed: number, keep?: boolean): void;
        setTask(task: ControllerAction): void;
        tonumber(...args: any[]): unknown;
    }

    Hierarchy (View Summary)

    Index
    className_: string
    Detection: {
        DLINK: number;
        IRST: number;
        OPTIC: number;
        RADAR: number;
        RWR: number;
        VISUAL: number;
    }
    parentClass_: { className_: string }
    • Checks what the controller knows about a target.

      Parameters

      • target: l_Object

        Target object.

      • ...detectionMethods: number[]

        Values from Controller.Detection; omit to check all.

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

      Detected, visible, last-seen time, known-type, known-distance, last position, and last velocity.

      `const [detected, visible] = controller.isTargetDetected(target);`
      
    • Forces a unit controller to know a target; group controllers do not support it.

      Parameters

      • object: l_Object

        Target to reveal.

      • type: boolean

        Whether its type is revealed.

      • distance: boolean

        Whether its distance is revealed.

      Returns boolean

      true when DCS accepts the operation.

      `const accepted = controller.knowTarget(target, true, true);`
      
    • Commands an aircraft altitude.

      Parameters

      • altitude: number

        Metres.

      • Optionalkeep: boolean

        Preserve it across waypoints.

      • OptionalaltitudeType: "BARO" | "RADIO"

        "BARO" for MSL or "RADIO" for AGL.

      Returns void

      Nothing.

      `controller.setAltitude(1000, true, "RADIO");`
      
    • Sets an option from the applicable AI.Option table.

      Parameters

      • optionId: number

        Option ID.

      • optionValue: string | number | boolean

        Option value.

      Returns boolean

      true when DCS accepts the option.

      `const accepted = controller.setOption(AI.Option.Air.id.ROE, AI.Option.Air.val.ROE.WEAPON_HOLD);`