Difference between revisions of "GetModelPath - ArmorAddon"

Jump to navigation Jump to search
665 bytes added ,  13:26, 19 September 2013
Expanded example
imported>Loop not defined
imported>Loop not defined
(Expanded example)
Line 21: Line 21:
<source lang="papyrus">
<source lang="papyrus">
; Retrieve the ArmorAddon nif file path for the biped male model of ArmorOrcishCuirass
; Retrieve the ArmorAddon nif file path for the biped male model of ArmorOrcishCuirass
Armor tempArmor = Game.GetForm(0x00012E49) as Armor ; WIKI EDITOR NOTE: Form ID currently references Iron Cuirass
Armor tempArmor = Game.GetForm(00013957) as Armor
ArmorAddon tempAA = tempArmor.GetNthArmorAddon(0) ; Use "0" to get first ArmorAddon, "1" for second, etc.
ArmorAddon tempAA = tempArmor.GetNthArmorAddon(0) ; Use "0" to get first ArmorAddon, "1" for second, etc.
string FilePath = tempAA.GetModelPath(false, false)
string FilePath = tempAA.GetModelPath(false, false)
; Returns "Armor\Orcish\cuirassM_1.nif"
; Assigns "Armor\Orcish\cuirassM_1.nif" to FilePath
 
 
; Retrieve the ArmorAddon nif file for any armor placed in a container
string mFilePathPOV
string mFilePathBiped
string fFilePathPOV
string fFilePathBiped
 
Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
  if akBaseItem.GetType() == 26 ; If item is Armor
      ArmorAddon tempAA = (akBaseItem as Armor).GetNthArmorAddon(0)
      mFilePathPOV = tempAA.GetModelPath(true, false) ; 1st person view, male
      mFilePathBiped = tempAA.GetModelPath(false, false) ; biped, male
      fFilePathPOV = tempAA.GetModelPath(true, true) ; 1st person view, female
      fFilePathBiped = tempAA.GetModelPath(false, true) ; biped, female
  endif
endEvent
</source>
</source>


== Notes ==
== Notes ==

Navigation menu