I'm announcing the release of the Advanced Script Compiler for NWN2. You can download it here. The NWVault page for the project can be found here. (Old, defunct vault page: old page.)
The Advanced Script Compiler is an improved NWScript compiler, both for the toolset (as a toolset plugin), and for standalone usage (as a console application suitable for batch compilation). It is based on Edward T. Smith (Torlack)'s nwnnsscomp, but with numerous bugfixes and improvements, plus updating to work seamlessly with NWN2 versus only being able to load script files from NWN1 KEY/BIFs as with nwnnsscomp.
The toolset plugin version brings several improvements over the stock toolset script compiler. You are no longer limited to just seeing the first compile error (any beyond the first go to the verify window), dangerous constructs now produce a compiler warning versus being allowed silently, and the script code produced can be optimized in some cases. Additionally, most compiler error/warning diagnostic messages are generally more informative than the stock compiler errors.
Source will be released with the next NWN2 Datafile Accessor Library refresh.
Installation instructions for how to install the Advanced Script Compiler as a toolset plugin are included, as well as the standalone version. Once installed as a toolset plugin, script compilation seamlessly uses the new compiler.
Since the NWScript compiler started by ETS seems to be more or less without a maintainer, I'm taking up maintainership for it.
----
Release notes for initial release (also included in the readme for the standalone compiler in the download package):
Improvements over the stock nwnnsscomp include:
- New -l option to load resources from the game zip files.
- New -b option for true batch mode under Windows.
- Nested structs are now usable and do not produce an erroneous syntax error.
- Case statement blocks now obey proper rules for variable declarations; it is
no longer possible to declare a variable that is skipped by a case statement,
which would not compile with the standard (toolset) script compiler.
- The main and StartingConditional symbols are now required to be functions.
- Prototypes that do not match their function declarations are now fixed up by
the compiler (with a warning) if compiler version 1.69 or lower is specified.
This allows several broken include scripts shipped with the game to compile
Note that a prototype cannot be fixed up if a function is called before the
real declaration is processed. In this case, an error is generated; the
standard compiler generates bad code in such a case. A prototype that is
fixed up by the compiler generates a compiler warning.
- Uninitialized constants (const int x;) now generate a warning instead of an
error if compiler version 1.69 or lower is specified. The standard script
compiler silently permits such constructs.
- An error is generated if a string literal's length exceeds 511 characters and
compiler version 1.69 or lower is specified. This is consistent with the
standard script compiler's internal limitations.
- Attempts to use a switch statement while immediately located within a
do/while block now generate a warning. In the standard script compiler, such
constructs cause bad code generation due to a compiler bug.
- Nested structure element access now generates a warning. In the standard
script compiler, a compiler bug may result in compilation errors or bad code
generation with nested structure usage.
- Modifying a constant global variable before it is declared now generates a
warning. In nwnnsscomp, such constructs could either cause an internal
compilert assertion failure, or could result in bad code generation.
- Script disassembly now generates a high level IR output (.ir), and a high
level optimized IR output (.ir-opt).
- Scripts can now be loaded directly from a module.
- NWN1 game resource directories no longer are required to be present on the
Windows build.
- NWN1-style resource directories can be used with the -1 command line option.
Edited by SkywingvL, 29 June 2014 - 01:00 AM.





Back to top






