NPC Helper 2 uses Stardew Valley's own dialogue keys and text syntax. It passes keys and text to the game unchanged; it does not define a separate dialogue language. Anything you can write in a vanilla NPC's dialogue works here.
Step 1: Add a [Dialogue] table#
Put the table in Dialogue.toml next to the NPC file, or in the NPC file itself. If a key exists in both, Dialogue.toml wins.
[Dialogue]
Introduction = "Hi, @. I'm Rei."
Mon = "A new week begins."
Hospital8 = "I hope everyone is feeling better."
AcceptGift_Loved = "You remembered what I like!"
Each line is Key = "text". The key says when the line is used. The text is what the NPC says.
Step 2: Choose the keys#
The game decides which line to show from the key. Common keys include:
| Key | When it is used |
|---|---|
Introduction |
The first time the player talks to the NPC. |
Mon, Tue, ... Sun |
On that day of the week. |
Mon2, Mon4, ... |
On that day, with the heart level in the key. |
spring_Mon, fall_Fri |
On that day in one season. |
Rainy |
On rainy days. |
<Location><hearts> |
When the NPC is in that location and the player has that many hearts. Hospital8 is used in the Hospital. |
AcceptGift_... |
Gift reactions. See Gift tastes. |
The complete list of keys and rules is on the Stardew Valley dialogue page. It also describes which key wins when several match.
Step 3: Use TOML quoting correctly#
- A line is a quoted text. Use
\"for a quote inside it, or write the line in single quotes ('literal text') or triple quotes ("""multi-line text""") when it has many quotes. - Do not put a key in two places. A repeated key is a warning.
Step 4: Use special text#
The game's special text works unchanged:
@is replaced with the player's name.#starts a new page of dialogue.$commands, such as the portrait tokens below, change how the line is shown.
Portrait expressions#
Add an expression token to the end of a line to select the portrait shown with it. Prefer the letter tokens for standard expressions and use numbers for custom portraits.
| Portrait | Recommended token | Numeric equivalent |
|---|---|---|
| Neutral | $0 |
none |
| Happy | $h |
$1 |
| Sad | $s |
$2 |
| Unique | $u |
$3 |
| Love or blushing | $l |
$4 |
| Angry | $a |
$5 |
| Custom 1 | $6 |
none |
| Custom 2 | $7 |
none |
| Custom 3 | $8 |
none |
| Custom 4 | $9 |
none |
For example, "You remembered what I like!$h" shows the happy portrait, and "A special reaction.$6" shows Custom 1. The portraits are the faces in portraits/Default.png, counted from the first face (see Sprites and portraits).
Step 5: Test#
- Start the game through SMAPI.
- Talk to the NPC on the day and place each key expects.
- If a line never appears, check the key's spelling and the conditions that key needs. A different key may match first.
Translating dialogue#
A translation only needs the keys it changes. See Localization.