EquipItem - Actor

Revision as of 05:37, 28 March 2013 by imported>Layam (Added not on using QueueNiNodeUpdate to workaround issue where actors do not draw armor equipped while in the OpenInventory or pick-pocketting dialogue.)

Member of: Actor Script

Forces this actor to equip the specified item, preventing removal if requested.

Syntax

Function EquipItem(Form akItem, bool abPreventRemoval = false, bool abSilent = false) native

Parameters

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

Return Value

None.

Examples

; Force the player to equip the tutu - but they can remove it
Game.GetPlayer().EquipItem(TutuProperty)


; Force Sally to equip the dress - but they can't remove it
Sally.EquipItem(DressProperty, true)

Notes

  • A bug (verified to exist upto and including Skyrim 1.7.7.0.6) prevents magical effects from being applied to the player or actor if the item is user-enchanted.
  • If the calling actor does not have akItem, they will be given one. It is best, however, to add the item with AddItem - ObjectReference, then equip it as the item might not otherwise register as equipped.
FrenchTaunterREF.EquipItem(HolyGrailARMO, True) ; Gives them one unless they've already got one
  • In some cases the aforementioned item addition can be utilized to add non-inventory items. The below will add an Alduin NPC form to the player's inventory that, when dropped, will be a full-sized Alduin actor.
Game.GetPlayer().EquipItem((Game.GetForm(0x00032DB7) As ObjectReference).GetBaseObject())
  • Armor equipped while in OpenInventory or pick-pocketing dialogues will not be visible on the actor until the dialogue is ended. Calling the SKSE function QueueNiNodeUpdate straight after calling EquipItem can force the actor to draw the new equipment immediately.

See Also