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.

Syntax Error in KotOR2 nwscript.nss

Page: 1 of 1
 tk102
01-14-2005, 12:10 PM
#1
For those of you attempting to compile KotOR2 scripts that include new constant values or new functions, there appears to be a syntax error in nwscript.nss that will prevent you from compiling!

Near line 5710 you will see:

// RWT-OEI 01/29/04
// 794: Disables or Enables the Orient On Click behavior in creatures. If
// disabled, they will not orient to face the player when clicked on
// for dialogue. The default behavior is TRUE.
void SetOrientOnClick( object = OBJECT_SELF, int nState = TRUE );

The problem lies in this part:
object = OBJECT_SELF

Change it to this:
object oCreature=OBJECT_SELF

and then place the modified nwscript.nss file in the same folder as nwnsscomp.exe.
 Dak Vesser
01-14-2005, 2:06 PM
#2
:D Ok I see that.

Now I have the Compiler in the Kotor 1 directory next to the Override folder, now I use it for the Xbox and the k1 Override is where I put the K2 scripts. Now If I fix that entry like you said, all I'll need to do is save it as nwscript.nss and just put it in the same directory right next to the compiler.exe, right?

And everything will be k0ol?
 Dak Vesser
01-14-2005, 2:14 PM
#3
"Excellent" It worked!!!!

I don't know how you figured that one out but thanx!
 tk102
01-14-2005, 2:40 PM
#4
Cool.

Just remember, if you have nwscript.nss in the same directory as nwnnsscomp.exe, nwnnsscomp.exe will use it -- otherwise it will try to read it from the KotOR1 scripts.bif using the registry as its guide.

Since KotOR1 and 2 use different nwscript.nss files, it is wise to do your compiling in different folders for the two games, with a copy of nwnnsscomp.exe and the appropriate nwscript.nss in each.
 Darth333
01-14-2005, 3:14 PM
#5
Thanks for that info :)
 beancounter
01-14-2005, 5:07 PM
#6
Very good. Thanks for the info. It will save some fustration once everyone starts modding Kotor II scripts. I for one can not wait until this game comes out for the PC next month.

It is concerning that nwscript.nss does not compile. It makes me think the source scripts may not be the ingame script.
 RedHawke
01-14-2005, 5:35 PM
#7
Originally posted by Darth333
Thanks for that info :)
Agreed! :D Good catch tk! ;)

*Goes back to impatiently awaiting the PC version of TSL*
 tk102
01-14-2005, 6:21 PM
#8
It is also possible that this will be "fixed" in the PC version, but I'm not holding my breath.

This would not be the first time that .nss files have had errors...

KotOR1 also had at least 2 syntax errors that I can think of... here (http://www.lucasforums.com/showthread.php?s=&postid=1503663#post1503663) (steps 5 & 6)
 beancounter
01-14-2005, 6:51 PM
#9
I agree with you there, I doubt it will be fixed in the PC release.

It really is a shame that mods are so unsupported with the KOTOR series. One would think that a company would incourage mods to their game. Games like Morrowind that are over two years old are still being modded by the community. Morrowind's mod forums generates over eight pages of posting a day! Talk about building a strong fan base.

Oh well, no sense in complaining about it. I am still excited about modding for KOTOR, I just wish it was easier.
 tk102
01-14-2005, 6:55 PM
#10
Modding KotOR makes you strong. :)
 StormSinger
01-30-2005, 4:06 AM
#11
I used this for a couple of days and it worked perfectly. Now - without changing a single thing - it still compiles, but with a massive list of errors.

No idea what happened.
 Pontifice
01-30-2005, 4:37 AM
#12
maybe you compiled nwnscript.nss by mistake ??
 StormSinger
01-30-2005, 4:42 AM
#13
That seems to be what's happening. What I don't understand is why it didn't do the same before.
 Achilles
01-30-2005, 5:41 AM
#14
Originally posted by beancounter
I agree with you there, I doubt it will be fixed in the PC release.

It really is a shame that mods are so unsupported with the KOTOR series. One would think that a company would incourage mods to their game. Games like Morrowind that are over two years old are still being modded by the community. Morrowind's mod forums generates over eight pages of posting a day! Talk about building a strong fan base.

Oh well, no sense in complaining about it. I am still excited about modding for KOTOR, I just wish it was easier. For some strange reason, KotOR is the only game that I've ever had any interest in modding. Perhaps it's because the members here have had to work so hard for the tools. Murphy's Law, I guess.
 tk102
01-30-2005, 3:04 PM
#15
Ah you're using a .bat file to compile aren't you? Now that nwscript.nss is extracted and lives in your directory with nwnsscomp, it will be subject to nwnnsscomp -v1.00 *.nss

You can avoid that by not using the .bat file method and just typing the command directly. If you have a special naming convention for your scripts, you can probably use a wildcard to save you some keystrokes. :rolleyes:

nwnnsscomp -v1.00 tk_script1.nss
nwnnsscomp -v1.00 tk_script2.nss
nwnnsscomp -v1.00 tk_script3.nss
del *.ndbor
nwnnsscomp -v1.00 tk*.nss
del *.ndb

I'll also refer you to a Command Prompt Trick (http://www.lucasforums.com/showthread.php?s=&threadid=130750)

The command prompt is your friend. Why doesn't anyone believe me? :D
 Darth Stryke
01-30-2005, 3:25 PM
#16
Well, good news is Obsidian allows discussion of TSL mods on their forums so they are already supporting us more than Bioware did. Now hopefully they will be even MORE supportive by answering questions and helping use once TSL is out on PC :D
 RedHawke
01-30-2005, 3:32 PM
#17
Originally posted by tk102
The command prompt is your friend. Why doesn't anyone believe me? :D
An unhealthy exposure to far too much Windoze! :bored: Will do that to most people. :D
 tk102
01-31-2005, 8:48 AM
#18
A fixed .bat file is available in this (http://www.lucasforums.com/showthread.php?s=&threadid=143667) thread.
 Dak Vesser
02-01-2005, 11:53 AM
#19
Originally posted by BoL_Stryke
Well, good news is Obsidian allows discussion of TSL mods on their forums so they are already supporting us more than Bioware did. Now hopefully they will be even MORE supportive by answering questions and helping use once TSL is out on PC :D

Well that's good. I think Obsidian needs the support of the holowan labs community to "Help them out on this game" Seeing as how they screwd up on things like syntax errors, and feat glitches, and frame rate lags, and the list goes on and on and on.... lol
 Darth333
02-10-2005, 2:25 PM
#20
BTW, they fixed it in the release of the PC version! Thanks to tk102!!! :D

New nwscript.nss
// RWT-OEI 01/29/04
// 794: Disables or Enables the Orient On Click behavior in creatures. If
// disabled, they will not orient to face the player when clicked on
// for dialogue. The default behavior is TRUE.
void SetOrientOnClick( object oCreature = OBJECT_SELF, int nState = TRUE );
 Dak Vesser
02-11-2005, 8:54 PM
#21
Originally posted by Darth333
BTW, they fixed it in the release of the PC version! Thanks to tk102!!! :D

New nwscript.nss
// RWT-OEI 01/29/04
// 794: Disables or Enables the Orient On Click behavior in creatures. If
// disabled, they will not orient to face the player when clicked on
// for dialogue. The default behavior is TRUE.
void SetOrientOnClick( object oCreature = OBJECT_SELF, int nState = TRUE );


Figures. I still think that Osidian should give all the xbox users a "Free" DVD of KotorII with all this fixed!:mad:

but that's just me
 tk102
03-03-2005, 9:36 AM
#22
Note this problem appears to still be present in non-US versions of the game. If you are trying to compile scripts and are getting nwscript.nss error messages and you have a non-US version, please follow the instructions listed in the first post of this thread or use the following fixed copy of nwscript.nss:
 Lorden Darkblade
03-03-2005, 10:03 AM
#23
I have the US version, but the errors I get when compiling are more then that.
Well I don't know much about scripting but I don't think that just that line could cause all the errors I see.
I sent Darth333 the log of it, ask her about it please tk102.
Tho I could compile the script I wanted, but there were several errors in my nwscript.nss even when I used Darth333's one I had issues, of course if you want I can send you my nwscript.nss.
 Darth333
03-03-2005, 10:24 AM
#24
Originally posted by Uchiha Itachi
I have the US version, but the errors I get when compiling are more then that.
Well I don't know much about scripting but I don't think that just that line could cause all the errors I see.
I sent Darth333 the log of it, ask her about it please tk102.
Tho I could compile the script I wanted, but there were several errors in my nwscript.nss even when I used Darth333's one I had issues, of course if you want I can send you my nwscript.nss.
You were compiling nwscript. Use the batch file provided in the "How to compile scripts" tutorial (it should work now) or use the following command:nwnnsscomp -v1.00 myscript.nss

edit: when you use nwnnsscomp -c *.nss you are compiling all the .nss files in your folder. If you want to compile them all without compiling nwscript.nss, you have to use the batch file made by tk.
 Lorden Darkblade
03-03-2005, 10:58 AM
#25
I can only do like this:

nwnnsscomp -c myscript.nss

Cuz if I do with one of the ways you said I get that weird error that only says the version of the nwnnsscomp.
And with the bat file it says its compiled but it is nowhere in the folder.
 Fred Tetra
03-03-2005, 6:08 PM
#26
I've been working more on the compiler, and I now have it set up so you can either:

1) put the desired nwscripts.nss in the same folder as the compiler (just as always)

2) specify an explicit path to the nwscript.nss file

3) specify the game version via a command line switch (-g = 0 or 1, meaning K1 or K2), which allows, in order of precedence:

(a) the compiler to read the file from override\nwscript.nss for the specified game, if it exists there

or

(b) the compiler to read the file from scripts.bif for the specified game

These extra options should cover alll of the possibilities, don't you think? Or have I missed something?
 Darth333
04-26-2005, 9:53 PM
#27
In order to update the "How to compile scripts" tutorial, I was wondering if, for international versions, nwscript.nss has been fixed with the latest patch? Can someone verify pleeeeease? :)
 Ayatus
04-27-2005, 7:33 AM
#28
I confirm, for the French version, nwscript.nss has been fixed with the latest patch.
 Darth333
04-27-2005, 9:37 AM
#29
Merci! That will make things much simpler for a lot of people.
Page: 1 of 1