How To: Make Inventory Icons
By: The Amethyst Dragon
Neverwinter Nights uses a lot of icons. GUI, feats, spells, skills...and a massive amount for inventory items.
Inventory icons come in multiple varieties, can easily be added via custom content, and can cause headaches for those just getting into making or manipulating them. This handy guide should help relieve some of those headaches, and will hopefully make the realm of inventory icons understood by the end.
Note: This will not cover inventory icons for armor, helms, or cloaks. Those are PLT icons and are a whole other topic on their own (although cloaks are covered here).
Quick Jump:
Size Matters
Single Part or Three Part
Override or Hak
File Types and Names
3D Models
Size Matters
When working with inventory icons (or any texture for that matter) for Neverwinter Nights, it's important to remember that image size really does matter. NWN images use powers of 2 with regards to dimensions. Both width and height need to be a power of 2 (2, 4, 8, 16, 32, 64, 128, 512, or 1024). The image may not necessarily be a square, but that is usually the case.
Inventory icons, and the inventory window for a character, are based on 32 x 32 pixel squares. The space in the inventory window is 10 squares wide and 6 squares high. This makes the smallest inventory icons a 32 x 32 pixel square (a gem, for instance), and the largest a 320 x 192 pixel rectangle (the encampment item icon included in the 1.68 patch).
Inventory icons come in a variety of shapes and sizes. This is determined by two columns in the baseitems.2da file: InvSlotWidth and InvSlotHeight. The numbers in these columns determine how many columns (InvSlotWidth) and rows (InvSlotHeight) an icon takes up in the inventory window.
No matter what the numbers say in baseitems.2da, the size actual image for each inventory icon must be in powers of 2. A gem icon is a 32 x 32 pixel image. A quarterstaff is a 32 x 128 pixel image. A light flail is a 32 x 128 pixel image. The encampment item (shown below) is a 512 x 256 pixel image.
If an icon is supposed to be smaller than the actual image (based on the 2da data), the game engine will simply ignore the part of the icon image that falls outside the correct area, counting from the upper left corner of the image. The example below shows just how much of an image can go unused...in the 2nd part of the picture, you can see the shaded part of the image that get's used, and the unshaded part of the image that get's ignored.
For the encampment, while the visible part of the icon is 320 x 192 pixels, the actual image is larger. A 320 x 192 image, while it would fit, is not in power of 2 dimensions, so it just would not work for NWN.

- Back to the start...
Single Part or Three Part
There are two different styles of inventory icons, single part icons and three part icons. The type of icon used is based on the type of item the icon represents, along with data from baseitems.2da.
Single part icons are the simplest style. They are used by all sorts of items from gems to wolf heads to bedrolls to jewelry. A single part icon is just that: a single iventory icon image.
Three part icons are a little bit more complex. They are used by items such as weapons, wands, and potions. A three part icon is made up of three identical sized inventory icons that overlap. The bottom part is covered by the middle part, and both are then covered by the top part. The complete icon is formed when the game makes parts of each image transparent so that the layers beneath show through.
The transparency for both single part and three part icons is controlled by the alpha layer of each image. This is a hidden greyscale part of the inventory icon images. This "secret layer" determines if a part of an image is fully visible (white pixels on the alpha layer), completely invisible (black pixels on the alpha layer), or partially transparent (various shades of grey on the alpha layer).
Three part icons use this transparency to blend the three layers together into a single icon that players see.
- Back to the start...
Override or Hak
Once an inventory icon is made, it can serve one of two purposes. The icon can be used to either overwrite an existing icon, or it can be used to add an entirely new one.
If used to overwrite an existing icon, the new icon must have the exact same file name as the original. Such icons are placed into the NWN/override folder. Icons used in this way are visible only to the player who's computer the new file is on. Overwriting icons can also be added to a hak file for everyone playing a module to see.
To add an additional inventory icon, the new icon needs to be added to a hak file that is associated with the module.
- Back to the start...
File Types and Names
Inventory icons are, in most cases, saved as 32-bit .tga (Targa) images.
There is one case where the file format needs to be changed. If a new inventory icon is going to be replacing a standard BioWare-made inventory icon and the new icon is being used in a hak file, then the hak needs to have an additional copy of the icon saved as a NWN-compatible .dds file.
If the new icon is used to add a new icon, the file name should match file names for icons of the same item type, but with a different number on the end. In general, new icons can be added up to number 255, as long as the MaxRange column in baseitems.2da has been extended to that number. No item type can have parts numbered higher than 255 or lower than 000 (numbers are kept as three digits, even for icons numbered less than 100).
- Back to the start...
3D Models
Icons made for certain types of items (weapons, armor, helms, shields, torches, and several others) are made to match new or existing 3D models. Such icons are needed for the models to even appear in the toolset for builders to use.
Inventory icons made for other types of items, such as miscellaneous small/medium/large items, potions, jewelry, and many other types do not normally have or require a matching 3D model. In most cases, if placed on the ground, such items will appear as non-descript brown bags (or blue bottles in the case of potions).
If desired, a content maker can create 3D models matching specific ones of these normally non-modeled items. If such a model is created, it can simply be named the same as the new icon file (except with one less letter "i" at the start of the file name). Such models get placed in either the NWN/override folder or in a hak, depending on the intended use.
- Back to the start...
|
|