NifSkope adjusting weapons for iron sights
This is my first text tutorial for NifSkope, and it will be pretty rough until I get it finished and polished. Pictures coming soon!
Part II: 'Blender - Adjusting And Exporting Weapon Meshes' can be found here:
What is a .Nif?
Files with the extension .nif are models used with the NetImmerse/Gamebryo game engine. Fallout 3, Oblivion, Pirates!, and Civilization IV all use this game engine and its .nif files.
The best part of .nif files (for us anyway) is that tools exist to view and edit them for modding.
To adjust a weapon for iron sights, you must have the latest version of NifSkope, and Bethesda's GECK toolkit. Of course, you must also have an iron sights mod, and naturally I recommend my own: RH_IronSights.
Depending on how much you want/need to alter the weapon, you may also require a 3D modeling program. I use Blender, but 3ds Max should also work just as well.
Please note that this tutorial assumes the I.S. mod you are using works properly. I suggest you try not to run any mods other than I.S. while testing, just in case.
For basic adjustments, run the game using the I.S. mod and your weapon of choice. Aim down the sights and take some screenshots. It will be very helpful if you set iron sights hand drift to minimum and turn on the reticule.
Leave the game and open up your screenshots. Consider how the weapon looks, and where you want it positioned. Most weapons will have to be shifted and rotated a little to fit the reticule.
I set the sights of my weapons to be slightly lower than the reticule for visibility purposes. If you don't play FO3 with a reticule or HUD, you may want to set your sights directly over the spot where the reticule would be, for increased accuracy.
Open the weapon's .nif mesh in NifSkope. NifSkope can be a quirky and occasionally unforgiving little program, but it's great once you get the hang of it. Remember that there is NO Undo option or Ctrl+Z hotkey, so you can't immediately change something you just did without reloading the file. However, the changes are not permanent until you specifically save the file.
Weapons consist of pieces of data, organized in the Block List and Block Details panels. If you can't see either of these windows, select them from the View menu.
The most important types of data we will be working with are NiNodes and NiTriStrips.
Animations use 'nodes' to interact with mesh models. For example, the player character's model has a LUpperArm node; when the animation applies translations and rotations to that node in the game engine, the player's left arm from the shoulder to the elbow will move accordingly.
Weapons are made up of a number of NiNodes. In order for the weapon to animate properly, the NiNodes must be named exactly the same in the weapon mesh and the corresponding .kf animation file. So if a reload animation uses a node called ##SMGClip, and in your .nif file you rename the model's node to MyBadassClipW00t, then it isn't going to animate properly in-game.
In fact, until you are proficient at working with .nif and .kf files, you really shouldn't mess with the nodes at all!
NiTriStrips, on the other hand, are just waiting to be messed around with. Strips represent the 'physical' parts of the weapon - where textures are placed to make the thing look like an actual object - and they are what we will be moving around.
Some NiTriStrips are not attached to a NiNode. Usually the main body of a gun will consist of one or more of these Strips. These parts will not animate independently like a clip or lever would, but we can still move them around.
Other Strips are part of a NiNode's branch. These Strips will animate with the Node, but do not have to be placed directly over the node.
Keep in mind that a rotating object (like the cylinder of a revolver) will rotate around the Node itself, not its own axes - if you translate the object away from the Node, it will probably swing around the weapon as if attached to an invisible arm!
To move a NiTriStrip, first identify it by selecting it with Left-click in the Render Window. The piece you have selected will highlight its wireframe (the color depends on how you set the colors for NifSkope, which you can do by choosing 'Render > Settings...' from the top menu).
Right-click the highlighted part of the weapon, or its corresponding NiTriStrip line in the Block List window, for a context menu. Select 'Mesh > Edit' and a new window will pop up - the transformation window.
This transformation window lets you alter the position of the NiTriStrips in real time by translating (shifting), rotating, or scaling (making bigger or smaller).
Try it: increase or decrease the X, Y, and Z characteristics, Euler/Axis rotation, and scale of the NiTriStrips and watch what happens. Remember, there is no Undo in NifSkope, but the changes don't become permanent until you save the mesh. In other words, there is little chance that you will 'break' anything unless you save your work that way!
Using your screenshots as a reference, make small adjustments to the translation and rotation of the NiTriStrips in your mesh.
At first, only adjust the parts of the gun that have the sights on them. If you adjust every part of the gun (i.e. clips and levers) then play the game and the gun is still crooked, you will have to re-adjust everything.
Remember when rotating or scaling the weapon: the 'center' of the entire mesh is the node located on the weapon's GRIP. That is directly in line with the player's hand. Other parts (i.e. revolver cylinders) will have their own centers, which should be highlighted in NifSkope and will probably become apparent if you mess around with them for a while.
Once you have the weapon's sights lined up the way you want, re-test the game. In other words: playtest, screenshots, adjust, rinse and repeat.
That's it for starters, but I'll continue to add more detail to this as time goes on. Thanks for reading!
Continue on to part II