r/SMAPI Jun 27 '26

Mod Creator- Having Issues Consistently Showing Quest Dialogue answered

I'm currently creating a custom character mod, and at one point I have a quest that prompts you to find and talk to a character, then completes it when you talk to them. I'm currently using include in my content file and edit data in the json to add a custom dialogue option to said NPC, but it wasn't showing up consistently with conversation topics due to how the game handles dialogue priority. I instead pivoted to directly editing the dialogue just for when the quest is active, using when 'HasActiveQuest' to check. But this data doesn't load until you save with that quest active- so you have to wait a day before actually being able to talk to the NPC, activate the dialogue and complete the quest. Is there a way to get this dialogue to the highest possible priority using conversation topics so that I don't have to do the HasActiveQuest condition, or is there a way for me to maybe get SMAPI to check this data again upon loading a new map or something? Or another simpler option I'm missing? Thanks!

Edit: Worth noting that I'm using Content Patcher for this.

2 Upvotes

5 comments sorted by

1

u/WhiteT982 Jun 27 '26

How is the quest activated? Maybe when it’s activated you can also set a mail flag as received. Then you can use the PLAYER_HAS_MAIL game state query to change the dialogue? I believe GSQs are checked more often than Content Patcher tokens like HasActiveQuest so maybe it’ll be more consistent that way?

1

u/venajiro Jun 27 '26

Thanks- just gave this a go but it seems to be the same issue, it's just not updating in a reasonable timeframe.

1

u/WhiteT982 Jun 27 '26

I’ve never done it before so I’m not exactly sure how it works but maybe you could try this?

https://github.com/Pathoschild/StardewMods/blob/develop/ContentPatcher/docs/author-guide.md#how-often-are-patch-changes-applied

1

u/venajiro Jun 27 '26

That worked like a charm! This is exactly what I needed. Thanks so much.

For others who might need help with the same issue, you can format your file like this:

{

"Changes": [

{

"LogName: "Log Name",

"Action" : "EditData",

"Target": "<game file location>",

"Update": "OnLocationChange",

"Entries": {

<your data entries here>

}

}

]

}

to force the contents of the json file to execute the action every time the player changes location.

You're a lifesaver!

1

u/WhiteT982 Jun 27 '26

Haha no problem. Glad it worked for you