Modding:Conversations

From Caves of Qud Wiki
Revision as of 22:46, 31 May 2019 by Gnarf (talk | contribs) (incremental changes just checking formatting / to share)
Jump to navigation Jump to search


Conversations are loaded as templates from Conversations.xml - The base conversations can not be extended or modified through the XML, however there are events that will allow dynamically editing conversations as they happen.

Conversation Object Parts

In order to be conversable, an object should use the CovnersationScript part and attach a conversation template ID.

Snippet of ObjectBlueprints.xml that links Mehmet's Conversation to "JoppaMehmet"

  <object Name="Mehmet" Inherits="NPC">
    <part Name="ConversationScript" ConversationID="JoppaMehmet" />
  </object>

Conversation.xml format and examples

The xml file for conversation consists of a single <conversations> node with multiple <conversation> nodes underneath. It does not currently support extending the base game dialog via Load="Merge" or the other similar tricks used for many of the XMLs. Creating a Conversation.xml file for your mod would be done when you want to add a new specific conversation / template to be used in the game.

Snippet of Conversation.xml with Mehmet's script

<?xml version="1.0" encoding="utf-8"?>
<conversations>
  <conversation ID="JoppaMehmet">
    <node ID="Start" IfNotHaveQuest="What's Eating the Watervine?">
      <text>
Live and drink, =player.formalAddressTerm=. May you find shade in Joppa.</text>
      <choice GotoID="AboutJoppa1">What can you tell me about Joppa?</choice>
      <choice GotoID="LookingForWork1">I am in search of work.</choice>
      <choice GotoID="End">Live and drink.</choice>
    </node>
    <node ID="Start" IfHaveQuest="What's Eating the Watervine?" IfNotFinishedQuest="What's Eating the Watervine?">
      <text>
Live and drink, =player.formalAddressTerm=. Have you tidings from Red Rock?
      </text>
      <choice GotoID="FinishExploringRedrock1" IfHasBlueprint="Girshling Corpse">Yes. I found bits of gnawed watervine and slew a white spiderling. I carry its corpse with me.</choice>
      <choice GotoID="End">I'm working on it, =pronouns.personTerm=! Live and drink.</choice>
    </node>
    <node ID="Start" IfHaveQuest="What's Eating the Watervine?" IfFinishedQuest="What's Eating the Watervine?">
      <text>
Live and drink, =player.formalAddressTerm=. May you find shade in Joppa.</text>
      <choice GotoID="AboutJoppa2">What can you tell me about Joppa?</choice>
      <choice GotoID="End">Live and drink.</choice>
    </node>
    <node ID="FinishExploringRedrock1">
      <text>
What a hideous thing! I dread the horrors its presence portends. Bring the
corpse to Elder Irudad's hut for the Elder to examine.
      </text>
      <choice GotoID="End">As you say.</choice>
    </node>
    <node ID="LookingForWork1">
      <text>
Some critters are eating our watervine. Faarooq claims he saw one slinking around a vine patch. Ugly little thing, he says; pale white, eight legs, an ear-splitting whine.

I noticed a bit of red dirt in the watervine pool, the same we find in the soil at a nearby &amp;Ycave to the north&amp;y we call &amp;rRed Rock.&amp;y

Travel to &amp;rRed Rock&amp;y and kill as many of these critters as you can. Bring back the corpse of one, too. &amp;GElder Irudad&amp;y will reward your efforts.
</text>
      <choice GotoID="End" StartQuest="What's Eating the Watervine?">I will do as you ask.</choice>
      <choice GotoID="Start">I will perform no such peasant's task.</choice>
    </node>
    <node ID="AboutJoppa1">
      <text>
You would be wise to speak with &amp;GElder Irudad.&amp;y Look for his hut to the north.
    </text>
      <choice GotoID="LookingForWork1" IfNotFinishedQuest="What's Eating the Watervine?">I am in search of work.</choice>
      <choice GotoID="End">Live and drink.</choice>
    </node>
    <node ID="AboutJoppa2">
      <text>
You would be wise to speak with &amp;GElder Irudad.&amp;y Look for his hut to the north.
</text>
      <choice GotoID="End">Live and drink.</choice>
    </node>
  </conversation>
</conversations>