Morrowind/NifSkope Alchemy

From NifTools
Jump to: navigation, search

Contents

NifSkoping Morrowind

At the time of writing this v 0.9.6 is the latest version.
5-10-07 updated to v 0.9.7
December 2007, updated some info on V1.0
Some of the UI may have changed since the time of writing this

Setting up NifSkope

Views


Make sure your block list and block details are checked in the view options.
I set my block list to hierarchy most of the time. This helps give a visual of how the blocks are linked to each other.

Render Options


-Draw axis-shows the center of the mesh, this is where the pivot point will be in the CS and scripted rotates in game, and also where weapons and body parts will attach themselves to the biped skeleton of NPC actors. This also shows the X Y Z directions.

-Draw Nodes- Shows the position of each node in 3D relation to the center axis and parented node and the links between the nodes

-Show Hidden- shows hidden trishapes, usually collision and creature shadows that don't show up in game

-Draw Havok- Oblivion collision shapes

-Draw Furniture- Oblivion furniture markers for sitting/ sleeping animations


Textutre Folders


NifSkope can't render textures on meshes if it doesn't know where to find them. The texture folder can be set in the render settings.

You can set multiple texture folders with NifSkope.

my morrowind folders are set as this

C:/Program Files/Bethesda Softworks/Morrowind/Data Files/Textures
C:/Program Files/Bethesda Softworks/Morrowind/Data Files
D:/Data Files/Textures


The first folder is set for textures not in a subfolder, and the second is set to render textures in a subfolder
The third folder is my copied data files from the morrowind CS disk to my D: drive partition, though it could also be the cd-rom drive. I have my tribunal and bloodmoon files copied into the D: drive folder as well, but they could be copied to seperate folders and just add them to nifskope. Bethesda didn't use subfolders for textures so you won't need to add the root folder for those.


I think NifSkope will render textures if they are in the same folder with the nif, I don't usually do it this way, I suggest setting texture folders

Also in the render>settings, there is a check box to render textures

Baked in textures (textures included in the nif) no longer render in newer versions of NifSkope. Some earlier versions allow you to import textures to NiPixelData blocks or extract textures to TGA format


Using NifSkope

Nifskope can do many things, Always refer to working meshes for reference and settings.

The arrow keys and W A S D will move the render view around the mesh, left click and mouse also rotates view, and scroll wheel zooms.
Clicking on the mesh can select trishape branches, the wireframe will highlight and so will the block in the block list, the block details will show in it's window
Double clicking on settings in the block details lets you change settings

To make new blocks, in the block list, right click, select Block>Insert, and select the type of block to insert.


Linking Blocks

Everything must be linked to the parent node whether directly or indirectly, any loose blocks won't function in game and may cause errors. The 'parent' node will be a NiNode, block number 0.
It is a generic node object for grouping. It will be the 'parent' to all other blocks in the mesh. You can have multiple blocks and nodes linked to the node, and multiple blocks and nodes linked to those. They are linked in the children array of the node.

There will be other types of blocks that aren't linked to in the children list. These will be linked to according to block type.


Node Block Details

The block details for nodes you will use most of the time are:

-String-
Name of node for organization and for biped animation.

-Extra Data-
Input block number to ExtraStringData block, mostly used for animation and particles, most meshes won't need anything here.
Editor markers and non-collision meshes will also use this.

-Controller-
Input block number of animation controller, static meshes won't use this

-Flags-
special settings assigned by number variable, used to hide mesh or set shadow. Right click brings up flag menu, collision settings should be set to triangle, though seem to have no effect.

-Translation-
The x, y ,z coordinates of the node in relation to the center axis or parented node, affects all children of node.

-Rotation-
The rotation of the node in relation to the center axis or parented node, affects all children of node

-Scale-
The scale of the node, will affect all children and controllers of node.
Game engine overrides settings of the 'root' node

-Num properties-
The number of properties in the properties array.

-Properties-
The array assigns blocks by number to the node.

-Bounding Box-
Used for creature collision. Does not render in Nifskope.

-Num of Children-
The number of child blocks assigned to the node

-Children-
The array assigns blocks by number to the node, usually other nodes or trishapes branch.


You do not want to set the translation, rotation, or scale of the root parent node, It's best to leave it's translation and rotation settings at 0 and scale at 1.0. Change the settings of it's children or link a child node in between them


Linking

To link a child node or other block, In the block details, you must first set the number of children, then right click on children and select update array. Then input the block number you want parented to your node.

If creating a new node, you can right click on the node you want to be the parent, select attach node, and select the type of node. It will automatically update the array and link the new node.

Properties are linked to in the same manner, set the number of properties and update the array, then input the block number of the property. Selecting attach property works the same way as attach node.

Extra Data and Animation controllers are linked by block number in the node block details.

Trishapes blocks must have a TriShapesData and a Material Property to be visible in Morrowind. I refer to it as the 'Trishapes branch' but thats not an official name. Most of the time it will also have a Texturing Property with an external texture file path (NiSourceTexture) or sometimes pixel data block. The block named NiTriShape has the object settings, and the triShapeData the mesh data itself. The block details for the TriShape block must have the block number for the triShapeData, and the material and texturing properties listed in the properties array. Different Trishapes can share the same material property and texture source.


Retexturing


Material Property

Setting the colors in the material property can change the color of the mesh, and how it reflects light

Usually the settings are Ambient and Diffuse are white, and Specular and Emissive are black.

Changing Texture Source

If your mesh uses an external texture source and you wish to retexture it, just input the filename of your new texture in the NiSourceTexture block attached to the NiTriShape you wish to re-texture.
If you are using a sub folder in your textures folder, you must include the texture folder in the file path, example:

textures/subfolder/texturefile.dds 

Otherwise if you have your texture in the root texture folder, all you need is the texture filename.

If the mesh you are retexturing has an internal texture, aka baked texture, you can change it to use an external texture by changing the NiSourceTexture setting Use External to 1, and input the file path as I just mentioned. Then to save loading times and file space, remove the pixel data block from the mesh.

NEW to v1, you can drag and drop texture files from windows explorer directly onto the render window!

In windows explorer Left click on the texture file you wish to use and hold it down, drag the mouse pointer over the render window onto the part of the mesh you want retextured, the texture will show up on that part, when the correct part is retextured release the mouse button.
If the texture is located in a directory or subfolder that you have assigned in the render options the path gets set properly, otherwise it uses the entire file path.

Baked textures

"Baked" or embedded textures, stored as NiPixelData, are a convenient way to avoid texture path issues but limit the ability to edit the textures used for a specific model.

"Full" support for embedded textures existed in versions from 0.6 to 0.8.1; rendering support was re-added in 1.0.13, with UV display and export re-added in 1.0.19. Some NIF versions have obscure or undocumented features in NiPixelData which may prevent exporting as of 1.0.20.

Where required (eg. for texture embedding/packing), multiple versions of NifSkope can be installed in different directories, although different versions cannot be run simultaneously.

To export NiPixelData to a TGA or DDS image file, right click on the NiSourceTexture which uses the internal texture and select Texture>Export.

To import a texture, choose a NiSourceTexture with an external texture file and select Texture>pack.

Export Texture Template

Right Click on the NiTrishape block, and select Texture>Export Template.

Flip Texture Map

Right click on the NiTriShapeData block and select Mesh>Flip UV. There are 3 options for the direction you wish to flip.

Edit UV map

Right click on a NiTrishape branch to select Texture>Edit UV
This pops up window which allows you select vertex points on the texture map and move them. Make sure you have your highlight color set different from the foreground color in the render settings

Transparency and Transparent Textures

To make a mesh transparent or use transparent textures, it must have have an Alpha Property.

Make a new NiAlphaProperty block. For Morrowind set the flag in the alpha property to 237. In your NiTrishape block, set the number of properties, update the array, and select the NiAlphaProperty's block number in the array.
You can also right click on the NiTrishape, select Node>attach Property, and then NiAlphaProperty. It will update the array, link itself, and set the flag to 237 all by itself.

Now If you use a transparent texture it will be transparent. You can make the mesh translucent by setting the alpha float in the Material Property. 0 is completely invisible, 0.5 is half opacity, and 1.0 is solid.

The standard flag of 237 isn't quite the best for overlapping alpha faces. Trees are a good example of a mesh where leaves with alpha textures may overlap. I have found that using 4845 works a lot better.
You can try different settings, right clicking on the NiAlphaProperty brings up a menu with different settings to try

Glowmaps

Right Click on the NiTexturingProperty, select texture>Add Glow Map. Select your glow map texture in the new NiSourceTexture that attached itself

Environment maps

To add an environment map effect, you will need an environment map texture. It should look like something as reflected in a sphere (for use as a sphere map, which is the default) but it could really be anything that has colour variation in it (flat colour will not work). You can add it via Advanced Texture Settings in Blender, or as of 1.0.19, via the "Node->Attach Effect->NiTextureEffect" Spell (context menu). Note that environment maps will not function correctly if they are attached directly to the root node. To overcome this:

  • If none exists, create a root NiNode and move it up to have index 0
  • For each NiNode with a NiTriShape, make it a parent of the root NiNode and attach a child NiTextureEffect node

If you save and view your mesh in SceneImmerse, TESCS etc. it should have a nice "shiny" effect which changes as you rotate the mesh/camera.

Mesh Editing


Collision

Setting the flag on your node and trishape will use it's triangles as collision detection, however many meshes will use a RootCollisionNode, a specific Morrowind node. The trishape parented to this node will be hidden with collision enabled. It is especially useful for steps and tree branches which otherwise could let actors become stuck due to the odd shapes with opposite sided faces. Thats my guess anyways.

To make a mesh without collision you need to add a NiStringExtraData block to the root node's extra data list. In the string Data simply input: NCO

Moving and Scaling

Moving the position of a node or trishape branch, is pretty straight forward. In the translation, set the x, y, and z setting to move it along the 3D axis.

If a trishape is parented to a rotated node, the x y and z may be off from the center mesh axis. For instance if the node is rotated 180 degrees on the x or y, the trishape will be upside down, so giving it a positive Z translation will actually move downwards instead up upwards. You can usually just input the same translation settings for each trishape if you need to keep a multiple part mesh intact but want to move the whole thing. However if the trishapes don't have the same pivot point, rotating them can screw things up. The pivot point of the mesh can't be changed with NifSkope, as far as I know, but an easy fix is assign all the trishapes to a node, and rotate the node. Rotating the trishape does not change the translation direction. Likewise, rotating a node, does not change it's own translation direction, only on it's children.

Setting the scale is as easy as doing it in the Construction Set. Again, different pivot points and translations can break multipart meshes up, the fix is the same, assign them to a node and scale the node.

To repeat what I typed earlier, don't change the settings of the root parent node. keep it centered and scaled at 1.0
The game engine overrides the settings of the root node, if necessary, link a child node and change it's settings

Scaling Vertices
A new feature is the ability to scale the vertices of a trishape, this is not the scale setting of the nif, rather a spell in nifskope that mathematically scales the vetices in the trishape data. The advantage of this is it allows non-uniform scaling.

Right click on a NiTrishape and select Tranform>Scale Vertices. In the menu that pops up, enter a number for each x y and z axis , then click on Scale.

Creating a dual-wield (offhand) weapon

A shield can use a modified weapon mesh to appear as an offhand or parrying weapon. The exact settings vary with each mesh, but in general, the mesh should be moved approximately -12 units on the X axis, -2 units on the Z axis, and rotated 180 degrees on the P axis. 1: Open up Nifskope and whatever weapon you wish to use as a shield load it up and save as a different mesh with a new name.

2: Open your new mesh.

3: Open Nifskope in another window and load a shield from a mod or an original shield from the game files (CS disc). Once that is done, Copy your shield Nif 'tree' and paste it to 0 node or root node of your new weapon mesh. This will display the shield in with the weapon in your first Nifskope window. You can now close the window with just the shield on it.

4: To make sure that your shield is not a child of the weapon, you need to click on the weapon's NiNode 0 or root node and click on the 'block details' box. Scroll down until you find 'Children'. Click on the + and it will display the children that are attached to the root node. The number of the root node of the shield you copy/pasted should be in the list of children and you do not want that to be. So, In order to do this, click on the index right above it called 'Number Children'. DoubleClick on the number and subtract one, then go down to 'Children' and right click so that it says 'Array update' and click on it. Make sure that it is the shield node that has broken off and no others from the weapon or you will have errors in your game.

5: Look at how the shield is positioned. You want to place the handle of the weapon to match the shield hand which is represented by the smaller strap of the shield. Right click on your weapon's root node again and click on 'Transform' and you will see a box with 6 different coordinate adjustments. Three at the top are position (x,y,z) and the bottom three represent rotation of the same coordinates related to the object. I cannot tell you exactly what these coordinates have to be, so you get to have the fun of maneuvering them. Once you are satisfied with where it is supposed to be, click accept. Click on the root node again, 'transform' and click 'apply'. This will set the coordinates for the game to read. Don't forget to save your new mesh and have it placed in your data files in your meshes folder.

6: To see if the new shield is what you want and how you want it, open up the CS and go to the body parts tab. Select new and place your shield as a 'wrist' body part and name the body part whatever index you want to name it as the shield. Click on the box and load your new mesh. Save as a new body part. Go to the armor tab now and find a shield that the game already has. Rename the ID ( make sure it is a little different than the body part name of the shield), name, stats (as this is your new shield). There are three columns: the first one is your slot for the body part, select 'wrist'. Then look for the name of the body part in the second column. Save and place it on a random NPC. If it doesn't look right, you can play around with it in nifskope. To view it after you saved your updated mesh, you will have to double click on the NPC again and delete the old shield and place the updated shield back in.

Copying Branches and Blocks

Right click on a block and select Block. You can copy just one block, or the whole branch of children nodes and properties attached to that block. With 2 windows of nifskope open, you can copy blocks or branches from one NIF to another. Right click in the block list to paste, or paste branch. You can also paste over blocks. You can combine 2 meshes by selecting the root parent node of one mesh, and copy branch the whole mesh into the other. If you paste the branch onto a node, it auto-links the branch to the node.

Exporting and Importing OBJ and 3DS

OBJ and 3DS are 3D model formats. You can only export to OBJ, but can import both 3DS and OBJ. Options are in the top menu bar under File. NifSkope will import the file and setup a new trishapes branch. If you import an OBJ and it has a material file in the same folder, NifSkope will create the material and texture source in the trishape branch.

Vertex Coloring

In the block details of the NiTrishapeData block, click on the No on the line Has Vertex Colors. It should now say Yes. Then right click on Vertex Colors and select Update Array. Now click the plus left of the vertex colors to expand the array. clicking on the vertices in the list should highlight the vertex selected. Once you've selected the vertex you want colored, click the color wheel and set the color, or input color hex number. If it's a high poly mesh, good luck.
Note, if the mesh has a Vertex Color Property you will need to remove it for the vertex colors to work.

Moving Vertices

You're better off importing the mesh into a modeling program if you need to edit it. Blender is free so theres no excuse for not having one. However there may be some cases, such as a skinned mesh, where the importing may complicate things, so editing the vertices would be easier. Select the TriShapeData block and scroll down the block details list to the vertex list. Expand the array the vertices will highlight in the render window. Set your highlight color different than the foreground color in your render settings or you'll have a hard time seeing which is selected. Once selecting the vertex you want moved, set the x y z translation. This is relative to the mesh data pivot point, which was set in the model program that built the mesh.
With morph animated meshes you will have to edit the morph vectors also, if it's high poly, good luck.

Animating Nodes

Heres where the fun begins. Remember the translation and rotation settings from earlier? Well thats how animations are made. A KeyFrame Controller sets different rotations and/or translations to a node according to the timer. You can even animate scale. If a Controller has rotate, translation, or scale keys, they keys override the settings of the node.
I'm no animation expert, but I will try to share what little knowledge I have.

The method I will be using makes a self-contained animated mesh, it won't have a xmesh.nif or xmesh.kf file with it, and cannot be be scripted with playgroups. It simply loops it's animation no matter what. Not unlike how particle emmiters are usually used.

Refer to act_sotha_dicer.NIF located in the data files/meshes/i folder on the tribunal CD for an example.

Link the trishapes branches you want animated to each their own node. If the trishape has the pivot point already where you want it, set the trishape translation to 0 0 0. If not, Set the translation and rotation of the Trishape Details so when you rotate your node the trishape pivots properly. If you aren't going to use rotation keys then don't worry about it.

Create a BsAnimationNode. set the flag to 106. Add a NiKeyframeController and link it to the controller of the BSAnimationNode. Create a KeyframeData block. In the KeyframeController block, set the flag to 8, active cycle, Frequency to 1.0, keep the start time 0 and input a stop time. Set the Data to the block number of the KeyFrameData block you just created, and the target to a node with a trishape branch. You are now ready to input the keyframe data

Set the number of rotation, translation, or scale keys, and update the arrays. For key type, I use Quadratic Keys for translations, and linear keys for rotations. I'm not sure what is best. On your keys, the first key in each array should start with the float time 0.00 and the last key should be the stop time you set in the keyframe controller. The keys float times will be set in increments from 0.00 to the stop time of the animation loop.
You want to have the same settings in the first key, as the last, so the loop doesn't 'skip' when it starts over.

Note, you can also Clamp the animation on body parts and equipped items to the base animation of NPC actors. It is limited and is different for 1st person view, and beast races. Refer to the animation files for keyframe timing.

Enabling creatures to throw darts

Here's a neat trick to make monsters throw darts, if you dont like the slow speed at which magic projectiles move, or just want to add some variety.

For each creature, theres 3 meshes: MONSTER.NIF which contains the model and animations, xMONSTER.NIF which is just the model and xMONSTER.KF which is just the animations. Copy them, and give them new names. Don't forget to add the "x" at the beginning of the non-animated model and the .kf.

Now, open up the xMONSTER.KF with nifscope. Under "NiSequenceStreamHelper" you will find "NiTextKeyExtraData". When you click on it, in the block details section you can see "num text keys". Double click on the number next to that and add 6 So if it starts at 20, it should be 26 now.

Add new text keys

Right under the num text keys thing is a tab that says text keys. Right click on that and choose array/update. Now if you open the list of text keys, at the very bottom will be six empty ones, no time, no value. First thing to do is open that first empty one and double click the empty space where the value should be. Add these lines: (Press shift+enter to start a new line.)
ThrowWeapon: Equip Start
ThrowWeapon: Equip Attach
ThrowWeapon: Equip Stop
ThrowWeapon: Shoot Start
ThrowWeapon: Shoot Min Attack
ThrowWeapon: Shoot Max Attack


Now, in the next two empty keys add these lines: (one line per key!!!!)
ThrowWeapon: Shoot Min Hit
ThrowWeapon: Shoot Release


In the next empty key, add these lines:
ThrowWeapon: Shoot Follow Start
ThrowWeapon: Shoot Follow Attach


In the next, add this line:
ThrowWeapon: Shoot Follow Stop


In the last key, add these lines:
ThrowWeapon: Unequip Start
ThrowWeapon: Unequip Detach
ThrowWeapon: Unequip Stop

Adding time values

Now give those actions you set in the text keys a time value. We'll just re-use one of the creature's existing animations. Choose which one you like the best, the one that maybe looks like its throwing something. Lets go with the attack1 animation.

Locate the beginning and end of the attack1 text keys. Paste the beginning time value in the first throw weapon key. Now paste the end time at the end of the throw weapon keys. Now fill in the empty time slots in the keys between those two. If you look at the other text keys, you will see each frame is aproximately .0333 bigger than the last. For example: 1.0000, 1.0333, 1. 0667, 2.0000. Shoot min hit should be one frame after the beginning of the animation. Conversely, the Shoot Follow Stop should be one frame from the end. Shootrelease is important, thats the frame where the creature lets go of the dart. Shoot Follow Start/ThrowWeapon: Shoot Follow Attach should take place somewhere between shootrelease and followstop. Save the .kf.

Adding the weapon bone

You need to add a "weapon bone" to the xMONSTER.nif and MONSTER.NIF Open each one, find a ninode attached to the body part (hand/mouth/tail etc.) where you want the projectile to originate from, right click and choose node-attach, node-ninode. Now name this new node "WEAPON BONE" without the quotes. Save the nifs. Once you have your new mosnter in the CS, check the "weapon and shield" tab in the creature's window in the CS, give it some darts and viola, all done!

Alternatives

Also, you can subsitute "throwweapon" with "crossbow" to make it shoot bolts, but it has to be equipped with a crossbow for it to work. The upside to using crossbows rather than thrown weapons is because you can control the frequency of the throws (or in other words, the speed of the animation) by adjusting the speed setting of the crossbow, and also the speed at which the projectiles travel by adjusting the speed setting of the bolts. Using thrown weapons limits you in that the travel and frequency speeds are one in the same, which can result in some undesireable looking throw animations (too fast/slow) if you set the speed of the dart to anything but 1. But the crossbow trick results in an error message of undetermined origin when the creature runs out of bolts. the only way to fix this problem as far as I know is to attach a script to the creature that removes the crossbow from it's inventory when all bolts are depleted. You really should consider making an empty nif for the crossbow, just a single node named "arrowbone" without the quotes. Otherwise, if you use an actual crossbow mesh, you will most likely have a crossbow sticking out of the monster's mouth or something strange like that.

Customising Projectiles

You probably dont want guars to throw knives, so you might want to make a special projectile mesh for it instead. Your first instinct might be to use one of the magic target meshes, but those wont show up as darts unless you make a couple minor edits to the meshes with nifscope. Also, you might notice that the dart shows up on the creature at an odd angle/placement before its thrown. You need to edit the location of the weapon bone to address this issue. The easiest way is to simply scale down the bone to .01 so that the dart is too small to be seen before it's thrown. Alternatively, you can open both the monster.nif and dart.nif, copy the dart and paste it on top of the weapon bone node, then make the adjustments to that node till it appears in your desired location. Dont save this edited monster.nif though. Just apply the translation/rotation changes to your original monster.

Personal tools