Forum rules - please read before posting.

Replaying Last Dialogue Element

I wonder if you could make an action which, when invoked, backed the speech up to the previous element?  My adventure game has long, deep discussions and players need to go back and review things that were said, like in a difficult book where you page back to reread something you didn't totally get.  I envision making a button that would appear next to the menu icon during conversations that, when clicked, would go backwards one element in the dialogue.  Would that be possible?
Thanks!

Comments

  • The dialogue system creates a SpeechLog class of every line as it's played.  As it's use will vary wildly from game to game, it requires a custom script to access it.  The script below (name it ShowLastLine.cs) will check for the last-processed speech line and record it's text.

    using UnityEngine;
    using System.Collections;
    using AC;

    public class ShowLastLine : MonoBehaviour
    {

        string lastSpeechText = "";

        void Update ()
        {
            Speech _speech = AC.KickStarter.dialog.GetLatestSpeech ();
            if (_speech != null)
            {
                lastSpeechText = _speech.log.fullText;
                Debug.Log (lastSpeechText);
            }

        }

    }

    You'll then be able to send this string (lastSpeechText) to a Global String variable, so that it can be displayed in e.g. a Menu when you click on a button.  A String variable's value can be set with this function.
  • Seems I forgot about AC's own features!

    The RuntimeVariables script keeps a log of all speech lines for you - you can access it with:

    AC.KickStarter.runtimeVariables.GetSpeechLog ();
  • All solutions seem to lead into problems created by the specific situation. As you said, the use of solutions widely vary.  I ended leaving it up to player to just replay the scene and made that easy to do. I also set the speech menu to "Display subtitles forever..." which allows player to do rapid clicking to just through the scene.

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.