NWN Area Mini-map Export Utility Version 1.0.1

Note: These tools require Java to run. I've only tested it on Java 1.4 and above. Go here and download the latest J2SE if you don't already have Java installed.

Also Note: This tool only reads data and as such should not accidentally destroy anything. That being said, you should always backup your work.

Introduction

Mini-map Exporter

Include is a utility for generating the minimaps for a set of areas and saving them as PNG images. There are numerous reasons one might want to do this... plus it's just cool to quickly browse a module this way.

This tool can work on unpacked area files (from tools like ModPacker/ModUnpacker) as well as entire modules. Unpacking tools are not necessary to process single areas though since Bioware's toolset will already unpack modules when editing them. It can just be more convenient.

When operating on an entire module, the HAK files are also found automatically. When generating minimaps for a single area file the relevant HAKs have to be specified on the command line.

Minimap-Export should now handle all kinds of tile images, including those with 32 bit depth and those that need to be rescaled. If you find a tileset that does not work in this tool then please file a bug report so that I can enhance the support. NWN Tools Bug Page

Known Limitations:

I'm not entirely sure that I'm reading the NWN .key files in the correct order. So if your minimaps don't look right that could be the problem and I'd like to know about it.

It has been reported that modules that include a tileset that is overloaded in a HAK file do not process correctly unless the HAK file is manually specified. This will only affect modules that use tilesets that override existing Bioware tilesets and I'm working on a fix.

Installation

Make sure you have Java installed.

Unzip the minimap-export.zip file to a directory somewhere.

Run the setup.cmd script that is in this directory. This script will create two other scripts called: setpath.cmd and MiniMapExport.cmd.

Whenever you want to use the tool, run the setpath.cmd to setup your environment in the command line within which you will be working. After that, you should be able to run MiniMapExport from wherever you want.

You can check your installion by running MiniMapExport.cmd with no arguments. If things are working correctly, you should see the simple help message explaining the tool's usage.

Example:

C:\>MiniMapExport
Usage: MiniMapExport <options> <files>

Where:

<files> are any combination of extracted .are area files or .mod
        module files.  The .are are converted to PNG images
        containing the area's minimap.  For .mod files, PNG images
        will be generated for every area in the module.
        For .mod files, the HAK list is picked up automatically
        from the module file.

<options> are one of the following:
    -nwn <dir>     Specifies the main Neverwinter Nights install
                   directory where the .key files can be found.
                   Defaults to \NeverwinterNights\NWN
                   This is also where .HAK files are located when
                   extracting area minimaps from a .mod file.

    -d <dir>       Specifies the directory to which images will be
                   written.  Defaults to the current directory.

    -scale <scale> Specifies a magnification factor for the generated
                   images.  Mini-map images can be pretty small so
                   it is often necessary to scale them up.
                   Scaling example option:
                       -scale 2.0
                   The above scale would double the mini-map image
                   sizes.

   -hak <file>     Specifies a HAK file that should be used when
                   resolving tileset resources.  You can have as
                   many -hak options as you need.

   -useAreaName    When this is specified, the area's in-game name
                   will be used as the file name instead of its
                   cryptic resref.  Warning: resrefs have to be unique
                   but names don't.

Using MiniMapExport

The easiest way to run MiniMapExport is to just point it to a module file and let it go. If the NWN directory is in the default location then it will automatically load any HAK files needed by the modules and produce PNG minimaps for all areas in the module.

    MiniMapExport \NeverwinterNights\NWN\modules\MyModule.mod

This will create a single PNG file for every area in the specified module. These files can be viewed in the usual ways... I like to browse them in thumnail mode from Windows explorer.

To generate larger images, you could run the following version:

    MiniMapExport -scale 2.0 \NeverwinterNights\NWN\modules\MyModule.mod

This will generate images that twice the size of the original images.

To direct these images to a particular directory you can use the -d option:

    MiniMapExport -d myImages \NeverwinterNights\NWN\modules\MyModule.mod

This will generate the images and store them in a myImages sub-directory underneath the current working directory.

For single areas or piece-meal area extraction, the easist way is to open a module in the Bioware toolset. This will extract the module into a temp directory underneath your Neverwinter Nights modules directory.

For example: \NeverwinterNights\NWN\modules\temp0

Sometimes it may also be temp1 or temp2. It all depends on prior activity with the toolset. It will usually be temp0.

So assuming you have a module open in temp0 and that you've run the MiniMapExport's setpath.cmd script, you're all set to generate some images.

For really simple execution, just change to the directory where you want the images to go and type:

    MiniMapExport \NeverwinterNights\NWN\modules\temp0\*.are

This will create a single PNG file for every area in the module. Which is more or less the equivalent of pointing the exporter directly to the module file itself.


See the usage instructions printed from the tool command line for additional options.

Non-windows Users

All of the above holds true except you may need/want to write your own shell scripts based on the Windows .cmd script files.

Preemptive Answers

A few answers to questions that may be asked.

Q: Is the source code available?
A: Yes, most certainly. See the sourceforge CVS at http://nwntools.sf.net/

Q: Why did you write this in Java instead of <insert super-elite language here>?
A: Because it's the language I use the most and it allowed me to cobble the original packer/unpacker tools together in a few hours.

Q: Why is the install size half a meg?
A: Well, with the resource loading necessary to play with the tilesets and images, this tool depends on a few external packages including Meta-JB and in some cases Log4j. I tried to keep it trimmed down though.