[#modding] It would be nice to have the ability to include a certain conversation in anothe...

Issue #5014 resolved
Freehold Games Bot Account created an issue

Marked for crossposting by: Armithaig

Message (jump):

<JadeLavenza> It would be nice to have the ability to include a certain conversation in another conversation, either via inheriting or including. This would allow for reducing repeated conversation nodes in conversations that extend dialogue, like Tam's dialogue being an extension of normal Dromad trader dialogue with extra additions or changes. Redefining nodes with the same ID and load="Merge" would allow for parts of inherited choices to be changed while keeping others, like existing choices or text.

Additionally, it would be useful to have choices defined outside of a node (i.e. conversation-level choices) that are automatically added to nodes. For example, <choice GotoID="Start" SpecialRequirement="GiveAllBooks">I have multiple books to donate.</choice> would be added to all nodes, but <choice Excludes="foo,bar" GotoID="foo">text</choice> would be added to all nodes except ones with the ID "foo" or "bar". I'm unsure if it would be best to apply it to all nodes (even the ones defined before it) or simply the nodes after it, but either way it would substantially reduce boilerplate/duplicated definitions.

Combined, this could look something like:
```xml
<conversation ID="JoppaDoru">
<choice Excludes="WhoIsTam" GotoID="WhoIsTam">I am =name=. Who are you?</choice>
<choice Excludes="Joppa" GotoID="Joppa">Do you live here?</choice>

<include ID="DromadTrader" /> <!-- should also include the conversation-level choices from the included conversation -->

<node ID="WhoIsTam">  
  <text>  
    It is a pleasure, =player.formalAddressTerm= =name=. I am Tam.  
  </text>  
  <choice GotoID="End">Live and drink, Tam.</choice>  
</node>

<node ID="Joppa">  
  <text>  
    Joppa is my home, yes.

    Once I walked the Moghra'yi like so many of my brethren, but upon meeting Elder Irudad, knew at once to settle down here. You will understand, =player.formalAddressTerm=, if you speak to him.  
  </text>  
  <choice GotoID="End">Ah. Live and drink.</choice>  
</node>

<node ID="AboutTheDromad" Load="Merge"> <!-- merges with included conversation -->  
  <text>  
    I am dromad, =pronouns.formalAddressTerm=. A saltstrider. My people have walked the salt for thousands of years, meeting every creature that lives and thinks. You will not find better, more resourceful traders in all of Qud than we.  
  </text>  
</node>

</conversation>
`` One modified and three new lines of code for the conversation-scope choices and including another conversation allow us to save 13 lines of duplicate code. (That could be reduced to 2 new and 2 modified lines of code if it inherited instead, with<conversation ID="JoppaDoru" Inherits="DromadTrader">`, but it would be unintuitive (though feasible) to have multiple includes that way.)

Regardless, it still makes conversation definition (especially for modders) a lot easier, and prevents things like copy-and-paste errors. Previously, if a modder wanted to have vanilla conversation choices on a modded node, they would have to readd it manually--which means that between version changes or with simple coder error, it could link to the wrong node, have outdated text, or simply stop functioning.

Comments (2)

  1. Log in to comment