Forum rules - please read before posting.

How to display a "Continue" icon/button at the end of a dialogue line?

Similar to a post I made about a continue button in a cutscene, I'm looking to have a "Continue" button display when a line of dialogue has completed. Clicking or pressing the button would go to the next bit of dialogue or exit/play a cutscene. Like dialogue in Zelda games or some old RPGs.
I feel like this is do-able in AC but I'm not sure if the answer is somewhere in the Speech manager or via creating a custom Subtitles menu. Any help here would be appreciated, thank you!

Comments

  • First make sure that Subtitles can be skipped? is checked in your Speech Manager.

    Once set, the "SkipSpeech" input - if listed in Unity's Input Manager - can be pressed to skip the current speech.

    If you want it to be an on-screen button, rather than a physical keypress, add a Button element to your Subtitles menu and have it simulate the "SkipSpeech" button - so that clicking it causes the input to fire.

  • How can the button appear after the dialogue line is done printing? Just an indicator that the character has finished speaking and you need to hit next. I haven't found a way for AC to detect when a line is complete and to activate a UI menu. Dialogue->WaitForSpeech doesn't work for this either, as it removes the dialogue to go to the next thing.

  • A custom script that hooks into a speech event can achieve this.

    How are you determing that a character has finished speaking? At the point of scrolling completing, or audio finishing?

  • Just when the text scrolling is complete!

  • This should do it:

    using UnityEngine;
    using AC;
    
    public class ContinueSpeechButton : MonoBehaviour
    {
    
        public string menuName = "Subtitles";
        public string buttonName = "Continue";
    
        private void OnEnable ()
        {
            EventManager.OnStartSpeech_Alt += OnStartSpeech;
            EventManager.OnEndSpeechScroll_Alt += OnEndSpeechScroll;
        }
    
        private void OnDisable ()
        {
            EventManager.OnStartSpeech_Alt -= OnStartSpeech;
            EventManager.OnEndSpeechScroll_Alt -= OnEndSpeechScroll;
        }
    
        void OnStartSpeech (Speech speech)
        {
            PlayerMenus.GetElementWithName (menuName, buttonName).IsVisible = false;
        }
    
        void OnEndSpeechScroll (Speech speech)
        {
            PlayerMenus.GetElementWithName (menuName, buttonName).IsVisible = true;
        }
    
    }
    

    Paste into a C# script named ContinueSpeechButton, place in the scene, and update its Inspector values with the name of your Menu, and it's "Continue" button, respectively.

  • Thank you so much Chris!! You are a saint!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.