Took me ages to track it down to this line of code, but this is actually putting my animations on the player character in an Idle state.
Is there a way I can get around this?
Thanks,
BB
DialogueManager.Unpause(); is stopping my animations
-
- Posts: 91
- Joined: Tue Jul 14, 2015 8:22 am
Re: DialogueManager.Unpause(); is stopping my animations
Hi,
DialogueManager.Unpause() does two things:
1. Unpauses DialogueTime, and
2. Broadcasts "OnDialogueSystemUnpause" to the Dialogue Manager and, if a conversation is active, the primary Actor & Conversant.
If you suspect the issue is related to DialogueTime, here's more info:
DialogueTime is essentially a wrapper for Unity's Time class. However, it can work in one of two modes:
However, if you've changed DialogueTime's mode to Gameplay, then it maps directly to Unity's Time class. In this case, if you pause DialogueTime it sets Time.timeScale=0. If you unpause DialogueTime, it sets Time.timeScale=1. Could this be affecting your animation control scripts?
If you suspect the OnDialogueSystemUnpause message is the issue, here's more info:
The only Dialogue System operations that react to OnDialogueSystemUnpause are:
What's your reason for calling DialogueManager.Unpause()?
DialogueManager.Unpause() does two things:
1. Unpauses DialogueTime, and
2. Broadcasts "OnDialogueSystemUnpause" to the Dialogue Manager and, if a conversation is active, the primary Actor & Conversant.
If you suspect the issue is related to DialogueTime, here's more info:
DialogueTime is essentially a wrapper for Unity's Time class. However, it can work in one of two modes:
- Realtime: (Default) Unaffected by Time.timeScale.
- Gameplay: Affected by Time.timeScale, just like Unity's Time class.
However, if you've changed DialogueTime's mode to Gameplay, then it maps directly to Unity's Time class. In this case, if you pause DialogueTime it sets Time.timeScale=0. If you unpause DialogueTime, it sets Time.timeScale=1. Could this be affecting your animation control scripts?
If you suspect the OnDialogueSystemUnpause message is the issue, here's more info:
The only Dialogue System operations that react to OnDialogueSystemUnpause are:
- AudioWait() and Voice() sequencer commands
- The Dialogue System Events component invokes any event handlers you've registered for the OnDialogueSystemUnpause event.
What's your reason for calling DialogueManager.Unpause()?
-
- Posts: 91
- Joined: Tue Jul 14, 2015 8:22 am
Re: DialogueManager.Unpause(); is stopping my animations
I've been using DialogueManager.Pause(); and Unpause because once a line is delivered I do various things that take a few seconds before I want the responses to come through, so I've been pausing to delay, doing my stuff then unpausing. Is there a better way to do that?
Re: DialogueManager.Unpause(); is stopping my animations
Yes. The typical way is to through the dialogue entry's Sequence. The Dialogue System won't move on from a dialogue entry's line until its Sequence is done, or until the player clicks the continue button if you're using continue buttons.
If you want the line to stay onscreen for 5 seconds before the response menu appears, set the Sequence field to:
Sequences can also wait for external events. Use the "@Message(xyz)" syntax, like this:
The None() sequencer command is just an empty command that does nothing. But it doesn't run until the sequencer receives the "qWasPressed" message, which causes the sequence to wait until then.
You can also write your own custom sequencer commands. They're actually very simple to write. You could write a command that runs until you're done doing your stuff. Then you'd use it like this:
If you want the line to stay onscreen for 5 seconds before the response menu appears, set the Sequence field to:
- Sequence: Delay(5)
- Default Sequence: Delay({{end}})
Sequences can also wait for external events. Use the "@Message(xyz)" syntax, like this:
- Sequence: None()@Message(qWasPressed)
Code: Select all
void Update() {
if (Input.GetKeyDown(KeyCode.Q)) {
Sequencer.Message("qWasPressed");
}
}
You can also write your own custom sequencer commands. They're actually very simple to write. You could write a command that runs until you're done doing your stuff. Then you'd use it like this:
- Sequence: DoMyStuff()
-
- Posts: 91
- Joined: Tue Jul 14, 2015 8:22 am
Re: DialogueManager.Unpause(); is stopping my animations
Ah yes. I was doing that originally, but that meant every single entry I wrote would have to use this sequence. Every line I use goes through this process which is why I was using pause.
Can I override the default behaviour?
Can I override the default behaviour?
Re: DialogueManager.Unpause(); is stopping my animations
What about setting the Dialogue Manager's Default Sequence? If your entries' Sequence fields are blank, they'll use the Default Sequence.
Another option is to add a script that has an OnConversationLine method that manually adds the command to every sequence:
Another option is to add a script that has an OnConversationLine method that manually adds the command to every sequence:
Code: Select all
void OnConversationLine(Subtitle subtitle) {
subtitle.sequence += "; None()@Message(xyz)"
}