GetBit

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 value of the bit at the specified position in a bitmask. Bit indices start at 0 and should not be greater than 20- higher values are unreliable and prone to conversion. Added by NVSE 5.0.1.

Syntax

[help]
(bool) GetBit BitMask:int BitIndex:int

Example

int BitMask
int BitTwo

set BitMask to 11		  ; binary: 10110000...
set BitTwo to GetBit BitMask, 2   ; 1

See Also