NWN Dialog File Format

Dialog files are resource files in GFF format, of type "DLG". It may be helpful while reading this document to have Torlack's nwnexplorer program open on a open on a dialog file in a module. Look under the category "Dialogs". You should also be familiar with Torlack's description of the GFF format (though he calls it ITP)

Root Entry

Under the root Entry there are several Elements, key are:

LIST .EntryList
contains Entries describing each possible thing an NPC could say.
LIST .ReplyList
contains Entries describing each possible thing a PC could say.
LIST .StartingList
Names the NPC nodes in .EntryList that may appear when the conversation starts.

Each of these is described later under its own heading.

A note: The Active entry is attached to the incoming edge, and replicated on each Link edge as well, even though in the Aurora dialog editor UI, the script seems to be associted with the node itself and you can't edit the script with the Link.

The Entries in each of .EntryList, .ReplyList, .StartingList have their "Code" element set to their index in that list.

.EntryList Element

Among other things,

STRREF .EntryList.<i>.Text
Contains the NPC's words.
RESREF .EntryList.<i>.Script
Refers to the action taken script.
STRING .EntryList.<i>.Comment
The developer's comment.
LIST .EntryList.<i>.RepliesList
Refers to the PC's possible replies.
UINT32 .EntryList.<i>.RepliesList.<j>.Index
Refers to the PC node describing this reply in the PC's LIST of all conversation nodes .ReplyList (described later)
RESREF .EntryList.<i>.RepliesList.<j>.Active
Refers to the script controlling whether this option appears to the PC. This appears to be redundant because it is also recorded elsewhere (more later).
UINT8 .EntryList.<i>.RepliesList.<j>.IsChild
Value is 0 for normal edges, 1 if this is a 'link' edge (alias). Though the conversation tree can take the form of general directed bipartite graph (excepting the start node), exactly one path from the beginning to any particular node is canonical, and all other paths involve a special edge called a link. So, the conversation is primarily tree, with exceptions.
STRING .EntryList.<i>.RepliesList.<j>.LinkComment
Optional. If .IsChild=1, then this field shadows the Comment field in the target PC node in the ReplyList(discussed later).

.ReplyList Element

This is the same as .EntryList, swapping PC and NPC. Exceptions:

Entry .ReplyList.<i>.EntriesList.<j>
Describes the possible NPC responses in the same format as .EntryList.<i>.RepliesList.<j>

.StartingList Element

UINT32 .StartingList.<i>.Index
As before, refers to an Entry in .EntryList
RESREF .StartingList.<i>.Active
Refers to the script that controls whether this node appears.