Modding:Dialogue
← Index
This page explains how the game stores dialogue text, its format, and how the game parses it. This is an advanced guide for mod developers.
Dialogue data
Character dialogue is stored in many different files: The Characters\Dialogue directory is where the majority of NPC-specific dialogue is stored. Data\ExtraDialogue.xnb, Strings\Characters.xnb, Strings\Events.xnb, Strings\SpeechBubbles.xnb, and Strings\StringsFromCSFiles.xnb contain various other pieces of dialogue, some generic, and some NPC-specific.
Characters\Dialogue directory
Characters\Dialogue\<NPC>
.xnb
An NPC's named file in Character\Dialogue contains most of their dialogue. The game will choose dialogue from one of the sections below, in the order shown here.
Special dialogue
There are a few predefined keys for specific cases:
key format | description | |
---|---|---|
danceRejection | Dialogue used to reject an offer to dance at the Flower Dance. (A different dialogue is used if they've already agreed to dance with another player.) | |
MovieInvitation | An NPC's response to being invited to the Movie Theater. If not defined, the NPC will use a generic line from Strings\Characters.xnb. The specific string used depends on the NPC's manners. | |
breakUp | An NPC's response to being broken up with by giving them a Wilted Bouquet. | |
divorced | Dialogue shown when you speak to your divorced spouse. | |
accept_<item_id>
|
If defined, this dialogue will be used when gifting an item with the given ID to the NPC. Does not affect and is not affected by an NPC's taste towards an item. Used when giving quest items to their proper recipients. Appears to have no affect when given the ID of a non-quest item. Example: accept_864: "...!$4#$b#...Where did you find this?$4#$b#...$5#$b#This man... We fought together in the war, @. He was like a brother to me. #$b#But... only one of us made it back.$5#$b#He never lost his courage, though. Even in the face of death. A true hero... I'll never forget him.#$b#Thanks for bringing me this... It means a lot to me.#$b#Here, take this. It's been sitting in the back of our cupboard for years, and we've never used it." | |
reject_<item_id>
|
If defined, when attempting to gift the item with the given ID, the NPC will not accept the item and instead say this dialogue. Used for quest items to ensure they're not accidentally gifted, or to give hints towards their proper recipient. Example: reject_864: "What's this? It looks like one of Kent's buddies from the war. Maybe you should show it to him?" | |
<location> _Entry
|
Possible dialogue lines shown above the NPC's name when they enter the named <location> , with a 50% chance. This dialogue entry can contain multiple options separated by / ; the game will randomly choose one to display.Example: SeedShop_Entry: "Hi, Pierre!/Now, what do I need.../Ah, that looks good!/Makin' my special sauce tonight!/Pierre! What's fresh?/Pierre! Waddya got for me?" Note: This key is not to be confused with Modding:Dialogue#Speech_bubbles. | |
Resort Resort_Bar Resort_Chair Resort_Dance Resort_Entering Resort_Leaving Resort_Shore Resort_Towel Resort_Umbrella Resort_Wander |
Various dialogue keys used when an NPC is visiting the Ginger Island Resort. | |
ComeBackLater Snoring |
Gil's dialogue when you haven't completed any new Adventure Quest goals. ComeBackLater will be shown once, and all subsequent dialogues will show Snoring. |
Location dialogue
Otherwise the game will choose dialogue in this order.
Variants:
- Each key can optionally be prefixed with a season name, like springMountain_47_23.
The game will check variants in this order: <season>
<key>
, and <key>
. 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.
key format | description |
---|---|
<location> _<x> _<y>
|
Dialogue shown in the named location when the NPC is standing at tile position <x> , <y> .Example: Mountain_47_23: "I come here for the peace and quiet." |
<location> _<dayName>
|
Dialogue shown in the named location on the given day of week. Example: Saloon_Fri: "Business has been really good tonight. I'm pleased." |
<location> <hearts>
|
Dialogue shown in the named location if you have at least <hearts> hearts with them. The <hearts> will be checked in the order 10, 8, 6, 4, 2 (no other value will be recognised).Example: Saloon8: "Hi there @. I'm glad to see you! You're always welcome here." |
<location>
|
Dialogue shown in the named location. Example: Saloon: "Now that I'm here I can finally relax and socialize a bit."
|
Generic dialogue
Otherwise the game will choose a dialogue using one of these key formats (in precedence order):
<season>
_<key>
_inlaw_<spouse>
<season>
_<key>
<key>
_inlaw_<spouse>
<key>
For each variation above: <season>
is a season name (like spring_14); _inlaw_<spouse>
matches if the player is married to the named NPC, regardless of whether the speaking NPC is related to the named one (like Sat_inlaw_Abigail); and <key>
is one of the formats listed below.
key format | description |
---|---|
<dayOfMonth>
|
Dialogue shown on the given day of month in the first year only. WARNING: this first-year-only behavior is different from other keys and often catches unsuspecting modders! Example: 10: "Did you watch the game last night?#$b#Or wait, do you even have a TV set...?" |
<dayOfMonth> _<firstOrLaterYear>
|
Dialogue shown on the given day of month in the first/later year. Example: 2_1: "My husband Kent is a soldier, working overseas. That's why he's not here right now.#$b#I know he'll come back safe once his tour is over!!#$e#Need something?" |
<dayOfWeek> <hearts> _<firstOrLaterYear>
|
Dialogue shown on the given day of week if you have at least <hearts> hearts with them, in the first/later year. The <hearts> will be checked in the order 10, 8, 6, 4, 2 (no other value will be recognised).Example: Thu2_2: "Well, my Dad is back. Have you met him?#$b#I'm just glad he's okay." |
<dayOfWeek> <hearts>
|
Dialogue shown on the given day of week if you have at least <hearts> hearts with them. The <hearts> will be checked in the order 10, 8, 6, 4, 2 (no other value will be recognised).Example: Sun4: "Hey, @.#$e#How's your day going?" |
<dayOfWeek> _<firstOrLaterYear>
|
Dialogue shown on the given day of week in the first/later year. Example: Sat_1: "Dad's coming back soon!#$b#I hope he brings me some toys.$u" |
<dayOfWeek>
|
Dialogue shown on the given day of week. Example: Mon: "Oh, hey. Taking a break from work?" |
Rain dialogue
Characters\Dialogue\rainy.xnb 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
Characters\Dialogue\MarriageDialogue.xnb contains dialogue text for all spouses, and each NPC may optionally have their own dialogue file like Characters\Dialogue\MarriageDialogueAbigail.xnb. When looking up a dialogue key, it will use the one in the NPC's file if it exists, else the one in the generic file, else a default text (usually blank).
Each dialogue entry has a key with one of these formats:
key format | description |
---|---|
<season> _<day>
|
Dialogue shown when the day starts, if <season> and <day> match the current date.Example: fall_1: "The scent is unmistakable... mushroom, rotting leaves, pumpkin. It's fall, alright. Isn't it lovely?" |
patio_<spouse>
|
Dialogue shown when the NPC is standing on the patio. |
<weather> _Day_<random>
|
Daily dialogue added when the day starts, based on the <weather> (Rainy if it's raining, else Indoor even if they're not indoors) and <random> (a random number between 0 and 4). If the game chooses a <random> value that doesn't have a dialogue, it'll use the default text instead.
|
Rainy_Night_<random>
|
Daily dialogue in the farmhouse after 6pm when it's raining. <random> is a number between 0–5 inclusively or the NPC name, each of which has an equal chance of being randomly chosen. If the game chooses a <random> value that doesn't have a dialogue, it'll use the default text instead.Example: Rainy_Night_3: "On nights like this, I like to turn the light down low and just listen...$8" |
Indoor_Night_<random>
|
Daily dialogue in the farmhouse after 6pm when it's not raining. <random> is a number between 0–4 inclusively or the NPC name, each of which has an equal chance of being randomly chosen. If the game chooses a <random> value that doesn't have a dialogue, it'll use the default text instead.
|
funLeave_<spouse>
|
Dialogue used when leaving the farmhouse, typically during a Monday, or a Friday if they have no job. (See below.) |
jobLeave_<spouse>
|
Dialogue used when leaving to go to their job. Only used for Maru, Penny, and Harvey. |
funReturn_<spouse>
|
Dialogue shown after 1pm when they enter the farmhouse but before reaching their target position, but only on Monday (any NPC) or Friday (if not Maru/Penny/Harvey). Example: funReturn_Abigail: "Hey! Did you have a good day? Mine went well. It was refreshing to take a walk.$h" |
jobReturn_<spouse>
|
Dialogue shown after 1pm when they enter the farmhouse but before reaching their target position, but only if funReturn isn't shown instead. Example: jobReturn_Penny: "#$c .5#Good evening. My day was fine, thanks! How was yours?$h#$e#Jas and Vincent weren't behaving very well today. I'm still all wound up..." |
<season> _<spouse>
|
Dialogue shown at 9+ heart levels with a 5% chance each day. Example: fall_Abigail: "Do I smell pumpkin on you? Maybe I'm just dreaming...$h" |
Outdoor_<spouse>
|
Dialogue shown on the farm with a 20% chance. Example: Outdoor_Abigail: "I'm just going to hang out here, okay?#$e#There's a lot of interesting bugs and things out here. *chuckle*$h" |
Outdoor_<random>
|
Dialogue shown on the farm with an 80% chance. <random> is a number 0–4, used to randomly select an entry.Example: Outdoor_3: "It's pretty cool that we have a cave on our property. It's something I always dreamed about.$h" |
spouseRoom_<spouse>
|
Dialogue shown when the NPC is in their room. Example: spouseRoom_Abigail: "$c .5#I got up a little before you and fed David Jr. He's very active this morning.#$e#I hope you don't mind the guinea pig smell." |
OneKid_<random>
|
Dialogue shown when standing in the kitchen, if they have one child. <random> is a number 0–4, used to randomly select an entry.OneKid_1: "I wonder if %kid1 will grow up to be a farmer like you?" |
TwoKids_<random>
|
Dialogue shown when standing in the kitchen, if they have two children. <random> is a number 0–4, used to randomly select an entry.TwoKids_2: "I had a dream that %kid2 will grow up to be a famous monster hunter. I've already been thinking about a little armor set." |
<affection> _<random>
|
Dialogue shown inside the farmhouse between 11am and 6pm, or when the day starts if a different dialogue isn't selected. <affection> is randomly Bad or Neutral if they have less than 9 hearts; 50% chance of Good if you have 10+ hearts, and 87.5% chance of Good if you have 11+ hearts; else Neutral <random> is a number 0–9, used to randomly select an entry.Example: Good_5: "I was just admiring the mermaid's pendant you gave me... I'll proudly wear this to my grave.$l" |
Data directory
Engagement dialogue
Similar to the rain dialogue, Data\EngagementDialogue.xnb contains entries in the form of <NPC>
0 and <NPC>
1, 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
Data\Events\*.xnb contains event scripts, including any dialogue in the event (see Modding:Event data).
Extra dialogue
Data\ExtraDialogue.xnb contains miscellaneous strings, some of which are NPC specific:
key format | description |
---|---|
PurchasedItem_* | 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 PurchasedItem_5_Cooking), the number is selected as such:
|
Town_DumpsterDiveComment_Child Town_DumpsterDiveComment_Teen Town_DumpsterDiveComment_Adult Town_DumpsterDiveComment_Linus |
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. |
SummitEvent_Dialogue3_<spouse>
|
Shown for your NPC spouse near the start of the perfection cutscene. |
Movie theater dialogue
An NPC's reaction to a movie is stored in Data\MoviesReactions.xnb, which is structured far differently from every other dialogue file. See Modding:Movie theater data for more details.
Strings directory
Animation descriptions
Strings\animationDescriptions.xnb contains short bits of dialogue to go with certain schedule points. Not to be confused to Data\animationDescriptions.xnb, which contains the data of animations, rather than the strings for their description.
Characters
Strings\Characters.xnb contains miscellaneous dialogue, some of which is NPC-specific:
key format | description |
---|---|
MovieInvite_Spouse_<NPC name>
|
Shown when the NPC accepts a movie ticket when they're married to you. If missing, defaults to a MovieInvite_Invited_* key. |
MovieInvite_Invited_<NPC name> MovieInvite_Invited_ <manner> MovieInvite_Invited_ <socialAnxiety> MovieInvite_Invited_ <optimism> MovieInvite_Invited_ <age> MovieInvite_Invited |
Shown when the NPC accepts a movie ticket. The NPC will use the first key that exists in the order listed here.
The |
Phone_* | 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
Strings\Events.xnb contains miscellaneous dialogue related to events and festivals, some of which is NPC-specific.
Speech bubbles
Strings\SpeechBubbles.xnb contains dialogue spoken by NPCs through speech bubbles when the player enters a given location. This is distinct from the <location>
_Entry field in an NPC's Characters\Dialogue\*.xnb file, which is triggered when the NPC enters a given location.
These keys are hardcoded, so new keys with the same pattern will be ignored.
Strings from CS files
Strings\StringsFromCSFiles.xnb contains miscellaneous strings, such as dialogue that's shared between multiple characters, dialogue for some hardcoded events like marriage, etc.
The file has entries in the form "<key>": "dialogue string", 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 — even though most keys look like <file name>
.<line number>
, 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 NPC.cs.4061 (English version: "Hi.").
Some other useful NPC-specific strings stored here are as follows:
key format | description |
---|---|
<NPC name> _AfterWedding
|
Shown after marrying an NPC, when you talk to them on the farm on the same day. |
<NPC name> _Engaged<NPC name> _EngagedRoommate
|
Shown after the NPC accepts an engagement item (e.g. mermaid's pendant or void ghost pendant for vanilla NPCs). |
NPC-specific generic dialogue
With some ingenuity, you can make each NPC respond differently instead of using the normal static dialogue. You can use a special mod like Custom Fixed Dialogue, but the same effect can be achieved with just Content Patcher with some effort. To change NPC.cs.3962 and NPC.cs.3963 (to give a bouquet), and NPC.cs.3980 (for the mermaid pendant acceptance):
{
"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?"
}
}
In this example, each NPC will get their response from the give_flowersA, give_flowersB, and give_pendant dialogue key in their character dialogue files. (See 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:
{
"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"
}
}
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
The game finds dialogue as follows:
- Event dialogue is read from the appropriate event commands (see Modding:Event data).
- Location-specific dialogue is read from StringsFromCSFiles
<location>
.cs. - Else character dialogue is read from the character-specific files.
- If no dialogues were found, the game resorts to hardcoded dialogue from the StringsFromCSFiles files (specifically keys prefixed with NPC.cs NPC.cs).
Format
Dialogue text can contain tokens and commands which control the dialogue box, change the text (e.g., switch between gender-specific strings), inject values, etc. These are parsed by the Dialogue class.
Special tokens
character | description |
---|---|
# | Separates two commands in a dialogue string. |
{ | TODO. Stands for "breakSpecialCharacter". |
^ | Gender switch character. The text before it is shown for male farmers, the text after it for female farmers. Example: Oh, good morning Mr. @!^Oh, good morning Ms. @!
|
% | Turns the dialogue box into a generic text box. Example: "%Abigail is lost in her music."
|
* | TODO. Stands for "quickResponseDelineator". |
Portrait commands
These set the portrait shown in the dialogue box for the current line of dialogue. If there's no portrait command, the neutral portrait is used.
Portraits are numbered left-to-right and top-to-bottom, starting at $0. The first six portraits are standard, and can be identified by the number (like $2) or a unique alias (like $s). All potential spouses and many other characters have these six portraits, but it's not fully consistent; for example, Caroline only has four.
numbered | alias | description |
---|---|---|
$0 | Use their neutral portrait. | |
$1 | $h | Use their happy portrait. |
$2 | $s | Use their sad portrait. |
$3 | $u | Use their unique portrait. This is different for each NPC: grumpy (Abigail), holding football (Alex), angry (Caroline), sick (Governor), etc. |
$4 | $l | Use their love portrait. |
$5 | $a | Use their angry portrait. |
$<id>
|
A custom portrait beyond the standard six. |
Portrait commands should be at the end of a dialogue line:
"fall_Fri6": "When I was a little girl, my father abandoned us.$s#$b#I'm sorry to make things uncomfortable for you...$u#$e#Anyway... How's the farming life going?",
Dialogue commands
command | description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
$q <response IDs> <fallback> #<text>
|
Show a dialogue box containing the given question text. If <response IDs> (a list delimited by / ) contains an answer already given, the question is skipped (along with the rest of this dialogue line), and instead the dialogue entry identified by <fallback> will be appended to whatever precedes this $q command. The <fallback> dialogue typically uses a $p command to adjust the text based on the player's answer to this question. NOTE: dialogue questions must use unique IDs, similar to events. See the event data page for more information.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$r <response ID> <friendship> <reaction> #<answer text>
|
Define a response option to a $q question dialogue. <answer text> is the text shown. <response ID> is used to group responses for future reference (multiple answers can share an answer ID). <friendship> defines the change in friendship value, positive or negative, if this response is selected. <reaction> names the dialogue entry from the NPC's Content\Characters\Dialogue\*.xnb file that will be the NPC's reaction if this response is selected by the player.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$p <response ID> #<match text> |<no-match text>
|
Stands for "dialoguePrerequisite". Shows different text depending on whether the player gave a particular answer to a previously-asked question. If <response ID> matches an answer the player gave, <match text> is shown; otherwise, <no-match text> is shown. These texts are separated by | and only <no-match text> can contain additional commands. This does not need to be the first command in the dialogue string.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$b | Indicates pauses in dialogue, where the player will need to click for the next part to load in a new dialogue box. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$e | Ends the current dialogue, closing the dialogue box and resuming player control. The dialogue following $e will require a new interaction with the NPC. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$k | Short for dialogueKill. Removes all dialogue messages after the current one. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$c <probability> #<text1> #<text2>
|
Show <text1> with a <probability> between 0 and 1; otherwise, show <text2> . E.g. $c 0.9 for a 90% chance of <text1> and a 10% chance of <text2> . NOTE: Replacer commands (see below) do not work in <text1> . This does not need to be the first command in a dialogue string. It is unaffected by daily luck.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$d <state id> #<text1> |<text2>
|
Show one of two dialogue strings based on a predefined condition: bus (whether the bus is repaired), joja (whether the Joja Mart is still in business), cc or communitycenter (whether the Community Center is accessible), or kent (whether Kent has returned to the valley). The dialogue string must start with $d, everything up to the first | symbol is shown if the condition matches, and everything after that is shown if the condition doesn't match.
For example: "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"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$y | TODO. Stands for "dialogueQuickResponse"; A simpler form of question. Works like $q, but within one and the same text line. It doesn't have neither "dialoguePrerequisite" ($p) nor friendship point changes. It can be triggered indenitelly. Example: Penny: "$y 'Breakfast?_Yes please._Here you go._No, I'm good_More for me then!'" | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$1 <letter ID> #<1st-time text> #$e# <nth-time text>
|
Creates a line of dialogue which the character will only see once (at most). <1st-time text> is shown only if <letter ID> has not been marked as sent yet (and this marks it as sent); otherwise, <nth-time text> is shown. <letter ID> should not correspond to an actual piece of mail (because it will not be sent), but it can be referenced by events or other dialogue lines.
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%fork | Sets the the specialEventVariable1 variable, which can be checked by a later fork event command. Mainly useful in reaction dialogue for $q questions during events. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[# # #] | Gives the player a random item, from the pool of item IDs within the brackets. For example, "I spent the afternoon daydreaming about the ocean. So I decided to cook some seafood. [198 202 727 728]$h"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
%revealtaste<NPC> <object ID>
|
Reveals the named character's gift taste for an object in their social menu profile. For example, %revealtasteLewis258 will update Lewis's profile to show that he likes blueberries. This only works if it's in the first message in a dialogue box (i.e., before any #$b# break, though #$e# breaks are fine).
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
${male^female}$ ${male^female^non-binary}$ |
Change text depending on the player's gender. This largely supersedes the ^ dialogue token (which still works), and is supported in many more places than that token. This is applied before most other commands or parsing, so it can safely be used in cases where ^ might have a different meaning (e.g. mail text). For example: Ahoy there ${lad^lass}$! or Ahoy there ${lad^lass^matey}$! .
You can optionally use ¦ instead of ^, in which case any ^ characters are left as-is. Note that the non-binary value is only used if a mod overrides the player's gender, since the in-game UI only allows male or female. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$action <action>
|
Run a trigger action string, like $action AddMoney 500 to add 500g to the current player. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
$query <query> #<if true> |<if false>
|
Show different dialogue text depending on the game state query in <query> . For example:
"Mon": "$query !PLAYER_VISITED_LOCATION Current Mine#Did you know there's an old abandoned mine up in the mountain? Apparently it's crawling with monsters!|I heard you went into the old mines up in the mountain!#Did you find anything tasty?$h"
|}
====Question example====
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:
<syntaxhighlight lang="yaml">
summer_Fri:
"I think I'll go to the beach tomorrow!
#$q 305/306 beachquestion_followup#Would you like to go with me?
#$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 -10 beachquestion_no#No thank you.
",
"beachquestion_yes": "Good! It's a date.$h",
"beachquestion_sorry": "Oh. Darn. Okay.$6",
"beachquestion_no": "Oh. Um. Sorry.$s",
"beachquestion_followup":
"$p 305
#Tomorrow should be a lot of fun!$h
|Hmm, I wonder if I can get someone to go with me...$s
",
summer_Sat:
"The beach is lovely this time of year...
#$p 305
#Thanks for coming with me today.$h
|Oh, hi @, how's it going?
",
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. #$q 305/306 beachquestion_followup#Would you like to go with me?
$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.) Next are the responses the player can give. You can add any number of $r lines; here we have three: #$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 -10 beachquestion_no#No thank you.
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 no (second and third option) the game will store ID 306 as the answer given, then depending on which answer you gave will either not change your friendship with the person, 0, or reduce it, -10. Then it will use either beachquestion_sorry or beachquestion_no to continue the dialogue. Now we need to make dialogue keys for each response: beachquestion_yes: "Good! It's a date.$h",
beachquestion_sorry: "Oh. Darn. Okay.$6",
beachquestion_no: "Oh. Um. Sorry.$s",
beachquestion_followup:
"$p 305
#Tomorrow should be a lot of fun!$h
|Hmm, I wonder if I can get someone to go with me...$s
",
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. $p 305 begins a variable response which means "if the player chose yes, say this line, else say this line instead". If the player answered yes, the NPC responds happily. Otherwise, they will comment that they need to find someone to go with them. There is another variable response the next day: summer_Sat:
"The beach is lovely this time of year...
#$p 305
#Thanks for coming with me today.$h
|Oh, hi @, how's it going?
",
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. 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. 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_12: "Hmm... sounds like a lot of work." #!String
summer_Sat_13: "What? You'd better not be doing that!$a" #!String
The first time the
The third response, The next time Replacer commandsReplacer commands will be replaced with the relevant string. Note that in mail entries, only the @ replacer works.
ValuesThe game uses these predefined values in some dialogue keys. This section is linked from above where needed. Days of week
Seasons
First/later yearIn some cases the game uses a "first/later year" value for dialogue conditions. This only has two possible values:
Response IDsA response ID identifies an answer chosen by the player in response to a question dialogue. In some cases a question may have several answers with the same ID (e.g., several variations of "yes"), or use the same ID for every question (in which case the ID just shows whether the player has answered the question). Mods can add their own response IDs, but here are the vanilla IDs as of 1.3.36¹:
¹ Extracted using this LINQPad script. Conversation topicsA conversation topic is a temporary flag which can be checked in event preconditions and can trigger one-time NPC dialogue (if they have a matching dialogue key). They're stored in Game1.player.activeDialogueEvents while active. A conversation topic can be started with a modder-defined length using the addConversationTopic event command, %item conversationTopic mail command, or in code by adding it to Game1.player.activeDialogueEvents. A conversation topic, by default, lasts four days when added via event commands. The game defines these events:
|