GetEquipmentBipedMask

From GECK

A function added by the New Vegas Script Extender.

Description

Returns the equipment flags used by the specified armor as a bitmask int. Bitmasks may be built by using ClearBit/SetBit. Added by NVSE 4.5.

Syntax

(BitMask:int) GetEquipmentBipedMask ToGetMaskOf:armor

Bit Fields

  • 2 (4) = HasBackpack
  • 3 (8) = Medium Armor
  • 5 (32) = Power Armor
  • 6 (64) = Non playable
  • 7 (128) = HeavyArmor

Other bits are either unused or unknown.

Example

int BitMask
let BitMask := GetEquipmentBipedMask ArmorTeslaPower ; * 160 (Heavy + Power)

To check if some item has the "HeavyArmor" flag, you could use:

if BitMask == (SetBit BitMask, 7)
   ; It is "Heavy armor". 
   ; (Bitmask compares equal to self with bit7 set, so bit7 is already set)
endif

You can alternatively use 'C' style bit operators in NVSE aware contexts, such as let or eval:

if eval BitMask & (1 << 7)
    ; Bit7 is set, so the item is flagged as "Heavy armor"
endif

See Also

Personal tools