Changes

37 bytes added ,  17:13, 2 June 2022
no edit summary
Line 3: Line 3:  
This page explains how the game stores dialogue text, its format, and how the game parses it. This is an advanced guide for mod developers.
 
This page explains how the game stores dialogue text, its format, and how the game parses it. This is an advanced guide for mod developers.
   −
==Overview==
+
==Dialogue data==
 
Character dialogue is stored in many different files: The <samp>Characters\Dialogue</samp> directory is where the majority of NPC-specific dialogue is stored. <samp>Data\ExtraDialogue.xnb</samp>, <samp>Strings\Characters.xnb</samp>, <samp>Strings\Events.xnb</samp>, <samp>Strings\SpeechBubbles.xnb</samp>, and <samp>Strings\StringsFromCSFiles.xnb</samp> contain various other pieces of dialogue, some generic, and some NPC-specific.
 
Character dialogue is stored in many different files: The <samp>Characters\Dialogue</samp> directory is where the majority of NPC-specific dialogue is stored. <samp>Data\ExtraDialogue.xnb</samp>, <samp>Strings\Characters.xnb</samp>, <samp>Strings\Events.xnb</samp>, <samp>Strings\SpeechBubbles.xnb</samp>, and <samp>Strings\StringsFromCSFiles.xnb</samp> contain various other pieces of dialogue, some generic, and some NPC-specific.
   −
==Characters\Dialogue directory==
+
===Characters\Dialogue directory===
===Characters\Dialogue\{{t|NPC}}.xnb===
+
====Characters\Dialogue\{{t|NPC}}.xnb====
 
An NPC's named file in <samp>Character\Dialogue</samp> contains most of their dialogue. The game will choose dialogue from one of the sections below, in the order shown here.
 
An NPC's named file in <samp>Character\Dialogue</samp> contains most of their dialogue. The game will choose dialogue from one of the sections below, in the order shown here.
   −
====Special dialogue====
+
=====Special dialogue=====
 
There are a few predefined keys for specific cases:
 
There are a few predefined keys for specific cases:
 
{| class="wikitable"
 
{| class="wikitable"
Line 48: Line 48:  
|}
 
|}
   −
====Location dialogue====
+
=====Location dialogue=====
 
Otherwise the game will choose dialogue in this order.
 
Otherwise the game will choose dialogue in this order.
   Line 74: Line 74:  
|}
 
|}
   −
====Generic dialogue====
+
=====Generic dialogue=====
 
Otherwise the game will choose a dialogue using one of these key formats (in precedence order):
 
Otherwise the game will choose a dialogue using one of these key formats (in precedence order):
 
# <samp>{{t|season}}_{{t|key}}_inlaw_{{t|spouseName}}</samp>
 
# <samp>{{t|season}}_{{t|key}}_inlaw_{{t|spouseName}}</samp>
Line 107: Line 107:  
|}
 
|}
   −
===Characters\Dialogue\rainy.xnb===
+
====Characters\Dialogue\rainy.xnb====
 
This file contains one dialogue entry per NPC. There's a roughly 50% chance they'll use this dialogue if one of the above didn't match, it's raining, and you're not married to or divorced from them.
 
This file contains one dialogue entry per NPC. There's a roughly 50% chance they'll use this dialogue if one of the above didn't match, it's raining, and you're not married to or divorced from them.
   −
===Marriage dialogue===
+
====Marriage dialogue====
 
<samp>Characters\Dialogue\MarriageDialogue.xnb</samp> contains dialogue text for all spouses, and each NPC may optionally have their own dialogue file like <samp>Characters\Dialogue\MarriageDialogueAbigail.xnb</samp>. When looking up a dialogue key, it will use the one in the NPC's file if it exists, else the one in the generic file, else a default text (usually blank).
 
<samp>Characters\Dialogue\MarriageDialogue.xnb</samp> contains dialogue text for all spouses, and each NPC may optionally have their own dialogue file like <samp>Characters\Dialogue\MarriageDialogueAbigail.xnb</samp>. When looking up a dialogue key, it will use the one in the NPC's file if it exists, else the one in the generic file, else a default text (usually blank).
   Line 168: Line 168:  
|}
 
|}
   −
==Data directory==
+
===Data directory===
===Data/EngagementDialogue.xnb===
+
====Data/EngagementDialogue.xnb====
 
Similar to the rain dialogue, this file contains entries in the form of <samp>{{t|NPC}}0</samp> and <samp>{{t|NPC}}1</samp>, which are used when you are engaged but not yet married to an NPC, or, in the case of a roommate, when they have been invited but have not yet moved in.
 
Similar to the rain dialogue, this file contains entries in the form of <samp>{{t|NPC}}0</samp> and <samp>{{t|NPC}}1</samp>, which are used when you are engaged but not yet married to an NPC, or, in the case of a roommate, when they have been invited but have not yet moved in.
   −
===Event files===
+
====Event files====
 
<samp>Data\Events\*.xnb</samp> contains event scripts, including any dialogue in the event (see [[Modding:Event data]]).
 
<samp>Data\Events\*.xnb</samp> contains event scripts, including any dialogue in the event (see [[Modding:Event data]]).
   −
===Animation descriptions===
+
====Animation descriptions====
 
<samp>Data\animationDescriptions.xnb</samp> contains short bits of dialogue to go with certain schedule points.
 
<samp>Data\animationDescriptions.xnb</samp> contains short bits of dialogue to go with certain schedule points.
   −
==Strings directory==
+
===Strings directory===
===Strings\StringsFromCSFiles.xnb===
+
====Strings\StringsFromCSFiles.xnb====
 
Contains miscellaneous strings, such as dialogue that's shared between multiple characters, dialogue for some hardcoded events like marriage, etc.
 
Contains miscellaneous strings, such as dialogue that's shared between multiple characters, dialogue for some hardcoded events like marriage, etc.
   Line 186: Line 186:  
In most situations, if the game is unable to find a string for an NPC to say, it will default to <samp>NPC.cs.4061</samp>. (English version: "Hi.")
 
In most situations, if the game is unable to find a string for an NPC to say, it will default to <samp>NPC.cs.4061</samp>. (English version: "Hi.")
   −
===Speech bubbles===
+
====Speech bubbles====
 
<samp>Strings/SpeechBubbles.xnb</samp> contains dialogue spoken by NPCs through speech bubbles when '''the player''' enters a given location. This is distinct from the <samp>{{t|location}}_Entry</samp> field in an NPC's <samp>Characters/Dialogue/*.xnb</samp> file, which is triggered when '''the NPC''' enters a given location.
 
<samp>Strings/SpeechBubbles.xnb</samp> contains dialogue spoken by NPCs through speech bubbles when '''the player''' enters a given location. This is distinct from the <samp>{{t|location}}_Entry</samp> field in an NPC's <samp>Characters/Dialogue/*.xnb</samp> file, which is triggered when '''the NPC''' enters a given location.
   Line 233: Line 233:  
|}
 
|}
   −
==Miscellaneous==
+
===Miscellaneous===
 
There are various other strings that are customizable on a per-NPC basis, stored outside of the <samp>Characters/Dialogue</samp> folder.
 
There are various other strings that are customizable on a per-NPC basis, stored outside of the <samp>Characters/Dialogue</samp> folder.
   Line 260: Line 260:  
|}
 
|}
   −
==NPC-specific generic dialogue==
+
===NPC-specific generic dialogue===
 
Many dialogue strings are, in the vanilla Stardew Valley framework, unable to be customized on a per-NPC basis. For example, an NPC's response to being given a [[bouquet]]. A workaround to this problem is possible using {{nexus mod|1915|Content Patcher}} alone, but in modern modding, {{nexus mod|6358|Custom Fixed Dialogue}} is recommended to be used instead.
 
Many dialogue strings are, in the vanilla Stardew Valley framework, unable to be customized on a per-NPC basis. For example, an NPC's response to being given a [[bouquet]]. A workaround to this problem is possible using {{nexus mod|1915|Content Patcher}} alone, but in modern modding, {{nexus mod|6358|Custom Fixed Dialogue}} is recommended to be used instead.
  
118

edits