Stratics - The Massively Multiplayer Network
Stratics Network   Stratics Community   Stratics Central     
 
 
Advanced Tutorial: Customizing Armor

Written by Alomar

One aspect of any role playing game that is important to both players and DMs is how they picture their character. In this tutorial we will walk through the steps necessary to customize existing sets of armor in NWN. This tutorial is meant for game designers and content creators who wish to add their own unique armor into the game. This is an advanced tutorial.

Several skills needed to complete these steps require knowledge outside the scope of this tutorial. If you are unfamiliar with these additional steps or tools, do not try to complete this tutorial. We will be concentrating on what files are required and how to get to show up for the toolset and the game.

You must be able to do the following in order to complete this tutorial:

  • Export from BioWare files. NWN Viewer for this step in this tutorial.
  • Hex edit model files. Any hex editor will do.

Additional skills needed in order to fully customize your armor:

  • Convert .plt files to bitmaps
  • Edit bitmap images
  • Convert bitmaps back to .plt files
  • Create your own model files

Getting Started

First, decide on the item you wish to add. For instance, a shoulder piece, a new forearm, or the most noticeable piece, the chest.

This section will go through the steps required for new chest armor. This is because the chest piece has a couple of unique points that require mentioning. The extra information will not affect how other types of pieces are created.

Specifically, we will be editing a chain mail chest piece. The goal of these edits is so it will show up as an AC 3 item. This will let it fall into the light armor category, allowing rangers the ability to wear armor that appears as a chain shirt, and does not deny them the ranger bonus feats. The chest piece being used is chest004.

File Naming Conventions

The files that NWN uses for all player pieces follow a strict naming scheme. For example, the chest piece we will be working with is called pmh0_chest004. The naming of this piece follows these rules:

  • P = stands for player, it is always the same
  • M = stands for male or female, it can be either an m or a f.
  • H = stands for the race of the file, a=Halfling, d=Dwarf, e=Elf, g=Gnome, h=Human and half Elf, o=Orc
  • 0 = the phenotype of the model, 0 is normal, 2 is large
  • _ is to separate the classification of the file, and the description
  • chest004 is the description of the piece. All pieces use a three digit number.

Files Required

For one piece, many files are needed to allow the piece to be used by any combination of characters. First, the game must use a 3d file, or model file to determine the shape of the piece you are adding. For this you will need all the files for the gender (2 sets), then you will need the files for the races (6 races), and finally each has 2 phenotypes (normal and large). In all, there are 24 model files to make one piece of armor. These have an extension of .mdl.

Next, you will need the texture files to apply to the models. BioWare has used one texture file for each gender. So, you will only need 2 texture files. These files are stored in a .plt file. A .plt file is a special indexed bitmap, that allows the game to apply different materials, such as metal 1, leather 2, cloth1, etc.. to different parts of the texture. Since only one file for each gender is required, BioWare chose to make a standard size human the keeper of this file. So, you would use the same naming standard as the model files for the .plt. In our example, this is going to be pfh0_chest004.plt and pmh0_chest004.plt. It is a player texture, it is female or male, it is the human, and it is the standard size.

Now you will need inventory pictures.These are the pictures that show up in player inventory, when you look at the item. These files start with an i which indicates inventory, then p for player, then f or m for gender _ then the piece's name. For our example the names of these 2 files is ipf_chest004.plt and ipm_chest004.plt.

Finally, a .2da file is required for the game to see the new part. The .2da that needs to be edited is parts_[partname].2da. In our case it is parts_chest.2da.

That's 29 files to add in one new piece of armor. It is a lot of files, but ensuring that they are all there will make your new piece of armor accessible to everyone, as well as make sure nothing strange happens when trying to use the piece.

Making Your Unique Armor

Now it's time to go about creating your unique armor. This is a very detailed process, and there are many ways to do it. The option selected for this tutorial is to use one of the BioWare files. Some people may choose to make their own completely unique model file. You may find that the BioWare model files work for you, depending on what you are creating.

After close scrutiny of the BioWare files, all 53 of their armor pieces are actually only 12 unique models, with different textures.

First, export the 29 files mentioned above for one piece of whatever it is you wish to create. In this example all the chest004 files were exported, and the parts_chest.2da file. Put them all into one directory. The steps required to export files from BioWare information files is beyond the scope of this tutorial (see the Additional Notes section below).

Now you need to open up the parts.2da file you are working with. Notepad was used for this step. These files all contain the same information: a numbering column, a cost column, and an AC column. Copy the last line, and paste it onto the next line. Increment the number in the first column. This tells the game there is another part.Make note of this new number. It must be the next number in order. For my chest armor, this is 54. If you are editing chest pieces change the armor class column of your new line to the AC of the piece you are creating. Otherwise this column is ignored, as is cost.

The last 2 lines of the parts_chest.2da now looks like this:

5308.00
5403.00

Now that you have your new part(s) number (54 in our case), rename all of your files so that they use the new number. For example, all of the sample pieces (.mdl and .plt) would now say pfa0_chest054.mdl, pfa2_chest054.mdl, etc.

The next step requires you to hex edit the .mdl files. To do this you must know how to hex edit, and have a hex editor, both of which are beyond the scope of this tutorial.

If you do know how to hex edit, here is what you will need to do. Open up the file, and you will see the translation. In the translation you will see the old name of the file, repeated several times, change each instance of the old name to the new name. For the chest pieces there are three places this needs to be changed.

For chest004, several of the male models had a fourth listing of the filename. When this extra fourth entry was altered problems occurred. This may be different for different pieces, so you may have to tweak changes if things are not working correctly. For the chest pieces worked on during this process, it was always the first 3 references to the old filename that had to change. (If you are making your own model files you will need to skin them. If you are skinning them, then you should use the correct naming of your texture files so that they follow the naming scheme. However, you will not need to hex edit any files in this case).

For what we are doing (adding an existing model exactly like it was, but adding it under a new AC), we are actually finished. However, it looks exactly like existing armor. So, if you want a unique look as well, here is where you will need to alter the four .plt files you have exported.

The general process for this is, convert them to a bitmap or other editable image format, editing them with your preferred image program, and then converting them back into a .plt file. During editing you must pay special care as to the colors you use, they will determine what material is placed where. Basically, it is a grayscale image with colors overlaid on top of it to indicate which color is placed where. This process is detailed and is not covered in this tutorial.

Finishing Up

Now you have your model files ready using the edited textures you created. All that is left is creating a Hak Pak for them. This is very easy.

All 29 files should be placed in the same directory. Go to the Neverwinter Nights folder, and to the directory called \Utils. Inside you will find BioWare's Hak Pak utility, NWHak.exe, run this program.

A file-like browser will open. Click on the Resources menu item, then Add. Now, browse to your directory, highlight all your files and add them into the Hak Pak. Save the Hak Pak into the \Hak directory underneath the Neverwinter Nights folder. Now when you build a module, you simply need to add in this Hak Pak, and you will get your additional armor choice(s).

Chain and Scale Armor HakPak Download

This hak pak is an example of what can be done using the system outlined in this tutorial by changing and adding to the choices of armor you can put in your module. It includes chest pieces that look like chain with an AC of 3 (for use as a chainshirt) and with an AC of 5 (for use as chain mail). Scale armors have been given the AC of 4 that they deserve.

Download the Chain and Scale Armor HakPak zip file. A 1.7M file.

For complete details the readme.txt file included in the download has additional information.

Additional Notes

BioWare Textures: The textures that reside in the BioWare .bif files are the LOW resolution textures. If you use them as a base for your model it will always appear in low resolution. The texture files you should use are located inside an .erf file inside the \texturepacks directory of NWN. The highest resolution images are in textures_tpa.erf.

BioWare models: The BioWare models needed for parts are kept in the models_02.bif file, located in the \data subfolder.

BioWare 2da files: The BioWare .2da files are kept in 2da.bif, also located in the \data subfolder

Zoligato's tool are great at working with the .bif files and the .erf files you will need to get into to export these files. It is called NWN Viewer, and can be found at many sites with NWN tools.

Pltcon is a widely used .plt converter to change images from .plt to bitmaps, and bitmaps into .plt format.




This site best viewed in Internet Explorer.
 
©2002, Stratics. All rights reserved.
Maintained by: Neverwinter Nights Stratics Staff
Last modified: June 22 2002