PDA

View Full Version : Dialogue the NPC way


shamelessposer
10-19-2005, 07:34 PM
Two questions regarding dialogs:

1.) How do I get a character's speech to just appear as a "pop-up," like a commoner on Taris?

B.) How do I get the whole "Carth is blahblahblah" at a certain point thing that lets characters unlock dialog over time?

brwarner
10-19-2005, 08:23 PM
1 is you make the dialog so it has one entry and one blank reply

-[OWNER]BlahBlahBlahPopup
-[End Dialog]

Darth333
10-19-2005, 08:45 PM
For n.1 just make a dialogue with an entry and no reply.

For no. 2, you have to use conditional scripts. Kotor doesn't use time but rather events such as plot advancement or leveling up per example.

Let's say you'd like a dialogue to become available only if Juhani is a party member, your PC is at least lvl 12, has at least 15 in demolition skill, is on Korriban, has dicovered 4 Star maps and has either a dealy plasma mine or a deadly gas mine in his inventory (I tried to put a lot of things in the example so it is more likely you will find something you are looking for in there). You would need a script like this:


int StartingConditional()
{
object oPC= GetPCSpeaker();

int nLevel = GetHitDice(oPC);
int nSkill = GetSkillRank(SKILL_DEMOLITIONS, oPC);
int nPlanet = GetGlobalNumber("K_CURRENT_PLANET");
int nPlot = GetGlobalNumber("K_STAR_MAP");
//insert item resref
object oMine1= GetItemPossessedBy(oPC, "G_I_TRAPKIT009");
object oMine2= GetItemPossessedBy(oPC, "G_I_TRAPKIT012");


if ((IsNPCPartyMember(NPC_JUHANI) == TRUE) && (nLevel >= 12) && (nSkill>= 15) && (nPlanet == 30) && (nPlot == 40) && ((GetIsObjectValid(oMine1)) || (GetIsObjectValid(oMine2))))

{
return TRUE;
}
return FALSE;
}


I understand this is for K1, so for the star maps and planets globals, check k_qa.nss :)

You'll find more in this post: http://www.lucasforums.com/showthread.php?p=1903207#post1903207

This overview of scripting syntax may also be useful: http://www.lucasforums.com/showthread.php?t=143390

shamelessposer
10-19-2005, 09:53 PM
You rock as hard as ever, Darth333. Thanks!

Pavlos
10-22-2005, 01:54 PM
I tried to do the NPC one line thing, with several different lines, it will only do the one. What must I do to get them to alternate?

Darth333
10-22-2005, 03:19 PM
I tried to do the NPC one line thing, with several different lines, it will only do the one. What must I do to get them to alternate?
I am not sure I get that :confused: Could you rephrase pls? :)

Pavlos
10-22-2005, 04:25 PM
What I mean is: Is there any way to get the NPC to say different things every time you click on them, just having all the different entries doesn't seem to work.