Refresh visited menu option if something new is unlocked

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
bohemian pulp
Posts: 21
Joined: Wed Apr 21, 2021 7:01 am

Refresh visited menu option if something new is unlocked

Post by bohemian pulp »

Would it be possible to make a script that refreshes a menu option that was already visited (and greyed out) if a new option becomes available deeper behind that menu option, or there are more options left unvisited?

For example, if I make a group of conversation options: Talk about the case, and early on in the game there are, for example, two options, I visit them both, everything is greyed out, as well as "Talk about the case," which is great, but - if later in the game I meet some conditions and unlock more options in the Talk about the case menu tree, can it refresh somehow indicating there are new options available in that tree?

I noticed that Disco Elysium didn't solve that one as well, so it might not be so easily done, but it's worth asking, and it's a great feature to have because it can stuck players or force them to revisit all the visited options in order to find a new one.
Creator of "Let Bions be bygones"
https://linktr.ee/bohemianpulp
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: Refresh visited menu option if something new is unlocked

Post by Tony Li »

Hi,

I think ZAUM could have done it. Maybe they overlooked it or chose to focus on other things. (Small team and all.)

An option is greyed out when the dialogue entry's SimStatus is set to "WasDisplayed". To un-grey it, just set SimStatus back to "WasOffered" or "Untouched". The catch is that dialogue entries are identified by ID numbers.

Say "Talk about the case" is in conversation 9, ID 42.

If you're in the same conversation and want to un-grey it, use this in the Script field:

Code: Select all

Dialog[42].SimStatus = "Untouched"
If you're in a different conversation, use:

Code: Select all

Conversation[9].Dialog[42].simStatus = "Untouched"
If you're using C# code, you'll need to find the dialogue entry and call DialogueLua.MarkDialogueEntryUntouched():

Code: Select all

var entry = DialogueManager.masterDatabase.GetDialogueEntry(9, 42);
DialogueLua.MarkDialogueEntryUntouched(entry);
Changing it in C# is actually a little more robust because you don't have to use ID numbers. Say the conversation title is "NPCs/Poirot" and the dialogue entry's Title field is set to "Discuss Case". Then you can use:

Code: Select all

var conversation = DialogueManager.masterDatabase.GetConversation("NPCs/Poirot");
var entry = conversation.dialogueEntries.Find(x = > x.Title == "Discuss Case");
DialogueLua.MarkDialogueEntryUntouched(entry);
User avatar
bohemian pulp
Posts: 21
Joined: Wed Apr 21, 2021 7:01 am

Re: Refresh visited menu option if something new is unlocked

Post by bohemian pulp »

It'll do. Thanks again for the quick and awesome help! 8-)
Cheers!
Creator of "Let Bions be bygones"
https://linktr.ee/bohemianpulp
User avatar
Tony Li
Posts: 22163
Joined: Thu Jul 18, 2013 1:27 pm

Re: Refresh visited menu option if something new is unlocked

Post by Tony Li »

Glad to help!
Post Reply