Jump to content

Home

Make players choose jedi classes of companions?


Recommended Posts

I want to make players being able to choose the jedi class each companion evolves into by themselves, is that even possible? If so, what would have to be done for that?

 

Do you mean if the player speaks to the party member, he can choose the class for him/her? If so, then here's a script:

void main()
{
AddMultiClass( CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("Mission"));

}

 

You can change the "CLASS_TYPE_JEDIGUARDIAN" line to these:

CLASS_TYPE_JEDIGUARDIAN

CLASS_TYPE_JEDICONSULAR

CLASS_TYPE_JEDISENTINEL

CLASS_TYPE_SOLDIER

CLASS_TYPE_SCOUT

CLASS_TYPE_SCOUNDREL

CLASS_TYPE_MINION

CLASS_TYPE_EXPERTDROID

CLASS_TYPE_COMBATDROID

 

And you can change Mission to the name of the party member.

Link to comment
Share on other sites

I mean that the one time a character becomes a jedi, the player get's to choose which class, like you could choose your own jedi class in K1. I'm not sure if your script does that, it seems way too short for me. Also, where would I add it?

 

The script I wrote adds another class to a party member, so if you only want to give your party member a new jedi class, this wroks.

 

To activate it in a converstaion, write the name of the compiled script in the "script fires when spoken" box in the dlg editor. For further information about dialogs, see this thread:

http://lucasforums.com/showthread.php?t=180845

Link to comment
Share on other sites

I think I get it now. Could someone please mail me a save where you can turn the Handmaiden into a jedi right away? My e-mail address is gijgorev{at}googlemail{dot}com.

Thanks in advance!

 

Edit: The conditionals in .dlg files, do they have to be declared somewhere or can I just add my own ones without further ado?

Link to comment
Share on other sites

I imagine you'd have to find the script that gives them the classes in question in the first place to see what it does.

 

If I understand you correctly, you want to choose which class your party members get when you turn them into a Jedi in TSL? So instead of Atton always getting Jedi Sentinel, you could choose.

Link to comment
Share on other sites

Yes, exactly. Derived from the script DathDac posted, I came up with this:

 

// This global script is intended to be used for making each CNPC a Jedi.
/* Parameter Count: 2 (Which CNPC you intend to make a Jedi. / Which Jedi class to apply.)

NPC numbers, as specified in NPC.2da
0       Atton
1       BaoDur
2       Mand
3       g0t0
4       Handmaiden
5       hk47
6       Kreia
7       Mira
8       T3m4
9       VisasMarr
10      Hanharr
11      Disciple

Class Numbers, as specified in classes.2da
3	CLASS_TYPE_JEDIGUARDIAN
4	CLASS_TYPE_JEDICONSULAR
5	CLASS_TYPE_JEDISENTINEL

*/

//// Andrei Gijgorev 26-05-09

void main()
{
// Grab the Parameters.
int nNPCNumber = GetScriptParameter(1);	 
int nClassNumber = GetScriptParameter(2);

// If Param = 0, then it's Atton. (Trying to make it consistent with the CNPC integers.)
if(nNPCNumber == 0)
{
	// Params as defined above (Trying to make it consistent with the classes integers.)
	if(nClassNumber == 3) AddMultiClass(CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("Atton"));
	else if(nClassNumber == 4) AddMultiClass(CLASS_TYPE_JEDICONSULAR, GetObjectByTag("Atton"));
	// Default class in case something went wrong.
	// else if(nClassNumber == 5) AddMultiClass(CLASS_TYPE_JEDISENTINEL, GetObjectByTag ("Atton"));
	else AddMultiClass(CLASS_TYPE_JEDISENTINEL, GetObjectByTag("Atton"));
}

// If Param = 1, then it's Bao-Dur. (Trying to make it consistent with the CNPC integers.)
if(nNPCNumber == 1)
{
	// Params as defined above (Trying to make it consistent with the classes integers.)		
	if(nClassNumber == 4) AddMultiClass(CLASS_TYPE_JEDICONSULAR, GetObjectByTag("BaoDur"));
	else if(nClassNumber == 5) AddMultiClass(CLASS_TYPE_JEDISENTINEL, GetObjectByTag("BaoDur"));
	// Default class in case something went wrong.
	// else if(nClassNumber == 3) AddMultiClass(CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("BaoDur"));
	else AddMultiClass(CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("BaoDur"));
}

// If Param = 4, then it's the Handmaiden. (Trying to make it consistent with the CNPC integers.)
if(nNPCNumber == 4)
{
	// Params as defined above (Trying to make it consistent with the classes integers.)		
	if(nClassNumber == 4) AddMultiClass(CLASS_TYPE_JEDICONSULAR, GetObjectByTag("Handmaiden"));
	else if(nClassNumber == 5) AddMultiClass(CLASS_TYPE_JEDISENTINEL, GetObjectByTag("Handmaiden"));
	// Default class in case something went wrong.
	// else if(nClassNumber == 3) AddMultiClass(CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("Handmaiden"));
	else AddMultiClass(CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("Handmaiden"));
}

// If Param = 7, then it's Mira. (Trying to make it consistent with the CNPC integers.)
if(nNPCNumber == 7)
{
	// Params as defined above (Trying to make it consistent with the classes integers.)
	if(nClassNumber == 3) AddMultiClass(CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("Mira"));
	else if(nClassNumber == 4) AddMultiClass(CLASS_TYPE_JEDICONSULAR, GetObjectByTag("Mira"));
	// Default class in case something went wrong.
	// else if(nClassNumber == 5) AddMultiClass(CLASS_TYPE_JEDISENTINEL, GetObjectByTag ("Mira"));
	else AddMultiClass(CLASS_TYPE_JEDISENTINEL, GetObjectByTag("Mira"));
}

// If Param = 11, then it's the Disciple. (Trying to make it consistent with the CNPC integers.)
if(nNPCNumber == 11)
{
	// Params as defined above (Trying to make it consistent with the classes integers.)
	if(nClassNumber == 3) AddMultiClass(CLASS_TYPE_JEDIGUARDIAN, GetObjectByTag("Disciple"));
	else if(nClassNumber == 5) AddMultiClass(CLASS_TYPE_JEDISENTINEL, GetObjectByTag("Disciple"));
	// Default class in case something went wrong.
	// else if(nClassNumber == 4) AddMultiClass(CLASS_TYPE_JEDICONSULAR, GetObjectByTag("Disciple"));
	else AddMultiClass(CLASS_TYPE_JEDICONSULAR, GetObjectByTag("Disciple"));
}
}

//EOF

This script does work as planned, but the choice between the Jedi classes has to be implemented somewhere in the .dlg files. Now not only do I have to add dialogue nodes, I also have to add entries in the dialog.tlk, which is a bit much for such a little mod. Also, most dialogues where NPCs become Jedi already include the name of the class ("blah has taken his first step to become a Jedi Consular blah") or lack a place where the choice would fit in. Regarding the Disciple, the best place for the choice would be right after "I want you to teach me the ways of the Force. To become a Jedi Knight, what I meant to be", since from that point on it's only "the Force this" and "the Force that" without room for anything else. So I have to set up some booleans and check them later, but I don't know what the lines should look like in the game. Should it be something like "I shall now train you in the ways of a Jedi Consular" or just "[Jedi Consular]"?

Link to comment
Share on other sites

Now not only do I have to add dialogue nodes, I also have to add entries in the dialog.tlk, which is a bit much for such a little mod.

 

You have to? I did a mod with this script and I didn't do anything with dialog.tlk. It was for K1 though. I don't know if TSL requires .tlk editing but K1 doesn't:)

 

Should it be something like "I shall now train you in the ways of a Jedi Consular" or just "[Jedi Consular]"?

 

It is better and more realistic if the player actually says something. So I think you should make something like what you mentioned:

"I shall now train you in the ways of a Jedi Consular"

Link to comment
Share on other sites

Well, since this line isn't anywhere in dialog.tlk (at least I think it isn't), I'll have to add it, unless of course you know a method that allows me to add dialogue lines in TSL without adding them to dialog.tlk.

 

BTW, I can't find Mira's dialogue to turn her into a jedi. Is it in another .dlg file?

Link to comment
Share on other sites

BTW, I can't find Mira's dialogue to turn her into a jedi. Is it in another .dlg file?

 

Well it should be in Mira's basic .dlg file but if it isn't there, try searching it in Nar Shadaa .dlg files.

 

Well, since this line isn't anywhere in dialog.tlk (at least I think it isn't), I'll have to add it, unless of course you know a method that allows me to add dialogue lines in TSL without adding them to dialog.tlk.

 

As I said I don't know if TSL requires this, but I could do it in K1 without touching dialog.tlk

Link to comment
Share on other sites

Well, since this line isn't anywhere in dialog.tlk (at least I think it isn't), I'll have to add it, unless of course you know a method that allows me to add dialogue lines in TSL without adding them to dialog.tlk.

 

You can store the text of the dialog nodes directly in the DLG file without having to place them in the TLK file.

 

If you use tk102's DLG Editor it will do this for you automatically, which I'd recommend using unless you have a compelling reason not to, since it makes things a lot quicker and easier. :) If you're using a GFF editor you set the StrRef to -1 in the ExoLocString field and then add language specific substrings to that struct or list, if I remember correctly (been a while since I was last looking at that.)

Link to comment
Share on other sites

It works, thanks a lot. You probably also happen to know how I can set up and check booleans in a .dlg without specifying them in some global array, right?

 

EDIT: Actually, scrap the last part. I just found out that those "conditionals" aren't booleans at all, but scripts / functions that return booleans. Oh well...

 

EDIT2: How can I check whether a character belongs to a certain class? My first thought was something along the lines of "return GetLevelByClass(CLASS, NPC);", but since any convertable npc starts off without jedi class levels this can't work. Any ideas?

 

EDIT3: Nevermind, GetClassByPosition() did the trick.

 

If anyone happens to have vanilla (or nearly-vanilla) savegames where you can turn party members into jedi right away, please mail them to gijgorev{at}googlemail{dot}com. So far, only the disciple has been tested:

 

Show spoiler
(hidden content - requires Javascript to show)
adjec0zxaa.jpg
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...