Table of Contents

Chatter

This ability is used to activate Chatter dialogue, which produces full dialogue boxes much like NPC dialogue.

Chatter data is stored on the tinker asset, as Dictionary<string, ChatterLinesData>, while the portrait, NPC, or display name is stored with variants. On ability activation, one set of ChatterLinesData will be picked based on priority and Condition, then one line out of the list will be chosen.

Args

Property Type Default Notes
ChatterPrefix string null A string prefix, used to filter for a specific group of ChatterLinesData by their keys.

Relevant Variant Data

Property Type Default Notes
Portrait string null A portrait texture, required to display a portrait and a name.
NPC string null An NPC name (key of Data/Characters) to associate this variant with, used to derive the display name.
Name string null A display name, used if there's no NPC.

The reason why Portrait/NPC/Name is stored with variants is so that you can associate portraits with their sprite, much like the appearance system in vanilla.

For trinkets that are meant to be a real NPC (or has at least an anti-social NPC entry), using the NPC field is preferred as it will make the dialogue box compatible with portraiture.

ChatterLinesData

Property Type Default Notes
Condition string "TRUE" A game state query used to check if this chatter should be picked. If you want to have chatter exclusively activate through ability with ProcChatterKey, use "FALSE".
Priority int 0 Sort priority of this chatter, higher number have their conditions checked first.
Lines List<string> null List of dialogue for this entry, this can be:
Responses Dictionary<string, string> null Response keys, needed only if your dialogue has $q that point to responses.

Choosing the next Dialogue Line

The Chatter system has nothing to do with the vanilla NPC dialogue keys beyond ability to reuse the same strings via translation key.

  1. If the previous dialogue has not finished (i.e. $e is used), finish that dialogue first.
  2. If a ProcChatterKey has been set and exists, skip the rest of the steps and pick that Chatter.
  3. Chatter data is sorted by Priority (highest to lowest)
  4. The first Chatter data that fits these conditions is picked:
    • Key starts with ChatterPrefix (if set)
    • Condition evaluates to true
    • There are at least 1 Lines in this Chatter
  5. A random dialogue from Lines is chosen, with equal chance, it can repeat.

Using $q in Chatter

Question depend on having key'd responses. To utilize this with Chatter, question goes in Lines, while matching response keys go in Responses.

(The following example is adapted from the official wiki)

Example:

"DialogueWithQuestion": {
  "Lines": [
    "I think I'll go to the beach tomorrow!#$q 305/306 beachquestion_followup#Would you like to go with me?#$r 305 15 beachquestion_yes#Sure, I would love to!#$r 306 0 beachquestion_sorry#Oh, sorry, I've already made plans with someone else...#$r 306 -10 beachquestion_no#No thank you."
  ],
  "Responses": {
    "beachquestion_yes": "Good! It's a date.$h",
    "beachquestion_sorry": "Oh. Darn. Okay.$6",
    "beachquestion_no": "Oh. Um. Sorry.$s",
    "beachquestion_followup": "$p 305#Tomorrow should be a lot of fun!$h|Hmm, I wonder if I can get someone to go with me...$s",
  }
}

Response keys are remembered, so after the first time the question is asked and answered, dialogue box will fall back to beachquestion_followup instead of offering choices.