Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

New version of nwnnsscomp!

Page: 1 of 1
 Fred Tetra
03-04-2005, 10:18 AM
#1
I have updated nwnnsscomp to better support KotOR:TSL.

Users can now specify which game the compiler should use when looking for the nwscript.nss file.

You can download it here:

nwnnsscomp 1.02 (http://kotortool.home.comcast.net/nwnnsscomp102.zip)


From the readme.txt:


nwnnsscomp Version 1.02 2005-3-4 Fred Tetra

Introduction
---------------

nwnnsscomp is a compiler/decompiler for use with Star Wars: Knights of the Old Republic
(KotOR) and Star Wars: Knights of the Old Republic: The Sith Lords (KotOR:TSL).

It is was originally written by Edward T. Smith for compiling NeverWinter Nights scripts.
It has been updated since that time by Fred Tetra to work with KotOR and KotOR:TSL.


Setting up the environment
-----------------------------

There are several cases that might apply to the way you want to work with the compiler:


Case 1: Compiling KotOR I script files with only KotOR I installed

No special setup is needed. The compiler will use the nwscript.nss file contained in
the game's scripts.bif file.


Case 2: Compiling KotOR I script files without KotOR I installed

Some users may wish to compile scripts on a different machine from where KotOR is
installed. You will need to use a utility such as Kotor Tool to extract the nwscript.nss
file from scripts.bif and put it in the same folder as nwnnsscomp.


Case 3: Compiling KotOR:TSL script files with only KotOR:TSL installed

If you have the US version of the game, You will need to use a utility such
as Kotor Tool to extract the nwscript.nss file from scripts.bif and put it in the same
folder as nwnnsscomp. If you have a non-US version, there is a syntax error in the
nwscript.nss file; you will have to either extract the file and fix the error or obtain
a copy with it corrected first.


Case 4: Compiling KotOR:TSL script files only without KotOR:TSL installed

Some users may wish to compile scripts on a different machine from where KotOR:TSL is
installed. If you have the US version of the game, You will need to use a utility such
as Kotor Tool to extract the nwscript.nss file from scripts.bif and put it in the same
folder as nwnnsscomp. If you have a non-US version, there is a syntax error in the
nwscript.nss file; you will have to either extract the file and fix the error or obtain
a copy with it corrected first.


Case 5: Compiling KotOR I and KotOR:TSL script files with both games installed.

If you are compiling script files for KotOR I and KotOR:TSL installed, perform the
following steps:

Extract the nwscript.nss file from KotOR I's scripts.bif into KotOR I's Override folder

US version of KotOR:TSL:
if you have a US version of KotOR:TSL, extract the nwscript.nss file from KotOR:TSL's
scripts.bif into KotOR:TSL's Override folder. If the Override folder doesn't already
exist, create it first.

Non-US version of KotOR:TSL:
There is a syntax error in the nwscript.nss file; you will have to either extract the file
from KotOR:TSL's scripts.bif and fix the error or obtain a copy with it corrected first.
Copy the file to KotOR:TSL's Override folder.




Examples
-----------

Compile multiple source files for KotOR:TSL, putting the output files all in one directory:

nwnnsscomp.exe -c -g 2 --outputdir "C:\test output" script1.nss script2.nss script3.nss



Compile one source file for KotOR, putting putting the output file in the same directory:

nwnnsscomp.exe -c script1.nss

-or-

nwnnsscomp.exe -c -g 1 script1.nss



Compile one source file for KotOR:TSL, putting the output file in a directory and
specifying a different filename for it:

nwnnsscomp.exe -c -g 2 --outputdir "C:\test output" -o foo.ncs ft_invoke.nss



Command Line Reference
---------------------------

USAGE:

nwnnsscomp {-c|-d} [--outputdir <Directory Path>] [-o <File Name>] [-g
<Game number>] [--optimize] [--] [-v] [-h] <file name> ...


Where:

-c, --compile
(OR required) Compile an NSS file
-- OR --
-d, --decompile
(OR required) Decompile an NCS file to byte code


--outputdir <Directory Path>
(value required) Output directory for compiled/decompiled files

-o <File Name>, --outputfile <File Name>
(value required) Output file

-g <Game number>, --game <Game number>
(value required) KotOR Game Version: 1=KotOR, 2=KotOR:TSL; default=1

--optimize
Turn on code optimizations

--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.

-v, --version
Displays version information and exits.

-h, --help
Displays usage information and exits.

<file name> (accepted multiple times)
(value required) file name(s) to compile/decompile


NeverWinter Nights Script Compiler/Decompiler
Copyright 2002-2003, Edward T. Smith
Rewritten for Star Wars: Knights of the Old Republic
by Fred Tetra to work with Kotor Tool

Version 1.02 2005-3-4 Fred Tetra
 T7nowhere
03-04-2005, 11:04 AM
#2
Thank you.
 Fred Tetra
03-04-2005, 11:15 AM
#3
Somebody's got to do it! :)
 tk102
03-04-2005, 11:21 AM
#4
Yes thank you Fred.

I have question. Say I am following the instrcutions for Case #4 as you describe it above. Does nwnnsscomp still require the -g 2 parameter even though the extracted TSL nwscript.nss is in the same directory?
 Fred Tetra
03-04-2005, 12:46 PM
#5
Originally posted by tk102
Yes thank you Fred.

I have question. Say I am following the instrcutions for Case #4 as you describe it above. Does nwnnsscomp still require the -g 2 parameter even though the extracted TSL nwscript.nss is in the same directory?

No, it doesn't, since the default behavior is for the compiler to look in it's own directory first.

The -g switch is so that you can do things like put the nwscript.nss for each game in it's respective override folder and specify which one will be used.
 Darth333
03-04-2005, 1:50 PM
#6
Thanks for doing this Fred :)
 RedHawke
03-04-2005, 5:11 PM
#7
Yes... yes... many thanks Fred! :D

:worship:
 Shimaon
03-04-2005, 6:26 PM
#8
Nice! Thanks.
 Fred Tetra
03-04-2005, 6:59 PM
#9
I hope it helps all of you who like script coding as much as I enjoy making the tools available!
 Mav
03-04-2005, 9:42 PM
#10
Awesome stuff Fred thanks a lot :)
 Darkkender
03-04-2005, 10:28 PM
#11
Thank you for this Fred.
 ChAiNz.2da
03-05-2005, 2:20 AM
#12
Originally posted by Fred Tetra
I hope it helps all of you who like script coding as much as I enjoy making the tools available!
Thank's Fred! As I have to start getting into scripting now, this will definitely help reduce the headaches I'm sure to get ;)

BTW, I hope you're playing TSL too during your tools development. You've got more than enough "go for its" here:

http://www.lucasforums.com/showthread.php?s=&threadid=145117)

Afterall, we'd hate to have to put you in "Time Out" for not getting to enjoy the game for a full playthrough .. hehe
 Lorden Darkblade
03-05-2005, 8:29 PM
#13
It seems I attract problems.....
I downloaded this new version and was about to test it when I got this error, I made an output:

Lookup path root set to: C:/NeverwinterNights/Nwn/
Error: Couldn't initialize the NwnStdLoader

Any ideas on what could have caused this?

In the folder its the nwnnsscomp, the nwscript.nss and my script.
I simply opened a command propt on a folder using the way tk102 described once.
 Fred Tetra
03-06-2005, 12:18 PM
#14
Originally posted by Uchiha Itachi
It seems I attract problems.....
I downloaded this new version and was about to test it when I got this error, I made an output:

Lookup path root set to: C:/NeverwinterNights/Nwn/
Error: Couldn't initialize the NwnStdLoader

Any ideas on what could have caused this?

In the folder its the nwnnsscomp, the nwscript.nss and my script.
I simply opened a command propt on a folder using the way tk102 described once.

The error you see could happen for a number of reasons. What is the command line you entered?
 Lorden Darkblade
03-06-2005, 12:52 PM
#15
Yeah I figure I should have read the readme LOL
I used: nwnnsscomp -c myscript.nss
When I should have used:
nwnnsscomp -c -g 2 myscript.nss

Well what can I say, I'm lazy :p :D
 envida
03-06-2005, 11:34 PM
#16
Thanks for this :)

There is one thing I didn’t like with this version and that is that I have to set the path and name of the file to compile. With the previous NWNNSSCOMP I just dropped the NWNNSSCOMP and my bat file in a directory and compiled the scripts that was in that directory.

My bat file had this in it: NWNNSSCOMP -c Source\* Override\

This way I had the NWNNSSCOMP in the top directory, the source files in the source directory and the compiled files was put in the Override directory. And all files was compiled

Is it possible to change this? Or is this just a preference that I like :p
 *Atris*
03-07-2005, 11:50 AM
#17
ok im having trouble could some one please tell me what i need to download and where i need to install it ;)
 sketch42
03-08-2005, 1:42 PM
#18
is this only to be used with KT?? cuz if so i cant figure out how... if not.. than i get a real funky thing when i run the exe... i get a dos prompt that scrolls through ... what looks like this line nwnnsscomp {-c|-d} [--outputdir <Directory Path>] [-o <File Name>] [-g
<Game number>] [--optimize] [--] [-v] [-h] <file name> ...

a million times an never stops
 *Atris*
03-08-2005, 1:48 PM
#19
I get that error to
 Fred Tetra
03-08-2005, 3:11 PM
#20
Originally posted by sketch42
is this only to be used with KT?? cuz if so i cant figure out how... if not.. than i get a real funky thing when i run the exe... i get a dos prompt that scrolls through ... what looks like this line nwnnsscomp {-c|-d} [--outputdir <Directory Path>] [-o <File Name>] [-g
<Game number>] [--optimize] [--] [-v] [-h] <file name> ...

a million times an never stops

So you mean when you open a command window (Start | Programs | Accessories | Command Prompt) and type nwnnsscomp (the rest of your commandline here), it just shows the help over and over again?

Don't see how that could happen. :(

Here's what it should look like when you run nwnnsscomp from the commandline:


http://img57.exs.cx/img57/1858/nwnnsscomp5sp.th.gif) (http://img57.exs.cx/img57/1858/nwnnsscomp5sp.gif)
(Click to go to the larger version)
 Fred Tetra
03-16-2005, 12:09 PM
#21
I have updated nwnnsscomp so that it properly handles wildcarded file names.


You can download it here:

nwnnsscomp 1.03 (http://kotortool.home.comcast.net/nwnnsscomp103.zip)


From the readme.txt:


nwnnsscomp Version 1.03 2005-3-16 Fred Tetra

Introduction
------------

nwnnsscomp is a compiler/decompiler for use with Star Wars: Knights of the Old Republic
(KotOR) and Star Wars: Knights of the Old Republic: The Sith Lords (KotOR:TSL).

It is was originally written by Edward T. Smith for compiling NeverWinter Nights scripts.
It has been updated since that time by Fred Tetra to work with KotOR and KotOR:TSL.

nwnnsscomp is a command-line only tool; no Windows GUI is present and it must be run
from the Command Prompt.


Setting up the environment
--------------------------

There are several cases that might apply to the way you want to work with the compiler:


Case 1: Compiling KotOR I script files with only KotOR I installed

No special setup is needed. The compiler will use the nwscript.nss file contained in
the game's scripts.bif file.


Case 2: Compiling KotOR I script files without KotOR I installed

Some users may wish to compile scripts on a different machine from where KotOR is
installed. You will need to use a utility such as Kotor Tool to extract the nwscript.nss
file from scripts.bif and put it in the same folder as nwnnsscomp.


Case 3: Compiling KotOR:TSL script files with only KotOR:TSL installed

If you have the US version of the game, You will need to use a utility such
as Kotor Tool to extract the nwscript.nss file from scripts.bif and put it in the same
folder as nwnnsscomp. If you have a non-US version, there is a syntax error in the
nwscript.nss file; you will have to either extract the file and fix the error or obtain
a copy with it corrected first.


Case 4: Compiling KotOR:TSL script files only without KotOR:TSL installed

Some users may wish to compile scripts on a different machine from where KotOR:TSL is
installed. If you have the US version of the game, You will need to use a utility such
as Kotor Tool to extract the nwscript.nss file from scripts.bif and put it in the same
folder as nwnnsscomp. If you have a non-US version, there is a syntax error in the
nwscript.nss file; you will have to either extract the file and fix the error or obtain
a copy with it corrected first.


Case 5: Compiling KotOR I and KotOR:TSL script files with both games installed.

If you are compiling script files for KotOR I and KotOR:TSL installed, perform the
following steps:

Extract the nwscript.nss file from KotOR I's scripts.bif into KotOR I's Override folder

US version of KotOR:TSL:
if you have a US version of KotOR:TSL, extract the nwscript.nss file from KotOR:TSL's
scripts.bif into KotOR:TSL's Override folder. If the Override folder doesn't already
exist, create it first.

Non-US version of KotOR:TSL:
There is a syntax error in the nwscript.nss file; you will have to either extract the file
from KotOR:TSL's scripts.bif and fix the error or obtain a copy with it corrected first.
Copy the file to KotOR:TSL's Override folder.




Examples
--------

Compile multiple source files for KotOR:TSL, putting the output files all in one directory:

nwnnsscomp.exe -c -g 2 --outputdir "C:\test output" script1.nss script2.nss script3.nss



Compile one source file for KotOR, putting putting the output file in the same directory:

nwnnsscomp.exe -c script1.nss

-or-

nwnnsscomp.exe -c -g 1 script1.nss



Compile one source file for KotOR:TSL, putting the output file in a directory and
specifying a different filename for it:

nwnnsscomp.exe -c -g 2 --outputdir "C:\test output" -o foo.ncs ft_invoke.nss



To compile a .nss file with the .ncs output file going in the same directory:

nwnnsscomp -c mysource.nss



To compile a .nss file with a differently named .ncs output file going in the same directory:

nwnnsscomp -c --outputdir d:\myoutput\ mysource.nss



To compile a .nss file with a differently named .ncs output file going in a different directory:

nwnnsscomp -c -o d:\myoutput\mycompiledfile.ncs mysource.nss

OR

nwnnsscomp -c --outputdir d:\myoutput\ -o mycompiledfile.ncs mysource.nss



To compile a list of .nss files with the .ncs output files going in the same directory:

nwnnsscomp -c mysource1.nss mysource2.nss mysource3.nss

OR

nwnnsscomp -c *.nss


To compile many .nss files in the current directory via a wildcard with the .ncs output
files going in a different directory:

nwnnsscomp -c --outputdir d:\myoutput\ *.nss


To compile many .nss files in one directory via a wildcard with the .ncs output files
going in a different directory:

nwnnsscomp -c --outputdir d:\myoutput\ c:\sourcfiles\*.nss



NOTE: Any path that has spaces in it must be surrounded by double quote marks (").
For example:

nwnnsscomp -c --outputdir "d:\my output files\" *.nss


Release history
---------------
1.03 - 2005-3-16
Adjusted a feature in TCLAP (Command Line Parser) that prevented proper wildcard
handling of .nss files

1.02 - 2005-3-4
Updated to work with KotOR II:TSL, supporting override folder look-up for nwscript.nss

1.01 - 2004-10-29
Initial version rewritten for Star Wars: Knights of the Old Republic by Fred Tetra
to work with Kotor Tool


Command Line Reference
----------------------


USAGE:

nwnnsscomp {-c|-d} [--outputdir <Directory Path>] [-o <File Name>] [-g
<Game number>] [--optimize] [--] [-v] [-h] <file name> ...


Where:

-c, --compile
(OR required) Compile an NSS file
-- OR --
-d, --decompile
(OR required) Decompile an NCS file to byte code


--outputdir <Directory Path>
(value required) Output directory for compiled/decompiled files

-o <File Name>, --outputfile <File Name>
(value required) Output file

-g <Game number>, --game <Game number>
(value required) KotOR Game Version: 1=KotOR, 2=KotOR:TSL; default=1

--optimize
Turn on code optimizations

--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.

-v, --version
Displays version information and exits.

-h, --help
Displays usage information and exits.

<file name> (accepted multiple times)
(value required) file name(s) to compile/decompile


NeverWinter Nights Script Compiler/Decompiler
Copyright 2002-2003, Edward T. Smith
Rewritten for Star Wars: Knights of the Old Republic
by Fred Tetra to work with Kotor Tool

Version 1.03 2005-3-16 Fred Tetra
 ChAiNz.2da
03-16-2005, 12:45 PM
#22
Originally posted by Fred Tetra
I have updated nwnnsscomp so that it properly handles wildcarded file names.
Bless you Fred, :worship:

I was about to start cussing my machine because I thought my .bat file was wanting to "......" with me (I had a wildcard entry line) :fist:

Maybe after I get home and download this one, I'll teach my machine "who's boss" ;)

yeah ok, I talk big when my computer isn't around.. hehehe..
 tk102
03-16-2005, 1:04 PM
#23
Originally posted by Fred Tetra
No, it doesn't, since the default behavior is for the compiler to look in it's own directory first.

I think this is still true, but the output of the .exe is lying to me. :)

Here's the experiment I tried:

My computer where the registry contains SWKOTOR path of "D:\SWKOTOR" (and the game files are present relative to that path).

I have a script that looks like this:
void main() { ActionSwitchWeapons(); }
(note this function is a TSL-only function.

I then place TSL's nwscript.nss in the same folder as my .nss and execute nwnsscomp.exe with only -c myscript.nss as parameters.

The output is the following:
Lookup path root set to: d:\swkotor\
Compiling: myscript.nss
Total Execution time = 30 ms and the .ncs is generated. (So it must have used the TSL nwscript.nss though it said it used the KotOR version.) And of course, if I remove nwscript.nss from the folder I get errors due the unidentified function.

If you're wondering, I'm trying to modify the nsscomp.bat file to accommodate the new syntax for your version. :)
 RebelScum!
03-16-2005, 2:02 PM
#24
Originally posted by T7nowhere
Thank you.

Such Emotion.
 Fred Tetra
03-16-2005, 2:18 PM
#25
Originally posted by tk102
I think this is still true, but the output of the .exe is lying to me. :)

Here's the experiment I tried:

My computer where the registry contains SWKOTOR path of "D:\SWKOTOR" (and the game files are present relative to that path).

I have a script that looks like this:
void main() { ActionSwitchWeapons(); }
(note this function is a TSL-only function.

I then place TSL's nwscript.nss in the same folder as my .nss and execute nwnsscomp.exe with only -c myscript.nss as parameters.

The output is the following:
Lookup path root set to: d:\swkotor\
Compiling: myscript.nss
Total Execution time = 30 ms and the .ncs is generated. (So it must have used the TSL nwscript.nss though it said it used the KotOR version.) And of course, if I remove nwscript.nss from the folder I get errors due the unidentified function.

If you're wondering, I'm trying to modify the nsscomp.bat file to accommodate the new syntax for your version. :)

Ah, I see what you're saying.

The
Lookup path root set to: d:\swkotor\ message means that the compiler is using that path as the one to look in for the chitin.key file and override folder. This is the default behavior - choosing KotOR as the game version - as the default value for the 'g' argument is 1. Since you supplied the nwscript.nss file locally, that takes precedence.

The search order the compiler uses (in order of precedence) is:

Local directory
The override folder for the game specified by the -g argument
The file referenced in the chitin.key file for the game specified by the -g argument


I hope that clears it up a bit. The compiler can actually search other places, too, but those are more relevant to NWN.
 Arlen Treesong
03-16-2005, 4:39 PM
#26
I tried to do it through project manager, I followed everything you say, but it gives me a [continue] [exit] error stating it cannot find C:/Program Files/LucasArts....... k_inc_force.ncs

why is it looking for ncs file???
 Darth333
03-16-2005, 4:45 PM
#27
Originally posted by Arlen Treesong
I tried to do it through project manager, I followed everything you say, but it gives me a [continue] [exit] error stating it cannot find C:/Program Files/LucasArts....... k_inc_force.ncs

why is it looking for ncs file???
What are you trying to compile?
 Arlen Treesong
03-16-2005, 5:17 PM
#28
Originally posted by Darth333
What are you trying to compile?
k_inc_force.nss
 envida
03-16-2005, 6:53 PM
#29
Sweet, not having wildcard prevented me from using this version

Thank you :)
 tk102
03-16-2005, 7:00 PM
#30
Arlen Treesong tried to compile
k_inc_force.nss
k_inc_force in an include file and is not compiled as a stand-alone script. You need to place k_sp1_generic.nss in that folder and compile it instead. (It has the #include "k_inc_force" directive in it.)
 RebelScum!
03-16-2005, 7:11 PM
#31
Um.....I just realised how much skill it takes to make mods:eek:. Whoa...I am most likely leetless....whoa
 Fred Tetra
03-16-2005, 10:27 PM
#32
Originally posted by envida
Sweet, not having wildcard prevented me from using this version

Thank you :)

You're welcome!

It was just a matter of getting the time to figure out what was causing the error and fixing it. (Like always!)

In this case, the problem was the TCLAP (http://tclap.sourceforge.net/) code that processes the command line. Since it is intended to work in environments where the shell expands wildcarded names before the commandline is processed, it was using the '*' character for another purpose (which we don't care about). I substituted a '$' for that purpose, allowing the '*' in file names to work right. (obviously, this is the short explanation, heh heh).
 Mono_Giganto
03-19-2005, 10:26 AM
#33
I just reformatted my computer, so I'm guessing there's some file that I've forgotten to download, or I haven't done something I needed to do, because I'm getting this when I try to compile a script:

'nwnnsscomp' is not recognized as an internal or external command,
operable program or batch file.

Can anyone point me in the right direction here?
 Fred Tetra
03-19-2005, 11:26 AM
#34
Originally posted by Mono_Giganto
I just reformatted my computer, so I'm guessing there's some file that I've forgotten to download, or I haven't done something I needed to do, because I'm getting this when I try to compile a script:

'nwnnsscomp' is not recognized as an internal or external command,
operable program or batch file.

Can anyone point me in the right direction here?

You'll see this message when the command interpreter could not find what you wanted to execute in neither the local directory nor in andy of the directories in your PATH environment variable. If you type PATH in a command window, you'll see all of the directories that will be searched.

For me, I usually just place the compiler and the scripts in the same place, CD there, and execute the command line.

Nwnnsscomp 1.03 can reside in a different directory from both the source and output files, as you can specify paths for both of those separately. Just CD to the directory where nwnnsscomp is, then exeute a command line like one of the examples in the readme.txt file.

Email me if you have further questions.

(P.S. You can always is the Project Mananger in Kotor Tool, too, if you like GUI's better)
 Darth333
03-20-2005, 10:40 AM
#35
When I extract nwscript.nss to a directory that contains also the script I want to compile, the compiler tries to compile nwscript.nss when I use: nwnnsscomp -c *.nss I know I can specify the game version but I was wondering for the international users who have that syntax error in nwscript.nss.

edit: forget that. I found out :D


It was just another RTFM problem:rolleyes:
 Thraxwhirl
07-19-2008, 5:32 PM
#36
Hello, everyone.

Can you please help me to get this working? I can't seem to get it to do anything, it won't even find the files(they're sat next to it in the same folder of course), let alone compile them into an .ncs.

Needless to say, the first and most obvious question is how do I know if the nwscript.nss file is the right one? You say in the opening post that it has a syntax error, yet what that error might be, and how to correct it...

...can anyone elaborate?

Secondly, how can I test if mine is the bugged one? I didn't extract it from KotoR II myself, as I haven't a clue how to do that, but I found it in my Override folder, evidently left in the Source Scripts by a scripter who'd uploaded work and left it in. Needless to say, if he/she has created scripts that I've DL'd, that would suggest at least that this nwnscript file is ok. Afterall, if his/her file had the syntax error, he'd never have been able to compile his/her scripts and finish his/her mod... n'est pas?

So... if for the moment we can assume that this nwscript file IS ok, can you help me to understand how to get this tool to work?

At present, I have the compiler, my .nss UNcompiled script, and the nwscript.nss file all in exactly the same folder... so it shouldn't have difficulty finding the script.

Now, I go to Start, and choose "Run", and I type in: "C:\Program Files\LucasArts\SWKotOR2\nwnnsscomp.exe -c ss-peragus-items.nss", but I get a Windows error "thump", saying, "Windows cannot find file "Program". Please make sure you typed in the name correctly" etc.

Ok, so it can't handle spaces in a filepath, I guess. Seems a bit odd to me, since I was led to believe that "Program Files" is the default folder into which software such as games get installed, so I'd have figured more people would've had this error.

Regardless, I moved the relevant files UPwards, and put them in "C:\Compiler". No spaces there, and a short filepath that should be easy to find. This time I type, "C:\Compiler\nwnnsscomp.exe". Still it tells me it cannot find it.

Please can you help? I've tried so many different things. Double-clicking the .exe is of course right out(tried that). And the maddening thing really is that I'm only trying to compile ONE simple script. All the batch functions, wildcard facilities and so on, and all the fiendishly clever features that I genuinely appreciate you must've worked really hard on, are far beyond my own modest requirements. I simply want it to look in one folder(where the compiler is), and and find one .nss script, and create a compiled version in the same folder.

But I can't even get Windows to execute the compiler. :(

Any chance you can help? I'd really appreciate it.

Many thanks.
 stoffe
07-21-2008, 11:07 AM
#37
I know if the nwscript.nss file is the right one? You say in the opening post that it has a syntax error, yet what that error might be, and how to correct it...

There should be a link in this thread (http://www.lucasforums.com/showthread.php?t=143681) to a corrected version of nwscript.nss. I don't remember exactly what the problem was.




At present, I have the compiler, my .nss UNcompiled script, and the nwscript.nss file all in exactly the same folder... so it shouldn't have difficulty finding the script.

Since I don't use KotorTool's version of nwnnsscomp I don't remember for sure, but I think you need to stick the nwscript.nss file and any include files used in the game's override folder for it to find them.

(Personally I prefer tk102's version of nwnnsscomp which keeps the nwscript.nss file in the same folder as the compiler and any include files in the same folder as the script being compiled. Makes it easier to organize projects in folders and such, and to integrate the compiler with a text editor. Personally I like using UltraEdit to write scripts since it allows you to run the compiler with the press of a button, and presents any error messages allowing you to click on one to go to that line in the script. Makes it much nicer to work with than having to fiddle with the command line all the time Like:
http://img185.imageshack.us/img185/2377/ultraeditnsszn3.jpg)


Now, I go to Start, and choose "Run", and I type in: "C:\Program Files\LucasArts\SWKotOR2\nwnnsscomp.exe -c ss-peragus-items.nss", but I get a Windows error "thump", saying, "Windows cannot find file "Program". Please make sure you typed in the name correctly" etc.

You should probably run it via a batch file with a pause (like more) following it, or from the commandline (type cmd in the Run box], otherwise you won't see any feedback or error messages the compiler outputs before the window closes.

As for your problems to run the compiler it's hard to tell what might cause it without knowing what you are doing and how exactly.
 Thraxwhirl
07-22-2008, 8:15 AM
#38
Hi, Stoffe.

Thank you so much for your helpful reply. It turns out that what you posted has proven FAR more useful, and indeed simple, than you might have imagined. I followed your link to the thread where I can DL the newer file, and it also gave instructions for using KotoR Tool to compile scripts. It's incredibly simple, and it works! Even a techno-iliterate such as myself can follow it, and KotoR Tool compiles scripts quite handsomely in no time at all.

Given how easy it is to use KotoR Tool to do this, and given that - unless I am mistaken - it's written by the same author(ie. Fred Tatra), it does leave me wondering why anyone would still use the NW Compiler. Seems a little obsolete to me, not to mention very complicated and difficult to use... but I guess some folk do have their reasons for sticking to this method. As I say, I'm not the most techno-literate of folk, so I'm probably missing something obvious.

Regardless, KotoR tool does it perfectly satisfactorily, and I am very grateful to you for providing that link. Many thanks. :)
Page: 1 of 1