Dialogue Modding – pt 1 – Orientation

Modding Dialogues Without The Toolset Editor

As requested, here’s how to mod dialogue files that aren’t accessible in the toolset dialogue editor, specifically those from Origins DLC or DA2.

Though you can use either pyGFF or the Toolset depending on personal preference, complex edits will likely require the use of both due to small limitations in each.

Extracting the dialogues

Dialogues for each campaign are located in module resources, not in core resources. So for example, the path for Awakening dialogues is Dragon Age\addins\dao_prc_ep_1\module\data\designerdialogues.erf while the path for DA2 basegame dialogues is Dragon Age 2\modules\campaignbase\data\designerconversations.erf. Origins files end in .dlg (dialogue) while DA2 files end in .cnv (conversation). Neither of these files is encrypted, unlike most DLC files. Extract or open the file you want using your tool of choice. You kind of just have to guess which one it is, though all files follow standard naming conventions.

Without the toolset we won’t be able to regenerate faceFX or recalculate animation blend trees (.dlb) so this is the only file we’ll need to edit.

A note on encrypted DLC

This is a legal grey area, but Bioware’s official stance on modding indicates that DLC assets are fair game to use in mods for the series as long as the modder 1) legally owns the DLC and 2) does not reproduce and redistribute the DLC to those who don’t own it. If you want to get at the DLC files you own and have installed on your hard drive, you can do so with the use of dedaodrm.exe or deda2drm.exe/slurpda2.exe. That’s as far as this tutorial will go on the subject. Use Google.

Orientation to dialogue structure

This is what a file looks like in the dialogue editor. Lines always alternate between red owner/speaker/NTRY and blue PC/listener/RPLY lines. The owner of this dialogue is Duncan, but other speakers can be tagged on individual lines.

Empty listener lines appear as [CONTINUE] (or [END DIALOGUE]) nodes and allow the conversation to continue uninterrupted by player input. Empty owner nodes also continue the conversation but in the toolset usually display as green [COMMENT] nodes.

In the toolset, grey linked lines show where one line is used in multiple dialogue branches. There is only ever one “real” entry for a line in the toolset. The toolset will not create completely identical duplicate copies of lines.

Any line can have multiple children, and the game chooses which line to play next based on conditions.

condition is composed of a plot, a flag, and a boolean (true/false) value. For owner/speaker lines, the game checks the condition for the first child line against the plot flags set in the save game. If the condition fails, then it moves down to evaluate the next, until it finds a line that is valid to play (there is usually a default line at the bottom of the list with no condition set, otherwise it’s possible to be ejected from the conversation early). For player/listener lines, the game checks the condition of each line and displays only the valid replies.

Actions, on the other hand, set or clear a specific plot flag when that line plays. This can be used to advance a particular plot quest, add or remove companion approval, move creatures and objects around in the scene, or any number of other scripted behaviors.

Note that there is also a (rarely-used) script field that can also be used to check the validity of a line or fire upon line completion.

One of the more important things to note is the ID, which is visible in the very bottom corner of the dialogue editor. This ID – the string reference– is used to locate the subtitle (in the module talktable), the voiceover audio, and the faceFX (lip sync) for each line that plays. The string reference is separate from the sequential line ID that is given to each line when a file is exported.

Understanding the basic structure of a dialogue makes it pretty easy to get at what’s going on once the conversation has been exported into GFF format.

Orientation to GFF structure

Above are two dialogues, one for Anders in Awakening and one for Zevran in DA2. Files from DAO are generally easier to read at first than those from DA2 because there’s more readable text, but the idea is basically the same. You can see both files have a starting list, indicating which lines of dialogue mark the beginning of separate branches. I’m using pyGFF for now because unlike the toolset it shows previews of the contents of unexpanded nodes (you can see the starting line IDs in Zevran’s file, for example).

Expanding the line list reveals further differences.

DAO dialogue files have all sorts of nonsense not present in DA2 conversation files. Some are for animations/cinematics, which in DA2 have been moved to external .cl files. Others are options which in DA2 have been converted to a single bitwise flag. (More on both of those concepts later). A few fields I’m pretty sure are never actually used in game.

For basic edits, everything we really want is present in both: the tlk string reference, the condition, and the children list.

Lines of dialogue export reasonably in order. One thing to note while unraveling the structure of the specific conversation you’re working with is that in DA2 speaker and player lines export mixed together, while DAO lines export speaker lines first (*NTRY) then player lines second (*RPLY). Player replies in Anders’ dialogue start at line 231, for example.

Here’s how the files look in the toolset editor, and a closer look at the conditions and actions. You’ll note the script field in DAO files is not present in DA2, but everything else is the same. There’s a plot GUID, a plot flag, and the plot test, which will be either 255 (true) or 0 (false).

Identifying plot flags

For the most part, you’ll be able to guess plot flags from context, but if you’re concerned with specific flags available in the DAO base game, you can find the flags and GUID in the toolset.

If you want to confirm a plot flag in DAO DLC you can find the same information in the .plo file.

>Unfortunately the plot structure of DA2 plot flags is very different, and none of it in human-readable format. Determining what plot flags you may need is a feat that requires a post all to itself.

Accessing the talktable

Of course all of this is pointless if we can’t see what each individual line is. That’s where the tlk string reference comes into play. Each string reference corresponds with an entry in the talktable.

Again, conversation data is located in module resources, not core resources. So the Awakenings talktable, for example, is in Dragon Age\addins\dao_prc_ep_1\module\data\talktables\dao_prc_ep_1_en-us.tlk and the DA2 talktable is in Dragon Age 2\modules\campaign_base\data\talktables\campaign_base_en-us.tlk. You can open talktables in the toolset or pyGFF if you reeeeeally want to but, uh, I really don’t recommend it.

For DAO talktables, download DAOTlkEdit. When you open the talktable, sort by StrRef (string reference) as, as is the case with line IDs, talktable entries end up more-or-less in order (though much less so, as string references are generated when the line is saved, not when the file is exported).

In the bottom right corner is a field where you can search for strings or string references. If you search for a string reference and it can’t be found, that just means it’s an empty string and that line functions as a [CONTINUE].

For DA2 talktables, you’ll need to export them in .txt format to be able to search them. Download DA2 Tlk Converter and copy the talktable into the same folder. Then copy the following into an empty text file and save it with the .bat extension in the same folder:

for %%a in (*.tlk) do da2tlkconv.exe -d -i %%a %%a.txt

Command line tools exist to export talktables to xml format. Download xoreos-tools and copy the talktable into its folder. Then type one of the following lines into an empty text file and save it with the .bat extension in the same folder:

for %%a in (*.tlk) do tlk2xml.exe --dragonage %%a %%a.xml

or

for %%a in (*.tlk) do tlk2xml.exe --dragonage2 %%a %%a.xml

Double clicking on the batch file will convert the talktable into an xml file you can open and search in any text editor.

Visualizing conversations from DA2

While you cannot open DLC dialogues or DA2 conversations in the toolset’s native conversation editor, some noble soul on the now-deleted Bioware forums did create a conversation viewer for DA2, and archive.org managed to snag most of it. This can be a helpful way to get an idea of the flow of a conversation before diving into the muddled mess that is GFF for yourself. Please read the installation instructions carefully. I barely remember how I got the SQL database working myself so I’m not going to help anyone troubleshooting. I’ve mirrored missing content here:

da2_content.zip (349 downloads)