Jump to content


NPC dialogue files: What they are and do


  • Please log in to reply
No replies to this topic

#1 -Ghrey-

-Ghrey-
  • Guest

Posted 02 April 2004 - 02:35 AM

NPC Dialogue Files: What They Are and Do
by
Ghreyfain

Contents:

Section I: Breakdown
Section II: "J" dialogue files (Join)
Section III: "B" dialogue files (Banter)
Section IV: "P" dialogue files (Post)
Section V: Summary
Section VI: There is no section 6


Section I: Breakdown

This is a quick rundown of what needs doing to get your NPC to do
the necessary things in your party.

So far your NPC will have:

- A .cre file
- A basic dialogue file. This is REMOVED when the NPC joins
your party.
- A basic script. If it is not in the Override slot, it will
be removed when the NPC joins.

What you need:

- Dialogues for when the NPC has Joined, is doing Banter, or
has been kicked. These are referred to as J (joined), B (banter),
and P (Post) dialogues.


Section II: "J" dialogue files

This dialogue file is assigned to the NPC when they join your
party. It is only used when:

You use the scripting actions of the "Dialog()" variant. I.e.
StartDialogueNoSet(), Dialogue(), and DialogueForceInterrupt()
The PC initiates dialogue by manually clicking the NPC.
It is also used by BioWare for storing in-game interjections with
non-party NPCs.

To assign a J dialogue file to your NPC, open Pdialog.2da, and
edit the appropriate field. If I use PirateJ.dlg as my "Joined"
dialogue file, I will enter PirateJ under the J field.


Section III: "B" dialogue files

These are assigned like the J dialogue, but they use
interdia.2da to control them.

Banter dialogue initiates when:

You use the scripting command "Interact()"
The random in-game timer expires, and the game finds a true condition.


Section IV: "P" dialogue files

Post dialogue files are assigned in the same manner as J files,
using pdialog.2da

Post dialogue initiates when:

The NPC has been in the party, and is then removed from the party.


Section V: Summary

Here is a list of the stages an NPC will go through, as far as
dialogues that are attached to them.

NPC Hasn't joined the party: Original .dlg as determined by
the .cre file

NPC Has joined the party: Banter and J dialogue files as
determined by interdia.2da and pdialog.2da respectively

NPC Has been kicked from party: Post dialogue file, as determined by
pdialog.2da


Section VI: There is no section 6

There is no section 6.


- Ghreyfain





EDIT:

Ah, forgot to mention something.

The DEATH VARIABLE in your .cre file is very important. It is what controls the NPC in scripts, .2da files, and... well, that's all I can think of at the moment, but it's very important!

When you add a line to a .2da for your NPC, you tell the game to apply these effects to your NPC by using the Death Variable.

For instance, my NPC's name is Eddy Grubbins, and his death variable is EddyTheGrand, so here are some good examples of .2da additions:

interdia.2da
EddyTheGrand BEddy

pdialog.2da
EddyTheGrand Eddy EddyJ EddyD EddyP Eddy25J Eddy25P EddyD25 Eddy25

And here are some BAD examples:

EDDY.cre BEddy
EDDY_GRUBBINS BEddy
Eddy Grubbins BEddy


That's about it.




EDIT 2:

Another appendage... er, appendix? Appendectomy?

Some notes on P (post) dialogue files.

When the player clicks the Reform Party button and chooses an NPC to kick, that NPC is already out of the party, so you need to add the "Do you really want to kick me?" lines to P.dlg. If the PC chooses not to kick them, then you will have to use the action JoinParty() in the appropriate spot in p.dlg.

If you do choose to kick them, you should set a local variable in the NPC, to tell them they've been kicked. This is used later when the PC wants them to rejoin the party (remember, they've been in the party, so they're still using p.dlg). They will check to see if this variable is set, and if it is they'll say their "Welcome back, want me to rejoin?" stuff. If the PC chooses to re-admit them to the party, make sure to set the variable back to it's original state (probably 0).