Forum rules - please read before posting.

Toggling whether dialog is skippable or not

During cinematic sequences -for timing reasons- I need to ensure that dialog can not be skipped. But during the rest of the game, I want skippable dialog as usual. Is there some simple way of toggling this ability?

Comments

  • Dialogue placed in Timelines won't be skippable - if you're dealing with specific timing, it may be best to rely on Timeline for such sequences.

    To change the value of the Speech Manager's Subtitles can be skipped? option, however, right-click the option's label to copy an API reference to it. This is true for any Manager option:

    AC.KickStarter.speechManager.allowSpeechSkipping
    

    You can then incorporate this into a simple C# script with functions to set this true/false:

    using UnityEngine;
    
    public class ToggleSpeechSkipping : MonoBehaviour
    {
    
        public void AllowSkipping ()
        {
            AC.KickStarter.speechManager.allowSpeechSkipping = true;
        }
    
        public void PreventSkipping ()
        {
            AC.KickStarter.speechManager.allowSpeechSkipping = false;
        }
    
    }
    

    To call these functions at runtime, place the script on a GameObject, make it a prefab, and then use the Object: Call event Action to trigger the functions on the prefab.

  • Excellent, thanks!

  • edited May 2021

    Correct me if I'm wrong, but I think it's worth noting that these functions will change the setting not only at runtime but also on the manager, permanently. So if you generally want "Subtitles can be skipped?" to be true, it's best to always call the AllowSkipping function on start.

    Edit: actually, I'm not sure about this, the code I'd been using was different. I'm going to give this script a try.

    Edit 2: I was using AdvGame.GetReferences ().speechManager.allowSpeechSkipping instead of AC.KickStarter.speechManager.allowSpeechSkipping. But both seem to do the same thing.

    Conclusion: I was right, the script Chris provided changes the manager setting permanently, so make sure you always call your preferred option on start.

  • Yes, quite right - apologies I missed that.

    Any change you make to a Manager field through scripting will survive exiting Play mode, so you will need to use such a script to set its "default" value when the game begins.

    Though, in this situation I would still urge looking into Timeline, as this works well when creating cutscenes that require strict timing. A video on how AC's Demo uses Timeline for its opening and closing cutscenes can be found here.

  • Thanks for the update. Will look into timeline. :smile:

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.