Difference between revisions of "GetWornItemMods - Actor"
Jump to navigation
Jump to search
imported>Qazaaq (Using slot index and not the slot number.) |
imported>Qazaaq (added required f4se version) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
'''F4SE Member of:''' [[Actor Script]] | '''F4SE Member of:''' [[Actor Script]] | ||
{{Template:Papyrus:RequiredF4SE|version=0.2.0}} | |||
Obtains all the [[Object Mod|Object Mods]] for an item at a particular [[Biped Slots|Biped Slot]]. | Obtains all the [[Object Mod|Object Mods]] for an item at a particular [[Biped Slots|Biped Slot]]. | ||
== Syntax == | == Syntax == | ||
Line 20: | Line 17: | ||
== Examples == | == Examples == | ||
<source lang="papyrus"> | <source lang="papyrus"> | ||
; Get the players left hand object mods. | |||
ObjectMod[] objectMods = Game.GetPlayer().GetWornItemMods(4) | |||
</source> | |||
<source lang="papyrus"> | |||
{For each object mod} | |||
int LeftHand = 4 const | int LeftHand = 4 const | ||
ObjectMod[] | ObjectMod[] objectMods = Game.GetPlayer().GetWornItemMods(LeftHand) | ||
If ( | If (objectMods) | ||
int index = 0 | int index = 0 | ||
While (index < | While (index < objectMods.Length) | ||
Debug.Trace("Found the object mod '" + | Debug.Trace("Found the object mod '" + objectMods[index] + "' on slot index " + LeftHand) | ||
index += 1 | index += 1 | ||
EndWhile | EndWhile | ||
Line 40: | Line 44: | ||
*[[Biped Slots]] | *[[Biped Slots]] | ||
*[[Object Mod]] | *[[Object Mod]] | ||
[[Category:Scripting]] | |||
[[Category:Papyrus]] | |||
[[Category:F4SE]] |
Latest revision as of 00:59, 21 January 2018
F4SE Member of: Actor Script
Requires F4SE version 0.2.0 or higher.
Obtains all the Object Mods for an item at a particular Biped Slot.
Syntax[edit | edit source]
ObjectMod[] Function GetWornItemMods(int slotIndex) Native
Parameters[edit | edit source]
- slotIndex: The Biped Slot index to check.
Return Value[edit | edit source]
An array of all Object Mods obtained from the given Biped Slot index, returns none if there is no item.
Examples[edit | edit source]
; Get the players left hand object mods.
ObjectMod[] objectMods = Game.GetPlayer().GetWornItemMods(4)
{For each object mod}
int LeftHand = 4 const
ObjectMod[] objectMods = Game.GetPlayer().GetWornItemMods(LeftHand)
If (objectMods)
int index = 0
While (index < objectMods.Length)
Debug.Trace("Found the object mod '" + objectMods[index] + "' on slot index " + LeftHand)
index += 1
EndWhile
Else
Debug.Trace("Slot index " + LeftHand + " had no object mods.")
EndIf
Notes[edit | edit source]
None