Tutorial: Adding characters to Multiple Spouse Dialog

From The Stardew Modding Wiki
Jump to navigation Jump to search

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

Future infobox info: Ceruleandeep, May 13 2021


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[edit | edit source | hide | hide all]

The existing speech bubbles in Stardew Valley are very brief. 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:

  • morning vs night
  • different weathers
  • different seasons
  • festival days

Getting set up[edit | edit source | hide]

  • 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[edit | edit source | hide]

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[edit | edit source | hide]

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[edit | edit source | hide]

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)[edit | edit source | hide]

  • 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[edit | edit source | hide]

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.

Sharing your finished dialog[edit | edit source | hide]

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.