Difference between revisions of "EquipItem"

1,079 bytes added ,  06:05, 15 June 2012
m
no edit summary
imported>Wrye
(Consolidate no spam info.)
imported>ZuTheSkunk
m
 
(9 intermediate revisions by 7 users not shown)
Line 7: Line 7:
Forces the actor to equip the item. If NoUnequipFlag = 1, actor (including the player) will be unable to unequip the item. Once the item is unequipped with the [[UnequipItem]] function, the item can be equipped and unequipped as normal.
Forces the actor to equip the item. If NoUnequipFlag = 1, actor (including the player) will be unable to unequip the item. Once the item is unequipped with the [[UnequipItem]] function, the item can be equipped and unequipped as normal.


==Notes==
== Notes ==
* This '''''will not''''' run the [[onEquip]] block of a script attached to the item. However, an [[onUnequip]] block '''''will''''' run when the object is unequipped using [[UnequipItem]]. This means that scripted ability spells that are added and removed using these two block types can malfunction if the item is equipped and unequipped via script.
*EquipItem will not work if there is already an item in that slot that has been equipped with the NoUnequipFlag set. This can be useful for determining whether or not that flag has been set. Use [[UnequipItem]] or [[UnequipItemNS]] to remove such an item before using EquipItem.
*This function can be used to force actors into drinking potions.
*Using this function to equip an armor item on an NPC will not automatically unequip the replaced item, as it does on the player. E.g., if you add and equip 10 types of boots, all will report as equipped (but not added to the Armor Rating). This may or may not be fixed in following frames.
*See [[Message Spam]] to avoid unwanted "Item Equipped" messages.
*This function does not always work when used to equip items which have been added to an inventory using [[addItem]], unless you provide a delay between adding the items and equipping them. For instance:
*This function does not always work when used to equip items which have been added to an inventory using [[addItem]], unless you provide a delay between adding the items and equipping them. For instance:
<pre>addItem someItem 1
<pre>addItem someItem 1
Line 22: Line 27:
   set equipDelay to -1 ; finished
   set equipDelay to -1 ; finished
endif</pre>
endif</pre>
 
*'''RemoveAllItems Bugs:'''
* See [[Message Spam]] to avoid unwanted "Item Equipped" messages.
:*If you equip a playable item with the ''NoUnequipFlag'' set to 1 on a NPC, a subsequent call of [[RemoveAllItems]] on this NPC will crash the game.
 
:*If you equip a playable non-quest item with the ''NoUnequipFlag'' set to 1 on the player, a subsequent call of [[RemoveAllItems]] on the player will crash the game.
* '''BUG''' :
- If you equip a playable item with the ''NoUnequipFlag'' set to 1 on a NPC, a subsequent call of [[RemoveAllItems]] on this NPC will crash the game.
 
- If you equip a playable non-quest item with the ''NoUnequipFlag'' set to 1 on the player, a subsequent call of [[RemoveAllItems]] on the player will crash the game.


==See Also==
==See Also==
* [[EquipItem2]]
* [[EquipItemNS]] - Spamless version of command (OBSE 15)
* [[EquipItemNS]] - Spamless version of command (OBSE 15)
* [[UnequipItem]]
* [[UnequipItem]]
Line 42: Line 44:
[[Category: Actor Functions]]
[[Category: Actor Functions]]
[[Category: Actor Functions (CS 1.0)]]
[[Category: Actor Functions (CS 1.0)]]
<!-- Begin Search Terms
Equip
Item
End Search Terms -->
Anonymous user