Each file is named <npc name>.txt or <npc number>.txt (in the case of Lilith, who is really two NPCs), and consists of a series of 14-line entries. The first entry (0) is where your first conversation with the NPC starts, and the second entry (1) is where all later ones start.
The contents of each entry are:
Code: Select all
1 The entry number, starting at 0 2 The "choice group" number this entry is a member of, 0 for entries 0 and 1 3 The player text choice that leads to this response, or blank for entries 0 and 1 4 The NPC's text, or blank for direct links in line 5 5 Choice group number, or if negative, a direct link to a specific entry number. Negative values are often used to implement "[Back]" links 6 Quest number - only display if quest is in following state, 0 if unused 7 Quest state for line 6, 0 if unused 8 Quest number - don't display if quest is in following state, 0 if unused 9 Quest state for line 8, 0 if unused 10 Item required to display this option, blank if unused 11 Script to run after this option is selected, blank if unused 12-14 reserved, always contain the exact text "reserved"
Often a choice only appears in certain circumstances. That's where lines 6-10 come in. 6 and 7 represent a quest that must be in a certain state for the option to appear. For example, options that assign quests usually use the quest number and 0 here to ensure that you're not already on the quest. For example, you will only have the option to ask Seamus, "What do you do here in Rockhammer?" if you're not already on quest 3, A Hammer for Seamus.
Lines 8 and 9 are the opposite: a quest and state that will prevent the option from appearing. For example, the option "I have killed all the roaches that were in the mine." only appears in Logi's dialog if (1) quest 106 is in state 6 (lines 6-7) and (2) quest 4 (Exterminator, At Your Service) is NOT in state 9.
Finally, line 10 is the name of an item that you must have for the option to appear. For example, "I found the Crafting Hammer we talked about" only appears in Seamus's dialog if quest 3 (A Hammer for Seamus) is in state 1, AND if you have a Crafting Hammer. You can give an amount of gold here, like the "gold 300" Leisle wants for Logi's bar tab, but not for other items - the pearls quest is implemented in a different way.
To really take advantage of the conversation engine, you'll want to make good use of quests. Many of the quests used in conversations aren't "real" quests, though. They don't show up in the quest log, and you don't get messages about failing or completing them. You interact with them in the usual way with the quest-related scripting commands and lines 6 and 8 above. These "invisible" quests are numbered 100-150 (normal ones are 1-30), but I don't know if that's a limitation in the engine or just convention.
If you're going to make your own invisible quests, you will need to avoid the ones that already exist in the game. Depending on how mod support shakes out, we may eventually also need to keep a registry of allocated number ranges for different mods to allow mods to co-exist.
Anyway, here are the existing invisible quests with a brief description. Note that the last one is evidently special and set by the game engine itself rather than using the "quest" script command or similar.
Code: Select all
100 Met Morwen 101 Arima told you about Lilith 105 Lilith explained things to you 106 Counter for roach egg sacs (need 6) 107 Counter for scorption kills in the mine (need 12) 108 Dealt with Logi's tab 109 Asked Shelta Marie about Blackened Bone tavern 110 Note for Ranimer unsealed 112 Dannia gave you advice about Alundar (not fully implemented) 113 Lilith is dead 114 Madam Glida read your fortune (not fully implemented) 115 Ranimer gave you the odd note 116 You found the note's meaning 117 You agreed to kill scorpions for Logi 118-119 Well cranks that open seawardens guild 120 You made a deal with the Akadai kingspawn 121 Training available from Alywin 122 Basilisk spawned in Moonrise Underground 123 You chose to take the kingspawn's head 124 You selected a skill point or an ability point from the secret area 125 Something about the goblins and cataclysm - affects Baizel and Lilith 2's dialog 127 Talked to Magpie 128 Baizel's apparatus destroyed 129 Baizel appeared 130 Counter for kills in the seawardens guild (need 15) 131 Shrock told you about deadly skills permit 133 Lilith gave you Erubor's second letter 134 Lilith is at Macross Point 136-137 Mutually exclusive levers in the Wizardtorium 138 Counter for goblin kills (need 7) 139 Baizel is dead 141 Set after talking to Erubor 142 Edgar is dead 143 You have 10 pearls. Set by cond_special 3 150 The moon is in the sky