Changes

Jump to navigation Jump to search
→‎Rain dialogue: Clarifying conditions (“one of the above” not including generic dialogue which is listed above it)
Line 55: Line 55:     
The game will check variants in this order: <samp>{{t|season}}{{t|key}}</samp>, and <samp>{{t|key}}</samp>. The variants aren't listed below for simplicity.
 
The game will check variants in this order: <samp>{{t|season}}{{t|key}}</samp>, and <samp>{{t|key}}</samp>. The variants aren't listed below for simplicity.
 +
Unlike daily dialogue, location dialogue is endlessly repeatable as long as the trigger conditions are fulfilled, ''e.g.,'' Being in the location. They will not remove daily dialogue from an npc's dialogue rotation, but will merely overwrite it when the NPC is in the specified location.
    
{| class="wikitable"
 
{| class="wikitable"
Line 72: Line 73:  
| <samp>{{t|location}}</samp>
 
| <samp>{{t|location}}</samp>
 
| Dialogue shown in the named location.<br /><small>Example: <samp>Saloon: "Now that I'm here I can finally relax and socialize a bit."</samp></small>
 
| Dialogue shown in the named location.<br /><small>Example: <samp>Saloon: "Now that I'm here I can finally relax and socialize a bit."</samp></small>
 +
*Note: Location dialogue will be accessible even if the NPC is only walking through the specified map unlike schedule strings that will only be accessible once the schedule end location is reached.
 
|}
 
|}
    
=====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|spouse}}</samp>
 
# <samp>{{t|season}}_{{t|key}}</samp>
 
# <samp>{{t|season}}_{{t|key}}</samp>
# <samp>{{t|key}}_inlaw_{{t|spouseName}}</samp>
+
# <samp>{{t|key}}_inlaw_{{t|spouse}}</samp>
 
# <samp>{{t|key}}</samp>
 
# <samp>{{t|key}}</samp>
   −
For each variation above: <samp>{{t|season}}</samp> is a [[#Seasons|season name]] (like <samp>spring_14</samp>); <samp>_inlaw_{{t|spouseName}}</samp> matches if the player is married to the named NPC, regardless of whether the speaking NPC is related to the named one (like <samp>Sat_inlaw_Abigail</samp>); and <samp>{{t|key}}</samp> is one of the formats listed below.
+
For each variation above: <samp>{{t|season}}</samp> is a [[#Seasons|season name]] (like <samp>spring_14</samp>); <samp>_inlaw_{{t|spouse}}</samp> matches if the player is married to the named NPC, regardless of whether the speaking NPC is related to the named one (like <samp>Sat_inlaw_Abigail</samp>); and <samp>{{t|key}}</samp> is one of the formats listed below.
    
{| class="wikitable"
 
{| class="wikitable"
Line 95: Line 97:  
|-
 
|-
 
| <samp>{{t|dayOfWeek}}{{t|hearts}}_{{t|firstOrLaterYear}}</samp>
 
| <samp>{{t|dayOfWeek}}{{t|hearts}}_{{t|firstOrLaterYear}}</samp>
| Dialogue shown on the given [[#Days of week|day of week]] if you have at least {{t|hearts}} hearts with them, in the [[#First/later year|first/later year]]. The {{t|hearts}} will be checked in the order 10, 8, 6, 4, 2 (no other value will be recognised).<br />'''Bug:''' only shown if an equivalent <samp>{{t|dayOfWeek}}{{t|hearts}}</samp> key also exists.<br /><small>Example: <samp>Thu2_2: "Well, my Dad is back. Have you met him?#$b#I'm just glad he's okay."</samp></small>
+
| Dialogue shown on the given [[#Days of week|day of week]] if you have at least {{t|hearts}} hearts with them, in the [[#First/later year|first/later year]]. The {{t|hearts}} will be checked in the order 10, 8, 6, 4, 2 (no other value will be recognised).<br />'''Bug:''' only shown if an equivalent <samp>{{t|dayOfWeek}}{{t|hearts}}</samp> key also exists.<br /><small>Example: <samp>Thu2_2: "Well, my Dad is back. Have you met him?#$b#I'm just glad he's okay."</samp></small>{{upcoming|1.6|Fixed bug.}}
 
|-
 
|-
 
| <samp>{{t|dayOfWeek}}{{t|hearts}}</samp>
 
| <samp>{{t|dayOfWeek}}{{t|hearts}}</samp>
Line 101: Line 103:  
|-
 
|-
 
| <samp>{{t|dayOfWeek}}_{{t|firstOrLaterYear}}</samp>
 
| <samp>{{t|dayOfWeek}}_{{t|firstOrLaterYear}}</samp>
| Dialogue shown on the given [[#Days of week|day of week]] in the [[#First/later year|first/later year]].<br />'''Bug:''' only shown if an equivalent <samp>{{t|dayOfWeek}}</samp> key also exists.<br /><small>Example: <samp>Sat_1: "Dad's coming back soon!#$b#I hope he brings me some toys.$u"</samp></small>
+
| Dialogue shown on the given [[#Days of week|day of week]] in the [[#First/later year|first/later year]].<br />'''Bug:''' only shown if an equivalent <samp>{{t|dayOfWeek}}</samp> key also exists.<br /><small>Example: <samp>Sat_1: "Dad's coming back soon!#$b#I hope he brings me some toys.$u"</samp></small>{{upcoming|1.6|Fixed bug.}}
 
|-
 
|-
 
| <samp>{{t|dayOfWeek}}</samp>
 
| <samp>{{t|dayOfWeek}}</samp>
Line 108: Line 110:     
====Rain dialogue====
 
====Rain dialogue====
<samp>Characters\Dialogue\rainy.xnb</samp> 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.
+
<samp>Characters\Dialogue\rainy.xnb</samp> contains one dialogue entry per NPC. There's a roughly 50% chance they'll use this dialogue if a special or location dialogue doesn’t match, it's raining, and you're not married to or divorced from them.
    
====Marriage dialogue====
 
====Marriage dialogue====
Line 171: Line 173:  
====Engagement dialogue====
 
====Engagement dialogue====
 
Similar to the rain dialogue, <samp>Data\EngagementDialogue.xnb</samp> 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, <samp>Data\EngagementDialogue.xnb</samp> 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====
 +
<samp>Data\Events\*.xnb</samp> contains event scripts, including any dialogue in the event (see [[Modding:Event data]]).
    
====Extra dialogue====
 
====Extra dialogue====
Line 180: Line 185:  
! description
 
! description
 
|-
 
|-
| <samp>PurchasedItem_{{t|NPC}}</samp></br><samp>PurchasedItem_{{t|NPC}}_Quality{{t|Quality}}</samp></br><samp>PurchasedItem_{{t|Number}}_Quality{{t|Quality}}_{{t|NPC}}</samp>
+
| <samp>PurchasedItem_*</samp>
| An NPC-specific version of the "purchased item" strings. {{t|Quality}} is Low or High. {{t|Number}} is a number from 1 to 5.
+
| Randomly shown by a non-child town NPC after you sell an edible item to a shop. These keys are hardcoded, and you can't add new keys with a similar pattern.
 +
 
 +
For keys with a number infix (like <samp>PurchasedItem_5_Cooking</samp>), the number is selected as such:
 +
* If the NPC is marked as rude in their data, they use 3.
 +
* Otherwise they randomly choose 1-5.
 
|-
 
|-
| <samp>Town_DumpsterDiveComment_{{t|NPC}}</samp>
+
| <samp>Town_DumpsterDiveComment_Child</samp><br /><samp>Town_DumpsterDiveComment_Teen</samp><br /><samp>Town_DumpsterDiveComment_Adult</samp><br /><samp>Town_DumpsterDiveComment_Linus</samp>
| An NPC-specific comment for being caught dumpster-diving. Currently only used for Linus, who uniquely has a positive reaction.
+
| Shown when an NPC catches you rummaging through trash cans, depending on the NPC's age. Linus has his own dialogue, but other NPCs don't.
 
|-
 
|-
| <samp>SummitEvent_Dialogue3_{{t|Spouse name}}</samp>
+
| <samp>SummitEvent_Dialogue3_{{t|spouse}}</samp>
| An NPC-specific dialogue line used near the end of the Summit cutscene.
+
| Shown for your NPC spouse near the start of the [[perfection]] cutscene.
 
|}
 
|}
   −
====Event files====
+
====Movie theater dialogue====
<samp>Data\Events\*.xnb</samp> contains event scripts, including any dialogue in the event (see [[Modding:Event data]]).
+
An NPC's reaction to a movie is stored in <samp>Data\MoviesReactions.xnb</samp>, which is structured far differently from every other dialogue file. See [[Modding:Movie theater data]] for more details.
    +
===Strings directory===
 
====Animation descriptions====
 
====Animation descriptions====
<samp>Data\animationDescriptions.xnb</samp> contains short bits of dialogue to go with certain schedule points.
+
<samp>Strings\animationDescriptions.xnb</samp> contains short bits of dialogue to go with certain schedule points. '''Not to be confused to <samp>Data\animationDescriptions.xnb</samp>, which contains the data of animations, rather than the strings for their description.'''
   −
===Strings directory===
   
====Characters====
 
====Characters====
 
<samp>Strings\Characters.xnb</samp> contains miscellaneous dialogue, some of which is NPC-specific:
 
<samp>Strings\Characters.xnb</samp> contains miscellaneous dialogue, some of which is NPC-specific:
Line 205: Line 214:  
! description
 
! description
 
|-
 
|-
| <samp>MovieInvite_Invited_{{t|NPC}}</samp></br><samp>MovieInvite_Spouse_{{t|Spouse name}}</samp>
+
| <samp>MovieInvite_Spouse_{{t|NPC name}}</samp>
| A custom response to being invited to see a movie.
+
| Shown when the NPC accepts a [[Movie Ticket|movie ticket]] when they're married to you. If missing, defaults to a <samp>MovieInvite_Invited_*</samp> key.
 +
|-
 +
| <samp>MovieInvite_Invited_{{t|NPC name}}</samp><br /><samp>MovieInvite_Invited_{{t|manner}}</samp><br /><samp>MovieInvite_Invited_{{t|socialAnxiety}}</samp><br /><samp>MovieInvite_Invited_{{t|optimism}}</samp><br /><samp>MovieInvite_Invited_{{t|age}}</samp><br /><samp>MovieInvite_Invited</samp>
 +
| Shown when the NPC accepts a [[Movie Ticket|movie ticket]]. The NPC will use the first key that exists in the order listed here.
 +
 
 +
The {{t|manner}}, {{t|socialAnxiety}}, and {{t|optimism}} values are those specified in the [[Modding:NPC data|NPC's equivalent data fields]]. The {{t|age}} value is one of <samp>Child</samp>, <samp>Teen</samp>, or <samp>Adult</samp>.
 +
|-
 +
| <samp>Phone_*</samp>
 +
| Shown when calling a shop owner NPC on the [[telephone]]. These keys are hardcoded, so new keys with the same pattern will be ignored.
 
|}
 
|}
    
====Events====
 
====Events====
<samp>Strings\Events.xnb</samp> contains miscellaneous dialogue related to events and festivals, some of which is NPC-specific:
+
<samp>Strings\Events.xnb</samp> contains miscellaneous dialogue related to events and festivals, some of which is NPC-specific.
 +
 
 +
====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.
   −
{| class="wikitable"
+
These keys are hardcoded, so new keys with the same pattern will be ignored.
|-
  −
! key format
  −
! description
  −
|-
  −
| <samp>SpouseFlowerDanceAccept_{{t|Spouse name}}</samp>
  −
| If specified, it will be used when a NPC who is your spouse accepts your offer to dance at the Flower Dance. Otherwise, the NPC will use a string from <samp>Strings\StringsFromCSFiles.xnb</samp>.
  −
|}
      
====Strings from CS files====
 
====Strings from CS files====
Line 226: Line 239:  
The file has entries in the form <samp>"<key>": "dialogue string"</samp>, where the key is an arbitrary unique identifier. These must exactly match the key expected by the game, but the keys are just unique identifiers &mdash; even though most keys look like <samp>{{t|file name}}.{{t|line number}}</samp>, that's just the convention originally used to assign IDs and it has no meaning or effect (nor does it even necessarily match the current file name or line number).
 
The file has entries in the form <samp>"<key>": "dialogue string"</samp>, where the key is an arbitrary unique identifier. These must exactly match the key expected by the game, but the keys are just unique identifiers &mdash; even though most keys look like <samp>{{t|file name}}.{{t|line number}}</samp>, that's just the convention originally used to assign IDs and it has no meaning or effect (nor does it even necessarily match the current file name or line number).
   −
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.").
    
Some other useful NPC-specific strings stored here are as follows:
 
Some other useful NPC-specific strings stored here are as follows:
Line 235: Line 248:  
! description
 
! description
 
|-
 
|-
| <samp>{{t|NPC}}_AfterWedding</samp></br><samp>{{t|NPC}}_Engaged</samp></br><samp>{{t|NPC}}_EngagedRoommate</samp></br><samp>{{t|NPC}}_Stardrop</samp>
+
| <samp>{{t|NPC name}}_AfterWedding</samp>
| Stored in <samp>Strings\StringsFromCSFiles.xnb</samp>. Currently only used for Krobus. Despite the name, <samp>AfterWedding</samp> is used when Krobus arrives at the farm. <samp>Stardrop</samp> is used when Krobus gifts you a [[Stardrop]].
+
| Shown after marrying an NPC, when you talk to them on the farm on the same day.
 +
|-
 +
| <samp>{{t|NPC name}}_Engaged</samp></br><samp>{{t|NPC name}}_EngagedRoommate</samp>
 +
| Shown after the NPC accepts an engagement item (e.g. [[Mermaid's Pendant|mermaid's pendant]] or [[Void Ghost Pendant|void ghost pendant]] for vanilla NPCs).
 +
|-
 +
| <samp>Krobus_Stardrop</samp>
 +
| Shown when Krobus gives you the [[Stardrop#Locations|spouse stardrop]]. Other NPCs don't have an equivalent entry, and will use <samp>Strings\StringsFromCSFiles:NPC.cs.4001</samp> instead.
 +
 
 +
{{upcoming|1.6|This no longer exists; use <samp>SpouseStardrop</samp> in <samp>Characters/Dialogue/&lt;name&gt;</samp> instead.}}.
 
|}
 
|}
   −
====Speech bubbles====
+
===NPC-specific generic dialogue===
<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.
+
With some ingenuity, you can make each NPC respond differently instead of using the normal static dialogue. You can use a special mod like {{nexus mod|6358|Custom Fixed Dialogue}}, but the same effect can be achieved with just {{nexus mod|1915|Content Patcher}} with some effort. To change <samp>NPC.cs.3962</samp> and <samp>NPC.cs.3963</samp> (to give a bouquet), and <samp>NPC.cs.3980</samp> (for the mermaid pendant acceptance):
 +
 
 +
<syntaxhighlight lang="json">
 +
{
 +
  "Action": "EditData",
 +
  "Target": "Strings/StringsFromCSFiles",
 +
  "Entries": {
 +
      "NPC.cs.3962": "$q 10001 give_flowersA#?!...#$r 10001 0 give_flowersA# [Give Bouquet]",
 +
      "NPC.cs.3963": "$q 10001 give_flowersB#?!...#$r 10001 0 give_flowersB# [Give Bouquet]",
 +
      "NPC.cs.3980": "$q 10001 give_pendant#?!...#$r 10001 0 give_pendant# Will you marry me?"
 +
  }
 +
}
 +
</syntaxhighlight>
 +
 
 +
In this example, each NPC will get their response from the <samp>give_flowersA</samp>, <samp>give_flowersB</samp>, and <samp>give_pendant</samp> dialogue key in their [[Modding:Dialogue#Character-specific dialogue|character dialogue]] files. (See [[#Format|format]] below for more info on the syntax.)
   −
Entries are in the following formats. All entries which are applicable make up a pool that the game randomly chooses from.
+
Note that these should be added for all datable characters to avoid errors. For example, you could add this for Haley:
   −
{| class="wikitable"
+
<syntaxhighlight lang="json">
|-
+
{
! key format
+
  "Action": "EditData",
! description
+
  "Target": "Characters/Dialogue/Haley",
|-
+
  "Entries": {
| <samp>{{t|location}}_{{t|NPC}}_Spouse</samp>
+
      "give_flowersA": "Oh.. these are beautiful.$1#$b#...What? You want to be my Boyfriend?$8^...What?  You want to be my Girlfriend?$8#$b#....I thought we already were together.$1",
| Added to the pool when the given NPC is your spouse.
+
      "give_flowersB": "Ohhh, @!  I would love to be your true love.$1",
|-
+
      "give_pendant": ".....$8#$b#@, I don't know what to say..$8#$b#...$7#$b#Yes... I accept...$4#$b#I can't wait to tell the Mayor... Everything should take 3 days to set up.$1"
| <samp>{{t|location}}_{{t|NPC}}_CloseFriends</samp>
+
  }
| Added to the pool when you have a certain friendship level with the NPC.
+
}
|-
+
</syntaxhighlight>
| <samp>{{t|location}}_{{t|NPC}}_NotCloseFriends</samp>
+
 
| Added to the pool when you are below a certain friendship point threshold with the NPC.
+
This can be used for other generic responses, and you even can avoid the "Give Bouquet" by asking for an answered question's ID.
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_Raining</samp>
  −
| Added to the pool when it is raining. Can be suffixed with a number, in which case all entries will be added to the pool.
  −
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_NotRaining</samp>
  −
| Added to the pool when it is not raining. Can be suffixed with a number, in which case all entries will be added to the pool.
  −
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_Snowing</samp>
  −
| Added to the pool when it is raining. Can be suffixed with a number, in which case all entries will be added to the pool.
  −
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_NotSnowing</samp>
  −
| Added to the pool when it is not raining. Can be suffixed with a number, in which case all entries will be added to the pool.
  −
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_{{t|time}}</samp>
  −
| Added to the pool when it is {{t|time}}, which can be <samp>Morning</samp>, <samp>Afternoon</samp>, or <samp>Evening</samp>.
  −
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_{{t|season}}</samp>
  −
| Added to the pool when it is the given season.
  −
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_Not{{t|season}}</samp>
  −
| Added to the pool when it is not the given season.
  −
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_Greeting</samp>
  −
| Always added to the pool. Can be suffixed with a number, in which case all entries will be added to the pool. Can also be suffixed with <samp>Male</samp> or <samp>Female</samp>, in which case only the one applicable to the player's gender will be added to the pool.
  −
|-
  −
| <samp>{{t|location}}_{{t|NPC}}_RareGreeting</samp>
  −
| Has a much lower chance of appearing than any other greeting.
  −
|}
     −
===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.
      
==Algorithm==
 
==Algorithm==
Line 335: Line 340:  
|-
 
|-
 
| <samp>$0</samp>
 
| <samp>$0</samp>
| <samp>$k</samp>
+
|  
 
| Use their neutral portrait.
 
| Use their neutral portrait.
 
|-
 
|-
Line 410: Line 415:  
|-
 
|-
 
| <samp>[# # #]</samp>
 
| <samp>[# # #]</samp>
| Gives the player a random item, from the pool of item IDs within the brackets.
+
| Gives the player a random item, from the pool of [[Modding:Items/Object sprites|item IDs]] within the brackets. For example, <syntaxhighlight lang="js">"I spent the afternoon daydreaming about the ocean. So I decided to cook some seafood. [198 202 727 728]$h"</syntaxhighlight> ...gives one of 198 (Baked Fish), 202 (Fried Calamari), 727 (Chowder), or 728 (Fish Stew) as a gift.
 
|-
 
|-
 
| <samp>%revealtaste{{t|NPC}}{{t|object ID}}</samp>
 
| <samp>%revealtaste{{t|NPC}}{{t|object ID}}</samp>
Line 515: Line 520:     
===Replacer commands===
 
===Replacer commands===
Replacer commands will be replaced with the relevant string. Note that only <samp>@</samp> works in mail entries.
+
Replacer commands will be replaced with the relevant string. Note that in mail entries, only the <samp>@</samp> replacer works.
    
{| class="wikitable"
 
{| class="wikitable"
Line 553: Line 558:  
|-
 
|-
 
| <samp>%rival</samp>
 
| <samp>%rival</samp>
| A random first name of the Farmer's gender from StringsFromCSFiles.xnb (keys Utility.cs.5499 through Utility.cs.5560).  Will not match the Farmer's name.
+
| {{upcoming|1.6.0|This token no longer exists.}} A random first name of the Farmer's gender from StringsFromCSFiles.xnb (keys Utility.cs.5499 through Utility.cs.5560).  Will not match the Farmer's name.
 
|-
 
|-
 
| <samp>%pet</samp>
 
| <samp>%pet</samp>
Line 826: Line 831:  
A ''conversation topic'' is a temporary flag which can be checked in [[Modding:Event data|event preconditions]] and can trigger one-time NPC dialogue (if they have a matching dialogue key). They're stored in <samp>Game1.player.activeDialogueEvents</samp> while active.
 
A ''conversation topic'' is a temporary flag which can be checked in [[Modding:Event data|event preconditions]] and can trigger one-time NPC dialogue (if they have a matching dialogue key). They're stored in <samp>Game1.player.activeDialogueEvents</samp> while active.
   −
A conversation topic can be started using the <samp>addConversationTopic</samp> [[Modding:Event data|event command]], <samp>%item conversationTopic</samp> [[Modding:Mail data|mail command]], or in code by adding it to <samp>Game1.player.activeDialogueEvents</samp>.
+
A conversation topic can be started with a modder-defined length using the <samp>addConversationTopic</samp> [[Modding:Event data|event command]], <samp>%item conversationTopic</samp> [[Modding:Mail data|mail command]], or in code by adding it to <samp>Game1.player.activeDialogueEvents</samp>. A conversation topic, by default, lasts four days when added via event commands.
    
The game defines these events:
 
The game defines these events:
3

edits

Navigation menu