Modding:Dialogue

From Stardew Valley Wiki
Revision as of 08:49, 4 May 2017 by Bmarquismarkail (talk | contribs) (Created page with "← Index This page explains how the game stores and obtains dialogue. This is an advanced guide for mod developers ==Source== The various dialogue options...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Index

This page explains how the game stores and obtains dialogue. This is an advanced guide for mod developers

Source

The various dialogue options are located in the following files:

  • Data\Strings\StringsFromCSFiles*.xnb : A common string pool for the game, including NPC dialogue
  • Data\Events\*.xnb : Event Specific Information.
  • Characters\Dialogue\*.xnb :Character specific dialog

For more information on Events, click on Event data. This page will explain the format of the String Pool and Character Specific Strings, and how the game parses them.

The String Pool

The Common String Pool has every bit of dialogue in the game that all Characters share. This is usually the last resort, if the game couldn't find character specific or event specific dialogue. the format of the strings located in this file are

<file most likely to use it>.<integerid>: "String" #!String

Take note of the integerid. This is what the game uses in some cases to find more specific dialogue (eg: marriage dialogue).

Character-Specific Dialogue

Every Character has a .xnb file for their specific dialogue located in the Characters\Dialogue\ folder. The format for these strings are

<Preface>[Heart Level]_[Day Of Month/Week]_[Year Number][suffix] : "String" #!String

Where:

  • Preface is any string identifying what it is for (Introduction, Event, Season, arbitrary things, etc.).
  • Heart Level is the minimum heartlevel the npc needs to be in order for this dialogue to fire.
  • Day Of Month/Week is the number day of the month or the 3-character day of the week
  • Year Number is either 1 (year one) or 2 (years 2 and beyond), and
  • Suffix is any string further identifying the dialogue (e.g. _inlaw_Abigail for Pierre and Caroline, identifying that this dialogue will fire if you are married to Abigail).

Parsing

The game parses for dialogue as follows:

  • If it's an Event, it parses for event dialogue (Data\Events or StringsFromCSFiles Event.cs group)
  • Then it parses for location-specific dialogue (StringsFromCSFiles [location].cs group)
  • Then it parses for Character-specific dialogue, prioritizing as follows:
    • Marriage Status
    • Preface value
    • Suffix value
    • In-law status
    • Day of Month
    • Year
    • Heart Level
    • Day of Week
  • Then, if it can't find any after that, it resorts to the NPC.cs group in StringsFromCSFiles