Jump to content

Home

Scripting question.


LoneFerret

Recommended Posts

Hullo again!

Got a question about scripting. I haven't done it in a while (not since Morrowind III Elderscrolls was it?), let's just say it's been a while. I've been

checking in the scripting forum, and I still got a few quesitons.

What I'm having troubles with which files to edit, where to place them

where to get them etc.

Downloaded NWNLexicon, very helpfull.

So what I'm looking for is just a simple script to which I can play with so as to

get the feel of the enviroment.

For now I would like just to add a NPC(any character would do) some where, have him walk up to me

when I'm within a certain distance from sed character and have him talk to me. I'll fugure out the rest. And post another question if need be. :ears1:

 

Thanx

:coffee:

 

 

LoneFerret

_____________________________________

'Human. It's kinda like Sebacean, but we haven't conquered other worlds yet,

so we just kick the crap out of each other.'

John Crichton

Farscape

Link to comment
Share on other sites

Ok... this is gonna sound stupid, I try and compile a script using the instructions in the

readme for TSL.. HAve te nwscript.nss in the same folder as nwnnsscomp.exe and my

own script.

run this command-> nwnnsscomp -co test.nss

and I get this...

 

'Star Wars: Knights of the Old Republic' Script Compiler/Decompiler

based on 'NeverWinter Nights' Script Compiler/Decompiler

Copyright 2002-2003, Edward T. Smith

Modified by Hazard (hazard_x@gmx.net)

 

Unable to locate or open Neverwinter Night <------WTF?

 

I know it's based on Neverwinter Night... but....

 

Can someone tell me what I'm missing???

 

Thx...

 

LoneFerret

_________________________________

I got nothing right now...

Link to comment
Share on other sites

You need to go to Fred Tetra's website and download his version of nwnnsscomp as it is setup to handle both K1 & K2 and has full instructions in the readme. I would also recomend downloading either my NSSEditor or using Fred's script editor in KT. Either way that way you have some more feature enriched methods of scripting. I keep trying to get the time to get back to working on the version 1.1 of NSSEditor as one of the tasks I'm trying to get done is to integrate full fledged compiler capability. Currently you need Freds version of nwnnsscomp available to use it.

Link to comment
Share on other sites

Thank Darkkender.. now I have another problem...

I'm trying to compile an nss file and it's giving me a nwscript.nss compile error.

I've read the thread on this, the changes are made "object oCreature=OBJECT_SELF" is there...

And it's giving me LOTS of errors when it tries to compile the script.

This is without the fact that I still don't know where to start.. there seems

to be many files to modify,create etc. All I'm trying to do start small...

Spwan a character (any character) in front of me. Got the coord. with the

whereami armband (great little thing :D )

But something tells me compiling the nss is not the only thing I have to do, and reading

the tutorials in the scripting section of the forum is not helping me much

(as you can see, I got one of the tutorial scripts here)

 

void main(){

float x=239.71643f; //Here is where you add the 'whereami' cheat coordinate 1.

float y=273.73050f; //Here is where you add the 'whereami' cheat coordinate 2.

float z=111.36278f; //Here is where you add the 'whereami' cheat coordinate 3.

float r=31.60764f; // This is where you set the orientation of the placeable, set in degrees.

vector MyVec = Vector(x,y,z); //line 1

location MyLoc = Location(MyVec, r); //line 2

CreateObject( OBJECT_TYPE_CREATURE, "g_dark_jed01", MyLoc);

}

 

So let's say the script is ok (probably ain't but anyway) is there anything else,

I have to do. Right now my in game character is on the surface of Telos, I

just got Bao Dur in my party. Do I have to mention the planet I'm on?

 

So can anyone help me fill in the gaps, push me in the right direction?

I'm sorry to say this question has probably allready been awnsered, but the

tuts in the forum right now aren't doing it for me :( Sorry

 

 

LoneFerret

_____________________________

screw it...

Link to comment
Share on other sites

Is there anybody out there that can help me here on this scripting thing?

As I mentionned, I have no problems with the language, it's basically a lower

form of C/C++ (more C++) anyways.... it's all the, edit this file, change this

and that in kotor tool, file extensions from here to timbuck-too... ahg... i'm

going crazy...ROFL

 

I've gone thru almost every tutorial here, still trying to do something simple.

Add a character (let's say a tweilek, tweelek) in the area where we first meet

Bao Dur... That's it! LOL

Another thing, I compile a script using nwssnncomp.exe and this string of

errors scrolls up in the cmd window. It still gives me a .ncs... but how can I

trust it with all those compile errors? I have the nwscript.nss patched like

it says in the thread (before someone asks :D )

I ain't blaming the tuts on this board, its just.. I don't know, like the star-map.

It's seems to be a quest... And between you and me, the DS points are starting

to add up... ROFL

Thanks...

 

LoneFerret

_________________________________

Cmd LoneFerret 108Dragons, Rogue Spear

Link to comment
Share on other sites

LF,

 

You do know you have to have the game run your script somehow, either when a line of dialoge is spoken, a cutscene is run, a pre-existing game script is fired, or when the module loads... this is the first thing you need to do even before making a spawn script, you need a way for the game to run it. ;)

Link to comment
Share on other sites

You do know you have to have the game run your script somehow,

either when a line of dialoge is spoken, a cutscene is run, a pre-existing

game script is fired, or when the module loads... this is the first thing you

need to do even before making a spawn script, you need a way for the game to run it.

 

Thanks RedHawke,

I know i need a trigger to fired up the script.

I'm following this tut here:

http://www.lucasforums.com/showthread.php?t=143536

 

Correct me if I'm wrong somewhere, please add or remove

any steps... :D

I choose the dialog on the Telos surface when we first meet

Bao Dur. Which I found with KTool here:

ERFs/Modules/231TEL_dlg.erf/2/231sntry.dlg

So I open it up and type in the "Script to run this node" field

the name of my script. Which is the one used in the tut above. Right?

my.php?image=scripthelp9bu.jpg

 

Ok, now I get the footlocker, remove any scripts attached to it using

KTool, change templateresref/resref rename it footlocker99 and

save the file as footlocker99.utp

 

Compile script and this happens:

my.php?image=compile1us.jpg

 

I've made the changes in the nwscript.nss posted on

http://www.lucasforums.com/showthread.php?t=146472

 

So can anyone, tell me what I'm missing? Doing wrong? Forgetting?

Thanks... :D

 

LoneFerret

__________________________________

Picked the wrong week to quite coffee...

Link to comment
Share on other sites

Looks to me your compile errors are coming from nwscript.nss itself and not your script you made... looks to me like you need to fix the nwscript.nss file.

 

Also you cannot use KotOR Tool's dialogue editor on TSL dialogues, you need to use tk102's Dialogue editor available on the tools page on StarWarsKnights page. TSL's dialogue files have fields that KT cannot handle yet.

Link to comment
Share on other sites

Hello there,

Thanks for all replies..

 

 

stoffe -mkb-:

I don't have an #include in the top of my script. I'm using an example from

RedHawke's thread on how to spawn object, creatures and placables.

 

Emperor Devon & RedHawke:

Thanks, thought I saw somewhere that I could, I'll check into getting

the proper utility.

 

Looks to me your compile errors are coming from nwscript.nss itself and not your script you made... looks to me like you need to fix the nwscript.nss file.

Well I know that! LOL Seriously, I got the nwscript.nss from this forum, it

has the fix mentionned on the thread.. near line 5710 etc. Wanted to know

if anyone else had errors like this... Are there any known scripting errors in this

file?

 

Thanks,

 

LoneFerret

________________________________

..and maybe someday, I'll script for TSL too...

Link to comment
Share on other sites

Ferret,

 

Make sure of the following:

1. save nwnnsscomp.exe in the SWKOTOR2 override directory

2. save nwscript.nss in the SWKOTOR2 override directory

3. goto the command prompt and switch directories to swkotor2/override

4. use the command nwnnsscomp -c -g 2 test.nss

 

That should compile fine. The only time I have seen the errors where it can looks for a Neverwinter Knights path is when KOTOR is not installed on your machine.

 

BTW, I have never fooled with changing the nwscript.nss and I have compiled tons of scripts using the above steps.

Link to comment
Share on other sites

Thanks beancounter,

I'll try that.. Stupid question, but I only have KOTOR2 installed on my comp.

I don't need KOTOR1... right? :D I'm turning red just asking, but with all the little

problems i've been getting try to do this... well, better ask

 

LoneFerret

 

p.s: it's been a while since someone called me "ferret", my old Rogue Spear clan

used to call me that... LOL ah.. the memories....

Link to comment
Share on other sites

Thx to all, I seem to be able to compile a script now. But I noticed something, wanted some input. When I compile a script from the command line like this:

-> nwnnsscomp -c -g 2 *.nss

If the nwsript.nss is in the same folder, I get several 100 errors.

If nwscript.nss is not there, all is well.

I read somewhere that I need nwsript.nss in order to script for TSL. When exactly do I need the nscript.nss and do I need to compile this file with my script?

 

Thanks again, and some day I'll stop asking question.. :D

 

 

LoneFerret

Link to comment
Share on other sites

Using the command *.nss will compile all the scripts in the directory - including nwscript.nss. It is much better to compile only the file that you want to compile, especially in the begining when you are trying to get the hang of things. You should give the exact program name in the compile command.

 

You do not need to compile nwscript.nss to execute your program.

Link to comment
Share on other sites

OMG..

Thx to all, well it works now. Having fun spawing stuff in different ways to see how it all works together... Even spawn a droid using an armband, then with the dialog ed.

 

Thank you for all your help, it shall not be forgotten.. and will probably be needed sometime in the near futur... :D

 

LoneFerret

 

p.s Can someone send me some saved games from various spots in the game? i kinda deleted mine.. :(

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...