GetEquippedItemsAsBitMask
From GECK
A function added by the ShowOff NVSE Plugin.
Contents
Description
Returns a bitmask containing which equip slots are currently occupied. Note that certain items can occupy multiple equip slots. Non-playable items are checked. If called from console, will display the return value in hexadecimal format.
Syntax
(equippedItemsMask:int) actorRefr.GetEquippedItemsAsBitMask
Or:
(equippedItemsMask:int) actorRefr.GetOccupiedEquipSlots
Example
if Player.GetEquippedItemsAsBitMask == 12
Checks if the player has both something equipped for the Upper Body and the Left Hand equip slots (and nowhere else!).
if eval player.GetEquippedItemsAsBitMask & (1 << 5)
Checks if the player has a weapon equipped. Equivalent to the following:
if eval player.GetEquippedItemsAsBitMask & 32
Notes
- The equip slot flags are:
Equip Slot Flag | Flag Value | Bit |
---|---|---|
Head | 1 | 0 |
Hair | 2 | 1 |
Upper Body | 4 | 2 |
Left Hand | 8 | 3 |
Right Hand | 16 | 4 |
Weapon | 32 | 5 |
PipBoy | 64 | 6 |
Backpack | 128 | 7 |
Necklace | 256 | 8 |
Headband | 512 | 9 |
Hat | 1024 | 10 |
Eyeglasses | 2048 | 11 |
Nosering | 4096 | 12 |
Earrings | 8192 | 13 |
Mask | 16384 | 14 |
Choker | 32768 | 15 |
MouthObject | 65536 | 16 |
BodyAddon1 | 131072 | 17 |
BodyAddon2 | 262144 | 18 |
BodyAddon3 | 524288 | 19 |