Tutorial: Adding characters to Multiple Spouse Dialog

From Stardew Modding Wiki
Jump to navigation Jump to search

Here's how to add dialog pairs to Multiple Spouse Dialog.

Future infobox info: DummyAccount02, 2023-04-17 (changed due to inactivity from previous user)


First we'll add some pairs for any characters to say, because that's the easiest way to get started. Then we'll add a few bits of character-specific dialog, and something that they only say when it's raining.

Tease.png

Writing style

The existing speech bubbles in Stardew Valley are very brief (max. of about 34 letters). Often there's no punctuation, and they're phrases rather than full sentences. This makes sense because there's not much space, and they're meant to be background conversation. See how short you can make your dialog pairs. Give the flavour, skip the detail.

There's no set number of dialog pairs that you need, but think about what your characters might say to each other in different situations such as:

  • current day
    • day of the week (monday, wednesday)
    • date of the month (1, 10, 28)
  • morning vs night
    • must be added as hour (military format)
  • different weathers
    • Snow
    • Rain
    • Sun
    • Wind
    • Storm
    • Festival
    • Wedding Day
  • different seasons
    • Spring
    • Summer
    • Fall
    • Winter
  • festival days
    • Egg Festival
    • Flower Dance
    • Luau
    • Dance of the Moonlight Jellies
    • Stardew Valley Fair
    • Spirit's Eve
    • Festival of Ice
    • Night Market
    • Feast of the Winter Star

Getting set up

  • Download the mod, unpack it and drag it into your Mods folder.
  • Check that the mod works, and get married to the characters you're writing dialog for.
  • Get a text editor to edit json files with. Notepad++ (Windows), TextMate (Mac), or Visual Studio are good choices.

First dialog

We're going to add two bits of dialog that can be said by any two NPCs, any time of year.

Have a look at the mod folder, and open up the assets subfolder. Any json file in here is loaded as dialog.

Assets.png

You can look at the existing json files for inspiration.

Now make a new json file. Call the file something like dialog-new.json . The exact name doesn't matter, but it has to end in .json.

  • Sidebar: how do I make a new json file?
    • In Textmate, choose File > New and start typing into the blank window. Then choose File > Save and pick the name and location for your file.
    • In Visual Studio, right-click the assets folder, choose Add > New file > Web > Empty JSON File, and call it dialog-new
    • In Windows, find the folder in File Explorer, right-click in it, and choose New > Text document, then right-click the document and rename it

Copy and paste this into your json file.

[
  {
    "Call": "Who wants a hug?",
    "Response": "Me! I do!"
  },
  {
    "Call": "Ahoy @",
    "Response": "Ahoy thar Cap'n @!"
  }
]

Save the file, restart Stardew Valley, and see if it worked!

Why did we add two dialogs? Because missing commas between sections is the most common json problem. But if you start with two dialogs you can add more, no problem!

What's the @ symbol do? It inserts the name of the other speaker.

Hug.png Capn.png

Testing hints

It can be a pain waiting for your new dialog to show up. Some ways to speed things up:

  • Drag the other dialog json files somewhere else, like your desktop, so the only dialog that gets loaded is your new stuff. You can put them back later.
  • Spawn dialog more often. Edit config.json and turn up the random chance from 0.05 to 0.95. Now your characters will chatter constantly.
  • If your characters are still being antisocial, increase the max chatting distance from 350 to, say 800. Or see the next section's testing tips for how to move them around the screen.

If you think your dialog might not have loaded properly:

  • Check your logs. If your file is formatted correctly, you'll see a line like this:
    • [Multiple Spouse Dialog] Reading dialog from .../dialog-leah-elliott.json
  • Check the trace log in SMAPI-latest.txt. All dialog pairs are printed to the trace log, like this:
    • [18:31:22 TRACE Multiple Spouse Dialog] Dialog loaded: I love you, Seb <: *mumble* m-me too.... Callers: Abigail Responders: Sebastian

If you think your JSON might not be formatted correctly:

  • Go to https://smapi.io/json and paste it in. Leave the JSON format set to None. It's faster to find your errors in the JSON validator than to restart Stardew Valley over and over.

Dialog for specific characters

Now make another json file. Here we're writing some dialog for Leah and Elliott, so I'll call the file dialog-leah-elliott.json . The exact name doesn't matter, but it has to end in .json.

Copy and paste this into your json file:

[
  {
    "Call": "Feeling creative today",
    "Response": "Let's make some art",
    "Callers": "Leah Elliott",
    "Responders": "Leah Elliott"
  },
  {
    "Call": "I want to paint today",
    "Response": "I'm inspired to write",
    "Callers": "Leah",
    "Responders": "Elliott"
  }
]

Save this and give it a test.

The first dialog can have both Leah and Elliott as the first speaker. The second dialog is just for Leah to say to Elliott.

Testing hints (2)

  • You need to be married to both the characters you're writing for, or dialog for those specific characters won't appear. This will make it hard to test! If you're not married to Leah and Elliott, you could:
    • pick two other characters who you are married to and test it on them
    • marry Leah and Elliott, possibly in a different save. Speed this process up by going into the SMAPI console and typing debug marry Leah and debug marry Elliott. Then go to bed for the night so that Multiple Spouses can build the new spouse rooms.
      So romantic
  • Warp your NPCs into place so that they're standing near each other. Stand where you want the first NPC to stand, go into the SMAPI console, and type debug wctm Leah. Then move slightly and warp the conversation partner into place with debug wctm Elliott.

Dialog for specific weather

Multiple Spouse Dialog supports the Content Patcher conditions system. You can have dialog that only appears at specific times, weathers, seasons, festival days, and many other situations.

For example, here's a dialog pair for a rainy day:

{
  "Call": "Too wet to go out today",
  "Response": "Stay inside with me <",
  "Callers": "Leah",
  "Responders": "Elliott",
  "When": {
    "Weather": "Rain"
  }
}

This is not a complete JSON file, it's to be pasted into your existing file. Make sure you put a comma between it and the dialog before. See the screenshot if unsure.

What the completed json file looks like

Check the json files that come with the mod for other examples of conditions. Full list here The known conditions are:


Special character can be added:

  • $ makes a coin or circle (may be inaccurate)
  • = makes a star
  • < makes a heart
  • @ adds the name of the farmer

Sharing your finished dialog

If you want to share your dialog with others, send your json to the mod maintainers so it can be added to a future version. as of 2023, for faster response, we suggest contacting ꧁Monthy 🦎꧂#9641 on discord or DummyAccount03 on Nexus