WeaponHasFlag

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


A function added by the ShowOff NVSE Plugin version 1.15.

Description

Returns true (1) if the weapon's BaseForm has the specified flag enabled. If the function is called with a weapon reference (weaponRefr), its BaseForm is used.

This function can be used either in a script, or as a Condition.

Syntax

[help]
(hasFlag:0/1) weaponRefr.WeaponHasFlag flagIndex:int weapon:baseForm 

Or:

(hasFlag:0/1) weaponRefr.GetWeaponHasFlag flagIndex:int weapon:baseForm 

flagIndex Values

Index Weapon Flag
0 ignores normal weapon resist
1 is automatic
2 has scope
3 can't drop
4 hide backpack
5 embedded weapon
6 don't use first-person IS animations
7 nonplayable
8 player only
9 NPCs use ammo
10 no jam after reload
11 override action points
12 minor crime
13 range fixed
14 not used in normal combat
15 override damage to weapon mult
16 don't use third-person IS animations
17 short burst
18 rumble alternate
19 long burst
20 scope has night vision
21 scope from mod

Example

let int hasFlag := SomeWeaponRef.WeaponHasFlag 21

hasFlag will be 1 if SomeWeaponRef's BaseForm has the "Scope From Mod" flag enabled, 0 otherwise.

Notes

  • This function essentially checks GetWeaponFlags1 and GetWeaponFlags2 for the enabled bits.
  • This was made with condition functions in mind, as unlike in scripts, bit manipulation is not possible for conditions.

See Also