NwHak - Beware it can Bite

I originally posted this over on the BD forums.

Before the use of “fancy map” graphics (e.g. diffuse, normal, etc.) one feature of NwHak was relatively benign. Not anymore (as I recently discovered). Now as long as the files that you pass to it are of the right type, NwHak will happily accept them whatever the filename is. There is a caveat, however. The actual filenames must be 16 characters or less. NwHak strictly enforces this. Any filename that is more than 16 characters long will find itself shortened by NwHak. It chops the offending character(s) off the far right end of the filename (not the extender). Usually, this used to be of little consequence. Not anymore. With the rise of files with the same name but distinguished by an underscore and a single character (e.g. fred_d, fred_n, etc.) this truncation can give rise to several files with an identical name (e.g. 5 files called oh_my_giddy_ant_ instead of oh_my_giddy_ant_d, etc.).

This has a consequence. Trying to use such a hak results in the game dumping you unceremoniously to desktop during mod launch with no warning or any error message in any log file. While you can add such a hak in the toolset, trying to open (in the toolset) an area that uses it results in the exact same behaviour. This in turn can lead to much wailing and gnashing of teeth until a close examination of the offending hak is undertaken. For those who’ve been around custom content for a while this can then lead to an outbreak of “Four Yorkshiremen” itis :sunglasses:.

So you have been warned.



I found this out recently as well. My question is, if it doesn’t like the 16+ characters on the back end, why doesn’t it tell you on the front end? I believe erf creation spouts out some such warning. Seems only logical that nwhak would too.

And to remind everyone that nwHak is also case sensitive. It will let you add nwHak.mdl, NwHak.mdl, and NWHak.mdl without overwriting. Whereas NWN will only use one of them. I forget if NWN uses the first or the last though.

I think it only seems to like lowercase lettering. I know for a fact this is the case for bodyparts.

I think it uses whatever is loaded last when the HAK is loaded, so probably the bottom one.