lfnetwork.com mark read register faq members calendar

Thread: New version of nwnnsscomp!
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 03-04-2005, 11:18 AM   #1
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Lightbulb New version of nwnnsscomp (1.02) posted

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


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


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-04-2005, 12:04 PM   #2
T7nowhere
Did you reset?
 
T7nowhere's Avatar
 
Join Date: Jan 2004
Location: Vancouver, BC
Posts: 2,972
Veteran Modder Forum Veteran Helpful! Notable contributor 
Thank you.
T7nowhere is offline   you may: quote & reply,
Old 03-04-2005, 12:15 PM   #3
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Somebody's got to do it!


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-04-2005, 12:21 PM   #4
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,767
Current Game: FTL
Forum Veteran Helpful! Notable contributor 
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?


tk102 is offline   you may: quote & reply,
Old 03-04-2005, 01:46 PM   #5
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Quote:
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.


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-04-2005, 02:50 PM   #6
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,295
Thanks for doing this Fred
Darth333 is offline   you may: quote & reply,
Old 03-04-2005, 06:11 PM   #7
RedHawke
Shadow Lord Of The Sith™
 
RedHawke's Avatar
 
Status: Moderator
Join Date: Mar 2004
Location: Stormreach CA.
Posts: 9,184
Current Game: DDO, Stormreach
Yes... yes... many thanks Fred!



"Beware the form-fitting black armor-clad Drow hottie with twin Mineral II Greensteel Khopeshes!"
"Liella d'Orien says, '"You're the fool, Devil. -- Witness the power of this fully ARMED and OPERATIONAL Titan!"'"
----------------------------------------------------------------------
RedHawke is offline   you may: quote & reply,
Old 03-04-2005, 07:26 PM   #8
Shimaon
Junior Member
 
Shimaon's Avatar
 
Join Date: Jan 2004
Posts: 261
Nice! Thanks.


Shimaon is offline   you may: quote & reply,
Old 03-04-2005, 07:59 PM   #9
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
I hope it helps all of you who like script coding as much as I enjoy making the tools available!


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-04-2005, 10:42 PM   #10
Mav
8-Bit Code Monkey
 
Mav's Avatar
 
Join Date: May 2004
Location: A House
Posts: 4,043
Current Game: SWTOR
Awesome stuff Fred thanks a lot


"Women are like sunsets… they’re beautiful, but there will be a different one tomorrow." - Gilder
Mav is offline   you may: quote & reply,
Old 03-04-2005, 11:28 PM   #11
Darkkender
Knight of Holowan
 
Darkkender's Avatar
 
Join Date: Aug 2004
Location: In the mountains of Oregon
Posts: 2,953
Current Game: Star Wars The Old Republic
Veteran Modder 
Thank you for this Fred.


Working so, we will learn history as a tree knows it; we will climb into shapes printed in the seed; we will become time made visible, years made fragrant; we will make of concentric memory a stem of praise; we will inhabit daylight at a trees own speed; we will be travelers who remain, patriots to this ground.
OMG I only rank 62.13018% geek or a Extreme Geek as it is referred to on the geektest at Geektest
[TSL]Holowan Plugin
Darkkender is offline   you may: quote & reply,
Old 03-05-2005, 03:20 AM   #12
ChAiNz.2da
Leave Everything to Me!
 
ChAiNz.2da's Avatar
 
Join Date: Oct 2004
Location: Tennessee (USA)
Posts: 6,848
Quote:
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/showthrea...hreadid=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


"Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines"


| Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd |
ChAiNz.2da is offline   you may: quote & reply,
Old 03-05-2005, 09:29 PM   #13
Lorden Darkblade
Computer Crazy
 
Lorden Darkblade's Avatar
 
Join Date: May 2004
Location: Brazil
Posts: 1,474
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.



Lorden Darkblade is offline   you may: quote & reply,
Old 03-06-2005, 01:18 PM   #14
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Quote:
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?


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-06-2005, 01:52 PM   #15
Lorden Darkblade
Computer Crazy
 
Lorden Darkblade's Avatar
 
Join Date: May 2004
Location: Brazil
Posts: 1,474
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



Lorden Darkblade is offline   you may: quote & reply,
Old 03-07-2005, 12:34 AM   #16
envida
Rookie
 
envida's Avatar
 
Join Date: Jan 2005
Posts: 145
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
envida is offline   you may: quote & reply,
Old 03-07-2005, 12:50 PM   #17
*Atris*
Junior Member
 
*Atris*'s Avatar
 
Join Date: Mar 2004
Location: England (a village called Kingswinford)
Posts: 367
ok im having trouble could some one please tell me what i need to download and where i need to install it
*Atris* is offline   you may: quote & reply,
Old 03-08-2005, 02:42 PM   #18
sketch42
Rookie
 
sketch42's Avatar
 
Join Date: Nov 2004
Posts: 168
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

sketch42 is offline   you may: quote & reply,
Old 03-08-2005, 02:48 PM   #19
*Atris*
Junior Member
 
*Atris*'s Avatar
 
Join Date: Mar 2004
Location: England (a village called Kingswinford)
Posts: 367
I get that error to
*Atris* is offline   you may: quote & reply,
Old 03-08-2005, 04:11 PM   #20
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Quote:
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:



(Click to go to the larger version)


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-16-2005, 01:09 PM   #21
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
New version of nwnnsscomp (1.03 - 2005-3-16)

I have updated nwnnsscomp so that it properly handles wildcarded file names.


You can download it here:

nwnnsscomp 1.03


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



Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-16-2005, 01:45 PM   #22
ChAiNz.2da
Leave Everything to Me!
 
ChAiNz.2da's Avatar
 
Join Date: Oct 2004
Location: Tennessee (USA)
Posts: 6,848
Re: New version of nwnnsscomp (1.03 - 2005-3-16)

Quote:
Originally posted by Fred Tetra
I have updated nwnnsscomp so that it properly handles wildcarded file names.
Bless you Fred,

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)

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..


"Eagles May Soar, But Weasels Don't Get Sucked Into Jet Engines"


| Mods (FF) (DS) | Folding | SWK.com | FB: (LF) (Me) | Steam | The Herd |
ChAiNz.2da is offline   you may: quote & reply,
Old 03-16-2005, 02:04 PM   #23
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,767
Current Game: FTL
Forum Veteran Helpful! Notable contributor 
Quote:
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:
Code:
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:
Code:
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.


tk102 is offline   you may: quote & reply,
Old 03-16-2005, 03:02 PM   #24
RebelScum!
Forumite
 
RebelScum!'s Avatar
 
Join Date: Sep 2004
Location: The Front Line next to Tk-8252
Posts: 600
Quote:
Originally posted by T7nowhere
Thank you.
Such Emotion.


Join the BBF

SWbattlefront name:RebelScum!
Check out my Site
Avatar by Astrotoy7
RebelScum! is offline   you may: quote & reply,
Old 03-16-2005, 03:18 PM   #25
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Quote:
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:
Code:
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:
Code:
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
Code:
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.


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-16-2005, 05:39 PM   #26
Arlen Treesong
Rookie
 
Arlen Treesong's Avatar
 
Join Date: Jun 2004
Posts: 119
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???


"Definition: "Love" is making a shot to the knees of a target 120 kilometers away using an Aratech sniper rifle with a tri-light scope." HK-47
Arlen Treesong is offline   you may: quote & reply,
Old 03-16-2005, 05:45 PM   #27
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,295
Quote:
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?
Darth333 is offline   you may: quote & reply,
Old 03-16-2005, 06:17 PM   #28
Arlen Treesong
Rookie
 
Arlen Treesong's Avatar
 
Join Date: Jun 2004
Posts: 119
Quote:
Originally posted by Darth333
What are you trying to compile?
k_inc_force.nss


"Definition: "Love" is making a shot to the knees of a target 120 kilometers away using an Aratech sniper rifle with a tri-light scope." HK-47
Arlen Treesong is offline   you may: quote & reply,
Old 03-16-2005, 07:53 PM   #29
envida
Rookie
 
envida's Avatar
 
Join Date: Jan 2005
Posts: 145
Sweet, not having wildcard prevented me from using this version

Thank you

envida is offline   you may: quote & reply,
Old 03-16-2005, 08:00 PM   #30
tk102
Well past expiration date
 
tk102's Avatar
 
Join Date: Jan 2004
Posts: 5,767
Current Game: FTL
Forum Veteran Helpful! Notable contributor 
Quote:
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.)


tk102 is offline   you may: quote & reply,
Old 03-16-2005, 08:11 PM   #31
RebelScum!
Forumite
 
RebelScum!'s Avatar
 
Join Date: Sep 2004
Location: The Front Line next to Tk-8252
Posts: 600
Um.....I just realised how much skill it takes to make mods. Whoa...I am most likely leetless....whoa


Join the BBF

SWbattlefront name:RebelScum!
Check out my Site
Avatar by Astrotoy7
RebelScum! is offline   you may: quote & reply,
Old 03-16-2005, 11:27 PM   #32
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Quote:
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 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).


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-19-2005, 11:26 AM   #33
Mono_Giganto
Giant Monkey of Doom™
 
Mono_Giganto's Avatar
 
Join Date: Dec 2003
Location: Florida
Posts: 2,478
Current Game: Baldur's Gate EE
Veteran Modder Helpful! 
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?




Mono_Giganto is offline   you may: quote & reply,
Old 03-19-2005, 12:26 PM   #34
Fred Tetra
Kotor Tool Guy
 
Fred Tetra's Avatar
 
Join Date: Jan 2004
Location: What a creepy photo, eh? Had to use it!
Posts: 947
Hot Topic Starter LFN Staff Member Helpful! Notable contributor 
Quote:
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)


Kotor Tool Developer
http://kotortool.starwarsknights.com/

"You want to help everyone who asks for aid, answer all of their questions, write that crucial bit of code for which they're searching, and be the hero who saves the day (and their job), but there comes a point when you realize that sleep is sometimes necessary."
—Stephen Toub

Visit the Kotor Tool Forum
Fred Tetra is offline   you may: quote & reply,
Old 03-20-2005, 11:40 AM   #35
Darth333
Administraterror
 
Darth333's Avatar
 
Status: Administrator
Join Date: Feb 2004
Location: In my secret dungeon...
Posts: 8,295
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:
Code:
 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


It was just another RTFM problem

Last edited by Darth333; 03-20-2005 at 02:09 PM.
Darth333 is offline   you may: quote & reply,
Old 07-19-2008, 06:32 PM   #36
Thraxwhirl
Lurker
 
Join Date: Jul 2008
Posts: 5
Can you help me?

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.
Thraxwhirl is offline   you may: quote & reply,
Old 07-21-2008, 12:07 PM   #37
stoffe
Mostly dormant
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,834
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by Thraxwhirl View Post
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 to a corrected version of nwscript.nss. I don't remember exactly what the problem was.



Quote:
Originally Posted by Thraxwhirl View Post
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:
Show spoiler
)

Quote:
Originally Posted by Thraxwhirl View Post
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.


mt
stoffe is offline   you may: quote & reply,
Old 07-22-2008, 09:15 AM   #38
Thraxwhirl
Lurker
 
Join Date: Jul 2008
Posts: 5
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.
Thraxwhirl is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > Knights of the Old Republic > Editing / Modding > T3-M4's Astromech Droid Center > New version of nwnnsscomp!

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:07 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.