Jump to content


Photo

P files


  • Please log in to reply
11 replies to this topic

#1 Grave

Grave
  • Member
  • 39 posts

Posted 25 March 2004 - 03:45 AM

Ok, I have a couple NPC's that I created for BG1tutu. I got them in the game, their initial dialogs work just fine.

BUT...

How do I get them to use their P dialogs?

Example 1:

I do the initial conversation, and reject their offer to join the party. When I click on them again, they would repeat the initial dialog.

Example 2:

When I kick one of them out of the party, a dialog should start saying "your kicking me out? blah blah blah" and then BOTH NPC's leave the party. Well, this isn't happening. When I kick one of them out, that's it... nothing else happens.

Any suggestions?

I can copy and paste actual threads from my .d files if it'll help.

#2 Kismet

Kismet

    Mild Thang

  • Member
  • 348 posts

Posted 25 March 2004 - 07:12 AM

Make sure the proper dialog files were appended to your pdialog.2da. Also, in your .cre file, make sure the flags are set to 'none'.

#3 -jcompton-

-jcompton-
  • Guest

Posted 25 March 2004 - 08:23 AM

I do the initial conversation, and reject their offer to join the party. When I click on them again, they would repeat the initial dialog.

This is correct and expected behavior. The P dialogue will not be used until after the NPC has been in the party and then kicked out. Include another set of conditions in your initial dialogue for NumTimesTalkedToGT(0) or something like that.

#4 Grave

Grave
  • Member
  • 39 posts

Posted 26 March 2004 - 02:04 PM

I did (or at least thought I did correctly) create another set of conditions, to where if you reject the initial offer to joint the party, some other dialog would happen once you clicked on them again.

This is what I want to happen.... example:

Pretend this is the initial dialog:

<NPC>: Hey, let me join your party!

<PC>: No

<NPC>: Ok, maybe some other time.

This is what I want them to say once you say "no"

<NPC>: Hey, it's <CHARNAME> again! Will you let me join the party now?

<PC>: No

Instead, this is what happens once I click "no" on the initial dialog:

<NPC>: Hey, let me join your party!

<PC>: No

<NPC>: Ok, maybe some other time.


Here is some of the dialog that I cut and paste:

IF ~~ THEN BEGIN 9 // from:
SAY ~So, does thou wish to accompany us to Durlag's Tower, and spoil thyself with the treasures within it's walls?~
IF ~~ THEN REPLY ~It sounds dangerous... but it may be worth our while. Consider us in!~ GOTO Finish2
IF ~~ THEN REPLY ~We have more important tasks ahead of us. We're not interested.~ GOTO Goodbye
IF ~~ THEN REPLY ~Bah! We'll not waste our time with the likes of ye or ye smelly orcish companion! Off with ye... and if we wish to plunder Durlag's Tower, we'll do it without your help!~ GOTO Fight
IF ~~ THEN REPLY ~Very well, we will accompany you to Durlag's Tower. But we have other issues we need to take care of first before we embark on your quest. Fall in line if you wish, but be advised Xavia, everybody carries their weight in this group.~ GOTO Finish
END


This is the result of clicking on the second option from above:

IF ~~ THEN BEGIN Goodbye // from:
SAY ~Perhaps some other time, then.~
IF ~~ THEN DO ~SetGlobal("RejectXaviaQuest","GLOBAL",1)~ EXIT
END


Now... this is what SHOULD pop up when you click on the NPC again:

IF ~Global("RejectXaviaQuest","GLOBAL",1) NumTimesTalkedToGT(0)~ THEN BEGIN 100 // from:
SAY ~Ah, <CHARNAME> has returned! So, have ye re-thought my offer?~
IF ~~ THEN REPLY ~Yes Xavia, we'll travel with you to plunder Durlag's Tower. We could also could use your... "extermination" services as well.~ GOTO FinishX
IF ~~ THEN REPLY ~Not right now, mayhaps some other time~ GOTO Goodbye4
END


But it doesn't...

From here, the NPC will either join your party, or get really pissed and leave the area.

Instead, the initial dialog happens all over again.

So what am I doing wrong? All of these dialog options are in the <NPCname>.dlg file, not in the .p file

#5 -jcompton-

-jcompton-
  • Guest

Posted 26 March 2004 - 02:57 PM

Show us, in order, all of the states with state triggers in this DLG.

#6 Grave

Grave
  • Member
  • 39 posts

Posted 26 March 2004 - 06:05 PM

Aw, what the heck... here's the entire .d file for the character Xavia. ^_^

BEGIN ~XAVIA~

IF ~NumTimesTalkedTo(0)~ THEN BEGIN 0 // from:
SAY ~You... you're <CHARNAME>, are you not? I've been... dying... to finally meet you. You've made quite a name for yourself along the Sword Coast, and ever since I first heard about your adventures, well... I've had this burning desire to... meet you.~
IF ~~ THEN REPLY ~And who exactly are you?~ DO ~SetGlobal("SpokeToXavia","GLOBAL",1)~ GOTO 1
IF ~~ THEN REPLY ~I don't have time to talk with the likes of you! Now be off ye little girl, lest I send you to meet your maker!~ DO ~SetGlobal("SpokeToXavia","GLOBAL",1)~ GOTO Fight
IF ~~ THEN REPLY ~While I would love to sit over a frothy mug of ale and recant my recent adventures to you, alas I fear I do not have the time right now.~ DO ~SetGlobal("SpokeToXavia","GLOBAL",1)~ GOTO Goodbye3
IF ~~ THEN REPLY ~Let me guess, are you another assassin sent by the Iron Throne to dispatch me? It'll take more than a little girl with a dagger and her smelly half orc companion slouching next to her to take the likes of us out!~ DO ~SetGlobal("SpokeToXavia","GLOBAL",1)~ GOTO 10
END

IF ~~ THEN BEGIN 1 // from:
SAY ~Please, allow me to introduce myself. I am Xavia of Athkathla, and over there is my bodyguard and faithful companion, Mulgore of Luruar. Say hello, Mulgore.~
IF ~~ THEN EXTERN MULGORE 0
END

IF ~~ THEN BEGIN 3 // from:
SAY ~MULGORE! I... I appologize for my companions... rude behavior. As you could detect, he's not a very sociable individual.~
IF ~~ THEN REPLY ~Well met then, Xavia. I'm <CHARNAME> of Candlekeep, and these are my traveling companions: <PLAYER2>, <PLAYER3>, <PLAYER4>, <PLAYER5> and last but not least <PLAYER6>. Now that we have the formal introductions out of the way, tell me what is it you want from us?~ GOTO 4
IF ~~ THEN REPLY ~Ho there stranger! Keep thy distance from me! I don't trust the looks of ye one bit! You look like a petty thief to me, and I don't like the way your orcish lackey is staring at me over there.~ GOTO Fight
END

IF ~~ THEN BEGIN 4 // from:
SAY ~It is a pleasure to finally meet you, <CHARNAME>. Your exploits in Nashkel and Cloakwood will be the stuff of legend! Now down to buisness, shall we? Let me ask you something... have you ever heard of Durlag's Tower?~
IF ~~ THEN REPLY ~Aye, I have heard about the legend of Durlag's Tower~ GOTO 5
IF ~~ THEN REPLY ~No, I haven't~ GOTO 6
END

IF ~~ THEN BEGIN 5 // from:
SAY ~Good. Then you know the stories about the treasure still hidden in it's depths, as well as the ghosts that protect. So I don't have to explain that to you then.~
IF ~~ THEN REPLY ~Please, continue.~ GOTO 7
END

IF ~~ THEN BEGIN 6 // from:
SAY ~It's an ancient dwarven stronghold a few days travel due east of Nashkel. It was built and owned by Durlag Trollkiller, a famous adventurer of his time. Over the years, ol' Durlag amassed a wealth of gold and treasure... gold and treasure that bards and storytellers still believe to be safely hidden away in the depths beneath the tower. It's long since been abandoned, but there are tales about it being haunted now as well.~
IF ~~ THEN REPLY ~Go on.~ GOTO 7
END

IF ~~ THEN BEGIN 7 // from:
SAY ~So Mulgore and I went to stake out the tower a tenday past, thinking the tales of ghosts and spirits were just that: tales meant to scare off anybody curious enough to get near. Aye, were we wrong! Suddenly, were attacked by a piece of floating armor! I've not seen anything like it before! It carried a great big flaming sword, and it's eyes glowed a deep reddish color.~
IF ~~ THEN REPLY ~I see. So what happened next?~ GOTO 8
END

IF ~~ THEN BEGIN 8 // from:
SAY ~We barely excaped with our bloody lives, that's what! We tried fighting it off at first, but it was just too powerful, even for us, so we were forced to retreat back into the woods. It followed us out to a certain point, then stopped and headed back to the tower. So we decided to head north towards Baldur's Gate, to see if we could find any sword arms willing to accompany us back to the tower to help "liberate" the treasure hidden within it, but no one I deemed worthy enough to travel with us. They were either over confident and too inexperienced, or just wanted too much of a cut in the treasure. So after a few days of searching the Gate with no luck, we thought our next best shot at finding help was to head further north to either Daggerford or Waterdeep. Along the way we stopped to rest here in Ulgoth's Beard, and that leads us to meeting you now, <CHARNAME>.~
IF ~~ THEN REPLY ~And this is where we come into play.~ GOTO 9
END

IF ~~ THEN BEGIN 9 // from:
SAY ~So, does thou wish to accompany us to Durlag's Tower, and spoil thyself with the treasures within it's walls?~
IF ~~ THEN REPLY ~It sounds dangerous... but it may be worth our while. Consider us in!~ GOTO Finish2
IF ~~ THEN REPLY ~We have more important tasks ahead of us. We're not interested.~ GOTO Goodbye
IF ~~ THEN REPLY ~Bah! We'll not waste our time with the likes of ye or ye smelly orcish companion! Off with ye... and if we wish to plunder Durlag's Tower, we'll do it without your help!~ GOTO Fight
IF ~~ THEN REPLY ~Very well, we will accompany you to Durlag's Tower. But we have other issues we need to take care of first before we embark on your quest. Fall in line if you wish, but be advised Xavia, everybody carries their weight in this group.~ GOTO Finish
END

IF ~~ THEN BEGIN 10 // from:
SAY ~Do watch that toungue of yours when speaking to me! I'll not tolerate such arrogance again!~
IF ~~ THEN GOTO 11
END

IF ~~ THEN BEGIN 11 // from:
SAY ~*Ahem* But... please, let us not quarrel with each other, not now. I can understand why one such as yourself would be a bit wary of people you come across, but I assure you this is something you would like to hear. So let us get off on the right foot, shall we? I have an proposition for you that you simply cannot refuse.~
IF ~~ THEN REPLY ~Go on then, we're listening.~ GOTO 1
IF ~~ THEN REPLY ~Bugger off, ye filthy trollop! Nothing you say could possibly interest me, so save yer breath for someone who gives a damn!~ GOTO Fight
END

IF ~~ THEN BEGIN Fight // from:
SAY ~You dare insult me! I shall drive this dagger deep into your black heart! Mulgore, let's get 'em!~
IF ~~ THEN DO ~ChangeEnemyAlly(Myself,EVILCUTOFF) Enemy() Attack(NearestEnemyOf(Myself))~ EXTERN MULGORE 2
END

IF ~~ THEN BEGIN Goodbye3 // from:
SAY ~So be it...~
IF ~~ THEN DO ~EscapeArea()~ EXTERN MULGORE 8
END

IF ~~ THEN BEGIN Finish // from:
SAY ~I assure you, <CHARNAME>, our performance will not dissapoint.~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",1) SetGlobal("XaviaKickedOut","LOCALS",0) JoinParty()~ EXTERN MULGORE 6
END

IF ~~ THEN BEGIN Finish2 // from:
SAY ~Excellent! In the mean time, allow Mulgore and myself to assist you in your current and future endeavours.~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",1) SetGlobal("XaviaKickedOut","LOCALS",0) JoinParty()~ EXTERN MULGORE 6
END

IF ~~ THEN BEGIN Goodbye2 // from:
SAY ~Bah! We waste our time here! Come Mulgore, let's get out of here!~
IF ~~ THEN DO ~EscapeArea()~ EXTERN MULGORE 8
END

IF ~~ THEN BEGIN Goodbye // from:
SAY ~Perhaps some other time, then.~
IF ~~ THEN DO ~SetGlobal("RejectXaviaQuest","GLOBAL",1)~ EXIT
END

IF ~Global("RejectXaviaQuest","GLOBAL",1) NumTimesTalkedToGT(0)~ THEN BEGIN 100 // from:
SAY ~Ah, <CHARNAME> has returned! So, have ye re-thought my offer?~
IF ~~ THEN REPLY ~Yes Xavia, we'll travel with you to plunder Durlag's Tower. We could also could use your... "extermination" services as well.~ GOTO FinishX
IF ~~ THEN REPLY ~Not right now, mayhaps some other time~ GOTO Goodbye4
END

IF ~~ THEN BEGIN FinishX // from:
SAY ~I assure you, <CHARNAME>, our performance will not dissapoint.~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",1) SetGlobal("RejectXaviaQuest","GLOBAL",0) JoinParty()~ EXTERN MULGOREP 6
END

IF ~~ THEN BEGIN Goodbye4 // from:
SAY ~Bah! We waste our time here! Come Mulgore, let's get out of here!~
IF ~~ THEN DO ~EscapeArea()~ EXTERN MULGOREP 8
END



BEGIN ~XAVIAP~

IF ~Global("XaviaKickedOut","LOCALS",0)~ THEN BEGIN KickOut // from:
SAY ~So be it, <CHARNAME>. If I go, so does Mulgore. Let's get out of here.~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",0) SetGlobal("XaviaKickedOut","LOCALS",1) LeaveParty()~ EXTERN MULGOREP 5
END

IF ~Global("XaviaJoined","LOCALS",0) Global("XaviaKickedOut","LOCALS",1)~ THEN BEGIN XaviaRejoin // from:
SAY ~So, the mighty <CHARNAME> returns! What do you want?~
IF ~~ THEN REPLY ~I'd like for you to accompany me again.~ GOTO Rejoin2
IF ~~ THEN REPLY ~Nothing for the moment. Just greeting a familiar face.~ EXIT
END

IF ~~ THEN BEGIN Rejoin2 // from:
SAY ~Really now? Right then! Let's go, Mulgore!~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",1) SetGlobal("XaviaKickedOut","LOCALS",0) JoinParty()~ EXTERN MULGOREP 7
END

IF ~~ THEN BEGIN 12 // from:
SAY ~If you're kicking out Mulgore, you're kicking me out as well!~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",0) SetGlobal("XaviaKickedOut","LOCALS",1) LeaveParty()~ EXIT
END


Here is the entire .d file for the other NPC, Mulgore:

BEGIN ~MULGORE~

IF ~~ THEN BEGIN 0 // from:
SAY ~BBBBBBUUUUUUUURRRRRRRRRRPPPPPPPPP!!!!~ [orco.wav]
IF ~~ THEN EXTERN ~XAVIA~ 3
END

IF ~NumberOfTimesTalkedTo(0)~ THEN BEGIN 1 // from:
SAY ~Get lost, <RACE>!~
IF ~~ THEN EXTERN ~XAVIA~ 0
END

IF ~~ THEN BEGIN 2 // from:
SAY ~Time for DEATH!~
IF ~~ THEN DO ~ChangeEnemyAlly(Myself,EVILCUTOFF) Enemy() Attack(NearestEnemyOf(Myself))~ EXIT
END

IF ~~ THEN BEGIN 6 // from:
SAY ~Keep out of my way <RACE>, and ye won't get hurt!~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",1) JoinParty() ReputationSet(-1)~ EXIT
END

IF ~~ THEN BEGIN 8 // from:
SAY ~Yer lucky we don't kill you this day, <RACE>!~
IF ~~ THEN DO ~EscapeArea()~ EXIT
END


BEGIN ~MULGOREP~

IF ~Global("XaviaJoined","LOCALS",0) Global("XaviaKickedOut","LOCALS",1)~ THEN BEGIN MulgoreRejoin // from:
SAY ~Talk to Xavia...~
IF ~~ THEN EXTERN ~XAVIAP~ XaviaRejoin
END

IF ~~ THEN BEGIN 7 // from:
SAY ~You get on my nerves, <CHARNAME>.~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",1) JoinParty()~ EXIT
END

IF ~Global("XaviaKickedOut","GLOBALS",0)~ THEN BEGIN KickOut // from:
SAY ~WHAT!?!?~
IF ~~ THEN DO ~LeaveParty()~ EXTERN XAVIAP 12
END

IF ~~ THEN BEGIN 5 // from:
SAY ~I didn't like the lot of ye anyways...~
IF ~~ THEN DO ~SetGlobal("XaviaJoined","LOCALS",0) LeaveParty()~ EXIT
END

IF ~~ THEN BEGIN 8 // from:
SAY ~Yer lucky we don't kill you this day, <RACE>!~
IF ~~ THEN DO ~EscapeArea()~ EXIT
END

IF ~Global("RejectXaviaQuest","GLOBAL",1)~ THEN BEGIN 100 // from:
SAY ~Piss off! I have nothing to say to you.~
IF ~~ THEN EXTERN ~XAVIAP~ XaviaRejoin
END


It's real basic, I know. But I just want to get everything working perfectly before I go in and really overhaul the actual character dialog.

#7 -jcompton-

-jcompton-
  • Guest

Posted 26 March 2004 - 07:55 PM

I don't see why that initial dialogue should possibly repeat. But as you say it does, try changing the state triggers around a bit.

Since you have a SpokeToXavia that gets set to 1 right away, do this:

IF ~Global("SpokeToXavia","GLOBAL",0)~ THEN BEGIN 0

and for the second-chance dialogue, just make it

IF ~Global("SpokeToXavia","GLOBAL",1)~ THEN BEGIN 100

(and BTW, stop using integers as state labels.)

#8 Grave

Grave
  • Member
  • 39 posts

Posted 27 March 2004 - 07:07 AM

Thanks jcompton, that made it work. The second-chance dialog triggers once you refuse the initial offer to join the party.

But I still can't get get the NPCs to say their KickedOut speech. Looking at the dialog files I put on here, does anybody see anything wrong?

** EDIT **

Also, the pdialog.2da file is properly appended. (see below)

2DA V1.0

0

POST_DIALOG_FILE JOIN_DIALOG_FILE

MINSC _MINSCP _MINSCJ

FALDORN _FALDOP _FALDOJ

JAHEIRA _JAHEIP _JAHEIJ

CORAN _CORANP _CORANJ

DYNAHEIR _DYNAHP _DYNAHJ

XAN _XANP _XANJ

YESLICK _YESLIP _YESLIJ

ELDOTH _ELDOTP _ELDOTJ

VICONIA _VICONP _VICONJ

SHARTEEL _SHARTP _SHARTJ

SKIE _SKIEP _SKIEJ

KIVAN _KIVANP _KIVANJ

XZAR _XZARP _XZARJ

SAFANA _SAFANP _SAFANJ

QUAYLE _QUAYLP _QUAYLJ

KHALID _KHALIP _KHALIJ

TIAX _TIAXP _TIAXJ

EDWIN _EDWINP _EDWINJ

AJANTIS _AJANTP _AJANTJ

KAGAIN _KAGAIP _KAGAIJ

MONTARON _MONTAP _MONTAJ

IMOEN _IMOENP _IMOEN2

GARRICK _GARRIP _GARRIJ

BRANWEN _BRANWP _BRANWJ

ALORA _ALORAP _ALORAJ

XAVIA XAVIAP XAVIAJ

MULGORE MULGOREP MULGOREJ

#9 -jcompton-

-jcompton-
  • Guest

Posted 27 March 2004 - 08:38 PM

My current theory is that the DV for the CREs for your NPCs doesn't actually match the DV in the list you're appending to PDIALOG.

#10 Grave

Grave
  • Member
  • 39 posts

Posted 27 March 2004 - 10:05 PM

Sorry... what does DV stand for?

#11 -jcompton-

-jcompton-
  • Guest

Posted 28 March 2004 - 12:03 AM

Death Variable, also called "script name."

#12 Grave

Grave
  • Member
  • 39 posts

Posted 28 March 2004 - 05:00 AM

Is the Death Variables and pdialog.2da case sensitive?

Their death variable is their full name in all lowercase letters (just like the rest of the BG1 NPCs), and their names in the pdialog.2da are all capitals, just like the rest of the NPCs.

Is there anything else that I'm possibly missing? I've done everything by the book that I can think of... even looking at other user created NPCs, and I can't see anything that I'm *not* doing.

I'm thinking of just posting the .zip file with all my work so far (as a last ditch resort)... maybe somebody with a sharper attention to detail on NPC creation can spot something I can't!