Difference between revisions of "GetWornItemMods - Actor"

260 bytes added ,  00:59, 21 January 2018
added required f4se version
imported>Qazaaq
(Fixed object mod link)
imported>Qazaaq
(added required f4se version)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:F4SE]]
'''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 13: Line 10:


== Parameters ==
== Parameters ==
*slotIndex: The [[Biped Slots|Biped Slot]] to check.
*slotIndex: The [[Biped Slots|Biped Slot]] index to check.


== Return Value ==
== Return Value ==
An array of all [[Object Mod|Object Mods]] obtained from the given [[Biped Slots|Biped Slot]], returns none if there is no item.
An array of all [[Object Mod|Object Mods]] obtained from the given [[Biped Slots|Biped Slot]] index, returns none if there is no item.


== Examples ==
== Examples ==
<source lang="papyrus">
<source lang="papyrus">
int LeftHand = 34 const
; Get the players left hand object mods.
ObjectMod[] mods = Game.GetPlayer().GetWornItemMods(LeftHand)
ObjectMod[] objectMods = Game.GetPlayer().GetWornItemMods(4)
If (mods)
</source>
 
 
<source lang="papyrus">
{For each object mod}
int LeftHand = 4 const
ObjectMod[] objectMods = Game.GetPlayer().GetWornItemMods(LeftHand)
If (objectMods)
     int index = 0
     int index = 0
     While (index < mods.Length)
     While (index < objectMods.Length)
         Debug.Trace("Found the object mod '" + mods[index] + "' on slot " + LeftHand)
         Debug.Trace("Found the object mod '" + objectMods[index] + "' on slot index " + LeftHand)
         index += 1
         index += 1
     EndWhile
     EndWhile
Else
Else
     Debug.Trace("Slot " + LeftHand + " had no object mods.")
     Debug.Trace("Slot index " + LeftHand + " had no object mods.")
EndIf
EndIf
</source>
</source>


== Notes ==
== Notes ==
 
None


== See Also ==
== See Also ==
Line 40: Line 44:
*[[Biped Slots]]
*[[Biped Slots]]
*[[Object Mod]]
*[[Object Mod]]
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:F4SE]]
Anonymous user