Dialogue system - mganzarcik/fabulae GitHub Wiki

Dialogue components

Every dialogue in Fabulae consists of four basic components:

  1. NPCGreetings – dialogues can have several greetings defined – these define what are the starting texts displayed when a dialogue starts. Greetings can be tied to conditions, so some will only be used if certain conditions are met. If multiple greetings meet the criteria, one is selected at random.

  2. PCTalk – sentences said or actions performed by the player character engaged in the dialogue. A PCTalk can be tied to conditions, meaning they will only be available if these are met. Every PCTalk must be tied to at least one NPCTalk that will be displayed as a reaction to it. Since NPCTalks can also have conditions associated, their conditions are first evaluated when deciding which one do display and one is chosen at random from the resulting pool. PCTalks can additionally be marked as conversation ends, in which case the dialogue will be closed if the player chooses that such a PCTalk.

  3. NPCTalk – these are reactions to PCTalks. Every NPCTalk has a set of PCTalks defined. These PCTalks can be chosen by the player to further proceed with the conversation.

  4. PCSelector – these are special kinds of NPCTalks that not only display their own text and any linked PCTalks, but also automatically generate a list of PCTalks, where one corresponds to each player character currently in the group. If the player chooses any of them, that character will be set as the character engaged in the current dialogue. PCSelectors can also be tied to specific skills - if they are, skill values will be displayed for each character as well and once one is chosen, a skill check will automatically be performed for that character and skill. This is very useful when the player for example has to choose which character will perform some action in the story.

All the components above can also have actions defined. Actions will be executed when the component is displayed (for NPCtalks and greetings) or chosen by the player (for PCTalks).

Greeting and NPCTalks also can have an image associated - if they do, it will be displayed prominently at the top of the dialogue.

These components together form a pretty flexible system, that can be used to define many different interactions in the game world. The dialogues do not have to always take place between two characters - they can also describe an event or interaction where the player has to make a decision without engaging in an actual dialogue with another character.

Special elements

Texts in dialogues can use several special tags to display specific information:

  • <pcName> - displays the name of the player character engaged in the dialogue
  • <pcPronoun> - displays the pronoun for the player character (he / she / it)
  • <pcPossesivePronoun> - displays the possessive pronoun for the player character (his / her / its)
  • <pcObjectPronoun> - displays the object pronoun for the player character (him/ her / it)
  • <npcName> - displays the name of the non-player character engaged in the dialogue
  • <npcPronoun> - displays the pronoun for the non-player character (he / she / it)
  • <npcPossesivePronoun> - displays the possessive pronoun for the non-player character (his / her / its)
  • <npcObjectPronoun> - displays the object pronoun for the non-player character (him/ her / it)
  • <characterName(ID)> - displays the name of the GameObject with the supplied ID. The GO be known to the game, i.e. it must have been loaded before and tracked by the GameState

Dialogue editor

Fabulae comes with a basic dialogue editor to ease the process of creating dialogues. You can access the online version here: https://mganzarcik.github.io/fabulae/dialogue-editor/editor.htm

Dialogue examples:

https://github.com/mganzarcik/fabulae-showcase/blob/master/showcase/dialogues/Borsuk.xml

https://github.com/mganzarcik/fabulae-showcase/blob/master/showcase/dialogues/WMRiverCrossing.xml

⚠️ **GitHub.com Fallback** ⚠️