Skip to content

meaglyn/nwn-tools

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Meaglyn's NWNScript Compiler, nwnnsscomp

This is a compiler for NWscript for the Neverwinter Nights game from Bioware and now continued by Beamdog.

This is a fork of the original compiler from Torlack. I ported my changes to the cleaned up tree by niv. It includes various bug fixes and ehnancements that make it work for my environment.

It very likely won't build on Windows or Mac. Use nwnsc if you need something for those OSes.

BUILD

A modern Linux system with c++ development files, bison, cmake and a few other things should be able to build the source code.

cd nwn-tools/
cmake .
make

By default this builds the 64bit compiler as nwnnsscomp/nwnnsscomp.

USAGE

Generally I use it with the -i <include_dir> option. I'm not sure if it can still open the game files directly.

Create a directory with all the NWNEE scripts. You can extract them with neverwinter.nim tools. Call it base_scripts. If you need to use the community patch project's ee scripts you can either apply them to that same directory or put them in eecpp_scripts at the same leve as base_scripts. Then use '-k -i ' when you build.

EE support is the default. To compile for 1.69 specify -N and use either a flat include directory with all the patches unpacked in order into it, or a layout like this:

include/
   base_data/
   xp1_data/
   xp1patch_data/
   xp2_data/
   xp2patch_data/
   xp3_data/
   xpcpp_data/

where cpcpp_data contains the community patch (non-EE version) scripts if you use them (again add -k as well).

nwnnsscomp [-cdegGkKlnNoqrsVwx] [-v#] [-i incdir] [-p nwndir] infile

  nwndir - directory where NWN is installed. (Can also be set in env as NWNDIR)
  incdir - directory where all NWN scripts are located.
  infile - name of the input file.
  -c - Compile the script (default)
  -d - Decompile the script (can't be used with -c)
  -e - Enable non-Bioware extensions
  -g - Produce ndb debug file
  -G - Don't produce ndb debug file (default)
  -i - Path to include dir is following non-switch argument
  -k - Enable CPP support - only meaningful with -i and using separate directory structure
  -K - disable CPP support - only meaningful with -i and using separate directory structure
  -l - List constant, struct and function symbols and running total
  -n - Enable NWNEE support (default) - only needed with -i
  -N - Disable NWNEE support - only needed with -i  
  -o - Optimize the compiled source
  -p - Path to NWNDir is following non-switch argument
  -q - Silence most messages
  -r - report basic status even when quiet (e.g. Compiling foo.nss)
  -s - print symbol count for compiled unit. Implies -w.
  -w - Warn if symbol count over base nwn compiler limit (~1870 after what comes in nwscript.nss) 
  -x - Extract script from NWN data files
  -vx.xx - Set the game version of the compiler
  -V - Print version number and exit
  Note: the include dir can either be a flat directory with all the files
        extracted in the right order (so later ones overwrite earlier ones) or
        it may contain a subdirectory for each set of scripts. These must be named
        "base_data",  "xp1_data",  "xp1patch_data",  "xp2_data",  "xp2patch_data",  "xp3_data"
        and "xpcpp_data" for non-ee CPP. For NWN:EE use "base_scripts" and "eecpp_scripts"

CREDITS

Copyright (C) 2011-2021 Phil Auld (meaglyn). Based on the original nwnnsscomp and NscLib which were written by Edward T. Smith (Torlack). Portions of NscLib were contributed by OpenKnights. Cmake and cleanups by Niv.

About

NWN script/model compiler tools

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 96.4%
  • C 3.0%
  • Other 0.6%