Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

NPC help adding dialogue and equipting custom robes

Page: 1 of 1
 TheHiddenJedi
02-16-2010, 8:46 PM
#1
How do I add dialogue to a NPC?
I am currently working on a new recruitment mod and I need some help. I've created the head and created a special robe. All I need to do is add the robe and dialogue to my character, but I don't know how to add the dialogue or start him with equipped robes. Can someone please help me:confused:???
 harIII
02-16-2010, 9:17 PM
#2
You can equip a robe (any one at random) on him in Kotor Tool and then open the utc file up in the KGFF Editor. Look for the entry that has the robe equipped and replace it with the name of your new custom robe.

As far as the dialog, in the utc file, there is a field for the Dialog; just type in the name of the dialog file you have made/intend to make. At that point you'll have to open the conversation editor in Kotor Tool and type out what you want him to say.

If everything goes well you can play the game and talk to him. Note that conditional scripts and/or boolean will always be necessary for good recruitment mods.
 TheHiddenJedi
02-17-2010, 3:15 PM
#3
You can equip a robe (any one at random) on him in Kotor Tool and then open the utc file up in the KGFF Editor. Look for the entry that has the robe equipped and replace it with the name of your new custom robe.

As far as the dialog, in the utc file, there is a field for the Dialog; just type in the name of the dialog file you have made/intend to make. At that point you'll have to open the conversation editor in Kotor Tool and type out what you want him to say.

If everything goes well you can play the game and talk to him. Note that conditional scripts and/or boolean will always be necessary for good recruitment mods.

Thank you for replying to my thread, but sadly I'm still confused. How do I actually MAKE the diolgoue file?:confused:
 harIII
02-17-2010, 4:22 PM
#4
Open up Kotor Tool and in the upper left hand corner you'll see 4 buttons; click the one of the head. That is the Conversation Editor.

Where it says root, right click and click add.

There will be a box that pops up and that's where you write your dialog.

When you're done save it as a .dlg file in the override folder.
 Star Admiral
02-17-2010, 5:26 PM
#5
Alternatively, you can use tk102's DLGEditor available here (http://www.starwarsknights.com/tools.php). Works much the same way, but it can be used for TSL as well.

Welcome to the forums and happy modding. :) Word to the wise, might want to reduce the size of your sig before a moderator does it for you.

- Star Admiral
 TheHiddenJedi
02-17-2010, 8:11 PM
#6
Alternatively, you can use tk102's DLGEditor available here (http://www.starwarsknights.com/tools.php). Works much the same way, but it can be used for TSL as well.

Welcome to the forums and happy modding. :) Word to the wise, might want to reduce the size of your sig before a moderator does it for you.

- Star Admiral

Thanks for letting me know about the sig I just changed it to that lol didnt see how big it was till now. I was thinking the same thing when I saw it! :)

Edit: One more question I know I've asked alot, but thank you for answering them:thmbup1:. What do I name the script for It to show up?
Oh yeah and is my signature a good size now?

Edit 2: Alternatively, you can use tk102's DLGEditor available here (http://www.starwarsknights.com/tools.php). Works much the same way, but it can be used for TSL as well.

Welcome to the forums and happy modding. :) Word to the wise, might want to reduce the size of your sig before a moderator does it for you.

- Star Admiral

Also how do you add darkside, lightside, and influence to dialogue in TK102's DLGEditor?
 harIII
02-17-2010, 10:16 PM
#7
These should do the trick...

Light Side:

There are a few different options for this:
1 - Small amount of Light Side Point (just copy the code)
2 - Medium amount of Light Side Point (replace "LightSml" with "LightMed")
3 - Large amount of Light Side Point (replace "LightSml" with "LightHigh")
void main()
{
UT_LightSml(GetPCSpeaker());
}

Dark Side:

There are a few different options for this:
1 - Small amount of Dark Side Point (just copy the code)
2 - Medium amount of Dark Side Point (replace "DarkSml" with "DarkMed")
3 - Large amount of Dark Side Point (replace "DarkSml" with "DarkHigh")
void main()
{
UT_DarkSml(GetPCSpeaker());
}

Increases Influence
// a_influence_inc
/* Parameter Count: 2

Increases an NPC's influence.

Param1 - The NPC value of the player whose influence is increased.
Param2 - magnitude of influence change:
1 - low
2 - medium
3 - high
all others - medium


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

*/
//
// KDS 06/16/04
void main()
{

int nInfluenceLow = 8;
int nInfluenceMedium = 8;
int nInfluenceHigh = 8;

int nNPC = GetScriptParameter(1);
int nImpact = GetScriptParameter(2);
int nInfluenceChange;

switch (nImpact)

{
case 1:
nInfluenceChange = nInfluenceLow;
break;
case 2:
nInfluenceChange = nInfluenceMedium;
break;
case 3:
nInfluenceChange = nInfluenceHigh;
break;
default:
nInfluenceChange = nInfluenceMedium;
break;
}

ModifyInfluence (nNPC, nInfluenceChange);

}

Decreases Influence:
// a_influence_dec
/* Parameter Count: 2

Decreases an NPC's influence.

Param1 - The NPC value of the player whose influence is Decreased.
Param2 - magnitude of influence change:
1 - low
2 - medium
3 - high
all others - medium


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

*/
//
// KDS 06/16/04
void main()
{

int nInfluenceLow = 8;
int nInfluenceMedium = 8;
int nInfluenceHigh = 8;

int nNPC = GetScriptParameter(1);
int nImpact = GetScriptParameter(2);
int nInfluenceChange;

switch (nImpact)

{
case 1:
nInfluenceChange = nInfluenceLow;
break;
case 2:
nInfluenceChange = nInfluenceMedium;
break;
case 3:
nInfluenceChange = nInfluenceHigh;
break;
default:
nInfluenceChange = nInfluenceMedium;
break;
}

ModifyInfluence (nNPC, - nInfluenceChange);

}


Good luck to you, hope to see this come out.
 TheHiddenJedi
02-18-2010, 11:43 AM
#8
These should do the trick...

Light Side:

There are a few different options for this:
1 - Small amount of Light Side Point (just copy the code)
2 - Medium amount of Light Side Point (replace "LightSml" with "LightMed")
3 - Large amount of Light Side Point (replace "LightSml" with "LightHigh")


Dark Side:

There are a few different options for this:
1 - Small amount of Dark Side Point (just copy the code)
2 - Medium amount of Dark Side Point (replace "DarkSml" with "DarkMed")
3 - Large amount of Dark Side Point (replace "DarkSml" with "DarkHigh")


Increases Influence
// a_influence_inc
/* Parameter Count: 2

Increases an NPC's influence.

Param1 - The NPC value of the player whose influence is increased.
Param2 - magnitude of influence change:
1 - low
2 - medium
3 - high
all others - medium


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

*/
//
// KDS 06/16/04
void main()
{

int nInfluenceLow = 8;
int nInfluenceMedium = 8;
int nInfluenceHigh = 8;

int nNPC = GetScriptParameter(1);
int nImpact = GetScriptParameter(2);
int nInfluenceChange;

switch (nImpact)

{
case 1:
nInfluenceChange = nInfluenceLow;
break;
case 2:
nInfluenceChange = nInfluenceMedium;
break;
case 3:
nInfluenceChange = nInfluenceHigh;
break;
default:
nInfluenceChange = nInfluenceMedium;
break;
}

ModifyInfluence (nNPC, nInfluenceChange);

}

Decreases Influence:
// a_influence_dec
/* Parameter Count: 2

Decreases an NPC's influence.

Param1 - The NPC value of the player whose influence is Decreased.
Param2 - magnitude of influence change:
1 - low
2 - medium
3 - high
all others - medium


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

*/
//
// KDS 06/16/04
void main()
{

int nInfluenceLow = 8;
int nInfluenceMedium = 8;
int nInfluenceHigh = 8;

int nNPC = GetScriptParameter(1);
int nImpact = GetScriptParameter(2);
int nInfluenceChange;

switch (nImpact)

{
case 1:
nInfluenceChange = nInfluenceLow;
break;
case 2:
nInfluenceChange = nInfluenceMedium;
break;
case 3:
nInfluenceChange = nInfluenceHigh;
break;
default:
nInfluenceChange = nInfluenceMedium;
break;
}

ModifyInfluence (nNPC, - nInfluenceChange);

}


Good luck to you, hope to see this come out.

Thank you harIII for the post but sadly enough I still have one more question. I know I'm such a noob.

Ok heres an example of when I want to get Light side
Me:What happened to him?
NPC:Later, he went off and joined the Jedi Civil War, I haven't heard from him since
ME:I'm sorry for your loss.
NPC:It's okay, I just need some time to myself.

What do I place into the conversation to get any medium light side?
 harIII
02-18-2010, 3:02 PM
#9
When you open the Conversation Editor you should see a box called "Script to run for this node", just type in the name of the script there.
 TheHiddenJedi
02-18-2010, 5:00 PM
#10
When you open the Conversation Editor you should see a box called "Script to run for this node", just type in the name of the script there.

Cool I think I know what to do know if not I will submit another post, but sadly I still have one more question. How to I make it so my npc wont say things if I don't have enough influence?
 harIII
02-18-2010, 9:22 PM
#11
You can flip flop the > (greater than), >= (greater than or equal to), < (less than), >= (less than or equal to), or = (equals) symbols in the script which will check to see if your influence is for example greater than or equal to 5. If you know anything about programming you can fool around with this and make it do all sorts of things.

Checks to see if an NPC's Param2 <= influence <= Param3

Param1 - The NPC value of the player whose influence is increased.
Param2 - lower bound (inclusive)
Param3 - upper bound (inclusive)

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


int StartingConditional()
{

int nNPC = GetScriptParameter(1);
int nInfluenceLower = GetScriptParameter(2);
int nInfluenceUpper = GetScriptParameter(3);

if((GetInfluence(nNPC) <= nInfluenceUpper) &&
(GetInfluence(nNPC) >= nInfluenceLower)) return 1;
else return 0;

}
 TheHiddenJedi
02-18-2010, 9:45 PM
#12
Kool I think I get it now I'm gonna try it out tomorrow if it doesnt work and I cant figure it out I will send you a PM.

Thank you for replying to my thread,
TheHiddenJedi
 TheHiddenJedi
02-19-2010, 11:08 AM
#13
You can flip flop the > (greater than), >= (greater than or equal to), < (less than), >= (less than or equal to), or = (equals) symbols in the script which will check to see if your influence is for example greater than or equal to 5. If you know anything about programming you can fool around with this and make it do all sorts of things.

Checks to see if an NPC's Param2 <= influence <= Param3

Param1 - The NPC value of the player whose influence is increased.
Param2 - lower bound (inclusive)
Param3 - upper bound (inclusive)

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

Darn it. I lied I still have two more questions lol.

One How do I make it so you only get light side once when you say someithing?

two: How do I make Dialogue only appear once?

Im such a noob I know almost nothing about scripting :(

Thank you for replying to my thread this is the first time I've tried making a dialogue script:)
 harIII
02-19-2010, 1:15 PM
#14
This will answer both of your questions once you figure out how they work. This requires some kind of conditional script, the easiest way is by using booleans. Note that there are all kinds of conditions such as what journal entry or quest is active, if the PC has an item, is there a companion, and so on. Booleans are true or false statements that are fired throughout the game, they are automatically set to false when you create them.

To make a boolean requires generally two scripts and an entry into the globalcat.2da file for either K1 or TSL. All you have to do is write down the row number (the next consecutive number), the name of the boolean (what ever you want), and either Boolean or Number (you want boolean)for the third row in the 2da file. Make sure it is saved in the override folder. Here is an image of what you should have:
http://i.imagehost.org/0887/pic_10.png)

At that point you're ready for the scripts. The first one is to set a Boolean to true, if you want it false, just change the "TRUE" to "FALSE". The second script is to check to see what the statement equals, either true or false; like wise this can be changed as well.

For the conditional script you need to enter it in the dialog file in the field that says "Script that determinds if this node is available", the one that changes the boolean to True or False needs to go in the one above it.


void main() {
SetGlobalBoolean("statement name", TRUE);
}

int StartingConditional() {
int i = GetGlobalBoolean("statement name");
if (i == TRUE){
return TRUE;
}
return FALSE;
}
 Star Admiral
02-19-2010, 2:21 PM
#15
In general, try not to use global booleans for simple things like dialog conditionals, unless it is quest-specific dialog. You can easily do the same with local booleans, thus avoiding the need to modify the globalcat.2da file.

void main() {
SetLocalBoolean( GetObjectByTag( "tagofnpc" ), 25, TRUE );
}

int StartingConditional() {
if( GetLocalBoolean( GetObjectByTag( "tagofnpc" ), 25 ) )
return TRUE;
return FALSE;
}

- Star Admiral
 TheHiddenJedi
02-19-2010, 4:22 PM
#16
Wow I'm so lost with the this whole Boolean thing. O well I think I am just gonna keep it so I can get infinite light side or dark thank you everyone for your help. I've almost finished the dialogue and thanks to you guys and will probably release my first beta test by the 22nd (my B-day:)).

I will make sure I PM everyone who helped me with this mod when I release.

Thanks again,
TheHiddenJedi
Page: 1 of 1