Page 1 of 1

[Solved] Two Questions

Posted: Tue Sep 04, 2018 6:28 am
by Japtor
Hi,

I have two questions.

The first one: When the conversation starts by using a Dialogue System Trigger -> OnUse, always all the dialogue UI appears instantly. Is there a way I could add a small delay to specific conversations? For example: Being near to the NPC, pressing the start dialogue button and, after one second, the conversation starts as normal.

The second one: When the NPC had the conversation with you, If I interact with him again he tells you the same thing. Is there a way I could deactivate a conversation from a specific NPC when it has been made? Additionally, is there also a way to detect it via script? As I would like to deactivate some images that identify if there can be an interaction between NPC/Player and the NPC has something to talk to you about.

Thanks! :)

Re: Two Questions

Posted: Tue Sep 04, 2018 11:01 am
by Tony Li
Hi,
Japtor wrote: Tue Sep 04, 2018 6:28 amThe first one: When the conversation starts by using a Dialogue System Trigger -> OnUse, always all the dialogue UI appears instantly. Is there a way I could add a small delay to specific conversations? For example: Being near to the NPC, pressing the start dialogue button and, after one second, the conversation starts as normal.
If you're using Standard Dialogue UI, Unity UI Dialogue UI, or TextMesh Pro Dialogue UI, it will always show the Dialogue Panel. If you're using Standard Dialogue UI, inspect the subtitle panels. Make sure their Visibility is not set to Always From Start. Then you can move your UI elements to the subtitle panels instead of the main dialogue panel.

Then set the first node's Dialogue Text to a blank string and the Sequence to: Delay(1)

Japtor wrote: Tue Sep 04, 2018 6:28 amThe second one: When the NPC had the conversation with you, If I interact with him again he tells you the same thing. Is there a way I could deactivate a conversation from a specific NPC when it has been made?
Use a dialogue database variable, or a custom actor field. For example, you could define a Boolean variable "Talked_To_Bob". In the first node:
  • Dialogue Text: (blank)
  • Sequence: Delay(1)
  • Conditions: Variable["Talked_To_Bob"] == false
  • Script: Variable["Talked_To_Bob"] = true
Japtor wrote: Tue Sep 04, 2018 6:28 amAdditionally, is there also a way to detect it via script? As I would like to deactivate some images that identify if there can be an interaction between NPC/Player and the NPC has something to talk to you about.
You can check the variable "Talked_To_Bob":

Code: Select all

bool hasSomethingToSay = DialogueLua.GetVariable("Talked_To_Bob").AsBool == false;
Or you can check DialogueManager.ConversationHasValidEntry():

Code: Select all

bool hasSomethingToSay = DialogueManager.ConversationHasValidEntry("Bob Conversation");
This may work better if your conversation defines a lot of complex conditions in order for it to start.