lfnetwork.com mark read register faq members calendar

Thread: Scripting question.
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 11-19-2005, 01:17 PM   #1
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
Question Scripting question.

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.

Thanx



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
LoneFerret is offline   you may: quote & reply,
Old 11-20-2005, 01:08 AM   #2
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
Well, you are in luck LF! We have a whole Forum full of sample scripts and tutorials, you can also look at this Forum as well it has some tidbits about scripting and NPC's, I believe what you want to do is in there.


"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 11-20-2005, 01:23 AM   #3
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
Cheers mate! This board is so big, it's hard sometimes to narrow things down.
I'll check it out

LoneFerret
__________________________________
Running out of Farscape quotes!
LoneFerret is offline   you may: quote & reply,
Old 11-20-2005, 11:44 AM   #4
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
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...
LoneFerret is offline   you may: quote & reply,
Old 11-20-2005, 11:53 AM   #5
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 
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.


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 11-20-2005, 02:38 PM   #6
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
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 )
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...
LoneFerret is offline   you may: quote & reply,
Old 11-20-2005, 09:42 PM   #7
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
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 )
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
LoneFerret is offline   you may: quote & reply,
Old 11-21-2005, 02:43 AM   #8
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
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.


"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 11-21-2005, 09:25 AM   #9
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
Quote:
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...
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?


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:


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

LoneFerret
__________________________________
Picked the wrong week to quite coffee...
LoneFerret is offline   you may: quote & reply,
Old 11-21-2005, 10:00 AM   #10
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
hmmm.. for some reason, I can't edit my post. It crashs my IE ....

Last edited by LoneFerret; 11-21-2005 at 10:37 AM.
LoneFerret is offline   you may: quote & reply,
Old 11-22-2005, 12:27 AM   #11
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
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.


"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 11-22-2005, 01:12 AM   #12
Emperor Devon
36 Wings, 365 Eyes
 
Emperor Devon's Avatar
 
Join Date: Oct 2004
Posts: 5,479
Current Game: Ass Effect
Contest winner - Fan Fiction 
To add onto what RedHawke said, you can't use KOTOR tool's dialogue editor for either game.


Quote:
Originally Posted by Sabretooth
We will be great failures one day, you and I
Emperor Devon is offline   you may: quote & reply,
Old 11-22-2005, 01:50 AM   #13
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
Quote:
Originally Posted by Emperor Devon
To add onto what RedHawke said, you can't use KOTOR tool's dialogue editor for either game.
KT's dialogue editor works fine in KOTOR I... just not in TSL.


"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 11-22-2005, 01:51 AM   #14
Emperor Devon
36 Wings, 365 Eyes
 
Emperor Devon's Avatar
 
Join Date: Oct 2004
Posts: 5,479
Current Game: Ass Effect
Contest winner - Fan Fiction 
Really? I tried editing some dialogue with it once, and it screwed up.


Quote:
Originally Posted by Sabretooth
We will be great failures one day, you and I
Emperor Devon is offline   you may: quote & reply,
Old 11-22-2005, 06:21 AM   #15
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by LoneFerret
Compile script and this happens:
Make sure you don't have any line that looks like...
Code:
#include "nwscript"
...in your script, or compile errors like the above will happen.

stoffe is offline   you may: quote & reply,
Old 11-22-2005, 07:06 AM   #16
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
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.

Quote:
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...
LoneFerret is offline   you may: quote & reply,
Old 11-22-2005, 09:07 AM   #17
beancounter
Rookie
 
Join Date: Jul 2004
Posts: 169
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.
beancounter is offline   you may: quote & reply,
Old 11-22-2005, 09:12 AM   #18
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
Thanks beancounter,
I'll try that.. Stupid question, but I only have KOTOR2 installed on my comp.
I don't need KOTOR1... right? 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....
LoneFerret is offline   you may: quote & reply,
Old 11-22-2005, 02:27 PM   #19
Darth InSidious
A handful of dust.
 
Darth InSidious's Avatar
 
Join Date: Feb 2005
Location: The Eleven-Day Empire
Posts: 5,765
Current Game: KotOR II
For compiling, you can also use KT's Project Manager (dunno if you've already been told this - I use it for compiling cuz command prompt programmes don't like XP )



Works-In-Progress
~
Mods Released
~
Quid existis in desertum videre?
Darth InSidious is offline   you may: quote & reply,
Old 11-22-2005, 06:14 PM   #20
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
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..


LoneFerret
LoneFerret is offline   you may: quote & reply,
Old 11-22-2005, 07:23 PM   #21
beancounter
Rookie
 
Join Date: Jul 2004
Posts: 169
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.
beancounter is offline   you may: quote & reply,
Old 11-22-2005, 10:11 PM   #22
LoneFerret
Rookie
 
LoneFerret's Avatar
 
Join Date: Nov 2005
Location: Quebec City
Posts: 61
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...

LoneFerret

p.s Can someone send me some saved games from various spots in the game? i kinda deleted mine..
LoneFerret 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 > Holowan Laboratories > Scripting question.

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 08:23 PM.

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