Background for Skyrim SE
Member of the ArmorAddon script
voidfunctionSetModelPath(stringpath, boolfirstPerson, boolfemale)Native

Description

Wiki Description

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

Documentation Comment

sets the model path of the particular model


Caveats

CK Wiki - Notes

  • WARNING: Changing the file path of an ArmorAddon affects all armor using it!
  • This is to set the nif file of the equipped model on an actor. Use Armor.SetModelPath(...) to set the nif file of the armor as it appears on the ground.
  • Remember that this function sets string values for ArmorAddon objects, not for Armor objects. You can use Armor.GetNthArmorAddon(...) on Armor objects to quickly retrieve ArmorAddon objects, however.
  • Graphical glitches can result if the target ArmorAddon and the source ArmorAddon do not use the same Biped Objects.
    • Example: Changing IronHelmetAA (Biped: 31 & 43) to use the model path from EbonyHelmetAA (Biped: 30) will result in a bald character wearing no helmet.

Parameters

stringpath

CK Wiki Description

The file path for the .nif file you want to change to.

boolfirstPerson

CK Wiki Description

Whether to set the file path of the biped armor model (false) or first person armor model (true).

boolfemale

CK Wiki Description

Whether to set the file path of the male armor model (false) or female armor model (true).


Examples

; Change all Ebony Armor (cuirass) to appear as Orcish Armor
ArmorAddon orcishCuirassAA = (Game.GetForm(0x00013957) as Armor).GetNthArmorAddon(0)
string FilePath = orcishCuirassAA.GetModelPath(false, false) ; Get Orcish Armor file path
ArmorAddon ebonyCuirassAA = (Game.GetForm(0x00013961) as Armor).GetNthArmorAddon(0)
ebonyCuirassAA.SetModelPath(FilePath, false, false) ; Sets Ebony Armor model path to Orcish Armor .nif file
; NOTE: Only affects male actors in 3rd person view


; Set the ArmorAddon nif file for any armor removed from a container
; Assumes the first four strings already have values, see GetModelPath - ArmorAddon example
string mFilePathPOV
string mFilePathBiped
string fFilePathPOV
string fFilePathBiped

Event OnItemRemoved(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akDestContainer)
   if akBaseItem.GetType() == 26 ; If item is Armor
      ArmorAddon tempAA = (akBaseItem as Armor).GetNthArmorAddon(0) ; 0 = first, 1 = second, etc.
      tempAA.SetModelPath(mFilePathPOV, true, false)    ; 1st person view, male
      tempAA.SetModelPath(mFilePathBiped, false, false) ; biped, male
      tempAA.SetModelPath(fFilePathPOV, true, true)     ; 1st person view, female
      tempAA.SetModelPath(fFilePathBiped, false, true)  ; biped, female
   endif
endEvent

Auto-Generated Example

string myString__path
bool myBool__firstPerson
bool myBool__female

myArmorAddon__toCallFunctionOn.SetModelPath(myString__path, myBool__firstPerson, myBool__female)

Related Pages


Additional References

View this function’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.