GetBit

Revision as of 13:28, 6 October 2015 by imported>Hemingway (source nvse_whatnew)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
< [[::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

(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