Difference between revisions of "NifGetPath"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>DragoonWraith
(New page: This is a command from Category:NifSE. '''Syntax''' (string:FilePath) NifGetPath short:NifID Returns the file path (relative to the Oblivion\Data\Meshes\ folder) of the particular...)
 
imported>DragoonWraith
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:


'''Syntax'''
'''Syntax'''
  (string:FilePath) NifGetPath short:NifID
  (string:filePath) NifGetPath short:nifID


Returns the file path (relative to the Oblivion\Data\Meshes\ folder) of the particular nif that the NifID refers to. Note that for writable nifs, this will differ from the file path given to [[NifOpen]], so this function must be used in order to get that file path for use. [[NifGetOriginalPath]] will return the file path given to NifOpen, if desired.
Returns the file path (relative to the <tt>Oblivion\Data\Meshes\</tt> folder) of the particular nif that the NifID refers to. Note that for writable nifs, this will differ from the file path given to [[NifOpen]], so this function must be used in order to get that file path for use. [[NifGetOriginalPath]] will return the file path given to NifOpen, if desired.
 
{{NifSE Example}}


== See Also ==
== See Also ==
* [[NifGetOriginalPath]]
* [[NifGetOriginalPath]]


[[Category:NifSE|NifGetPath]]
[[Category:NifSE]]

Latest revision as of 11:30, 31 August 2010

This is a command from NifSE.

Syntax

(string:filePath) NifGetPath short:nifID

Returns the file path (relative to the Oblivion\Data\Meshes\ folder) of the particular nif that the NifID refers to. Note that for writable nifs, this will differ from the file path given to NifOpen, so this function must be used in order to get that file path for use. NifGetOriginalPath will return the file path given to NifOpen, if desired.

Example

As an example of using NifSE, consider this code:

ref playerWeapon
string_var filepath
short nifID

Begin GameMode

  if ( playerWeapon != player.GetEquippedObject 16 )
    if ( playerWeapon )
      let filepath := NifGetOriginalPath nifID
      SetModelPath $filepath playerWeapon
      NifClose nifID
    endif
    let playerWeapon := player.GetEquippedObject 16
    let filepath := GetModelPath playerWeapon
    let nifID := NifOpen $filepath 1
    let filepath := NifGetPath nifID
    SetModelPath $filepath playerWeapon
  endif

End

Every time the player equips a new weapon, creates a copy of the weapon's model that can be edited using NifSE, and sets the weapon's model to the copy. If a previous weapon had been affected, sets that weapon's model back to its original file, and closes that nif in NifSE. From here, one would presumably have further blocks dedicated to determining when to apply various changes using the other NifSE functions.

See Also[edit | edit source]