Conversation Requirements
Requirements allow you to control when a a character will have a conversation with the player. This can include relationship stats that the character has with the player, the location, the day of the week, the year, or many other things to think about.
A simple example is having different conversations based on the day of the week.
{
"Name": "Robin",
"Conversations":
[
{
"Statement": [ "Nice to see to you!" ]
},
{
"Reqs": { "Days": ["Sunday", "Saturday"] },
"Statement": [ "I love the weekends!" ]
},
{
"Reqs": { "Days": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"] },
"Statement": [ "I love being my own boss." ]
}
]
}
The first conversation could be picked to be said to the player. The second conversation could be chosen on weekend. The third conversation could be chosen on weekdays.
You may want to require conversations to only happen if another conversation has occurred first. To do this you can use the conversations Key.
{
"Name": "Robin",
"Conversations":
[
{
"Statement": [ "Nice to see to you!" ]
},
{
"Key": "weekends"
"Reqs": { "Days": ["Sunday", "Saturday"] },
"Statement": [ "I love the weekends!" ]
},
{
"Reqs":
{
"Keys": [ "weekends" ]
"Days": [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" ]
},
"Statement": [ "I love being my own boss.", "I can set my own hours." ]
}
]
}
Setting the key in the second conversation makes it a conversation that can be accessed by later conversations. The third conversation then can use that key as a requirement. This will ensure that the player will see the second conversation before seeing the third conversation. Multiple keys can be listed within the square brackets (e.g. [ "key1", "key2" ]). In this way to can ensure that any number of conversations were seen first.
You can also use Stardew Valley's built in Friendship stat, known generally as hearts, to determine what a character will say. To accomplish this you need to use the "Hearts" requirement.
{
"Name": "Robin",
"Conversations":
[
{
"Reqs":{ "Hearts": "0-1" } // Requires hearts to be between 0 and 1
"Statement": [ "I'm enjoying getting to know you better." ]
},
{
"Reqs":{ "Hearts": "2" } // Requires hearts to be four or more
"Statement": [ "It's always really good to see you!" ]
}
]
}
It's important to remember that these conversations will not automatically increase the friendship points on the character. You can achieve that but you need to use the Effects tag which is discussed later.
You can also setup requirements using custom stats for your mod, for example tracking friendship and business relationships separately
{
"Name": "Robin",
"Conversations":
[
{
"Reqs":
{
"Stats":
{
"Friendship": "4" // Friendship custom stat must be four or more.
}
}
"Statement": [ "I really like hanging out with you." ]
},
{
"Reqs":
{
"Stats":
{
"Business": "2-6" // Business custom stat must be between two and six.
}
}
"Statement": [ "It's a always a pleasure doing business with you." ]
}
]
}
You can set the stat requirements to be anything within the conversation. The framework will see if that value has ever been set. If it hasn't then it will assume that the value of the stat is zero. This means that you must be careful of spelling errors as the framework won't detect the error. Setting the custom stats will be discussed later with the Effects tag.
Remember that white space doesn't impact how the file is handled by the game. Likewise, the order of the tags within the json file doesn't matter. So the following two files would work in game the same way.
{
"Name": "Robin",
"Conversations":
[
{
"Key": "hangout"
"Reqs":
{
"Stats": { "Friendship": "4" }
}
"Statement": [ "I really like hanging out with you." ]
}
]
}
{
"Name": "Robin",
"Conversations":
[
{
"Reqs": { "Stats": { "Friendship": "4" } }
"Statement": [ "I really like hanging out with you." ]
"Key": "hangout"
}
]
}
I would encourage you to be consistent, as conversations get larger having them ordered the same way every time will make it easier on you in the long run. However, as with how to manage white space within your file the style you choose is up to you. For my files I will always put them in the following order: Key, Reqs, Statement, Effects, NextConversation, Responses. Effects, NextConversations, and Responses will be discussed later.