Talk:EquipItem
From The Elder Scrolls Construction Set Wiki
Actually, the delay discussed here is nothing to do with the EquipItem command but rather how low it takes an object to really be added to your inventory. This can actually be a variable number of frames depending on whether the item is scripted, added in multiples, and perhaps other scripts running it that frame. Since the equip flag is relative to a base object, I find the best way to do this is:
if doOnce == 0
if player.GetItemCount MyAddedObjectID
player.EquipItem MyAddedObjectID 1
set doOnce to 1
endif
endif
In fact the doOnce variable may be unnecessary - this is only an example code fragment. It is also of note that the forced-equip option only applies to the player when attempting to unequip in play. It does not prevent scripted UnequipItem or other EquipItem commands from executing correctly. Btw, this info. is particular useful for anyone trying to force-equip potions. Guidobot 15:05, 15 March 2007 (EDT)
- You're right, Guido. Thanks for the correction. Scruggs 17:11, 15 March 2007 (EDT)
- I've never had to worry about a delay. In fact, it's kind-of nice because I can add/unequip and run the onUnEquip block in the same frame. Maybe it's because I'm only adding/equipping to a persistent NPC that's in the same cell? Do you only need a delay with the player?
- --Haama 09:41, 28 July 2007 (EDT)

