A library for Neverwinter Nights 1/2 resource files

This package provides a library for reading, changing, and writing common file formats that are found with NWN, a Bioware game.

They should work with NWN2 just as well, since the file format specifications did not change.

Features of nwn-lib

nwn-lib reads and writes the following file formats (hopefully bug-free!), both with an API and useful command-line tools:

  • GFF 3.2 (are, git, gic, dlg, itp, ifo, jrl, fac, ssf, ut*, among others)

  • ERF (mod, hak, erf, among others)

  • 2DA V2.0

  • TLK

nwn-lib can read and write the following representations of GFF data:

  • kivinen-style (“gffprint.pl”) presentation of data

  • yaml presentation of data

  • ruby-native marshalling of gff data

Also in the box:

  • shell scripts and tools to simplify your life (see BINARIES)

  • extensive developer API

  • a powerful get-out-of-my-way scripting system for data transformation (see SCRIPTING)

Upgrade from 0.3.6 to 0.4.x

With the release of 0.4.0, the API changed significantly. Previous yaml dumps made with 0.3.x are INCOMPATIBLE, and so are all scripts. I can't help you with your API bindings, but for your YAML dumps, a converter script has been provided (see BINARIES).

Attention Unicode/UTF-users

ruby 1.8 does not support character sets natively, and as such nwn-gff-irb will FAIL to encode non-standard characters properly on non-latin1 shells. This will be worked around in a future release until the release of ruby 1.9, which will provide native charset support.


To use it, simply install the gem (available on rubyforge):

gem1.8 install nwn-lib

And do the following in a script of your own devising:

require 'rubygems'
require 'nwn/all'

Also, Read BINARIES.

For nwn-lib scripts, see SCRIPTING.

For using the developer API, I suggest you start reading NWN::Gff::Struct.

Latest code & developer contact

The latest source is available through git.

All stable releases are tagged properly.

You can reach me via email.