Conversation Statements
Dialogue works differently with this framework than normal Stardew Dialogue. Using the standard Stardew Valley dialogue you must specify one thing that the character will say on a given day based on various factors like weather, hearts, day of the week, and location.
With Midnight Stardew you instead create a collection of dialogues that the character may say each day based on those same factors and the framework will randomly choose one of them to say. So the simpliest dialogue to setup is something that the character might say any time the player interacts with them.
Here is the simpliest example of creating a file for a character.
{
"Name": "Robin",
"Conversations":
[
{
"Statement": ["It's good to see you."]
}
]
}
To break down the elements in the file:
- Name: The name of the character that this file is handling.
- Conversations: All of the conversations that the character can have with the player.
- Statement: What the character says to the player.
To create a longer dialogue that displays text on dialogue boxes you add additional quotes to the list of statements like this.
{
"Name": "Robin",
"Conversations":[
{
"Statement":
[
"It's good to see you.",
"If you need any new farm buildings come visit my shop!"
]
}
]
}
At the moment Robin will say this same thing every time the player talks to her. Which isn't very interesting. So lets add a few more things for her to say. As a reminder from the JSON basics page, everything following // is a comment that will be ignored by the computer and can be safely removed.
{
"Name": "Robin",
"Conversations":[
// Start first conversation
{
"Statement":
[
"It's good to see you.",
"If you need any new farm buildings come visit my shop!"
]
},
// Start second conversation
{
"Statement":
[
"Hello!"
]
},
// Start third conversation
{
"Statement":
[
"If you need any wood or stone, stop by the shop!"
]
},
// Start fourth conversation
{
"Statement":
[
"It's a lazy day for me.",
"I don't have any projects right now.",
"...",
"If you need any buildings created, let me know!"
]
}
]
}
Every time the player talks to the character it will choose a random conversation from the file. The next step is adding requirements limiting when statements will be said.
The json file format doesn't care about white space (e.g. spaces, tabs, new lines). So the above file could be rewritten as follows without impacting how it is displayed in game at all.
{
"Name": "Robin",
"Conversations":[
{
"Statement": [ "It's good to see you.",
"If you need any new farm buildings come visit my shop!"]
},
{
"Statement": [ "Hello!" ]
},
{
"Statement": [ "If you need any wood or stone, stop by the shop!" ]
},
{
"Statement": [ "It's a lazy day for me.",
"I don't have any projects right now.",
"...",
"If you need any buildings created, let me know!" ]
}
]
}
It is important to write your files to be clear and easy to understand. The computer could read the file if you put it all in one line but you would find it hard to update or expand. I would encourage you to be consistent in your style but otherwise the choice of how to format your files is up to you.