Forum rules - please read before posting.

Dialogue Speech Text Visual Click Indicator

edited December 2020 in Technical Q&A

Hello,

As we've been progressing along in the development of our story game one thing our team has discussed was having some kind of visual indication during dialogue for when the user can click to continue progressing through dialogue speech text. I think this is a pretty common thing in most games (i.e. usually games will do things like display a blinking cursor at the end of the dialogue text, or show some kind of visual button saying something like 'Next', etc...)

Right now we make use of the [wait] special text to keep dialogue paused until the player clicks on the screen but obviously this doesn't show any visual indication that the player should click something to continue the dialogue.

Is this something that is natively supported with AC (i.e. is there a setting somewhere that maybe lets you choose to display some kind of visual indication that dialogue is paused and you need to click in order to progress speech text)? Or would this be something that should be done through custom logic and other Unity functionality outside of AC?

Thanks again,

Comments

  • The [wait] token isn't typically needed unless it's used mid-sentence. If you want speech to always remain until the user clicks to move on, this can be done by checking Display subtitles forever until user skips it?.

    As there's too wide a variety in the way a visual indicator could be designed - and when exactly it would be displayed - this is best handled using custom events that listen out for the correct moment.

    Custom events are an easy way to hook custom behaviour into common AC tasks. A tutorial on their usage can be found here.

    Is your speech scrolling? As in, do you want to show such a button only once speech has finished scrolling? If so, that can be done by hooking into the OnCompleteSpeechScroll event.

    For example, here's a script that shows a new Menu named "SkipIndicator" once speech has completed scrolling (and hides it again when the speech ends/is skipped):

    using UnityEngine;
    using AC;
    
    public class ShowSkipIndicator : MonoBehaviour
    {
    
        private void OnEnable ()
        {
            EventManager.OnStopSpeech += OnStopSpeech;
            EventManager.OnCompleteSpeechScroll += OnCompleteSpeechScroll;
        }
    
        private void OnDisable ()
        {
            EventManager.OnStopSpeech -= OnStopSpeech;
            EventManager.OnCompleteSpeechScroll -= OnCompleteSpeechScroll;
        }
    
        private void OnCompleteSpeechScroll (Char speakingCharacter, string speechText, int lineID)
        {
            PlayerMenus.GetMenuWithName ("SkipIndicator").TurnOn ();
        }
    
        private void OnStopSpeech (Char speakingCharacter)
        {
            PlayerMenus.GetMenuWithName ("SkipIndicator").TurnOff ();
        }
    
    }
    
  • Yes, I believe I do have speech scrolling enabled, i.e. I have the "Scroll speech text?" flag enabled in the speech manager. I think the custom events is likely what I'm looking for so I will look into this for sure.

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.