IsWeaponRanged

From GECK
Jump to: navigation, search


A function added by the ShowOff NVSE Plugin.

Description

A convenience function that returns true if the weapon's BaseForm is of ranged (non-melee) type. Can be used as a condition.

If the weapon:baseForm argument is omitted, the function instead checks the weapon reference's base form.

Syntax

[help]
(isRanged:bool) weapRefr.IsWeaponRanged weapon:baseForm

Example

short bIsRanged

let bIsRanged := IsWeaponRanged BMWeapNailBoard

Returns false, since BMWeapNailBoard's weapon type is "TwoHandMelee".

let bIsRanged := IsWeaponRanged EDEZapGun

Returns true, since EDEZapGun's weapon type is "OneHandPistol".

Notes

  • Internally, this function does nothing more than check if the weapon's type is >= 3 && <= 13. The same result could be achieved with GetWeaponType.

See Also