Changes

162 bytes added ,  17:01, 19 February 2021
m
Replace deprecated <source> tags with <syntaxhighlight> tags
Line 159: Line 159:  
====NPC-specific generic dialogue====
 
====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):
 
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">
+
<syntaxhighlight lang="json">
 
{
 
{
 
   "Action": "EditData",
 
   "Action": "EditData",
Line 169: Line 169:  
   }
 
   }
 
}
 
}
</source>
+
</syntaxhighlight>
    
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:
 
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:
<source lang="json">
+
<syntaxhighlight lang="json">
 
{
 
{
 
   "Action": "EditData",
 
   "Action": "EditData",
Line 182: Line 182:  
   }
 
   }
 
}
 
}
</source>
+
</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.
 
This can be used for other generic responses, and you even can avoid the "Give Bouquet" by asking for an answered question's ID.
Line 283: Line 283:     
For example:
 
For example:
<source lang="js">"Mon2": "$d kent#Yesterday I visited Yoba's Altar to give thanks for my husband's safe return.|Yesterday I visited Yoba's Altar to ask for my husband's safe return.#$e#I'm trying to stay positive, but it's hard sometimes.$s"</source>
+
<syntaxhighlight lang="js">"Mon2": "$d kent#Yesterday I visited Yoba's Altar to give thanks for my husband's safe return.|Yesterday I visited Yoba's Altar to ask for my husband's safe return.#$e#I'm trying to stay positive, but it's hard sometimes.$s"</syntaxhighlight>
 
|-
 
|-
 
| <tt>$y</tt>
 
| <tt>$y</tt>
Line 301: Line 301:  
To understand how $q, $r, and $p work, an example may be helpful. Note how you can format the script to be easier to read:
 
To understand how $q, $r, and $p work, an example may be helpful. Note how you can format the script to be easier to read:
   −
<source lang="yaml">
+
<syntaxhighlight lang="yaml">
 
summer_Fri:
 
summer_Fri:
 
     "I think I'll go to the beach tomorrow!
 
     "I think I'll go to the beach tomorrow!
Line 324: Line 324:  
         |Oh, hi @, how's it going?
 
         |Oh, hi @, how's it going?
 
     ",
 
     ",
</source>
+
</syntaxhighlight>
    
The dialogue above triggers on any Friday in the summer. The NPC begins with a response that is always shown: "I think I'll go to the beach tomorrow!"
 
The dialogue above triggers on any Friday in the summer. The NPC begins with a response that is always shown: "I think I'll go to the beach tomorrow!"
    
Next they ask you a question.
 
Next they ask you a question.
<source lang="yaml">#$q 305/306 beachquestion_followup#Would you like to go with me?</source>
+
<syntaxhighlight lang="yaml">#$q 305/306 beachquestion_followup#Would you like to go with me?</syntaxhighlight>
    
'''$q''' starts the question. '''305/306''' checks to see if this question has been asked before, and if it has it sends you to the dialogue key '''beachquestion_followup'''. (Note that you can name your dialogue keys whatever you like which makes it easier to read.)
 
'''$q''' starts the question. '''305/306''' checks to see if this question has been asked before, and if it has it sends you to the dialogue key '''beachquestion_followup'''. (Note that you can name your dialogue keys whatever you like which makes it easier to read.)
Line 335: Line 335:  
Next are the responses the player can give. You can add any number of '''$r''' lines; here we have three:
 
Next are the responses the player can give. You can add any number of '''$r''' lines; here we have three:
   −
<source lang="yaml">
+
<syntaxhighlight lang="yaml">
 
     #$r 305 15 beachquestion_yes#Sure, I would love to!
 
     #$r 305 15 beachquestion_yes#Sure, I would love to!
 
     #$r 306 0 beachquestion_sorry#Oh, sorry, I've already made plans with someone else...
 
     #$r 306 0 beachquestion_sorry#Oh, sorry, I've already made plans with someone else...
 
     #$r 306 -10 beachquestion_no#No thank you.
 
     #$r 306 -10 beachquestion_no#No thank you.
</source>
+
</syntaxhighlight>
 
If you say yes (first option), the game will store '''ID 305''' as the answer given to this question. Next, your friendship with that person increases by '''15'''. '''beachquestion_yes''' tells the script which dialogue key continuation to use as a response to your answer.
 
If you say yes (first option), the game will store '''ID 305''' as the answer given to this question. Next, your friendship with that person increases by '''15'''. '''beachquestion_yes''' tells the script which dialogue key continuation to use as a response to your answer.
   Line 346: Line 346:  
Now we need to make dialogue keys for each response:
 
Now we need to make dialogue keys for each response:
   −
<source lang="yaml">
+
<syntaxhighlight lang="yaml">
 
     beachquestion_yes: "Good! It's a date.$h",
 
     beachquestion_yes: "Good! It's a date.$h",
 
     beachquestion_sorry: "Oh. Darn. Okay.$6",
 
     beachquestion_sorry: "Oh. Darn. Okay.$6",
Line 355: Line 355:  
             |Hmm, I wonder if I can get someone to go with me...$s
 
             |Hmm, I wonder if I can get someone to go with me...$s
 
         ",
 
         ",
</source>
+
</syntaxhighlight>
    
Of note here is '''beachquestion_followup'''. If the player talks to the NPC again, '''$q 305/306''' will check that the question has already been answered and instead go directly to this key.
 
Of note here is '''beachquestion_followup'''. If the player talks to the NPC again, '''$q 305/306''' will check that the question has already been answered and instead go directly to this key.
Line 363: Line 363:  
There is another variable response the next day:
 
There is another variable response the next day:
   −
<source lang="yaml">
+
<syntaxhighlight lang="yaml">
 
summer_Sat:
 
summer_Sat:
 
     "The beach is lovely this time of year...
 
     "The beach is lovely this time of year...
Line 370: Line 370:  
         |Oh, hi @, how's it going?
 
         |Oh, hi @, how's it going?
 
     ",
 
     ",
</source>
+
</syntaxhighlight>
    
Once again the first line (The beach is lovely...) always shows up when the player talks to the NPC, but the next line depends on whether or not they've answered yes the previous day.
 
Once again the first line (The beach is lovely...) always shows up when the player talks to the NPC, but the next line depends on whether or not they've answered yes the previous day.
Line 378: Line 378:  
Here is another example from Haley's existing dialogue file. Note how the script formatting is harder to read, but the game is able to process both.
 
Here is another example from Haley's existing dialogue file. Note how the script formatting is harder to read, but the game is able to process both.
   −
<source lang="yaml">
+
<syntaxhighlight lang="yaml">
 
     summer_Sat: "Farming sounds so boring...#$q 42/43 summer_Sat_old#What do you even do all day?#$r 42 10 summer_Sat_12#Care for plants#$r 42 10 summer_Sat_12#Explore the caves#$r 43 -10 summer_Sat_13#Snoop around in your room#$r 42 10 summer_Sat_12#Dig for treasure" #!String
 
     summer_Sat: "Farming sounds so boring...#$q 42/43 summer_Sat_old#What do you even do all day?#$r 42 10 summer_Sat_12#Care for plants#$r 42 10 summer_Sat_12#Explore the caves#$r 43 -10 summer_Sat_13#Snoop around in your room#$r 42 10 summer_Sat_12#Dig for treasure" #!String
 
     summer_Sat_old: "#$p 43#Hey, you better not be snooping around in my room anymore!$a|But I guess it could get you in pretty good shape." #!String
 
     summer_Sat_old: "#$p 43#Hey, you better not be snooping around in my room anymore!$a|But I guess it could get you in pretty good shape." #!String
 
     summer_Sat_12: "Hmm... sounds like a lot of work." #!String
 
     summer_Sat_12: "Hmm... sounds like a lot of work." #!String
 
     summer_Sat_13: "What? You'd better not be doing that!$a" #!String
 
     summer_Sat_13: "What? You'd better not be doing that!$a" #!String
</source>
+
</syntaxhighlight>
    
The first time the <code>summer_Sat</code> dialogue is chosen, neither response 42 nor 43 will have been given (because this question is the only one which has them as responses), so Haley will say, "Farming sounds so boring... What do you even do all day?"  The player can select among these responses:
 
The first time the <code>summer_Sat</code> dialogue is chosen, neither response 42 nor 43 will have been given (because this question is the only one which has them as responses), so Haley will say, "Farming sounds so boring... What do you even do all day?"  The player can select among these responses:
114

edits