Difference between revisions of "UnequipItem - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Rhavlovick
m (1 revision: Clobber re-import by Henning)
 
imported>Icecreamassassin
 
(5 intermediate revisions by 5 users not shown)
Line 27: Line 27:
<br/>
<br/>
<source lang="papyrus">
<source lang="papyrus">
; Force Sally to unequip the dress - but they can't equip it
; Force Sally to unequip the dress - and they can't equip it
Sally.UnequipItem(DressProperty, true)
Sally.UnequipItem(DressProperty, true)
</source>
</source>
== 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())


== See Also ==
== See Also ==

Latest revision as of 21:36, 2 August 2019

Member of: Actor Script

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

Syntax[edit | edit source]

Function UnequipItem(Form akItem, bool abPreventEquip = false, bool abSilent = false) native

Parameters[edit | edit source]

  • akItem: The item the actor should unequip.
  • abPreventEquip: If true, prevents the actor (or player) from equipping the item.
    • Default: False
  • abSilent: Should the unequip message be silenced?
    • Default: False

Return Value[edit | edit source]

None.

Examples[edit | edit source]

; 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)

Notes[edit | edit source]

  • 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())

See Also[edit | edit source]