Hak/Tlk general questions
BeaverMage
Member Posts: 20
Hey i've been having fun learning to script and making my own little module but I thought it'd be cool to take bits from Hak pack a and bak pack b.
I went ahead and downloaded nwn explorer and it seemed pretty simple opening haks up and exporting things but once you open up a tlk file in there s*** starts looking really complicated so I guess i'm asking how does someone that doens't know much about anything go about combining different elements from a hak pack and where do I go to get the required knowlege to do so?
Oh and what exactly is a tlk file? How do you make one? I just see a bunch of numbers and stuff when I open it.
I went ahead and downloaded nwn explorer and it seemed pretty simple opening haks up and exporting things but once you open up a tlk file in there s*** starts looking really complicated so I guess i'm asking how does someone that doens't know much about anything go about combining different elements from a hak pack and where do I go to get the required knowlege to do so?
Oh and what exactly is a tlk file? How do you make one? I just see a bunch of numbers and stuff when I open it.
0
Comments
This was important for translation reasons. It provides nwn a way to programatically recognise a number, and translate it into the appropriate string depending on which tlk file is used.
Some areas in the game can of course just be fed strings, but some are hard-coded to use tlk references - Like in many .2da's for example. If you open up a "classes.2da" you can see the "Name" column is just a bunch of numbers - These numbers correspond to the row-number in the tlk where the game should go and find the name for that class.
It's recommended not to change the base game dialog.tlk. One custom tlk can be used per module. When referenced by the game, instead of using the row number the custom tlk is referenced by using 16777216 + the row number. That is, if you wanted to change the name of one of the classes to something else, you would create your own custom.tlk, connect it to the module, make the first row something like "NewClass Name", then change the .2da "Name" reference to 16777217 (16777216 + 1).
In addition to NWN Explorer, you'll probably need nwhak (which ships with the game) to edit hak files, a GFF editor and a TLK editor (several available on Neverwinter Vault).
If you aren't bothered about supporting multiple languages, you'll find that many 2da files (not all) allow you to hard-code descriptions in the 2da itself (rather than making a new .tlk entry, which is more effort).
For further reading, try dipping into the Custom Content Guide. It gives a pretty good account of how most things work. There are sections you can safely skip on first reading - for example, on Creatures, you can gloss over how to make your own models, but focus on how to integrate them into the game.
If so is there another tutorial reguarding this I should be aware of?
Most hak packages don't have custom tlk files, or, if they do, the custom tlk only has a few lines. The exception is the major content packages like CEP, which have big tlk files. So, most people choose one such package as the base, make a copy of its tlk file, and add lines to that copy.
Merging two major content packages is a huge amount of work, best avoided. Most builders choose one (normally CEP), then cherry-pick content from the other into a top hak, adding to the tlk file only if a cherry-picked resource refers to a custom strref (which isn't that common).
@WilliamDraco has explained the basics of tlk files above.
The first thing you need is a tlk editor from Neverwinter Vault. If you need a recommendation, I'd ask in the forum there, because I'm using an old one that's probably not the easiest but works for me.
For example, if you look at the custom tlk file for CEP2, you'll see that it's just a list of line numbers (the strref minus 16777216) and corresponding text, e.g.
30005 Heavy Pick*
Line numbers are in use up to, and including, 192500.
When I wanted to make a custom tlk for my module, I copied the CEP2 file, padded it to 250000, then added my new lines from 250001 onwards. This was to allow room for CEP2 expansion.
Some of my new lines in the 250000+ range were copies of the custom tlk lines from minor packages. The tlk editor allows blocks of lines to be copied from one file and pasted to another, renumbering in the process. Since the new line numbers were different, I also had to change the corresponding 2da lines from those minor packages to refer to the new line number +16777216. (I hear some modern tlk editors calculate that offset for you).
CEP2 expansion did occur after I made my module. That meant that the new CEP2 tlk lines weren't in my module, but neither was the new CEP2 content, so no problem. When I wanted to use the new CEP2 content, I had to make a new custom tlk file, by copying the new CEP2 tlk, then pasting in my private lines at 250000+. That way, none of my private line numbers had to change.
Hope that helps.