NPC Helper 2/Docs

Create an NPC

Gift tastes

Set which items an NPC loves, likes, dislikes, and hates, and write the lines they say when given a gift.

Two separate things control gifts:

  • Gift tastes decide how the NPC feels about each item. They go in the [GiftTastes] table.
  • Gift reactions are what the NPC says when receiving a gift. They go in the [Dialogue] table.

Step 1: Add the taste lists#

Add a [GiftTastes] table to the NPC file (Rei.toml). Each of the five groups is a list.

toml
[GiftTastes]
Love = ["Diamond", "(O)74", "-75"]
Like = ["Blueberry"]
Neutral = []
Dislike = ["Copper Ore"]
Hate = ["Joja Cola"]

The groups are Love, Like, Neutral, Dislike, and Hate. A group you leave out is empty.

Step 2: Choose how to write each item#

Each entry in a list can be written in any of these forms:

Entry Example Meaning
English item name "Joja Cola" Resolved to an item by its name in the game's object data.
Item ID "74" A single item.
Qualified item ID "(O)74" A single item with its type, as the game writes it.
Category number "-75" A whole category of items (here, vegetables).
Category by name "category:Vegetable" The same as the number, written as a name.
Item context tag "egg_item", "category_fruit" Any item with that tag. Tags are lowercase words joined by _.

The categories and their numbers are in Game options. Item names and IDs are listed on the Stardew Valley item page. Names must be spelled as the game spells them in English, so use IDs for modded items.

What happens to entries that cannot be resolved#

  • A name with spaces that cannot be resolved is dropped, with a warning.
  • A single word that cannot be resolved is passed to the game as it is, with a warning, in case it is the ID of an item added by another mod.
  • A negative number that is not a real category is reported, because it can never match an item.

Read the warnings in the SMAPI console after you test.

Step 3: Write the gift reactions#

In the game's 1.6 version, what the NPC says when given a gift comes from their dialogue. Add the keys to [Dialogue] in Dialogue.toml (or in Rei.toml).

toml
[Dialogue]
AcceptGift_Loved = "You're giving this to me?!"
AcceptGift_Liked = "Thank you, this is nice."
AcceptGift_Neutral = "Oh. Thanks."
AcceptGift_Disliked = "Hm. Not my favourite."
AcceptGift_Hated = "Why would you give me this?"
AcceptGift = "Thanks for the gift."
AcceptGift_(O)74 = "A Prismatic Shard! I cannot accept this!"

The game looks for a reaction in this order and uses the first that exists:

  1. AcceptGift_<qualified item ID>, a reaction for one specific item.
  2. AcceptGift_Loved, AcceptGift_Liked, AcceptGift_Disliked, AcceptGift_Hated, or AcceptGift_Neutral, matching how the NPC feels about the item.
  3. AcceptGift, the general fallback.

Reactions are ordinary dialogue, so portrait expressions such as $h work. See Dialogue.

Step 4: Test#

  1. Start the game through SMAPI and check the console for gift warnings.
  2. Give the NPC an item from each group and read the reaction.
  3. Open the NPC's entry in the Social tab. The items they love and like appear there once you have learned them.

Translating gift tastes#

A translation can replace a taste list. A group you write in a language file replaces that whole group; the lists are not combined. See Localization.