Jump to content

Home

Simple Scripting help


JuniorModder

Recommended Posts

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

Link to comment
Share on other sites

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, " [color="Red"]character.utc file[/color]", Location(Vector(28.78271, (-33.75924), 10.00148), [color="red"]character faceing direction in degrees[/color] 0-360), 0);
}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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);
}

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...