DCS World Typescript
    Preparing search index...

    2.9.29.27468

    interface l_Object {
        Category: {
            BASE: number;
            CARGO: number;
            SCENERY: number;
            STATIC: number;
            UNIT: number;
            VOID: number;
            WEAPON: number;
        };
        className_: string;
        database_: {
            Batumi: {
                _origin: string;
                attributes: { Airfields: boolean };
                category: number;
                displayName: string;
                life: number;
                typeName: string;
            };
            "Leopard-2": {
                _origin: string;
                attributes: {
                    All: boolean;
                    "AntiAir Armed Vehicles": boolean;
                    "Armed ground units": boolean;
                    "Armed vehicles": boolean;
                    "Armored vehicles": boolean;
                    "Ground Units": boolean;
                    "Ground Units Non Airdefence": boolean;
                    "Ground vehicles": boolean;
                    HeavyArmoredUnits: boolean;
                    "Modern Tanks": boolean;
                    Tanks: boolean;
                    Vehicles: boolean;
                };
                box: {
                    max: { x: number; y: number; z: number };
                    min: { x: number; y: number; z: number };
                };
                category: number;
                displayName: string;
                Kmax: number;
                life: number;
                massEmpty: number;
                maxSlopeAngle: number;
                RCS: number;
                riverCrossing: boolean;
                speedMax: number;
                speedMaxOffRoad: number;
                typeName: string;
            };
            getCategoryEx(...args: any[]): unknown;
        };
        parentClass_: { className_: string };
        cancelChoosingCargo(...arguments_: unknown[]): unknown;
        destroy(): void;
        getAttributes(): Record<string, unknown> | undefined;
        getCategory(): number;
        getName(): string;
        getPoint(): l_Vec3;
        getPosition(): l_Position3;
        getTypeName(): string;
        getVelocity(): l_Vec3;
        hasAttribute(attribute: string): boolean;
        inAir(): boolean;
        isExist(): boolean;
        tonumber(...args: any[]): unknown;
    }

    Hierarchy (View Summary)

    Index
    Category: {
        BASE: number;
        CARGO: number;
        SCENERY: number;
        STATIC: number;
        UNIT: number;
        VOID: number;
        WEAPON: number;
    }
    className_: string
    database_: {
        Batumi: {
            _origin: string;
            attributes: { Airfields: boolean };
            category: number;
            displayName: string;
            life: number;
            typeName: string;
        };
        "Leopard-2": {
            _origin: string;
            attributes: {
                All: boolean;
                "AntiAir Armed Vehicles": boolean;
                "Armed ground units": boolean;
                "Armed vehicles": boolean;
                "Armored vehicles": boolean;
                "Ground Units": boolean;
                "Ground Units Non Airdefence": boolean;
                "Ground vehicles": boolean;
                HeavyArmoredUnits: boolean;
                "Modern Tanks": boolean;
                Tanks: boolean;
                Vehicles: boolean;
            };
            box: {
                max: { x: number; y: number; z: number };
                min: { x: number; y: number; z: number };
            };
            category: number;
            displayName: string;
            Kmax: number;
            life: number;
            massEmpty: number;
            maxSlopeAngle: number;
            RCS: number;
            riverCrossing: boolean;
            speedMax: number;
            speedMaxOffRoad: number;
            typeName: string;
        };
        getCategoryEx(...args: any[]): unknown;
    }
    parentClass_: { className_: string }
    • TODO: cargo-selection cancellation is engine-native and its parameter/return contract is not exposed by installed scripts.

      Parameters

      • ...arguments_: unknown[]

      Returns unknown

    • Returns the attributes table directly from the object's descriptor. DCS returns nil when the descriptor has no attributes table.

      Returns Record<string, unknown> | undefined

      Attribute-name map, or undefined when the object has no attributes.

      const unit = Unit.getByName("Target");
      const attributes = unit?.getAttributes();
      if (attributes?.["Ground Units"] === true) {
      env.info("Target is a ground unit");
      }

      %DCS_INSTALL_DIR%/Scripts/ScriptingSystem.lua:106

    • Tests whether the object's descriptor contains an attribute whose value is exactly true. Attribute names are DCS database strings such as "Air", "Ground Units", or "Ships".

      Parameters

      • attribute: string

        DCS database attribute name to test.

      Returns boolean

      true only when the descriptor contains that attribute with the value true.

      const unit = Unit.getByName("Target");
      if (unit?.hasAttribute("Air Defence")) {
      env.info("Target is an air-defence unit");
      }