Author Topic: Advanced Script Compiler for NWN1 release thread  (Read 7372 times)

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #60 on: September 05, 2013, 08:15:34 pm »


               I use Skywing's without any diffculty - it absolutely kicks butt. Here's the compile.bat we use, located in my install directly in the NWN folder:


@ECHO OFF
set mask="%1*.nss"
CD C:\\NeverwinterNights\\NWN\\MODULES\\TEMP0
..\\..\\NWNScriptCompiler -1cegloq -r . %mask%
CD ..\\..
PAUSE

Makes it very easy to compile code in sets of like prefixes. I'm running Win 7 64 bit. For example, this:

compile fky_

compiles all scripts beginning with fky_, while

compile

compiles everything in the temp0 folder.

Of course, I haven't updated it in over a year, so my version may be somewhat different, but I'd be very suprised if the same params don't still work.

Funky
               
               

               


                     Modifié par FunkySwerve, 05 septembre 2013 - 07:17 .
                     
                  


            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #61 on: September 05, 2013, 09:32:19 pm »


               

FunkySwerve wrote...
Makes it very easy to compile code in sets of like prefixes. I'm running Win 7 64 bit. For example, this:

compile fky_

compiles all scripts beginning with fky_, while

compile

compiles everything in the temp0 folder.

Of course, I haven't updated it in over a year, so my version may be somewhat different, but I'd be very suprised if the same params don't still work.

Funky

Feature to specify input files has the Torlack/PRC compiler too.
Nobody has a version 1.0.0.2.3 ?
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #62 on: September 14, 2013, 07:17:07 pm »


               I am using NWNTX (latest version) and today upgraded the .ndl for the script compiler to th latest from skywing

Compiles now result in
Access Violation at address 2A022DA9 in module 'NWNScriptCompilerDll.ndl'.  Read of address 00000000.

If it matters I am using the toolset in VMWare Player. The toolset extender was working fine in this environment until I changed the ndl.

I changed the ndl back to the one distributed in VMan's NWNTX, and no longer get the error.
               
               

               


                     Modifié par henesua, 14 septembre 2013 - 06:21 .
                     
                  


            

Legacy_Via Con Diablos

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #63 on: October 09, 2013, 07:11:51 am »


               Skywing or Funky: I'm overriding some function names in nwscript, and and when I run funky's batch file, I get tons of errors like the following
nwscript.nss(5793): Error: NSC1045: Variable "sLanguage" defined multiple times
in the same scope (previous definition at nwscript.nss(5793))

which makes sense if it's loading the base version as well.

Is there any way to avoid this, other than compiling chunks of files at a time?
               
               

               
            

Legacy_Via Con Diablos

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #64 on: October 09, 2013, 07:31:33 am »


               I guess I can add -y to just pass on and look for errors after, but it would be nice if files in the module properly overrode the base ones (or maybe I'm just missing the obvious way to do so)
               
               

               
            

Legacy_SkywingvL

  • Full Member
  • ***
  • Posts: 115
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #65 on: January 28, 2014, 08:53:59 am »


               Release 15 of the Advanced Script Compiler posted.  New NWNScriptCompiler.exe (standalone command line compiler executable) and NWNScriptCompiler.ndl (for NWNTX users).

Download link here.

Release 15:
-----------
- Added -k option to standalone compiler to generate a pseudo-preprocessed
  version of script source text, annotated with originating line numbers and
  file names (useful for diagnosing problems with conflicting #includes).
- Fixed internal compiler assertion when printing out the error diagnostic
  for a duplicate default: block in a switch statement.
- The compiler was not previously issuing an error diagnostic if a duplicate
  case select value was supplied within a switch statement (longstanding bug
  dating back to nwnnsscomp).  This has been rectified with new error
  diagnostic NSC1089: Case value '<integer>' already used.  Previously, code
  for duplicate case blocks would be generated silently.
               
               

               
            

Legacy_Zeke

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #66 on: January 30, 2016, 01:27:06 am »


               

I'm trying to compile nw_c2_default9.nss and nw_c2_default4.nss and they give the following warnings:



x0_i0_anims.nss(1261): Warning: NSC6023: Function "AnimActionPlayRandomGreeting" argument "nHDiff" default value does not match the initializer value for a previous declaration.  The first declaration value will be used.

x0_i0_anims.nss(1261): Warning: NSC6023: Function "AnimActionPlayRandomGreeting" argument "nHDiff" default value does not match the initializer value for a previous declaration.  The first declaration value will be used.

x2_inc_switches.nss(596): Warning: NSC6023: Function "SetExecutedScriptReturnValue" argument "nValue" default value does not match the initializer value for a previous declaration.  The first declaration value will be used.

x0_i0_anims.nss(1261): Warning: NSC6023: Function "AnimActionPlayRandomGreeting" argument "nHDiff" default value does not match the initializer value for a previous declaration.  The first declaration value will be used.

x0_i0_anims.nss(1261): Warning: NSC6023: Function "AnimActionPlayRandomGreeting" argument "nHDiff" default value does not match the initializer value for a previous declaration.  The first declaration value will be used.

x0_i0_anims.nss(1261): Warning: NSC6023: Function "AnimActionPlayRandomGreeting" argument "nHDiff" default value does not match the initializer value for a previous declaration.  The first declaration value will be used.

I'm using the following command:



"path-to\NWNScriptCompiler.exe" -1cegloq -i "path-to\NWN Project\nss" -n "path-to\Neverwinter Nights" -y -b "path-to\NWN Project\nss" "path-to\NWN Project\nss\*.nss"

Is this normal behaviour?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #67 on: January 30, 2016, 02:02:26 am »


               

yes this is normal, these vanilla includes have minor bugs in them


 


you can either fix it yourself, or since you get this warning install my community patch which fixes this and much, much more



               
               

               
            

Legacy_Zeke

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #68 on: January 30, 2016, 09:50:32 am »


               


yes this is normal, these vanilla includes have minor bugs in them


 


you can either fix it yourself, or since you get this warning install my community patch which fixes this and much, much more




 


Ah, thank you! I'm calmer now.


 


Does the patch has any known module and CEP incompatibilities?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #69 on: January 30, 2016, 02:00:57 pm »


               


Ah, thank you! I'm more calm now.


 


Does the patch has any known module and CEP incompatibilities?




its compatible in everything in a way that if there is any file conflict it uses the version from hak/module to avoid conflict. on the other hand that means that you wont get all promised fixes in every modules but thats how it always worked with official patches.


 


check FAQ



               
               

               
            

Legacy_Zeke

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #70 on: February 02, 2016, 09:57:47 am »


               

Great! Thank you very much. I'm using your patch to implement changes to the original files.


 


Is someone using the compiler with *.nss files in an external directory (not in temp0)?


 


For rebuilding everything I use sublime. Using this command:



["C:\\Program Files (x86)\\NWNScriptCompiler\\NWNScriptCompiler.exe","-1cegloq", "-i", "${file_path}", "-n", "E:\\Games\\Neverwinter Nights","-y", "-b", "${file_path}", "*.nss", "&", "move", "/y", "*.ncs", "E:\\Games\\Neverwinter Nights\\modules\\temp0", "&", "xcopy", "*.nss", "/r", "/y", "E:\\Games\\Neverwinter Nights\\modules\\temp0"]

In other words:


1) Compile everything


2) move the *.ncs files in temp0


3) xcopy the *nss files in temp0


 


I don't like this approach because it copies and moves even when there is a compile error and it takes time to copy and move everything. Is there a better approach to this?



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #71 on: February 02, 2016, 11:01:36 am »


               

yes i use it externally for my patch project


 



 


cd scripts

..\nwnnsscomp.exe -g -o -i ../includes *.nss ../scripts_compiled/

pause



this simple batch file compiles all nss files in scripts directory



               
               

               
            

Legacy_Zeke

  • Jr. Member
  • **
  • Posts: 86
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #72 on: February 02, 2016, 05:50:30 pm »


               

Do you then copy manually the compiled scripts from /scripts_compiled  to temp0?


 


I'm having some problems. I can't seem to be able to specify where to output the compiled *.ncs files. It always outputs them in the same directory where the *.nss files are located.



               
               

               
            

Legacy_leo_x

  • Sr. Member
  • ****
  • Posts: 403
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #73 on: February 02, 2016, 10:34:18 pm »


               

Don't recall how the earlier versions work.  But in the lastest Skywing versions you can specify -b <output directory> and all ncs files will be placed there.  Taking a gander at your Sublime script that might be why they're always in the current directory.



               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #74 on: February 02, 2016, 11:31:41 pm »


               


Do you then copy manually the compiled scripts from /scripts_compiled  to temp0?


 


I'm having some problems. I can't seem to be able to specify where to output the compiled *.ncs files. It always outputs them in the same directory where the *.nss files are located.




thats not how im using it, but yes im cutting the files from scripts_compiled and putting them into other folder after