Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

We need your feedback on the new forum text editor switch.
Neverwinter Nights: Enhanced Edition has been released! Visit nwn.beamdog.com to make an order. NWN:EE FAQ is available.
Soundtracks for BG:EE, SoD, BG2:EE, IWD:EE, PST:EE are now available in the Beamdog store.
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

Script Compiler for Enhanced Edition

GlorwingerGlorwinger Member Posts: 40
edited February 22 in Tools & Plugin Developers
*** UPDATE ***

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

Post edited by Glorwinger on
BalanorthirdmousesquattingmonkProont

Comments

  • shadguyshadguy Member Posts: 129
    @Glorwinger

    Thank you. It sounds like this may be a separate branch from Skywing's work, based on the same source. Is my understanding correct? [ Reference: https://neverwintervault.org/project/nwn2/other/tool/advanced-script-compiler-nwn2 ]

    -Dave

  • GlorwingerGlorwinger Member Posts: 40
    It is the base for the Skywing Compiler. I am going to pull the parser from that one and update this one. It doesn't have all of the optimizations etc. of the Skywing version. This one was already cross platform and easier to update for NWN EE.

  • shadguyshadguy Member Posts: 129
    Cool, thank you for the follow-up. :) :)

    -Dave

  • HimmelweissHimmelweiss Member Posts: 56
    @Glorwinger

    This is really awesome, also using Visual Studio Code now for nwscript and made a build task with your compiler.

    Really awesome!!!

  • BalanorBalanor Member Posts: 141
    edited February 17
    I'm not able to get this to work. External script compilers are definitely not my thing.

    I put the nwnnss.exe in C:\Users\username\Documents\Neverwinter Nights
    Then I created a .bat in the same directory with the following in it since that was the example on the NWVault page:
    @ECHO OFF
    nwnnss compile -p /Applications/Beamdog/00829 -u "/Users/username/Documents/Neverwinter Nights/" *.nss
    PAUSE

    And it always errors out with:
    "Unable to locate or open Neverwinter Nights"

    What am I doing wrong?

  • FinalStandFinalStand Member Posts: 87
    Balanor said:


    nwnnss compile -p /Applications/Beamdog/00829 -u "/Users/username/Documents/Neverwinter Nights/" *.nss
    PAUSE

    And it always errors out with:
    "Unable to locate or open Neverwinter Nights"

    You probably need to give the full path to the -p parameter. Also use backslashes in windows, not forward slahes.

    Something like `-p C:\Applications\Beamdog\00829`

    Lastly, if you update your client in beam dog client the last directory name (00829) will change, so need to update your script everytime you update.

  • SherincallSherincall Member Posts: 268

    Lastly, if you update your client in beam dog client the last directory name (00829) will change, so need to update your script everytime you update.

    00829 is not a version, it's the code for "NWN:EE Head Start Standard Edition". If you update it, it'll stay in the same spot. If you install Digital Deluxe, you'll get a different number. And when it gets released, it will get a new number (and head start will become beta for patches).

  • FinalStandFinalStand Member Posts: 87

    Lastly, if you update your client in beam dog client the last directory name (00829) will change, so need to update your script everytime you update.

    00829 is not a version, it's the code for "NWN:EE Head Start Standard Edition". If you update it, it'll stay in the same spot. If you install Digital Deluxe, you'll get a different number. And when it gets released, it will get a new number (and head start will become beta for patches).

    Good to know. It did change on me once, but regardless, that should fix his problem.

  • GlorwingerGlorwinger Member Posts: 40
    I updated the first post above with an updated Compiler. This is based on the Skywing engine and is more robust and stable.

    Give this one a try and report any issues here or better in the Issue tracker via the link above.

  • BalanorBalanor Member Posts: 141
    edited February 24
    just to close the loop, and in case it might help someone else; with Glorwinger' and sherincall's help I did get the new compiler to work. the .bat I setup looked like this:
    @ECHO OFF
    nwnsc -n "\Users\balan\Beamdog Library\00829" -i "\Users\balan\Beamdog Library\00829\ovr" -l *.nss
    pause
    Thanks Glorwinger, for your work on this!

  • GlorwingerGlorwinger Member Posts: 40
    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

    squattingmonk
  • fot1fot1 Member Posts: 41
    I could use some help to make this work. I'm on Linux with a steam installation. I'm getting a segfault. I'm not sure what is the right directory to point the compiler. Without a directory, I get the same "Unable to locate script nwscript.nss" error. My best try was this one:

    $ /nwnsc -p /steam/steamapps/common/Neverwinter\ Nights/data/ temp0/*.nss Segmentation fault (core dumped)

    I have tried all partial paths and no luck. strace tells me the following:

    access("/steam/steamapps/common/Neverwinter Nights/data/", F_OK) = 0 open("/steam/steamapps/common/Neverwinter Nights/data/", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 fstat64(3, {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0 _llseek(3, 0, [2147483647], SEEK_END) = 0 _llseek(3, 0, [0], SEEK_SET) = 0 mmap2(NULL, 2147483647, PROT_READ, MAP_SHARED, 3, 0) = -1 ENODEV (No such device) mmap2(NULL, 2147487744, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x77514000 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0xffffffff} ---

    I wonder what is the directory I should point to the compiler?

  • GlorwingerGlorwinger Member Posts: 40
    What version of the compiler? I haven't tried it on Steam on Linux...

  • Grizzled_DwarflordGrizzled_Dwarflord Member Posts: 79
    This may seem like a stupid question, but why can't we have a compiler like this, or NWNx's compiler, inside the toolset itself?

  • dTddTd Member Posts: 161
    How hard would it be to get this to be case insensitive? Many old scripts have includes which for some odd reason are capitalized which breaks when using the external compiler.

  • BohuntinBohuntin Member Posts: 1
    I've mostly got this to work, but I cannot figure out how to get the compiler to find includes that are in a hak. Compile command:

    nwnsc -m $(VER) -n $(NWN_INSTALL_DIR) -h $(NWN_HOME_DIR) *.nss
    ...
    NSC1085: Unable to open the include file "zep_inc_main"

    which will be on one of the CEP 2.65 haks. I am using version 1.0.0 - built Jun 2 2018 18:03:29 on linux. The above is from a makefile and the variables point to the right places.


    PS-Hi GDL!

  • TarotRedhandTarotRedhand Member Posts: 476
    @Grizzled_Dwarflord
    This may seem like a stupid question, but why can't we have a compiler like this

    The compiler being discussed here is a command line compiler. Though limited, the compiler in the toolset has a gui. While this command line compiler may well be better at its job, I would much rather stick with a gui unless I have a pressing need for compiled code.

    @Bohuntin I don't think this compiler has the ability to look inside haks. I certainly can't see such an option on the project page. The reason that the toolset script compiler can do so is because the toolset itself needs to open hak files so that you can use their contents when building a module. I suppose you could open your project in the toolset and then look in the temporary folder that the toolset creates when it opens a module but I don't know if the include file will be in there.

    TR

Sign In or Register to comment.