Jump to content

Dialogue questions


Crimpson

Recommended Posts

I'm working on another mod as well. I've created two NPCs, Prissa and Anishai. If you talk to Prissa (name holder) she says hello, then Anishai interrupts, then the dialogue goes back to Prissa. Like this:

BEGIN ~Prissa~
IF ~~ 2 /* notice i dont have "THEN BEGIN" it isn't making any difference. It's working this way for Anishai's part when she interrupts. */
SAY ~Ooo... Fancy that.~
IF ~~ THEN EXIT
END

APPEND ~Prissa~

IF ~NumTimesTalkedTo(0)~ THEN BEGIN Prissaintro
 SAY ~oO, Well if it isn't <CHARNAME>, I've herd o'ye.~
IF ~~ THEN EXTERN ~Anishai~ 1
END

IF ~NumTimesTalkedToGT(3)~ THEN BEGIN Talk3
 SAY ~I do remember you - we talked before, didn't we..."~
 IF ~~ THEN GOTO Talk3.1
END

IF ~~ Talk3.1
 SAY ~Yes yes, Anishai speaks highly of your abilities and... techniques."~
 IF ~~ THEN EXIT
END
END

You talk to Prissa, she says "hi" then the dialogue goes to Anishai. When it comes back it goes to Talk3 (after NumTimesTalkedToGT(3)) instead of 2 like it's suppose to.

Note that i keep the EXTERN dialogue's out of the APPEND section of the file, EXTERN command doesn't seem to work if it's in APPEND. is this correct?

 

Anishai's D

BEGIN ~Anishai~

IF ~~ 1 //from Priz 1
SAY ~~ 
/* I figured this out, to put in the "~~" before starting dialogue, otherwise it skips the first part and goes to "~New guild leader now too.~". By putting in "~~" like I did, she says both parts perfectly, is this good?*/
=~Oh! Why look! Prissa it's that recrute in training I've been tellin you about! ..~
=~New guild leader now too.~
IF ~~ THEN EXTERN ~Prissa~ 2
END
APPEND
//bunch of dialogue for when you talk to Anishai instead
END

Do I have to put their EXTERN Dialogue in a separate Bfile? or how can I fix my code so when you talk to Prissa again it goes to Talk3 (after GT(3) ), instead of during the EXTERN dialogue. Also, check my note in Anishai's Dfile.

Link to comment

Crimpson, I hate to do this (and i think you should dive in and do what you want), but...

 

the questions you are asking show you are diving into the pool without any swimming lessons at all. I know - i did that too :blush:

 

I hate to tell you to do this, but I have to - go back and start working through Theacefece's beginner tutorial, and K'aeloriee's tutorials on dialog. Then you can take a look through mine, if you like - this stuff is part and parcel of knowing how it all works, and you are skipping way ahead.

 

(Side note - there are two mods and Bioware's Anishai, so you may want to change the dialog file naming. If you are looking to start out by adding to Bioware's Anishai, you need to hit the tutorials on INTERJECT_COPY_TRANS (I_C_T) instead of rebuilding her whole file. )

 

To answer your questions,

 

IF ~~ 2 /* notice i dont have "THEN BEGIN" it isn't making any difference. It's working this way for Anishai's part when she interrupts. */

SAY ~Ooo... Fancy that.~

IF ~~ THEN EXIT

END

IF ~<<condition>>~ THEN BEGIN statename

works for states (dialog states) that have something to trigger them. For things that ae non-conditional, IF ~~ statename works fine. You are saying IF ~<<no_conditions>>~ statename. No problems.

 

You will, however, run into troubles with that structure, because

 

 BEGIN ~DialogFile~

blah...

APPEND
blah..
END

that IF ~~ 2 is being picked up by WeiDU as part of the BEGIN; BEGIN ~DialogFile~. To make sure you don't have problems when you add another BEGIN ~AnotherDialogFile~ (and wonder why the mod breaks), you need to put materials inside of APPEND ~DialogFile~ <> END structures.

 

The use of numbers alone is usually a dangerous idea. Modern usage is to separate the numbers (which weidu creates, and manipulates, and can be out of order in sequence due to weighting issuses in the engine) from the statename.

 

IF ~~ 1 //from Priz 1

SAY ~~

/* I figured this out, to put in the "~~" before starting dialogue, otherwise it skips the first part and goes to "~New guild leader now too.~". By putting in "~~" like I did, she says both parts perfectly, is this good?*/

a SAY uses ~text~ - after that, within the same state, you can use multi-say to repeat the speaker. By doing this, you have a blank line, then another line...

 

 

EXTERN works as a transition to another file, just like a REPLY or GOTO. The [ IF ~~ newstate ] become the targets for the transition. So EXTERNs do not need a separate file.

 

 

So, a recode of this to work would be:

 

file: MyNewmod\MyNewmod.D

BEGIN ~Anishai~
BEGIN ~Prissa~

APPEND ~Prissa~

IF ~NumTimesTalkedTo(0)~ THEN BEGIN Prissaintro
 SAY ~oO, Well if it isn't <CHARNAME>, I've herd o'ye.~
 IF ~InMyArea("JK#ainshai") !StateCheck("JK#ainshai",CD_STATE_NOTVALID)~  THEN EXTERN ~Anishai~ ainsh_interrupts
 IF ~OR(2) !InMyArea("JK#ainshai") StateCheck("JK#ainshai",CD_STATE_NOTVALID)~ THEN GOTO pris_continues
END

IF ~~ pris_interrupts
 SAY ~Ooo... Fancy that.~
 IF ~~ THEN EXTERN ~Anishai~ ainsh_continues
END

IF ~~ pris_continues
 SAY ~I am afraid my friend Ainshai is not here at the moment. But come back later, and perhaps I can talk to you.~
 IF ~~ THEN EXIT
END

IF ~~ pris_dangerous
 SAY ~So you mean because you EXTERN'd to me without checking if I am really there, and a player has clobbered me, or a script has not worked right, the dialog will crash?~
 IF ~~ THEN EXTERN ~AINSHAI~ ainsh_finishes
END

IF ~NumTimesTalkedToGT(1)~ THEN BEGIN Talk2
 SAY ~I do remember you - we talked before, didn't we..."~
 IF ~InMyArea("JK#ainshai") !StateCheck("JK#ainshai",CD_STATE_NOTVALID)~  THEN GOTO Talk3.1
 IF ~OR(2) !InMyArea("JK#ainshai") StateCheck("JK#ainshai",CD_STATE_NOTVALID)~  THEN GOTO Talk3.2
END

IF ~~ Talk3.1
 SAY ~Yes yes, Anishai speaks highly of your abilities and... techniques."~
 IF ~~ THEN EXIT
END

IF ~~ Talk3.2
 SAY ~I wish Ainshai were here, but she is not. Or she is dead. So come back later."~
 IF ~~ THEN EXIT
END

END // of p's append block

APPEND ~Anishai~

IF ~~ ainsh_interrupts
 SAY ~Oh! Why look! Prissa it's that recrute in training I've been tellin you about! ~
 = ~New guild leader now too.~
 IF ~~ THEN EXTERN ~Prissa~ pris_interrupts
END

IF ~~ ainsh_continues
 SAY ~See, the first line of a SAY is in tildes, and then the shortcut is to start using equals.~
 = ~So this new line is still assigned to me, part of what is called a "Multi-SAY".~
 IF ~~ THEN EXTERN ~Prissa~ pris_dangerous
END

IF ~~ ainsh_finishes
 SAY ~~
 = ~Yes. And adding that pair of tildes right after the SAY, like I just did, means you are just adding a blank line to the dialog.~
 IF ~~ THEN EXIT
END

END // of ainshai's dialog addition

 

 

The "notecards" flow like this:

 

PC talks to Prissa:

 

 

FIRST TIME = oO, Well if it isn't <CHARNAME>, I've herd o'ye.

IF <<ainshai is ok to talk>> GOTO Ainshai's dialog file, ainsh_interrupts

IF <<ainshai is not ok to talk>> GOTO pris_continues

 

SECOND AND GREATER TIMES = I do remember you - we talked before, didn't we...

IF <<ainshai is ok to talk>> GOTO Talk3.1 EXIT

IF <<ainshai is not ok to talk>> GOTO Talk3.2 EXIT

 

 

 

FOLLOW UP:

 

IF pris_continues, EXIT

IF ainsh_interrupts, GOTO Prissa's dialog file, pris_interrupts

 

IF pris_interrupts, GOTO Ainshai's dialog file, ainsh_continues

 

IF ainsh_continues, GOTO Prissa's dialog file, pris_dangerous

 

IF pris_dangerous, GOTO Ainshai's dialog file, ainsh_finishes EXIT

 

 

There are other ways of tackling this, too, including CHAIN and INTERJECT_COPY_TRANS - but again, before you start trying to get two NPC's talking to eachother, save yourself a huge headache and potential dropping of your project - go back through Theaceface's stuff, K'aeloree's stuff, Berelinde's stuff, and then poke about with Blue's stuff and my stuff, etc. Grab Tyris Flare, download hger, and look through her files for how Grim set up her dialog. Abnd then get one simple joining dialog and a simple dialog where one NPC talks to the PC working in-game. Then you might be ready to try EXTERN without driving yourself bonkers.

 

Trust me - I have been exactly where you are. And Grim Squeaker led me through the basics the same way. We can help you better if you focus your excitement and creativity on a single NPC, get her rolling, and get some dialog working in-game. You will understand better, have more fun, and your project will be so much easier to work on!

Link to comment

Thank you for your advise, I'll follow it carefully.

Just on a side note, for Anishai, I exported her CRE file and was putting her back into the game after you take over the thief guild. When she reappears she has a couple of new friends with her, they will also be merchants when I learn about how to do that. For now I'm trying to keep it simple and just get dialog working how I want it to. I'll definitely go over those tutorials, again if I have already.

I'm going to take a closer look at your coding a bit later, but I'm sure I'll learn quite a bit from it.

I was reading about extern, chain and multisay in the weidu documentation, I didn't really think chain was appropriate for what I was trying to do, but obviously I need to do some more studying on this.

Thank you very much for the helpful advise.

Link to comment

As long as you understand I am not trying to shut you down, I am a happy dude. I think you should have fun, and do what you want - I am just trying to save you some serious headache :blush:

 

I think the idea for Anishai is a good one, even if the player ended up killing her in taking over the Guild. You might need some simple scripting to work her in with mod-expanded versions - currently, as far as I an emember, her modNPC versions come with only a small amount of content, so your idea has plenty of room. (There are two Xans, several Branwens, and so on - plenty of room in the IE universe for some competing variants).

 

When you get farther along, there are some good ways of scripting her to reappear. I would suggest, though, that you make sure the dialog files and DV and such use your prefix, so that you get the freedom to do with her as you will. The original BioWare .cre will have some materials set, including (most likely) SPRITEISDEAD and some other things that will drive you crazy when you write something perfectly, but the game thinks she is dead or something. Keep posing up questions here, and PPG and SHS both have good folks to help out too, so if you get stuck there are plenty of folks available to help.

Link to comment

Just poking my head in to add a comment. You say that you didn't think that CHAIN would be appropriate there, but I've found that there are very few places it doesn't work. It looks like you're trying to do something with straight dialogue that could more easily be accomplished using CHAIN.

 

You're setting up:

NPC1 speaks

NPC2 speaks

NPC1 speaks

etc.

 

You don't have to EXTERN all over the place. All you have to do is use CHAIN. I'm real rusty, so this prolly won't parse, but it goes like this:

 

CHAIN

IF ~conditions~ THEN ~DLGFILE1~ statelabel

~Blah blah blah~

DO ~Actions~

== ~DLGFILE2~ ~Sez you!~

== ~DLGFILE1~ ~Yeah?~

== ~DLGFILE2~ ~Yeah.~

== ~DLGFILE1~ ~Oh.~

EXIT

 

And that's it.

 

There are times that I've found that I have to break the chain to do something. Basically, whenever your conversation can go one of two or more ways, I've found it best to stick in an END. This can be a choice of following lines based on PC class/race, a selection of PC responses, or a choice of actions based on some other criteria.

 

What you absolutely MUST do is include the references for any EXTERN lines in the same dialogue file, unless you are referring to specific Bioware dialogue states.

 

EXTERN ~MAEVAR~ 2 will work because there is a state 2 in Mae Var's dialogue file. EXTERN ~MyNPC~ 6 probably won't work because your dialogue file won't have compiled yet during the installation process. The very second thing the compiler does is look for EXTERN references, before it compiles one single state of the new dialogue. Not sure what the first thing the compiler does before that, but I know I've hit parse errors before getting to the EXTERN lines.

Link to comment

Yeah I've noticed there's a problem getting my NPC to spawn in the guild house, I figured it was because of the expansion mod.

I admit, I'm jumping into the deep end with no swimming lessons and my hands tied. But I've always wanted to learn this stuff and now that I am, it turns me on.

I've got some life sh** to deal with so i have to take a short break from this. As soon as I can get back on it, I'm going to read those tutorials, Remake Anishai's CRE file and her two merchant friends, get the dialog working between them, and when I have that nailed down I"ll start a new topic for their mod where I can get some help figuring how to set up merchants, get them spawning in the guild house and anything else I haven't figured out. I'm thinking of signing up for some college classes this spring and really getting into game design.

Don't worry, I won't ever abandon this, to me Baldur's Gate is epic. I started playing it when it first came out and I doubt I'll ever really get sick of it. When I can build my own game, It's going to be a lot like BG.

You guys are great, I look forward to having by scripts shredded here :blush:

 

ps. Just to be clear, Cmorgan, when you recoded my Dfile, what you're showing me is that Anishai's dialog and Prissa's can be in the same Dfile? I had no idea you could do that. what about the third NPC I haven't created yet, can all three of them be talking to each other using a single Dfile? then have solo conversations with them using the same file? that seems like it would get really confusing really fast epically if there's a LOT of dialog. or maybe not...

Link to comment
I admit, I'm jumping into the deep end with no swimming lessons and my hands tied. But I've always wanted to learn this stuff and now that I am, it turns me on.
Then you are a born modder - or a game designer!

 

I've got some life sh** to deal with so i have to take a short break from this.
No worries - while there is still emulation software and the possibility of running BG/BG2 (even in engine revamps like GemRB), there will be folks who want to play new mods expanding Baldur's Gate. Development time for mods can last years, and years, andd years :blush:

 

ps. Just to be clear, Cmorgan, when you recoded my Dfile, what you're showing me is that Anishai's dialog and Prissa's can be in the same Dfile?

 

Kind of - they can be built in the same file, because the actual dialog file is created by that BEGIN ~JK#AINSH~ or BEGIN ~PRISSA~. What is happening is weidu is following instructions in a file. So a .D file is not a .DLG file - it is directions for weidu.

 

Think about it this way. Creating a .D dialog (setting up berelinde's CHAIN , writing out the long form EXTERNs, etc.) all of that information can be in a bunch of little files, or they can be in a big file - either way, WeiDU will see them and rearrange them, compiling the information into the format the engine reads. So you can create lots of different instructions within one file, and weidu will read through and build many smaller files out of that instruction set, assign them into the game, and report what worked and what didn't.

 

There are some advantages to working within one .d (which creates a number of assigned .dlg files when it is compiled). Folks use both methods. For me, keeping three files open to make entries jump between them is more difficult to follow than simply splitting the text editor window into multiple views, each zoned for the dialog in question. Eventually, you may split up into several .d files, one for interjections, one for lovetalks, one for frinedtalks, etc. - as many as you want. But that is for your convenience, not a structural requirement. All of those instruction sets will be telling weidu to add the contents to this file, or to that file, or to another file. Sometimes it matters what order you put things in, too, but that is way advanced - Player initiated Dialogs and such might be put in a separate .d file so that you can compile that last, so it works properly.

 

When you get rolling again, the currently active modders to follow/study/ask questions about how they work and balance things using multiple joinable NPCs in the same are Miss Sakaki and Feuille over at SHS with the Luxley Family (http://www.shsforums.net/index.php?showforum=324) and Bookwyrme's team working on Mage Trio (same site, but they do not have anything public to study yet). CoM_Solaufein, over at Chosen of Mystra, has a multiple-NPC mod as well, but he is Old Skool - some of the newer coding techniques will save you time and trouble. One fun thing might be to look at his code alongside that of Luxley Family, and see where things are ending up with the same result but done differently. The granddaddy multi-NPC mod is Beyond The Law, but you want to know what you are doing before looking at Zyraen's stuff - he is the most creative coder I can think of. He does wild things - his "use and abuse of CHAIN" tutorial completely rocked my world the first time I read it - but that creativity means that you really need to know your business before tackling his code, or you will get the equivalent of being thrown into a mental blender. I think he liked playing "what if I bent the rules this way - would that get me where I want to go?", which is way cool, but like following a good jazz musician. If you know the piece and a good bit of history, you grok why what he is doing is so cool, but if it is the first time you are there you have immense trouble figuring out what happened to the melody.

Link to comment

Well, why should you - you think that way! For those of us who are more "linear", CHAIN construct immediately appears in the brain as a sequence:

 

CHAIN

a

b

a

b

a

b

EXIT

 

whereas you introduced a pointilistic, or perhaps even abstract way of seeing CHAIN as a binder for dialog states. Instead of seeing it as a conversation, you opened me up to ideas like

 

CHAIN

a if 1

b if 1

a if 2

b if 2

c if 1 + 2

c if 1 not 2

c if 2 not 1

c if not 1 not 2

 

etc.

 

so the same basic interaction could be custom tailored to lots of different events/factors all in one coding pass.

 

Basically, the beginner approach to CHAIN is to think like a screenplay. You got me thinking about it as a tool.

That, and your stuff in BTL with random .bcs blocks are pretty darned original interpretations of thinking about making things fresh and different; another tutorial but I don't remember where http://www.shsforums.net/index.php?showtopic=30675 . I have a huge pile of mods that I use for weidu testing, and referencing that, I can tell you that noone else out there has played as extensively with randomization (other than igi's materials) and few have pushed boundaries like this. It seems less important now because more and more folks are using and manipulating things in CHAIN.

 

(ok, back to work for me. No fanboi stuff here - just appreciation for your thinking about things in new ways.)

Link to comment

Archived

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

×
×
  • Create New...