Hello! So far, I really like the asset, I just have this little issue.
For my specific case I essentially want to have 2 different types of dialogue:
- Blocking: when you stop and talk to NPC characters, you lose control over your character and have to pick choices etc..
- Non-blocking: you might be navigating the world, enter a trigger and your character makes a comment.
I managed to create the first type, but for the second one I am struggling a bit. I don't think that I can use barks because they are one liners? And I sometimes need multiple lines of dialogue.
I also have the issue where I want the blocking dialogues to prompt you to press "continue" to advance the dialogue, while the non-blocking should proceed automatically.
How might I go about this?
Thanks!
How to have blocking and non-blocking dialogues
Re: How to have blocking and non-blocking dialogues
I think I made slight progress - I found that there is the method to SetContinueMode to false, then I can call SetOriginalContinueMode to revert to the original state once the conversation is finished.
At the moment I am taking away control form the player by using the DialogueSystemEvents component, but that triggers every time I start any kind of conversation, no matter if it's blocking or non-blocking, so I just need to figure out a better way to take away control from the player I guess.
That's the progress I made so far, but would love to hear from someone more experienced if I am on the right track or if there is a better way to achieve this of course!:D
At the moment I am taking away control form the player by using the DialogueSystemEvents component, but that triggers every time I start any kind of conversation, no matter if it's blocking or non-blocking, so I just need to figure out a better way to take away control from the player I guess.
That's the progress I made so far, but would love to hear from someone more experienced if I am on the right track or if there is a better way to achieve this of course!:D
Re: How to have blocking and non-blocking dialogues
More progress, this is how my code is looking so far
at the moment I am using a string to start the conversation, I am wondering if there is a better way, maybe some sort of dropdown picker.
In any case I stop all conversations (because if the player is making a comment about the environment and suddenly an NPC interrupts and starts a blocking dialogue, I need it to stop immediately)
Then I update the continue mode and continue button state, then start the conversation, on end I revert everything.
Then on the player I listen to when the conversation starts and do this:
So, I guess I mostly got everything working that I wanted to.
Code: Select all
DialogueManager.Instance.StopAllConversations();
DialogueManager.Instance.SetContinueMode(shouldLock);
DialogueManager.Instance.displaySettings.subtitleSettings.requireContinueOnLastLine = shouldLock;
DialogueManager.StartConversation(conversation);
DialogueManager.Instance.conversationEnded += EndDialogueEvent;
In any case I stop all conversations (because if the player is making a comment about the environment and suddenly an NPC interrupts and starts a blocking dialogue, I need it to stop immediately)
Then I update the continue mode and continue button state, then start the conversation, on end I revert everything.
Then on the player I listen to when the conversation starts and do this:
Code: Select all
public void OnConversationStarted()
{
ToggleLock(DialogueManager.instance.displaySettings.subtitleSettings.continueButton == DisplaySettings.SubtitleSettings.ContinueButtonMode.Always);
}
Re: How to have blocking and non-blocking dialogues
Hi,
In the current versions of the Dialogue System, conversations are started by title or ID. (Technically you look up the conversation by ID and then start it using that conversation's title.) The Dialogue System has a [ConversationPopup] attribute that you can apply to a string variable to make it appear in the inspector as a dropdown menu.
In the current versions of the Dialogue System, conversations are started by title or ID. (Technically you look up the conversation by ID and then start it using that conversation's title.) The Dialogue System has a [ConversationPopup] attribute that you can apply to a string variable to make it appear in the inspector as a dropdown menu.
Re: How to have blocking and non-blocking dialogues
Works like a charm, thank you!:D I'm really impressed by this asset, amazing quality.
I have one more quick question:
When one conversation interrupts another conversation, it does not work for some reason due to the order in which the end conversation event is triggered...
My code looks like this:
I also put 2 debug logs on the "DialogueSystemEvents" component on "OnConversationStart" I print "Conversation started" and on "OnconversationEnd" I print "Conversation ended". This is where I hook onto these events and toggle the users ability to move around.
For some reason the order does not make sense, I get the following:
Conversation started
End previous conversation
Start new conversation
Conversation started
Conversation ended
The conversation ended event gets fired way too late, it gets fired after the new dialogue has started, effectively giving the player back control. This messes up my control over the players movement. So, for me the order is really important. Why is this happening, am I doing something wrong?
Thanks!
I have one more quick question:
When one conversation interrupts another conversation, it does not work for some reason due to the order in which the end conversation event is triggered...
My code looks like this:
Code: Select all
Debug.Log("End previous conversation");
DialogueManager.instance.StopConversation();
// configure the continue button based on if the dialogue is non-blocking or not...
DialogueManager.instance.SetContinueMode(shouldLock);
DialogueManager.instance.displaySettings.subtitleSettings.requireContinueOnLastLine = shouldLock;
Debug.Log("Start new conversation");
DialogueManager.StartConversation(conversation);
DialogueManager.instance.conversationEnded += EndDialogueEvent;
For some reason the order does not make sense, I get the following:
Conversation started
End previous conversation
Start new conversation
Conversation started
Conversation ended
The conversation ended event gets fired way too late, it gets fired after the new dialogue has started, effectively giving the player back control. This messes up my control over the players movement. So, for me the order is really important. Why is this happening, am I doing something wrong?
Thanks!
Re: How to have blocking and non-blocking dialogues
Progress update: I have a feeling this might be what is causing the issue:
But I might be wrong
Code: Select all
private IEnumerator InvokeOnConversationEndAtEndOfFrame(Transform actor)
{
yield return endOfFrame;
conversationEvents.onConversationEnd.Invoke(actor);
}
Re: How to have blocking and non-blocking dialogues
Lol.. I figured it out:D
I accidentally TICKED ON the "RunOnConversationEnd Events At End of Frame"... My bad! Unticked that and everything works perfectly:D Hope you don't mind me thinking out loud, just wanted to leave my solutions out there in case anyone has similar problems in the future.
Thanks for the amazing asset!
I accidentally TICKED ON the "RunOnConversationEnd Events At End of Frame"... My bad! Unticked that and everything works perfectly:D Hope you don't mind me thinking out loud, just wanted to leave my solutions out there in case anyone has similar problems in the future.
Thanks for the amazing asset!
Re: How to have blocking and non-blocking dialogues
Hi,
Thanks for sharing your solution!
Thanks for sharing your solution!