Background for Skyrim SE
Member of the Actor script
voidfunctionUnequipItem(FormakItem, boolabPreventEquip=false, boolabSilent=false)Native

Description

Wiki Description

Forces this actor to unequip the specified item, preventing equipping if requested. Updated to remove the item from the left hand weapon slot too.

Documentation Comment

Unequips the specified item from this actor


Caveats

CK Wiki - Notes

  • It is possible for this function to deplete the enchantment charges on weapons in the player's inventory under certain conditions. Please see the discussion tab.
  • abPreventEquip does not seem to work as described when used on NPCs. They seem fully capable of re-equipping items unequipped with this flag set to true. More testing is needed.
  • abPreventEquip works for the Ammo objects. Enemy archers are left there holding their bow, unable to do anything. However as noted above, this does not work for Weapon objects.
  • Attempting to Equip or Unequip Quest Alias items via script which are generated via the quest fill to method (as opposed to forced fill of an existing reference) will require you to acquire not only the reference but also the base form (ex: Game.GetPlayer().EquipItem(Alias_Waystone.GetReference().GetBaseObject())

Parameters

FormakItem

CK Wiki Description

The item the actor should unequip.

boolabPreventEquip=false

CK Wiki Description

If true, prevents the actor (or player) from equipping the item.

  • Default:False

boolabSilent=false

CK Wiki Description

Should the unequip message be silenced?

  • Default:False

Examples

; Force the player to unequip the tutu - but they can equip it
Game.GetPlayer().UnequipItem(TutuProperty)
; Force Sally to unequip the dress - and they can't equip it
Sally.UnequipItem(DressProperty, true)

Auto-Generated Example

Form myForm__akItem
bool myBool__abPreventEquip
bool myBool__abSilent

myActor__toCallFunctionOn.UnequipItem(myForm__akItem, myBool__abPreventEquip, myBool__abSilent)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.