Coding Help I’m struggling with how to make dialogue change depending on the time of day

asatone

Newcomer
Hello. These I’m struggling with how to make dialogue change depending on the time of day.
Because even when the code is added without any errors, it doesn’t work at all in-game. Only the dialogue without time conditions is being displayed.
If anyone knows how to make different dialogue appear at different times in the same location, could you please let me know? I’m begging here—I’ve been stuck on this for days.

Here’s the situation I’m dealing with—could you take a look?

For example, when I write it like this, only the vanilla dialogue is shown.

{ "Changes":[
{
"Action":"EditData",
"Target": "Characters/Dialogue/Gus",
"When":{
"Time": "{{Range: 1300, 1400}}"},
"Entries":{
"Saloon": "Why don’t you relax for a bit? The omelet here is really good—want to go with that?”
}
}
]
}

For example, when I write it like this , only the vanilla dialogue is shown.
{ "Changes":[
{
"Action":"EditData",
"Target": "Characters/Dialogue/Gus",
"When":{
"Time": "1300"},
"Entries":{
"Saloon": "Welcome!"
}
},
{
"Action":"EditData",
"Target": "Characters/Dialogue/Gus",
"When":{
"Time": "1400"},
"Entries":{
"Saloon":"Why dont you relax for a bit? The omelet here is really good—want to go with that?"
}
}
]
}


For example, when I write it like this, only the first editdata "welcome" is shown.


{ "Changes":[
{
"Action":"EditData",
"Target": "Characters/Dialogue/Gus",
"Entries":{
"Saloon": "Welcom!"
}
},
{
"Action":"EditData",
"Target": "Characters/Dialogue/Gus",
"When":{
"Time": "1400"},
"Entries":{
"Saloon":"Why dont you relax for a bit? The omelet here is really good—want to go with that?"
}
}
]
}
 
Last edited:
Cool! Idk u could do that! Getting a log on one of the study representatives/helpers to try and help you figure this out especially if it’s Stardew Valley related.
 
It does look like you're doing the "when" condition code correctly in the first example (and not in the later ones), but I've never seen anyone attempt to edit dialogue strictly for the time of day before. Most dialogue is either for the day or for the location or for the heart level, or a combo of those. I also think the only time I've tried to use a "when" condition in dialogue, I did it inside the actual dialogue line, with a | marking the split between the dialogue when the condition is met and when the condition isn't met (I'm not at my home computer or I'd dig up an example that i know works)

If you have access to it, you might have better luck asking at the stardew discord in the modding thread. I've found responses there happen within a few minutes.
 
Back
Top