Repeat current dialogue node
Repeat current dialogue node
What is the best way to set a node to repeat itself via code? This is to give the option to hear the audio a second time.
Re: Repeat current dialogue node
Hi,
You can tell the conversation controller to re-run the current state:
You can tell the conversation controller to re-run the current state:
Code: Select all
DialogueManager.conversationController.GotoState(DialogueManager.currentConversationState);
Re: Repeat current dialogue node
The GotoState function looks like it should work (I checked with Debug statements), but unfortunately it still isn't replaying the audio associated with a state. I'm not sure where/how the system is playing audio, but there must be something preventing it from working. Please let me know if you have an suggestions on where to look! Thanks.
Re: Repeat current dialogue node
Hi,
How are you playing the audio? Are you using an Audio/AudioWait() sequencer command? Here's an example:
DS_RepeatLineExample_2022-08-19.unitypackage
It's a modified version of DemoScene1 with this script:
Talk to Private Hart and click the Repeat button to repeat the current dialogue node.
How are you playing the audio? Are you using an Audio/AudioWait() sequencer command? Here's an example:
DS_RepeatLineExample_2022-08-19.unitypackage
It's a modified version of DemoScene1 with this script:
Code: Select all
using UnityEngine;
using PixelCrushers.DialogueSystem;
public class RepeatLineExample : MonoBehaviour
{
public void RepeatLine()
{
DialogueManager.conversationController.GotoState(DialogueManager.currentConversationState);
}
}
Re: Repeat current dialogue node
I'm using AudioWait(entrytaglocal);
Thanks for the tip - I will check the demo scene.
Thanks for the tip - I will check the demo scene.
Re: Repeat current dialogue node
I can't see a repeat scene function in the demo scene. I am using a slightly older version of the Dialogue System - was this feature added recently?
- Attachments
-
- demoscene.png (466.66 KiB) Viewed 381 times
Re: Repeat current dialogue node
Hi,
After you import the package, the scene will be located in Assets / Dialogue System Examples / Repeat Line Example. The scene is named "Repeat Line Example".
You'll know that you're playing it instead of the original DemoScene1 because it uses the gray Basic Standard Dialogue UI:
After you import the package, the scene will be located in Assets / Dialogue System Examples / Repeat Line Example. The scene is named "Repeat Line Example".
You'll know that you're playing it instead of the original DemoScene1 because it uses the gray Basic Standard Dialogue UI:
Re: Repeat current dialogue node
Is it one of these packages? https://www.pixelcrushers.com/dialogue- ... em-extras/ - I can't see it in the latest version.
Re: Repeat current dialogue node
It's in the link in my post above.