PDA

View Full Version : Simple Scripting help


JuniorModder
11-16-2009, 07:44 PM
I am trying to recruit a custom character. I want to create him at a specific location when the PC enters the module.

I did the warp band, and I don't understand any of it.

Module: 502ond

> 28.78271

> -33.75924

> 10.00148

> XOrientation: -0.24490

> YOrientation: -0.96955

> Bearing: -1.81821

Now, how do I spawn a character there?

I did look through the forums!! I did try before posting, but I am very lost..

JuniorModder

DarthStoney
11-16-2009, 10:04 PM
I am trying to recruit a custom character. I want to create him at a specific location when the PC enters the module.

I did the warp band, and I don't understand any of it.

Module: 502ond

> 28.78271 x coordinates

> -33.75924 y coordinates

> 10.00148 z coordinates

> XOrientation: -0.24490

> YOrientation: -0.96955

> Bearing: -1.81821

Now, how do I spawn a character there?

I did look through the forums!! I did try before posting, but I am very lost..

JuniorModder

here is a simple spawn script

void main() {
CreateObject(1, " character.utc file", Location(Vector(28.78271, (-33.75924), 10.00148), character faceing direction in degrees 0-360), 0);
}

JuniorModder
11-17-2009, 01:03 PM
No dice..

Here is what I put:

void main() {
CreateObject(1, " p_tenneth ", Location(Vector(28.78271, (-33.75924), 10.00148), 0), 0);
}

And I can't get the script to compile!! Using kotortool, I get this error

Lookup path root set to: C:\Program Files\LucasArt\SWKotOR2\
Loaded nwscript.nss from C:\Program Files\LucasArt\SWKotOR2\override/
Error: Unable to open input file "BLABLABLA..spwntent.txt"

???

JuniorModder

DarthStoney
11-17-2009, 01:15 PM
do you have a copy of nwscripts.nss in your override folder? Just extract the one with Ktool into your override if you don't.

JuniorModder
11-17-2009, 01:23 PM
I have it in my override, but it still screws up.

JuniorModder

DarthStoney
11-17-2009, 01:40 PM
The only think I can think of ,is do you have p_tenneth.utc in your override folder?

JuniorModder
11-17-2009, 01:50 PM
Yea... Well maybe I'm doing something wrong in-game. Can I warp there and he will still spawn?

JuniorModder

ForeverNight
11-17-2009, 02:06 PM
No.

Error: Unable to open input file "BLABLABLA..spwntent.txt"

What is the EXACT name used there as opposed to BLABLABLA..spwntent.txt?

Also, it's been awhile since I've done any scripting, but I'm pretty sure it should be spwntent.nss not .txt

What script compiler are you using? KotOR Tool or what?

JuniorModder
11-17-2009, 02:12 PM
Well I typed the code in txt, then tried to compile it.

BLABLABLA is just the location of the file. Ya know "My Documents"?

JuniorModder

JuniorModder
11-17-2009, 02:13 PM
Well I typed the code in txt, then tried to compile it.

BLABLABLA is just the location of the file. Ya know "My Documents"?

JuniorModder

DarthStoney
11-17-2009, 02:13 PM
Try this and see if it wil compile,aslo you have to execute the script from something in order for him to spawn,or you can edit the module .git file which he will be there without a script.
void main() {
CreateObject(OBJECT_TYPE_CREATURE, " p_tenneth ", Location(Vector(28.78271, (-33.75924), 10.00148), 0), 0);
}

JuniorModder
11-17-2009, 06:41 PM
aslo you have to execute the script from something in order for him to spawn,or you can edit the module .git file which he will be there without a script.
\

I will try that, but first, how do I do that exactly?

JuniorModder

DarthStoney
11-17-2009, 11:02 PM
this may be of some help.http://lucasforums.com/showthread.php?t=185991&highlight=anatomy , you'll want to add your new character to the "Creatures list" of the .git file for your module. The easiest way is to copy an existing one and paste it as new and edit the x,y,and z coordnants. make sure to edit the TemplateResRef to match your character.

ForeverNight
11-17-2009, 11:54 PM
However, if it's for a mod, scripts are so much nicer than .mod files.

Anyway, try using KotOR Tool's built in Script Compilier as opposed to Notepad + NWNSC It's in the latest release prior to Fred's departure.

If it's for a mod don't forget a SOURCE folder, save all your .nss files there, makes life easier :xp: