GetModelPath - ArmorAddon

From Creation Kit
Jump to: navigation, search

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

string Function GetModelPath(bool firstPerson, bool female) native

Parameters

  • 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

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

Examples

; 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

  • 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