Difference between revisions of "UnequipItem"

96 bytes removed ,  21:59, 14 February 2009
note about the EquipItem flag
imported>Wrye
(→‎Notes: Generic Unequip)
imported>DragoonWraith
(note about the EquipItem flag)
 
(4 intermediate revisions by 3 users not shown)
Line 5: Line 5:
  player.UnequipItem AmuletOfKings 1
  player.UnequipItem AmuletOfKings 1


Forces the actor to unequip the object. If NoEquipFlag = 1, actor (including the player) will be unable to equip the object.


Forces the actor to unequip the object. If NoEquipFlag = 1, actor (including the player) will be unable to equip the object.
== Note ==


==Notes==
* UnequipItem (and [[UnequipItemNS]]) are the only ways to remove items that have been equipped with [[EquipItem]] with its "no-unequip" flag set to 1. To check for this flag before calling UnequipItem (to avoid unequipping items that you shouldn't), try using EquipItem ''without the flag'' on another item that uses the same slot. If the flag has been set on the currently equipped item, the script will be unable to equip a new item over it.
'''[[Generic Unequip]]:'''
UnequipItem requires that the base object be specified. For a single script that works for different items, see [[Generic Unequip]].


'''Message Spam:'''
== See Also ==
By default, using this function on the player will display a message informing the player that the item in question has been unequipped. player. In many situations, this is very annoying, but you can use a pair of blank [[Message]] calls to prevent it from happening, like so:
<pre>Message " "
Message " "
player.UnequipItem "item ID"</pre>
This seems to shortcircuit the message display and will prevent any other messages from being queued or displayed for a couple of seconds. [[Avoiding Message Spam|Here]] are some alternative methods that don't disrupt other messages.


==See Also==
*[[UnequipItemNS]] - Spamless version of command (OBSE 15)
*[[EquipItem]]
*[[EquipItem]]
*[[Preventing messages]]
*[[Message Spam]] - Avoiding message spam.
 
*[[Generic Unequip]] - Unequipping an item knowing its editor id.


[[Category: Functions]]
[[Category: Functions]]
Line 31: Line 25:
[[Category: Inventory Functions]]
[[Category: Inventory Functions]]
[[Category: Inventory Functions (CS 1.0)]]
[[Category: Inventory Functions (CS 1.0)]]
<!-- Begin Search Terms
Unequip
equip
item
End Search Terms -->