How to load Oblivion hair models into Fallout 3
Note: This guide is outdated and should be used for reference purposes. The guide listed here should be used instead.
Tutorial by Josef Grey and Throttlekitty
This tutorial will explain in detail how to load your favorite hair models made for Oblivion into Fallout 3. This information is also good for loading completely new hair models into Fallout 3 (provided that you knew how to create a mesh and get it to work in Oblivion), as it contains everything I've learned from the Nifskope community about the subject. Be aware that this isn't as simple as just dropping some files into folders -- this is an advanced tutorial, and simply getting an already completed hair model working in Fallout 3 goes beyond what it took to do the same in Oblivion.
Before you begin the process be prepared to spend some time debugging, because depending on the mesh that you want to load, some steps may vary to a degree. I will give the best possible explanation that I can for each step, and I will try to cover all of the possible problems one could have with this process, though I likely cannot account for every situation. Before you begin, make sure you have the following programs and files:
- The latest version of Nifskope (1.0.16 at the time of writing this)
- The Conformulator(a mod made for Oblivion that creates .egm files... more on that later)
- FOMMor another FO3 .bsa archiver program to access the Fallout 3 meshes and textures.
- FO3Edit, a program that will enable you to manipulate the Fallout3.esm and create new plugins. Other programs can accomplish this as well, so use what works best for you.
- A hair mesh (.nif) along with its textures (.dds, _hl.dds, and _n.dds). Hair meshes made forOblivion are your best option, as the base head mesh in FO3 is either exactly or nearly thesame shape as in Oblivion. If you have another mesh you'd like to use, be aware that the structure of it may be wildly different than that of one that was made for intended use with the Gambryo engine.
- Oh yeah, you'll need a calculator too.
UNDERSTANDING AND OBTAINING A FALLOUT 3 HAIR .NIF
Bethesda has changed a lot in the file structure it uses for its hair files since Oblivion, and therefore there are parts of the old Oblivion .nifs that just aren't there anymore in the new .nifs. Therefore, if you try to load an Oblivion hair mesh directly into Fallout 3, you'll probably get a red and white box where the mesh would be, marking it as an error. To remedy this, you need to transfer all of the useful information from the old Oblivion .nif that the engine won't recognize into a nice and shiny .nif compatible for Fallout 3.
First though, there are a few *very essential* things to understand about the changes that were made to the hair .nif files for Fallout 3. Fallout 3 uses two different version of the hair model for every .nif file. The first is a 'No Hat' version that is what you see when your character is not wearing a helmet or hat. This is the only version that was present in Oblivion, as when your character put on a hat their hair just disappeared entirely. Fallout 3 however has a second version of the model, called a 'Hat' version, which is used while your character is wearing a hat. The difference is that the 'Hat' version is simply a geometric copy of the character's scalp, except the texture of the 'No Hat' version is applied using a different UV map (the method by which a 2D texture is wrapped around a 3D object). At the current point in time, there is no method for using a *separate* texture for the 'Hat' version, which is a huge drawback for modding hair into Fallout 3. This means one of two things, really: Either the texture for the 'No Hat' version must be re-UV mapped for the 'Hat' version, or you just go 'bald ala Oblivion' while wearing a hat. Of course, your full set of options depends on your skills at texturing and 3D modeling, but all the same this is a pretty large mountain for the average modder, and is hopefully one that will have an easier path around it later on. Make note that this tutorial does not go into UV mapping, so if you do intend on UV mapping a texture for this there are many free tutorials that cover the subject with regards to your program of choice (Blender, Maya, 3DS Max, and Nifskope all have UV mapping editors). So now that you've been made aware of the worst, it's time to get started with obtaining a Fallout 3 hair .nif.
This is the point where your .bsa archiver program will come into play, as you will need access to a Fallout 3 hair .nif from the .bsa archives. Follow the instructions that came with your archiver program (FOMM, FO3Archiver, etc) to unpack the 'meshes' archive into a separate folder -- away from the Fallout 3 folder. Inside the meshes\characters\hair folder you will see all of the .nifs used for Fallout 3. You will need to select one to use as your 'container' for all of the Oblivion hair .nif data you're about to dump into it. For this tutorial, I'll be using the hairmessy01f.nif for examples, as it is the one I've used for this process and have had no problems with it. If you're replacing the male hair, use the hairmessy01.nif as it will be pretty much the same structure-wise.
Now's the time for Nifskope... and where the ugliness begins. Go ahead and open in Nifskope both the hairmessy01f.nif mesh and the .nif for the mesh you want to load into FO3.
TRANSFERRING OBLIVION .NIF DATA TO A FO3 .NIF
First, maximize your Oblivion .nif window. At the top of the screen, you'll see the File, View, Render, Spells, and Help options. Go to View and check 'Block List', 'Block Details', and 'Show Blocks in Tree'. In the 'Block List' frame, you should now see an expandable branch called 'NiNode'. Expand it, and you'll see another branch called 'NiTriShape'. Expand that, and click on the block (probably the last one on the list) called 'NiTriShapeData'. Now, down in the 'Block Details' frame, the uppermost entry should be the 'Name' entry. Under the 'Value' column you should see that it has a value in it -- likely the name of the mesh. Double click on its value and delete it,leaving the 'Value' column empty.
Now right click on the 'NiTriShapeData' block in the 'Block List' frame (the one we just edited), and select 'Block > Copy'.
Go ahead and maximize hairmessy01f.nif, and select View and check the 'Block List', 'Block Details' and 'Show Blocks in Tree' if these aren't already checked. Expand the 'NiNode' branch in the 'Block List' window to reveal two 'NiTriShape' branches. Expand the one with value 'NoHat' to the right of it. At the bottom of the list is a block titled 'NiTriShapeData'. Right click it and select 'Block > Paste Over'. You should now see the mesh in the viewing window, along with what looks like a blue scalp. This blue model may be clipping through the hair mesh, but it's not important.
Save the file to a new name at this point using the Save As option in the 'File' menu at the top (just as a safeguard, mainly). Once that's done, select the block that you've just pasted in so that you can see it's block details. This part is pretty confusing. Right click on the very top entry in the 'Block Details' window -- it should be the 'Name' entry. Select the 'File Offset' option. You will get a little popup window *that you should not close* with an integer value (don't worry about the code in the parentheses to the right of it).
Do the exact same thing for the very *last* entry in the 'Block Details' window. For my file it is the 'Match Groups' entry. Another integer value will pop up under the last one.
Subtract the first integer value from the second, obtaining the difference between the two.
Note that this number is going to be different for every mesh, so there's no way I can say what it will be. This difference is actually the size of the data of the block, in bytes.
Now that you have the byte size, select the View menu at the top and click 'Show Blocks in List'. You'll see that the 'Block List' window is now organized differently. At the very top, you'll see the 'NiHeader'. Click on it, and about halfway down the 'Block Details' window you will see the entry 'Block Type Index'. Expand this. You will now see a list of 'Block Type Index' entries.
What you need to do here is find the one with the *value* 'NiTriShapeData'. Once you see it, count the number of blocks that it sits from the top. For hairmessy01f.nif it should be the 8th block from the top. With the number in mind, collapse that branch and now find the entry 'Block Size', which should be a little lower in the 'Block Details' list. Expand that. You should now see a list of 'Block Size' entries with integer values. These integer values are actually the number of bytes held in each block -- and the order of them is directly related to the order of the 'Block Type Index' branch that we just counted out in the last step. Therefore, you want to count down from the top of this list till you reach the number you counted down in the 'Block Type Index' branch. For the hairmessy01f.nif, it was 8, so the 8th 'Block Size' entry shows the number of bytes for the corresponding block-- the 'NiTriShapeData' block.'
Thoroughly confused by now I'm sure, you're probably wondering what this part is for. Well, remember the byte size that you calculated a few steps back for the 'NiTriShapeData' block? It's in the integer value of this 'Block Size' entry that you want to place it. Please note though that if the number is the same number that you calculated before, then everything is in working order. If it's not the same number, right click the 'Value' field and type the new one in.
It's time to go back to the 'NiTriShapeData' block. To get there, change your View options back to 'Show Blocks in Tree', expand the 'NiTriShape' block with the 'NoHat' value in it, and select the 'NiTriShapeData' block. Partway down the list of entries in the 'Block Details' frame is an entry titled 'TSpace Flag'. Change the value of this entry to '16' if it is not there already. You should see some of the formerly grayed out entries 'light up' as they become active. Now move the cursor into the viewing window, and right click on the hair mesh (not the blue scalp). A pop up menu will appear -- you want to select 'Mesh > Update Tangent Space' from it. This will allow your mesh to render properly in game without any funky lighting and graphical issues.
We're now going to make the FO3 .nif point to the textures for the new hair mesh. Expand the 'BSShaderPPLightingProperty' branch under the 'NoHat' version of the 'NiTriShape' branch. There will be a block under the branch called 'BSShaderTextureSet'. Click on this, and now go down to the 'Block Details' and expand the 'Textures' entry. You will now see a list of the textures that this .nif uses in the form of 'Textures\Characters\Hair\...'. You want to keep this format, so double click on the 'Value' field of each texture, replacing just the name of the file with your respective new file (do this for all three: the .dds, the .hl, and the _n.hl). If you haven't already done so, you should place the new texture files for the mesh in your Fallout 3\Data\Textures\Characters\Hair folder.
As far as getting the 'NoHat' version of our mesh to function properly, we're almost done with the .nif editing. We now have to correct the number of bytes the .nif requires for the 'BSShaderTextureSet' block, just as when we edited the number of bytes in the 'NiTriShapeData' block.
As before, right click the top entry in the 'Block Details' of the 'BSShaderTextureSet' block (the entry's name should be 'NumTextures'). Click 'File Offset'. This time, you need to go to the first entry of the Block Details window in the next sequential block (denoted by the number to the left of the block name in the 'Block List' window). BSShaderTextureSet is block 4 for the hairmessy01f.nif file, so you should click on block 5 ('NiMaterialProperty') directly below it in the 'Block List' window, and get the 'File Offset' of its first entry in the 'Block Details' window. As before, take the second integer value that was output into the popup window and subtract the first from it to obtain the byte size of the 'BSShaderTextureSet' block.
Once again, go to 'View' and select 'Show Blocks in List'. Click on the 'NiHeader' in the 'Block List' window, expand the 'Block Type Index' and count the number of entries to the one with the value 'BSShaderTextureSet'. If you're using hairmessy01f.nif, it should be the 5th one. Now expand the 'Block Size' entry just as before and input the new integer value into the 'Value' column of the corresponding 'Block Size' entry.
Make sure that your math is correct, save the file as the name that you intend to use for your hair mesh (for example 'ShortHair.nif'), and close Nifskope. We now have to make a .egm file so that the new hair mesh will morph to fit the character's head.
Open the Conformulator and click 'Select' for the head file. Navigate to the 'meshes' archive that you extracted earlier and follow this path to find the female head shape file:
If your hair mesh is going to be for males, use:
Once you've selected the head file, click 'Select' for the hair file. For this file, you want to select the original .nif for the hair that you want to add to Fallout 3 (not the .nif you just made -- the Conformulator is a program designed for making .egms for Oblivion, so it only works for .nifs that will work for Oblivion).
Set the settings to 'Quality: Nearest Face', 'Tri file: None', and leave the rest set to default. Click 'Conformulate'. It will output a .egm file in the directory that you took the hair file from. Move the .nif file that you made in Nifskope along with the new .egm file that you just produced to the Data\Meshes\Characters\Hair folder in your Fallout 3 directory. Change the name of the .egm file to the following:
Where 'NameofNifFile' is the name of the .nif file that you produced, minus the extension.
You now have a complete 'No Hat' version of the hair mesh and textures. However, you still need to create the new hair style so that it appears as a new entry in the Hair Style menu in the game. To do that, you'll have to make a .esp (Elder Scrolls Plug-in File. I know, this is Fallout...).
MAKING A .ESP USING FO3EDIT
Upon opening FO3Edit, you'll be prompted to select a master/plugin file to load. Just check the Fallout3.esm file and click 'Ok'. Once the program is finished loading, you will see Fallout3.esm as an expandable entry in the left frame. Expand it, scroll down to the 'Hair' entry and expand that. Here you will see all of the default hair meshes used in Fallout 3. To create a new .esp, it will require choosing one to insert the data for your new mesh into and thereby making it into a new entry entirely. Don't worry though, this process will not replace the entry you choose to insert the new data into; we're just going to use a copy of it as a container for the new information. For this example, let's just use 'hairmessy01' (which you will see as the 'Editor ID'). Scroll down and right click to open a pop up menu, from which you want to select 'Copy as new record into...'.
You will be prompted to enter a new EditorID for the entry. Make it something similar to the file name that you chose for your mesh. A window will pop up directing you to choose where to place the new entry. Check 'New File' and click 'Ok'. The program will then ask you to name the .esp file (which can be named whatever you like). You will now see your newly created .esp file under the master file (Fallout3.esm) in the left frame. Expand it and click on the entry for your hair mesh.
There are four values in the frame on the right side of the screen that you will need to edit. To edit them, right click on the area containing the information that you want to change and choose 'Edit':
- 'FULL - Name': Change this to the name that the hair style will be called *in game*.
- 'MODL - Model Filename': Edit just the file name to match your newly made .nif.
- 'ICON - Texture': Edit just the file name to match the .dds texture for your new mesh.
- 'DATA - Flags': Enter '1' if the mesh can be used by both genders. '101' if it can be used bymales only. '11' if it can be used by females only.
Now expand the Fallout3.esm again and scroll down to the 'Race' entry. Expand that, and right click the first race that you would like the new hair style to be used by. On the pop up menu that opens, select 'Copy as override into...' and select your new .esp when it asks you what file you want to copy the entry into.
Go to your .esp in the left frame and select the newly added entry under the expandable 'Race' branch. Scroll down in the right frame until you see an entry called 'HNAM - Hairs'. This is where all of the playable hair styles for that specific race are stored. To add your new hair style, right click in the blank area to the right of the words 'HNAM - Hairs', but in the column for your new .esp (should be filled largely with gray text, whereas the column for the master file Fallout3.esm should contain purple text). Select 'Add' from the pop up menu.
A new entry will appear with the value 'NULL...'. Right click on this value and select 'Edit' from the pop up menu. A box filled with zeros will appear, in which you need to type the code for your hair entry's 'FormID'. The FormID is the number contained in the left-most column of the left frame for your new hair style's entry.
Repeat the last few steps to allow more races to use your new hair style. Once you are finished, close the program and it will prompt you to 'Save changed files'. Make sure your file is checked and click 'Ok'. Lastly, make sure that the newly created .esp is in the 'Data' folder of your Fallout 3 directory. If all went well, you should now have a newly added functioning hair style that will be available via the Gene Projector or Barber Shop menus in game. Of course, at this point your character will look pretty odd in a hat, as the game will either render the 'No Hat' version of the hair mesh, or you will be left bald under your hat. For more information on the 'Hat' version of the mesh, continue on to the final step.
MORE ON THE 'HAT" VERSION OF THE MESH
I'll admit the information that I can give here is limited, as currently the only way I've discovered for getting a good looking 'Hat' version of a hair mesh is by re-UV mapping one texture to fit two different meshes (the mesh for the 'NoHat' version of the hair and the 'Hat' version of the hair). Granted, this may take considerable skill with regards to texturing, however that is something Bethesda developers are not short on and thereby no doubt the reason that they chose to go this route. If you decide to go ahead and re-UV map, then here is what you will need to do to complete the 'Hat' version of the mesh. Be aware that since you could use one of many UV editors, I have to be general with the following steps.
When editing the UV map, be aware that you want to edit the UV map for the 'Hat' NiTriShape only. Therefore, you will want to export the 'Hat' NiTriShape in Nifskope to a obj. file. Load the .obj into your preferred development environment and make the necessary changes to the UV map. Save the file, and import the file to a 18.104.22.168 .nif file.
In the 22.214.171.124 .nif file, 'Copy' the NiTriShape and 'Paste Over' the NiTriShape that you originally exported in your hair style .nif. You will have to 'Update Tangent Space' again by right clicking on the mesh in the viewing window (Note that this time you are updating the tangent space of the 'scalp' shaped mesh, which is the mesh for the 'Hat' version, so you want to right click on that and select 'Mesh > Update Tangent Space'). Be aware that if you cut a UV when UV editing, you will have to edit the 'Block Size' for the NiTriShapeData because this will effectively change the vertex count.
The last step in Nifskope is to change the textures that the .nif points to for the 'Hat' NiTriShape. To do this, simply repeat the steps for changing out the textures back in Step 2. One thing to note however is that you will also need to change the 'Block Size' for this block just as you did when you changed the textures for the 'NoHat' version.
The 'BSShaderTextureSet' block that contains the texture information for the 'Hat' version is not the same 'BSShaderTextureSet' block that contains the texture information for the 'NoHat' version, even though the block has the same name. To tell them apart, use the assigned block number shown to the left of the block name in the 'Block List' window. For the hairmessy01f.nif file, block 10 is the block for the "Hat' textures, whereas it was block 4 for the 'NoHat' textures.
Again, double check to make sure that your math is correct with regards to the 'Block Sizes'. Save the file (perhaps move the original copy to a different folder as a safeguard and save this file to the 'Meshes\Characters\Hair' folder, because if there's an error at this point, the .nif file may not open and will crash Nifskope).
The last step is to make a copy of the .egm file that you made in the Conformulator, and rename it so that it reads:
Where 'NameofNifFile' is the name of the .nif for the hair style, minus the extension.
If need be, you can make additional UV mapping adjustments using the UV Editor inside Nifskope. To make use of it simply right click on the NiTriShape 'Hat' version, and select 'Texture > Edit UV' from the pop up window.
Your hair style should now function properly when your character is not wearing a hat as well as when he or she is wearing a hat.
Disclaimer - This tutorial was made for fallout3nexus.com. If you wish to post this tutorial elsewhere or use it for anything other than personal use, you must ask thepermission of the author before doing so.