UnequipItemAlt

From GECK
Jump to: navigation, search


A function added by the JIP NVSE Plugin.

Description

Similar to the vanilla UnequipItem - forces the calling actor to unequip the specified item. However, unlike UnequipItem, this function will also trigger the OnUnequip script event (where applicable).

Syntax

[help]
reference.UnequipItemAlt item:ref noEquip:0/1 hideMessage:0/1

Example

player.UnequipItemAlt WeapLaserRifle 0 1 

Parameters

  • If NoEquipFlag = 1, actor (including the player) will be unable to equip the item. Once the item is equipped with the EquipItem function, the item can be equipped and unequipped as normal.
  • If HideEquipMessage = 1, the item unequipped message will be hidden from the player.

Notes

  • The NoEquipItem flag is effectively ignored by Companions. Calling "UnequipItemAlt <itemname> 1" on a Companion will not prevent them from re-equipping the item if it is the best equipment available.
  • If UnequipItemAlt is called on the player while they're viewing their inventory, whether or not the visual "equipped" indicator is updated immediately depends on the HideEquipMessage flag. If it's set to 0, the graphic will update immediately, but if it's set to 1 the graphic won't update until another graphic updates. Running the following code will prevent this bug:
UnequipItemAlt ObjectID 0 1
AddItem ObjectID 1 1
RemoveItem ObjectID 1 1

See Also