GetEquipmentSlotsMask

From the Fallout3 GECK Wiki
Jump to navigation Jump to search
< [[::Category:Functions|Category:Functions]]

A function added by the New Vegas Script Extender.

Description

Returns the slots used by the biped form as a bitmask int, for the specified object or calling reference.

The mask is a bitmask that should be built by using ClearBit/SetBit. The order of bits is as specified for the slot id of GetEquippedObject or as defined in the GECK slot list of an armor, 0="head" to 19="body addon 3".

Syntax

[help]
(BitMask:int) reference.GetEquipmentSlotsMask ToGetMaskOf:form 

Or:

(BitMask:int) reference.GetESM ToGetMaskOf:form

Example

To check if some equipment is using the "eyeglasses" slot (bit 11):

int BitMask
set BitMask to GetEquipmentSlotsMask SomeItem

if BitMask == (SetBit BitMask, 11)
    ; SomeItem uses the "eyeglasses" slot.
    ; (BitMask compares equal to itself with bit 11 set, so bit 11 is already set)
endif

NVSE aware functions, such as Let and Eval also allow 'C' style bit operators (see NVSE Expressions), an alternative method to check if the 11th bit is set is:

if eval BitMask & (1 << 11)
    ; Bit 11 is set, so the item uses the "eyeglasses" slot
endif

See Also