GetEquipmentSlotsMask

From GECK
(Redirected from GetESM)
Jump to: navigation, search


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 Base Form. If a calling reference is passed, its base form will be used instead.

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:baseForm 

Or:

(BitMask:int) reference.GetESM ToGetMaskOf:baseForm 

Example

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

int BitMask
set BitMask to GetEquipmentSlotsMask SomeItemBaseForm

if (GetBit BitMask, 11)
    ; SomeItemBaseForm uses the "eyeglasses" slot.
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