Changes

1,705 bytes removed ,  16:54, 2 June 2022
Removed apocryphal workaround. I don't think we should be giving new modders this outdated information.
Line 259: Line 259:     
====NPC-specific generic dialogue====
 
====NPC-specific generic dialogue====
'''Note: the following information is largely outdated. [https://www.nexusmods.com/stardewvalley/mods/6358 Custom Fixed Dialogue] is recommended to achieve 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.
 
  −
With some ingenuity, you can make each NPC respond differently instead of using the normal static dialogue. For example, you can use {{nexus mod|1915|Content Patcher}} 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.) Note that these should be added for all datable characters to avoid errors. For example, you could add this for Haley:
  −
<syntaxhighlight lang="json">
  −
{
  −
  "Action": "EditData",
  −
  "Target": "Characters/Dialogue/Haley",
  −
  "Entries": {
  −
      "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",
  −
      "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"
  −
  }
  −
}
  −
</syntaxhighlight>
  −
 
  −
This can be used for other generic responses, and you even can avoid the "Give Bouquet" by asking for an answered question's ID.
      
==Algorithm==
 
==Algorithm==
118

edits