AddItemAlt

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Adds quantity of the specified item to the calling reference's inventory.

  • Unlike the vanilla AddItem/AddItemHealthPercent functions, this does not cause the infamous "invisible weapon" glitch when used on actors.
  • The 1st argument item may be either an Item form, a Leveled Item, or a Form List of items.
  • The 3rd argument condition is optional and sets the item(s) health percent (100% by default).
  • The 4th argument equipItem is optional. If non-zero, and the calling reference is an actor, the added item(s) will be immediately equipped. This is mainly intended to be used with leveled items, where it is not possible to reliably determine which item(s) was added.
  • The 5th argument noMessage is optional (1 by default). If non-zero, the function will not display corner messages.

Syntax

[help]
reference.AddItemAlt item:form quantity:int condition:float{0-100} equipItem:0/1 noMessage:0/1

Example

TargetRef.AddItemAlt Camera 10

Add 10 Camera items to TargetRef.

TargetRef.AddItemAlt NVHoldoutWeapons 4 65

Add 4 of each item in the list NVHoldoutWeapons to TargetRef, each with 65% health.

TargetRef.AddItemAlt LL2Tier3Guns 1 50 1

Add a random leveled weapon with 50% health and suitable ammo to TargetRef, and immediately equips both.

See Also