Changes

Jump to navigation Jump to search
75 bytes removed ,  18:07, 21 January 2019
→‎Strings from CS files: copyedit, reformat
Line 153: Line 153:     
===Strings from CS files===
 
===Strings from CS files===
<tt>Strings\StringsFromCSFiles.xnb</tt> contains many translation strings, including NPC dialogue defined in the code. That includes every bit of dialogue that's shared between multiple characters, and dialogue for some hardcoded events like marriage. The format in this file is:
+
<tt>Strings\StringsFromCSFiles.xnb</tt> contains miscellaneous translations. That includes NPC dialogue defined in the code, dialogue that's shared between multiple characters, dialogue for some hardcoded events like marriage, etc.
   −
<source lang="yaml">
+
The file has entries in the form <tt>"<key>": "dialogue string"</tt>, 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 <tt>{{t|file name}}.{{t|line number}}</tt>, 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).
"<key>": "dialogue string"
+
 
 +
====NPC-specific generic dialogue====
 +
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 <tt>NPC.cs.3962</tt> and <tt>NPC.cs.3963</tt> (to give a bouquet), and <tt>NPC.cs.3980</tt> (for the mermaid pendant acceptance):
 +
<source 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_flowersB# Will you marry me?"
 +
  }
 +
}
 
</source>
 
</source>
   −
The key is generated based on the file that contained it before translations were added (in the form {{t|file name}}.{{t|int id}}), but doesn't have any particular meaning now.
+
In this example, each NPC will get their response from the <tt>give_flowersA</tt>, <tt>give_flowersB</tt>, and <tt>give_pendant</tt> 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:
{{stub|section=1}}
+
<source lang="json">
StringsFromCSFiles.xnb contains most of the game's static dialogue as well as other things the game may call for randomization and other functions.  Some of the static dialogue can be changed to make everyone say something different.  With some ingenuity, you can create dynamic responses to normally generic answers.
  −
The easiest lines to create dynamic responses are NPC.cs.3962, NPC.cs.3963, and NPC.cs.3980, which the first two control the giving of a bouquet and the last being the mermaid pendant acceptance.
  −
Using Content Patcher, create the following code block:
  −
 
  −
            "LogName": "Custom Messages",
  −
            "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_flowersB# Will you marry me?",
  −
 
  −
           
  −
       
  −
This will allow you to set up the dynamic response.
  −
Each datable character must have the dynamic responses give_flowersA, give_flowersB, and give_pendant in order to not break the game afterwards. You add this dialogue in Characters/Dialogue/* where * is the name of the NPC.
  −
For now, let's use Haley:
  −
Let's add in the appropriate dialogue:
  −
 
   
{
 
{
"LogName": "Add Dynamic Response Haley",
+
  "Action": "EditData",
"Action": "EditData",
+
  "Target": "Characters/Dialogue/Haley",
"Target": "Characters/Dialogue/Haley",
+
  "Entries": {
"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_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_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"
"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",
+
  }
},
+
}
},
+
</source>
   −
This can be used for other generic responses, and you even can avoid the "Give Bouquet" by asking for an answered question's ID..
+
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==
translators
8,447

edits

Navigation menu