Difference between revisions of "GetModelPath - ArmorAddon"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Loop not defined
imported>Loop not defined
 
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(00013957) as Armor
Armor orcishCuirass = Game.GetForm(00013957) as Armor
ArmorAddon tempAA = tempArmor.GetNthArmorAddon(0) ; Use "0" to get first ArmorAddon, "1" for second, etc.
ArmorAddon orcishCuirassAA = orcishCuirass.GetNthArmorAddon(0) ; 0 = first, 1 = second, etc.
string FilePath = tempAA.GetModelPath(false, false)
Return orcishCuirassAA.GetModelPath(false, false)
; Assigns "Armor\Orcish\cuirassM_1.nif" to FilePath
; Returns the string "Armor\Orcish\cuirassM_1.nif"





Latest revision as of 11:37, 20 September 2013

SKSE Member of: ArmorAddon Script

Returns the file path for the nif file representing the equipped model of the armor. (This function requires SKSE)

Syntax[edit | edit source]

string Function GetModelPath(bool firstPerson, bool female) native

Parameters[edit | edit source]

  • firstPerson: Whether to get the file path of the biped armor model (false) or first person armor model (true). "True" only applicable to certain armor types.
  • female: Whether to get the file path of the male armor model (false) or female armor model (true).

Return Value[edit | edit source]

A string representing the file path of the nif file from the Data\Meshes folder.

Examples[edit | edit source]

; Retrieve the ArmorAddon nif file path for the biped male model of ArmorOrcishCuirass
Armor orcishCuirass = Game.GetForm(00013957) as Armor
ArmorAddon orcishCuirassAA = orcishCuirass.GetNthArmorAddon(0) ; 0 = first, 1 = second, etc.
Return orcishCuirassAA.GetModelPath(false, false)
; Returns the string "Armor\Orcish\cuirassM_1.nif"


; 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) ; 0 = first, 1 = second, etc.
      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

Notes[edit | edit source]

  • This is to retrieve the nif file of the equipped model on an actor. Use GetModelPath - Armor to retrieve the nif file of the armor as it appears on the ground.
  • Remember that this function returns string values from ArmorAddon objects, not from Armor objects. You can use GetNthArmorAddon on Armor objects to quickly retrieve ArmorAddon objects, however.

See Also[edit | edit source]