Jump to content

Home

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


JuniorModder

Recommended Posts

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 for an introduction to scripting.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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, http://www.torlack.com doesn't work. Is there another way to compile my script?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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! :(

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!?!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...