PDA

View Full Version : NOOB QUESTION: How do I add a character to TSL?


JuniorModder
09-24-2009, 12:32 PM
I want to test out a character, but don't know how to add him into the game. He is not reskinned or anything and is not a recruitable npc. just a baddie that a want to see. He is a force zombie. I don't really care where he is put, but I do want to know where he is. Can somebody help me? Thx!

Queen of Night
09-24-2009, 02:53 PM
Are you busy yourself with the tutorials available here? Most are well explained.

Giant Graffiti
09-24-2009, 02:59 PM
From the "Frequently used script functions topic":

How can I create an object right next to me?
// same OBJECT_TYPEs as above

CreateObject( OBJECT_TYPE_CREATURE,
"object_template", GetLocation(GetFirstPC()));
Your object's template would go in the "object_template" section. Example: if your template's name is "grue01" you would put that there. This script can easily be attached to the end of any dialog.

Be sure to read this topic (http://lucasforums.com/showthread.php?t=143390) for an introduction to scripting.

JuniorModder
09-24-2009, 03:09 PM
From the "Frequently used script functions topic":


Your object's template would go in the "object_template" section. Example: if your template's name is "grue01" you would put that there. This script can easily be attached to the end of any dialog.

Be sure to read this topic (http://lucasforums.com/showthread.php?t=143390) for an introduction to scripting.

So the template for file could be n_forcezomb01.uct? Sorry, I pretty new to this :confused:.

And also, when I have the script all finished, would I put it in a dlg file or something? How would I get it to activate?

Giant Graffiti
09-24-2009, 03:43 PM
So the template for file could be n_forcezomb01.utc?
The template is the filename without the .utc, so it would be n_forcezomb01.

Sorry, I pretty new to this.
Don't worry, I'm sure all of us here have been at the stage that you're at. :)

And also, when I have the script all finished, would I put it in a dlg file or something? How would I get it to activate?
After you name the script and have it compiled, open up any dialog file, for this example I'll use Bao-Dur's default dialog. It's found in BIFs>dialogs.bif>Dialog>baodur.dlg. Save that somewhere on you computer and open it with DLGEditor. Press F10 to search and find the listing for "Never mind.", after finding it put the name of your script in this part (http://img401.imageshack.us/img401/3907/pic1e.png) (in my case that would be "spawn_grue"). After that put your compiled script and the edited dialog in your override folder. Start up the game and talk to Bao-Dur, choose the "Never mind." option. If everything went correctly, you should have spawned an NPC.

EDIT: Force Zombies are enemies, so be prepared ready to fight.

JuniorModder
09-24-2009, 04:25 PM
Okay, now I have my line of dialog ready for the ncs file, but I can't get either of the script compilers at http://www.starwarsknights.com/tools.php to work. And I the nwnnss compiler says I need NWN Explorer to extract the files, but the website it suggests, www.torlack.com doesn't work. Is there another way to compile my script?

Star Admiral
09-24-2009, 04:53 PM
"doesn't work" as in the compiler doesn't start, or "doesn't work" as in the script has problems? Could you post the script that you're using?

- Star Admiral

JuniorModder
09-24-2009, 05:07 PM
The nwnnss compiler opens for like a millisecond and then closes before a can read it. And there is no readme to tell me what to do with it. In the one called Kotor compiler, when I click on the nwnnsscomp exe, the same thing as above happens. And when I click on the _CompileAll exe, it opens, but it says

Unable to locate or open Neverwinter Night

C:\BlaBlaBLa\Downloads\kotorcomp>pause
Press any key to continiue . . .

The script it self, I wrote in plain old notepad:

// same OBJECT_TYPEs as above

CreateObject( OBJECT_TYPE_CREATURE,
"n_forcezomb01", GetLocation(GetFirstPC()));

Giant Graffiti
09-24-2009, 06:47 PM
^^^

Just a note, you'll need brackets, so it would actually be:

void main(){

CreateObject( OBJECT_TYPE_CREATURE,
"n_forcezomb01", GetLocation(GetFirstPC()));
}

Also, I would suggest using KotOR tool's own script compiler. You can see it near the top, it's the "TXT" button.

JuniorModder
09-24-2009, 09:27 PM
This is so frustrating! I open the txt file spawn_forcezomb01, where the script is located, in the KOTOR tool script compiler, and I get the error: Unable to open imput file "C:\Program Files\LucasArts\SWKotOR2\Override\spawnforcezomb". I have added new node that says "spawn" in T3's dialog that SHOULD spawn the force zombie beside the PC, but when I select "spawn" in the game, nothing happens!

Star Admiral
09-24-2009, 10:49 PM
Did you save the spawn_forcezomb01 script as a .nss file? Compilers don't like compiling .txt files.

- Star Admiral

JuniorModder
09-25-2009, 11:55 AM
How do I save it as an nss file? My only option was txt.

JuniorModder
09-26-2009, 10:23 PM
1: Sorry for doubleposting, but it's been awhile since someone has posted.
2:Is it considered spam here to bump topics?

Exile007
09-26-2009, 10:55 PM
^yes, and yes. :p

But just change the file save type to all types. Then add the .nss end. ;)

stoffe
09-27-2009, 03:40 AM
How do I save it as an nss file? My only option was txt.

NSS files are text files, just with a different file extension to mark them as NWScript Source code files. So you should be able to just type in .NSS as the file extension when saving, usually. Not using KotorTool when doing scripts so I don't know if it forces the file extension to txt, but I doubt it. If it does you can just change it manually in the Windows Explorer so the compiler will accept it.


This is so frustrating! I open the txt file spawn_forcezomb01, where the script is located (...snip...)

Also, that file name is too long. The name of a resource file can be at most 16 characters long (not counting the file extension), while spawn_forcezomb01 is 17 characters.

JuniorModder
09-27-2009, 01:51 PM
YEEEAAAHHH!!! It worked!

I'm so happy!! Thanks so much!

But I do have a question. Why is the spawn_forcezomb an .nss file when all of the other scripts are .ncs?

EDIT: Now it's not working. :( In the game, when I talk to T3, I get the error: Last conversation node contains either an end node or continue node. Please contact designers!

I looked in the dlg file, and can't find anything wrong!

I have created two replies for T3,

SPAWN ZOMBIE [Already Listed], which would fire "spawn_forcezomb01"
and
SPAWN TENNETH [Already Listed] (Tenneth is my custom character) which would fire "spawn_tent"

And the lines are not already listed! I want to end the dialog after you select that line! I am so confused! :(

stoffe
09-27-2009, 05:02 PM
Also, that file name is too long. The name of a resource file can be at most 16 characters long (not counting the file extension)


SPAWN ZOMBIE [Already Listed], which would fire "spawn_forcezomb01" (17)


:dev8:


But I do have a question. Why is the spawn_forcezomb an .nss file when all of the other scripts are .ncs?

EDIT: Now it's not working. :( In the game, when I talk to T3, I get the error: Last conversation node contains either an end node or continue node. Please contact designers!

NSS files are script source code. These aren't used by the game for anything; they're used by designers/modders to write scripts in a more human-readable manner. In order for the game to use the script it must be compiled into a .NCS bytecode file.

As for the dialog error, make sure all dialog branches that should exit dialog end with a reply node (put one without any text in it if the player isn't going to get the last word in).

JuniorModder
09-27-2009, 10:32 PM
Okay this is ridiculous. I can't get anything to work.
I made sure all of the dialog branches that exit dialog ended with a reply node. That fixed that problem. But nothing happens when I select the custom lines of dialog.

The lines of dialog and corresponding scripts located in t3m4.dlg:

SPAWN ZOMBIE (already listed) Script 1: spawn_forcezomb

SPAWN TENNETH (already listed) Script 1: spawn_tent


The actual scripts (without quotes of course):


spawn_forcezomb:
void main(){

CreateObject( OBJECT_TYPE_CREATURE, "n_forcezomb", GetLocation(GetFirstPC()));
}

spawn_tent
void main(){

CreateObject( OBJECT_TYPE_CREATURE, "p_tent", GetLocation(GetFirstPC()));
}

And I deleted the ; that came at the end of both scripts, bc in kotor tool, I would get an error on the line of the ; .

And in my override folder are

p_tent.uct (The uct file for my new character)

tenneth.dlg (My new characters global dlg)

spawn_tent.ncs and spawn_tent.nss

The edited t3m4.dlg

spawn_forcezomb.ncs and spawn_forcezomb.nss

Now! What am I doing wrong!?!