Hello,
we use the dialogue system in simulated chat sequences in our game. As with every messenger we want to show the dates a message has been send or received. Whether those dates are fictional or authentic, they are a dynamic element we can't add to the conversation database upfront. Is there a way to append such meta information into the stored data when saving a conversation, being able to retrieve it later? Does anybody have suggestions how to accomplish this elegantly?
Thanks in advance.
Best practices in adding dynamic data to conversations
Re: Best practices in adding dynamic data to conversations
Hi,
It's relatively easy to show additional dynamic content as the conversation plays. One way is to use an OnConversationLine method. Example:
Saving it for later reference may be harder.
If you just save the lines of text as they're played, you don't need to do anything special:
If you're not doing that, please let me know how you're saving conversations. I may be able to suggest something.
It's relatively easy to show additional dynamic content as the conversation plays. One way is to use an OnConversationLine method. Example:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
// Prepend current date:
subtitle.formattedText.text = $"{DateTime.Now}:\n{subtitle.formattedText.text}";
}
If you just save the lines of text as they're played, you don't need to do anything special:
Code: Select all
private string transcript;
void OnConversationLine(Subtitle subtitle)
{
// Prepend current date:
subtitle.formattedText.text = $"{DateTime.Now}:\n{subtitle.formattedText.text}";
// Add line to transcript:
transcript += $"\n{subtitle.speakerInfo.Name}\n{subtitle.formattedText.text}";
}