Difference between revisions of "EquipItemEx - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Wafflesalot
(Created page with "Category:Scripting Category:Papyrus Category:SKSE '''SKSE Member of:''' Actor Script Forces this actor to equip the specified item at the specified slot. == ...")
 
imported>SniffleMan
m
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
'''SKSE Member of:''' [[Actor Script]]
'''SKSE Member of:''' [[Actor Script]]


Forces this actor to equip the specified item at the specified slot.
Forces this actor to equip the first item in the specified form's extralist to the specified slot.


== Syntax ==
== Syntax ==
Line 24: Line 24:
== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
:Force the player to equip swordProperty to the Default slot
;Force the player to equip swordProperty to the Default slot
Game.GetPlayer().EquipItemEx(swordProperty)
Game.GetPlayer().EquipItemEx(swordProperty)
</source>
</source>
Line 34: Line 34:


== Notes ==
== Notes ==
* The first item in the extralist will be the last item added. For example, if the player has two steel swords and they enchant one, then poison the other, the poisoned sword will be equipped. Alternatively, if they poison one sword, then enchant the other, the enchanted sword will be equipped.
* See [[EquipItemById - Actor]] for adding an item without an extralist.


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

Latest revision as of 14:57, 6 October 2018

SKSE Member of: Actor Script

Forces this actor to equip the first item in the specified form's extralist to the specified slot.

Syntax[edit | edit source]

Function EquipItemEx(Form item, int equipSlot = 0, bool preventUnequip = false, bool equipSound = true) native

Parameters[edit | edit source]

  • item - The Form of the item to equip.
  • equipSlot - The slot you wish to equip the item to.
    • Default Slot = 0
    • Right Hand Slot = 1
    • Left Hand Slot = 2
  • preventUnequip - If true, will prevent unequipping of the item for the actor.
  • equipSound - If true, no sound will be played on the equip.


Examples[edit | edit source]

;Force the player to equip swordProperty to the Default slot
Game.GetPlayer().EquipItemEx(swordProperty)


; Force Ralof to equip a Dagger to his Left hand and do not suppress the sound.
Ralof.EquipItemEx(DaggerProperty, 2, false, false )

Notes[edit | edit source]

  • The first item in the extralist will be the last item added. For example, if the player has two steel swords and they enchant one, then poison the other, the poisoned sword will be equipped. Alternatively, if they poison one sword, then enchant the other, the enchanted sword will be equipped.
  • See EquipItemById - Actor for adding an item without an extralist.

See Also[edit | edit source]