Alterações

144 bytes adicionados ,  21h13min de 23 de maio de 2021
replace depricated source tags
Linha 160: Linha 160:  
====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",
Linha 170: Linha 170:  
   }
 
   }
 
}
 
}
</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",
Linha 183: Linha 183:  
   }
 
   }
 
}
 
}
</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.
Linha 298: Linha 298:  
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!
Linha 321: Linha 321:  
         |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.)
Linha 332: Linha 332:  
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.
   Linha 343: Linha 343:  
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",
Linha 352: Linha 352:  
             |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.
Linha 360: Linha 360:  
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...
Linha 367: Linha 367:  
         |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.
Linha 375: Linha 375:  
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:
106 362

edições