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
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.
The RuntimeVariables script keeps a log of all speech lines for you - you can access it with:
AC.KickStarter.runtimeVariables.GetSpeechLog ();