Marking Dialogue Nodes as visited
Marking Dialogue Nodes as visited
Hello!
Is there any way to mark a specific dialogue node as visited? I have an information-gathering group of nodes, and I want to change the color of text of dialogue options we have already visited so that it's clear to the player.
I'm using a Response Button Template to generate the dialogue buttons - trying to figure out if there's a built-in way to pass a "visited" variable from the dialogue node specified to the button itself.
Is there any way to mark a specific dialogue node as visited? I have an information-gathering group of nodes, and I want to change the color of text of dialogue options we have already visited so that it's clear to the player.
I'm using a Response Button Template to generate the dialogue buttons - trying to figure out if there's a built-in way to pass a "visited" variable from the dialogue node specified to the button itself.
Re: Marking Dialogue Nodes as visited
Hi,
You can either define a Dialogue System variable (e.g., in the Dialogue Editor's Variables section) and set it in the node's Script field, or you can use the built-in SimStatus feature.
You can either define a Dialogue System variable (e.g., in the Dialogue Editor's Variables section) and set it in the node's Script field, or you can use the built-in SimStatus feature.
Re: Marking Dialogue Nodes as visited
This is very helpful! A few more questions then:
Defining a variable in the variables section seems impossible for this use-case, correct? If each node needs to know whether or not it is visited, I would have to declare a global variable per each node, it seems. Let me know if I am misunderstanding.
As far as SimStatus goes - this looks like exactly what I need. However, how does one access the Dialogue[ID].SimStatus value from C#? It's not entirely clear to me how the Lua and C# code interact.
Defining a variable in the variables section seems impossible for this use-case, correct? If each node needs to know whether or not it is visited, I would have to declare a global variable per each node, it seems. Let me know if I am misunderstanding.
As far as SimStatus goes - this looks like exactly what I need. However, how does one access the Dialogue[ID].SimStatus value from C#? It's not entirely clear to me how the Lua and C# code interact.
Re: Marking Dialogue Nodes as visited
I will add - I did watch this:
It seems to show how to access C# variables from Lua scripts, but not how to access SimStatus/Lua variables from C# code.
It seems to show how to access C# variables from Lua scripts, but not how to access SimStatus/Lua variables from C# code.
Re: Marking Dialogue Nodes as visited
Hi,
If you use SimStatus, you'll use this form in Lua -- typically, in a dialogue entry node's Conditions field. To check the visited status of the current node:
To check the status of some other node with ID 42 in the conversation:
To check in C#, use DialogueLua.GetSimStatus():
If you want to get and set variables in C#, use DialogueLua.GetVariable() and DialogueLua.SetVariable().
If you use SimStatus, you'll use this form in Lua -- typically, in a dialogue entry node's Conditions field. To check the visited status of the current node:
Code: Select all
Dialog[thisID].SimStatus == "WasDisplayed"
Code: Select all
Dialog[42].SimStatus == "WasDisplayed"
Code: Select all
var currentEntry = DialogueManager.masterDatabase.GetDialogueEntry(link);
if (DialogueLua.GetSimStatus(currentEntry) == DialogueLua.WasDisplayed)
{ ... }
Re: Marking Dialogue Nodes as visited
That makes sense!
One last thing in this chain of logic - how would a ResponseButton initialized by a ResponseButtonTemplate know the ID/which DialogueEntry it is associated with?
I looked through the docs and it seems like you could do
and compare it with the button's text.
String comparison like this seems non-ideal, however. Is there an easier way to get the current nodes from the buttons rendered?
One last thing in this chain of logic - how would a ResponseButton initialized by a ResponseButtonTemplate know the ID/which DialogueEntry it is associated with?
I looked through the docs and it seems like you could do
Code: Select all
DialogueManager.instance.currentConversationState.pcResponses.formattedText
String comparison like this seems non-ideal, however. Is there an easier way to get the current nodes from the buttons rendered?
Re: Marking Dialogue Nodes as visited
Hi,
Response buttons will have StandardUIResponseButton components. This component has a response property. The response property has a destinationEntry, which is the dialogue entry to show if the player chooses the response. The destinationEntry has an id, which is the ID of the dialogue entry. So you can check:
But, stepping back a bit, what do you want to accomplish? There might be a more straightforward, built-in way to do it.
Response buttons will have StandardUIResponseButton components. This component has a response property. The response property has a destinationEntry, which is the dialogue entry to show if the player chooses the response. The destinationEntry has an id, which is the ID of the dialogue entry. So you can check:
Code: Select all
DialogueEntry entry = GetComponent<StandardUIResponseButton>().response.destinationEntry;
string simStatus = DialogueLua.GetSimStatus(entry);
Re: Marking Dialogue Nodes as visited
That makes sense! That will probably work.
The goal of this is two-fold:
A: Change the color of dialogue options that have already been selected (in info-gathering situations).
B: Perhaps use this to number dialogue options (ie 1, 2, 3, 4)
Do you see a more straightforward way to do this?
The goal of this is two-fold:
A: Change the color of dialogue options that have already been selected (in info-gathering situations).
B: Perhaps use this to number dialogue options (ie 1, 2, 3, 4)
Do you see a more straightforward way to do this?
Re: Marking Dialogue Nodes as visited
Hi,
> A: Change the color of dialogue options that have already been selected (in info-gathering situations).
You could set the Dialogue Manager GameObject's Display Settings > Input Settings > [em#] Tag for Old Responses.
> B: Perhaps use this to number dialogue options (ie 1, 2, 3, 4)
If you mean just putting numbers in front of responses (and assigning number key hotkeys), inspect the response menu panel and tick the Standard UI Menu Panel component's Autonumber > Enabled checkbox.
If you mean reordering the responses -- for example to put already-selected responses at the bottom -- you can do this using DialogueLua.GetSimStatus() in an OnConversationResponseMenu(Response[]) method.
> A: Change the color of dialogue options that have already been selected (in info-gathering situations).
You could set the Dialogue Manager GameObject's Display Settings > Input Settings > [em#] Tag for Old Responses.
> B: Perhaps use this to number dialogue options (ie 1, 2, 3, 4)
If you mean just putting numbers in front of responses (and assigning number key hotkeys), inspect the response menu panel and tick the Standard UI Menu Panel component's Autonumber > Enabled checkbox.
If you mean reordering the responses -- for example to put already-selected responses at the bottom -- you can do this using DialogueLua.GetSimStatus() in an OnConversationResponseMenu(Response[]) method.
Re: Marking Dialogue Nodes as visited
Great! Autonumber works well.
For the "[em#] Tag for Old Responses" - I enabled this, but nothing seems to happen. Do I need to define what "Em 1" is somewhere, so that I can set the color?
For the "[em#] Tag for Old Responses" - I enabled this, but nothing seems to happen. Do I need to define what "Em 1" is somewhere, so that I can set the color?