Thank you very much!
Now the dialogue is perfectly synchronizing with the timeline!
There are still some room for improvement,
such as when every texts has been typed out wait for 1~1.5 sec and stop timeline(to fit the timing when the player has read the text and pause the timeline. If it's too fast it feels like rage stop)
But I'll try to find the way myself.
How to pause the game when the dialogue is shown
-
- Posts: 17
- Joined: Mon Oct 11, 2021 9:48 pm
-
- Posts: 17
- Joined: Mon Oct 11, 2021 9:48 pm
Re: How to pause the game when the dialogue is shown
And there's 1 more thing I'm thinking about.
Normally in Dialogue System, Player interact to NPC(Dialogue System Trigger) to activate Conversation.
But in my project, dialogue is controlled by timeline.
So how can I start playing timeline with Dialogue System Trigger?
As the try I wrote Sequence "Timeline(play, speaker)" in <START> entry,
But this error came out.
Normally in Dialogue System, Player interact to NPC(Dialogue System Trigger) to activate Conversation.
But in my project, dialogue is controlled by timeline.
So how can I start playing timeline with Dialogue System Trigger?
As the try I wrote Sequence "Timeline(play, speaker)" in <START> entry,
But this error came out.
Code: Select all
NullReferenceException: The PlayableGraph is null.
UnityEngine.Playables.PlayableGraph.GetRootPlayableInternal (System.Int32 index) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
UnityEngine.Playables.PlayableGraph.GetRootPlayable (System.Int32 index) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
PixelCrushers.DialogueSystem.SequencerCommands.SequencerCommandTimeline+<Proceed>d__9.MoveNext () (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Options/Timeline/Sequencer/SequencerCommandTimeline.cs:150)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <31d5d65b32ec483292e13e8ae4100b93>:0)
Re: How to pause the game when the dialogue is shown
Hi,
In your Dialogue System Trigger, select Add Action > OnExecute() UnityEvent instead of Add Action > Start Conversation. Configure the OnExecute() UnityEvent to start your timeline.
In your Dialogue System Trigger, select Add Action > OnExecute() UnityEvent instead of Add Action > Start Conversation. Configure the OnExecute() UnityEvent to start your timeline.
-
- Posts: 17
- Joined: Mon Oct 11, 2021 9:48 pm
Re: How to pause the game when the dialogue is shown
Thank you!
Now the timeline starts when the player interact NPC!
It's a small thing, but... An Usabe attached on NPC keeps showing in front during the conversation.(Eでインタラクト)
I think in normal Dialogue conversation it's supposed to be hidden.
Maybe because running dialogue with "OnExecute", not "Start Conversation"?
Now the timeline starts when the player interact NPC!
It's a small thing, but... An Usabe attached on NPC keeps showing in front during the conversation.(Eでインタラクト)
I think in normal Dialogue conversation it's supposed to be hidden.
Maybe because running dialogue with "OnExecute", not "Start Conversation"?
Re: How to pause the game when the dialogue is shown
Hi,
Add a Dialogue System Events component to the player's GameObject. Configure OnConversationStart() to disable the player's Selector component. Configure OnConversationEnd() to re-enable it.
Add a Dialogue System Events component to the player's GameObject. Configure OnConversationStart() to disable the player's Selector component. Configure OnConversationEnd() to re-enable it.
-
- Posts: 17
- Joined: Mon Oct 11, 2021 9:48 pm
Re: How to pause the game when the dialogue is shown
Unfortunately, it didn't fix.
Re: How to pause the game when the dialogue is shown
Hi,
It will only fix it if the player GameObject is the conversation's conversation actor or conversation conversant. (Only the Dialogue Manager, the conversation actor, and the conversation conversant receive "OnConversationStart" and "OnConversationEnd" messages.)
If you want to hide the Selector even if the player isn't the actor or conversant, you'll need to add a script like this to the player:
HideSelectorDuringConversations.cs
It will only fix it if the player GameObject is the conversation's conversation actor or conversation conversant. (Only the Dialogue Manager, the conversation actor, and the conversation conversant receive "OnConversationStart" and "OnConversationEnd" messages.)
If you want to hide the Selector even if the player isn't the actor or conversant, you'll need to add a script like this to the player:
HideSelectorDuringConversations.cs
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
[RequireComponent(typeof(Selector))]
public class HideSelectorDuringConversations : MonoBehaviour
{
private void OnEnable()
{
DialogueManager.instance.conversationStarted += HideSelector;
DialogueManager.instance.conversationEnded += ShowSelector;
}
private void OnDisable()
{
DialogueManager.instance.conversationStarted -= HideSelector;
DialogueManager.instance.conversationEnded -= ShowSelector;
}
private void HideSelector()
{
GetComponent<Selector>().enabled = false;
}
private void HideSelector()
{
GetComponent<Selector>().enabled = true;
}
}