3ds Max/NifSkope: Custom Weapons

Revision as of 22:07, 24 April 2006 by imported>Edgeofforever

The aim of this tutorial is to help you get a mesh from a 3d program into Oblivion with collision data (it won’t fall through the floor), a color map and a normal map, and with correct lighting interaction. At the time of writing this there is no official exporter, thus we are making due with nifskope and the civ4 plugin (for 3ds max). Please keep in mind that while I will try to make this as user friendly as possible that troubleshooting will likely be needed, and that google is a wonderful tool.

  • There is a method for blender, but it has its problems- as of now, the blender plugin by the nifskope team doesn’t seem to create the new smoothing groups upon export like the civ4 one does (this is just my speculation). This means your object will be lit slightly oddly, but your spec maps and HDR will work. Go to the very bottom for this method.


The tools you will need are… TES4BSA - Unpacks the oblivion master files (so you can see the models and textures)

Check this part of the Wiki on how to use it. Tutorial

Civilization 4 NIF Exporter plugin (version 7 is compatible with version 8 of 3ds max) Civ4

3dsmax8 (Link to Trial version, 30 day use)

Photoshop Normal Map Filter/DDS Import/Export

Nifskope


To begin with: This tutorial assumes you are aiming to make a 2 handed sword. Other weapon types are possible with this method (with the possible exception with bows), but require a bit more tweaking. I personally use 3ds max 8. I will also assume you are using Photoshop when I talk about texturing.


Step 1: Obtain/Create your mesh in your 3d program. You will need to UV map it as well, then place textures on it. Oblivion supports color maps, specular maps, and normal maps (there are more, but they are not used by most meshes). There are many, many tutorials on these subjects online- google the subject if you don’t know how it well.

However, I will mention this- if you are familiar with bump maps, grayscale images that represent height on a texture, it is fairly easy to convert these into a normal map. Using the aforementioned normal map filter, accessible in Photoshop via Filters>Nvida Tools>Normal Map Filter, you can turn a grayscale image in Photoshop into an RGB normal map. Explaining normal maps themselves is another matter- again, google it if the concept confuses you or you are unfamiliar with it.

Place your weapon at 0, 0, 0 in your 3d program. From experience, the middle of the hilt is usually running through the 0 line on the x axis. Results may vary. In max, the weapon should be rotated so it is lying “flat”, the blade running up the z axis.

Another word of warning: Make sure the alpha channel of your weapon is pure white. If not, some of the mesh may show up as transparent (or not show up at all).

Your specular map, a grayscale image representing how light affects the surface of your mesh, goes in the alpha channel of normal map. Basically, make shiny parts white and darker parts, like iron, dark gray. Pure black may have unpleasant results. Adding a new channel can be as simple as clicking channels in your layer manager, and clicking the add new icon on the bottom bar (Near the trash bin, or delete channel).


Step 2: Export your textures as .dds files. DDS stands for direct draw surface, a file type many games use. You can export as dds from photoshop after installing the dds plugin, as referred to above. To do so, just click Save as>dds

I personally save as DXT 3 Explicit Alpha. I had no need to fiddle with all the options, just make sure “create mipmap” is enabled.


Step 3:Put your textures in your oblivion directory.... C:\Program Files\Bethesda Softworks\Oblivion\Data\textures\weapons. If you have yet to make a weapon you will probably have to make some of these folders yourself. A word of warning: DO NOT INCLUDE UNDERSCORES IN THE NAME OF YOUR WEAPON, WITH ONE EXCEPTION. This exception is the normal map, which should be “myweapon”_n.dds. Both textures should be in the same directory.

Thus, your textures will look like… “myweapon”.dds (color map) “myweapon”_n.dds (normal map)


Step 4: Export with Civ4.

Make a new shader (blinn) and only assign it a diffuse map. Go to export>Civ4 (NIF). Make sure to check original images. Here are screenshots of the material editor and exporter...

Material Editor Exporter Options

Save this in your meshes folder….such as C:\Program Files\Bethesda Softworks\Oblivion\Data\meshes\weapons.


Step 5: Nifskope.

First, make sure block details are on.

Load up Nifskope. Load the file you just exported. MAKE SURE YOU HAVE A TEXTURE BLOCK ALREADY IN THE FILE- this block will have a purple flower within it, which is clearly visible. IF NOT, YOU EXPORTED WRONG. Copy the NiTriStrip branch by clicking your mesh in the viewport, then right clicking the block that becomes highlighted and going to block>copy branch. Now load a default weapon from the game- like a claymore - in the same instance of Nifskope (A new window doesn't work for me).

Paste your branch. (Right click any block, block>paste branch). Now, go to NiNode near the top. Expand children. Expand Indicies. Change the number under value to the number of the block you just pasted. Screenshot

Click the old mesh in the viewport, go to the block highlighted, right click, block>remove.

Make sure the texture node of YOUR mesh (should have been copied over with NiTriStrips) is going out to the correct dds. Also, I changed the material to that of the original weapon...the symbol with the pallette. Here's a Screenshot

Save the file in your meshes directory, such as C:\Program Files\Bethesda Softworks\Oblivion\Data\meshes\weapons, and go into the CS and place it. You can place it by right clicking under weapons and choosing new. Remember to give it health, make it a 2 handed sword (or whatever), speed, reach, damage, and weight. And of course assign it the NIF you just made. Load up a cell, drag drop your weapon in, and run a Havok sim (world>run havoc sim). Save your new plugin and test it out.



FOR BLENDER USERS:

First, if you aren’t familiar with Blender, it can be a little confusing. Take the time to learn how to navigate it if you must…I will assume you can get around it on your own.

You’re going to need the NIF exporter scripts for Blender. Nifskope Scripts


Then, you will need to configure the Blender NIF script options… Options REMEMBER TO CHANGE THE SCALE TO 1.

Step 1: Export from your 3d program as an OBJ. Disable everything but texture coords and smoothing groups. OBJ Options

Step 2: Import the wavefront OBJ in blender.

Step 3: Hit F6. Click new texture, and for the type, choose image. Navigate to any image, you can change this later. It just has to have a texture in place (I believe). Screenshot

Step 5: Hit F5. Look for the tab on top of the bottom right menu…click map input. Choose the UV tab. Screenshot

Step 6: Do a test render by going to render>render current frame. If your weapon has a texture you should be good.

Step 7: Export as NIF format. If you get the UV coord error, you did not perform step 5 correctly. Open it in nifskope. If you can view your mesh and have a texture node in the file, you did everything right. Proceed as Max users would (Step 5).