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

Legacy_GlowingCactus

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #75 on: April 27, 2016, 05:12:50 am »


               

Hi, I'm trying to use this compiler to re-compile parts of the PRC pack I've modified.  First things first: I want to compile a little bitty script I've made (that doesn't use anything from the PRC) as a tester, basically just a PrintString().  I did have some other problems that I've toiled through but I'm not quite sure what it wants now as I'm not using any ERFs (AFAIK)



NWNScriptCompiler.exe -1cejloy -r %scriptDir% -n "%installDir%" *.nss

This gives me the error:



Loading base game resources...
WARNING: Exception 'Failed to open ERF file.' loading module resources.  The area map may not function.
Error: Exception 'Failed to open ERF file.' executing compiler (fatal).

I'm either not giving it something it wants or I've not got it.  I've just got a standard install with all the expansions in "C:/NeverwinterNights/NWN/".


 


Any advice would be greatly appreciated.  Cheers.



               
               

               
            

Legacy_kevL

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #76 on: April 28, 2016, 08:21:47 pm »


               I think your command-line is overly complicated. Strip it down and let defaults silently do the work

[also, there's a lot you're not telling us ...]
               
               

               
            

Legacy_GlowingCactus

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #77 on: April 29, 2016, 03:49:20 pm »


               

Thank you for the response kevL. '<img'>


 




[also, there's a lot you're not telling us ...]




 


There are the literal file contents I'm trying to compile as a test:



void main()
{
   PrintString("Print: Some class in a file");
   SpeakString("Speak: Some class in a file");
}

(modified from one I've seen on here with a bit of tweaking to get the NWN1 resources loaded) This is the full bat file with the command line as short as I can make it and getting the same error:



@echo off

set installDir="C:/NeverwinterNights/NWN/"

set scriptDir="C:/NeverwinterNights/my_nss/"

C:/Neverw~1/NWN_tools/AdvancedScriptCompiler/StandaloneCompiler/NWNScriptCompiler.exe -1cel -r %scriptDir% -n "%installDir%" *.nss

cd %scriptDir%

And here is the error I get:



C:\NeverwinterNights\my_nss>nwn_compiler.bat
NWNScriptCompiler - built Jan 29 2014 19:24:04
Copyright (C) 2008-2014 Skywing.
Portions copyright (C) 2002-2003, Edward T. Smith.
Portions copyright (C) 2003, The Open Knights Consortium.
Loading base game resources...
WARNING: Exception 'Failed to open ERF file.' loading module resources.  The are
a map may not function.
Error: Exception 'Failed to open ERF file.' executing compiler (fatal).

The class file compiles in the toolset NP, but this is a step to compiling part of the PRC pack with some edits I've made.  Some tutorials seem to say is necessary for the overall changes I'm making, I've done the 2da parts and got them working without problem but there are things that need changing in the nss->ncs files.  But if I can't get a simple script to compile ^^ how can I get the PrC pack to compile?  Even then it would be nice to not have to work in the toolset when all I want to currently work on is scripting and not areas or conversations.


 


Any ideas what's causing this exception?



               
               

               
            

Legacy_kevL

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #78 on: April 29, 2016, 09:53:53 pm »


               ok i have a better idea what you're aiming for now ... but I thought/think Kaedrin's PrC Pack is for NwN2 only. So, uh first, why are you trying to get the ASC working with NwN resources?

Second, i don't have NwN installed ....

Third, are you sure you have a version of the PrC Pack that comes with source .NSS?


Fourth, i can tell you how I get things working:

copy NwScript.nss to a directory outside the NwN/NwN2 paths. Put the ASC stand-alone compiler there too. Use a batchfile similar to this:

for /r %%1 in (.) do if exist "%%1\*.nss" f:\asc -aglo -v1.69 -y "%%1\*.nss"

pause
and change "f:\asc" to the path to your ASC. Place and Run the batchfile in the top-level directory of the script(s) you want compiled. However, what I can't tell you is what switches to use for NwN.

-aglo -v1.69 is for NwN2. I guess you'd replace those with

-aglo1 -v1.69 or somethin' -- for NwN ... but am pretty sure Kaedrin's scripts are NwN2

And finally if you have a regular install of NwN/NwN2, omit the -r and -n switches: Skywing will get those paths from the Windows registry auto.



ps. The only reason i have nwscript.nss in its own dir is so I can also run the compiler without its -l option -- ie, do not load base-game resources (eg. stock #includes). However, recompiling the KPrC pack very likely needs access to those #includes .......

tl;dr It sounds like you don't need to specify a "module" etc.
               
               

               
            

Legacy_GlowingCactus

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #79 on: April 29, 2016, 11:55:33 pm »


               


but I thought/think Kaedrin's PrC Pack is for NwN2 only.  


Third, are you sure you have a version of the PrC Pack that comes with source .NSS?




 


My mistake, it's the Player Resource Consortium's PRC Pack.  There are nss and ncs files within.  Will give it a go.  Thanks so far. '<img'>



               
               

               
            

Legacy_kevL

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #80 on: April 30, 2016, 12:40:26 am »


               good luck,

iirc, NwN doesn't allow sub-directory structures as freely as NwN2, so ...

my batchfile command above is mostly about subdirs; but if you have all scripts in a single dir, I suggest simply placing the ASC executable in that dir and running something like

NWNScriptCompiler -1aglo -v1.69 -y *.nss
               
               

               
            

Legacy_Taino

  • Sr. Member
  • ****
  • Posts: 268
  • Karma: +0/-0
Advanced Script Compiler for NWN1 release thread
« Reply #81 on: May 03, 2016, 04:38:59 pm »


               

Not sure if I have downloaded the compiler. Read the README txt first and it seems that it only explains how to install it on NWN2. Nothing about how it can be installed to NWN1.


 


So am I or have I over read how it can be installed to NWN1?


 


Thanks in Advance.