Skip to content

Script Compiler for Enhanced Edition

I just posted an updated script compiler to the vault and Github that works with NWN EE and the packed game files. This one is based on the Skywing compiler engine and is more robust and faster. There are a few things left on the ToDo list - visit the source repository below to see or add bugs and issues.


This has been tested on Windows, Linux, and Mac for both 1.74 (EE) and older 1.69 and things seem i order so far...

https://neverwintervault.org/project/nwn1/other/tool/nwnsc-nwn-enhanced-edition-script-compiler

Source code... https://gitlab.com/glorwinger/nwnsc

Comments

  • squattingmonksquattingmonk Member Posts: 59
    edited February 2018
    Thanks for doing this!

    I've used the prebuilt binary and compiled it from source and I can't get it to open the base game resources.

    Using the example on the Neverwinter Vault download page:
    $ nwnsc -n ~/Games/00840 -l *.nss “nwnsc -n ~/Games/00840 -l *.nss” terminated by signal SIGSEGV (Address boundary error)
    When pointing -n to the data or ovr directory:
    $ nwnsc -n ~/Games/00840/data -l *.nss WARNING: Failed to open .key archive '/home/squattingmonk/Games/00840/data/data/nwn_base.key': exception 'Failed to open KEY file.'. Compiling: test.nss Unable to load nwscript.nss Failed to initialize compiler; compilation aborted. Compilation aborted with errors. Processing aborted. Total Execution time = 0.0000 seconds
    When using the -i flag to point to the ovr directory:
    $ nwnsc -i ~/Games/00840/ovr -l *.nss WARNING: Failed to open .key archive 'data/nwn_base.key': exception 'Failed to open KEY file.'. Compiling: test.nss test.nss(1): Error: NSC1085: Unable to open the include file "x3_inc_string" Compilation aborted with errors. Processing aborted. Total Execution time = 0.0150 seconds
    When attempting to use a 1.69 install (this same error appears when using -m "1.69"):
    $ nwnsc -m 1.69 -i ~/opt/nwn -l *.nss WARNING: Failed to open .key archive 'chitin.key': exception 'Failed to open KEY file.'. WARNING: Failed to open .key archive 'xp1.key': exception 'Failed to open KEY file.'. WARNING: Failed to open .key archive 'xp1patch.key': exception 'Failed to open KEY file.'. WARNING: Failed to open .key archive 'xp2.key': exception 'Failed to open KEY file.'. WARNING: Failed to open .key archive 'xp2patch.key': exception 'Failed to open KEY file.'. WARNING: Failed to open .key archive 'xp3.key': exception 'Failed to open KEY file.'. Error: Unable to read input file '1.69'. Processing aborted. Total Execution time = 0.0000 seconds
    I'm testing this on Arch Linux 64-bit. Installing lib32-libstdc++5 doesn't seem to make any difference.
    $ uname -srvo Linux 4.15.3-2-ARCH #1 SMP PREEMPT Thu Feb 15 00:13:49 UTC 2018 GNU/Linux
  • GlorwingerGlorwinger Member Posts: 41
    edited February 2018
    The Instructions were incorrect - typo...

    when using the -l flag to read game resources the install dir is passed with the -n flag so...

    nwnsc -l -n (install dir) (script(s))
  • squattingmonksquattingmonk Member Posts: 59
    edited February 2018
    Hmm... I tried that with my initial testing.
    $ nwnsc -l -n ~/Games/00840/ test.nss “nwnsc -l -n ~/Games/00840/ test…” terminated by signal SIGSEGV (Address boundary error)
  • GlorwingerGlorwinger Member Posts: 41
    Updated nwnsc script compiler version 0.9.6 - https://neverwintervault.org/project/nwn1/other/tool/nwnsc-nwn-enhanced-edition-script-compiler
    • Fixed several null pointers and segmentation faults
    • Improved speed with compile optimizations
    • Redundant -l command line option not required when passing -n
    • When building for NWN EE the installdir ovr folder (override) will be processed for includes before the .bif files
    • Added -M to create Makefile compatible dependency files

    Hopefully the above is fixed now!
  • squattingmonksquattingmonk Member Posts: 59
    Hmm... not getting segfaults anymore. Now I get:
    $ nwnsc -n ~/Games/00840/ test.nss Loading base game resources... Compiling: test.nss free(): invalid size “nwnsc -n ~/Games/00840/ test.nss” terminated by signal SIGABRT (Abort)
    This happens when I attempt to use 1.69 mode, too.
  • GlorwingerGlorwinger Member Posts: 41
    Updated script compiler nwnsc 0.9.7 is available (release notes are on the page) https://neverwintervault.org/project/nwn1/other/tool/nwnsc-nwn-enhanced-edition-script-compiler

    This fixes the 1.69 issue above as well as file handle leaks on Linux / Mac
Sign In or Register to comment.