Understanding the NNK

Well, the first thing you have to understand is that the game uses the NNK to know where to find meshes, animations, and textures. The NNK is basically a list of directories and directory trees that the game executable uses to look up a filename, and figure out where that file is stored.

For example, Farmgirl's face skins are found in the folder art\bitmaps\characters\good_a_heroes\farmgirl\
So, if we were looking for b_c_gah_fg_skin_01, we would find it under this folder.

Now, note the name - it begins with b_c_gah_fg. This is what the game looks at, and compares with the listing in the NNK to see where to find this file when it is called by a template or a skrit.

In the NNK, the entry that tells the game to look in art\bitmaps\characters\good_a_heroes\farmgirl\ for Farmgirl's face skins looks like this:

TREE = B_C_GAH_FG , Farmgirl , "Farmgirl"

Notice that the first part is B_C_GAH_FG. Again, this is what the game looks up. It finds a match, and knows to look in the Farmgirl folder.

Now, this isn't just something that comes out of the blue - earlier entries in the NNK define the tree all the way down to that folder, like so:

TREE = B, Bitmaps, "Bitmaps"
TREE = B_C , Characters , "Characters"
TREE = B_C_GAH , Good_A_Heroes , "Good A Heroes"
TREE = B_C_GAH_FG , Farmgirl , "Farmgirl"

And thus, by looking at the filename and referencing it with the file tree data in the NNK, the game is able to find any file that it needs to find - assuming you put it in the right place. Wink

Adding to the NNK:
Now, let us suppose for a moment that you have created a new monster called the "Nose Goblin". You have decided that textures for it will be under your own folder, \myspecialmonsters, and you have placed that folder like so:

art\bitmaps\myspecialmonsters\nosegoblin\

What you would then do is create a new NNK file that will be loaded in addition to the existing NNK. This file can be named anything you like, but must end with the NNK extension, and must be stored under the \art folder so the game can find it. So, for example, we might create a new file called mystuff.nnk, and store it under the \art folder.

Having done this, we then create entries in the new file to add the NNK items we want. In the case of our "Nose Goblin", above, we would add entries that look like this to be able to access his textures in the correct folder:

TREE = B_MSM , myspecialmonsters , "My Special Monsters"
TREE = B_MSM_NG , nosegoblin , "Nose Goblin"

Then, all we have to do is make sure all the textures our Nose Goblin uses all begin with B_MSM_NG (such as b_msm_ng_01.raw), and are stored under art\bitmaps\myspecialmonsters\nosegoblin\

Note also that you do not necessarily have to create a new NNK file - you can simply add the original NNK to your mod, open it, scroll down to the bottom, paste in your new tree additions, and tank it up as part of your mod.

And that's all there is to the NNK. :thumbup:

(originally posted by Xaa)

tutorials: