NPC Helper 2/Docs

Create an NPC

Spouse room, patio and kiss

Give a married NPC a farmhouse room, a patio, floors and wallpapers, the kiss frame, and how they behave as a spouse.

Once the player marries an NPC, the game can add a room to the farmhouse and a patio outside it, and the NPC has habits as a spouse. This page covers those settings. For the engagement, vows and schedule, see Marriage. They only matter when Marriageable = true, and a pack that uses them must require NPC Helper 2.6.0.

How the NPC behaves: [Spouse]#

toml
[Spouse]
Adopts = true
WantsChildren = true
GiftJealousy = true
GiftJealousyLoss = -30
KissFrame = 28
KissFacing = "right"
Key Default Meaning
Adopts not set: the game decides Whether the NPC can adopt a child.
WantsChildren not set: the game decides Whether the spouse asks for children.
GiftJealousy true Whether they mind the player giving gifts to other NPCs.
GiftJealousyLoss -30 Friendship lost when they do. Write a negative number.
KissFrame 28 The sprite frame drawn during the kiss.
KissFacing "right" Which way that frame faces: "right" or "left".

NPC Helper 2 checks that the sprite sheet is drawn at the kiss frame and names the frame and the facing if it is empty. See Sprites.

The farmhouse room: [SpouseRoom]#

toml
[SpouseRoom]
Map = "spouseRooms"
Area = "x=12 y=0 w=6 h=9"
Floors = ["1"]
Wallpapers = ["2"]
Key Default Meaning
Map none A map that already exists, written without Maps/. Leave it out when you ship your own map file.
Area 6 x 9 tiles from the top left The part of the map used, in tiles.
Floors, Wallpapers none Floor and wallpaper IDs the farmhouse gets.

The game's own rooms are all in one map, spouseRooms (100 x 27 tiles), and every room is 6 x 9 tiles. To reuse one, name that map and give the Area of the room you want. Another mod's map works the same way.

Your own map#

Put a SpouseRoom.tmx (or SpouseRoom.tbin) in the NPC's folder. NPC Helper 2 hands it to the game as the NPC's own map, so [SpouseRoom] is not needed. Add the table only to set an Area, floors or wallpapers.

text
NPCs/Rei/
  Rei.toml
  SpouseRoom.tmx
  SpousePatio.tmx
  • The file name decides what it is, in any letter case. If both .tmx and .tbin exist, the .tmx is used. If the table also names a Map, the file wins and the log says so.
  • Start from the game's spouseRooms.tmx and spousePatios.tmx in the unpacked Content/Maps folder (see the Stardew Valley wiki). Their tilesheets belong to the game, so a map that refers to them by name needs no copy.
  • The map comes from the content pack, so an NPC registered through the Mod API cannot ship one. It can still name an existing map.

The patio: [SpousePatio]#

toml
[SpousePatio]
Map = "spousePatios"
Area = "x=0 y=0 w=4 h=4"
Animation = ["0 5s", "20 2s", "22 200ms"]
Offset = "x=0 y=-4"

It takes Map and Area as above (a patio is 4 x 4 tiles, in spousePatios, 20 x 12 tiles), plus:

Key Meaning
Animation What the spouse does there: a list of steps, each a sprite frame and how long it stays ("20 2s", "22 200ms").
Offset Moves the sprite, in pixels.

Floors and Wallpapers belong to [SpouseRoom] only. A [SpouseRoom] table that holds only floors and wallpapers adds no room.

In the SDK#

csharp
new NpcBuilder("Rei")
    .SpouseRoom("spouseRooms", 12, 0)               // or .SpouseRoomFile("MyRoom.tmx")
    .SpousePatio("spousePatios")                     // or .SpousePatioFile("MyPatio.tmx")
    .PatioStep(0, TimeSpan.FromSeconds(5)).PatioStep(20, TimeSpan.FromSeconds(2)).PatioOffset(0, -4)
    .SpouseFloors("1").SpouseWallpapers("2")
    .AdoptsChildren(true).WantsChildren(true).JealousOfGifts(true, -30)
    .Kiss(28, facingRight: true);

Giving a room or patio makes the NPC marriageable. Naming a map after giving a file drops the file, and the other way round. See the C# SDK.