Difference between revisions of "EquipItem"

330 bytes added ,  22:02, 14 February 2009
imported>Vswe
m (Added Search Terms)
imported>DragoonWraith
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 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:
 
<ul><li>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.</li>
<li>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
equipItem someItem 1 ; <- item may not be equipped
equipItem someItem 1 ; <- item may not be equipped
Line 21: Line 23:
   equipItem someItem ; <- should work properly now
   equipItem someItem ; <- should work properly now
   set equipDelay to -1 ; finished
   set equipDelay to -1 ; finished
endif</pre>
endif</pre></li>
 
<li>See [[Message Spam]] to avoid unwanted "Item Equipped" messages.
* See [[Message Spam]] to avoid unwanted "Item Equipped" messages.
<li>'''RemoveAllItems Bugs:'''
 
<ul><li>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.</li>
* '''RemoveAllItems Bugs:'''
<li>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.</li></ul></ul>
** 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==