Page 1 of 1
SMS template - when there are new entries user didn't see
Posted: Mon May 12, 2025 10:28 am
by ukieiri
I have a phone in the game, where I want to see notifications about the new messages. Is there a way to learn if there are new messages in the conversations somehow?
Re: SMS template - when there are new entries user didn't see
Posted: Mon May 12, 2025 11:17 am
by Tony Li
Hi!
First, let's say a conversation looks like this:

- park.png (29.73 KiB) Viewed 5041 times
The conversation will stop at the node with the condition until IsAtPark() is true.
Here are two ideas on how to handle it:
1. You could handle it outside of the conversation. When you make whatever change causes IsAtPark() to be true, also activate a custom "new message" indicator. The conversation doesn't need to know about this.
2. Or handle it in the conversation. To do this, you'll need to get the SMSDialogueUI's
Code: Select all
public bool AreThereNewEntries(string conversationTitle);
// Get the conversation's current history:
string dialogueEntryRecords = DialogueLua.GetVariable($"DialogueEntryRecords_{conversationTitle}").asString;
// Get the last dialogue entry in the conversation history:
string[] values = s.Split(';');
if (values.Count >= 3)
{
var conversationID = Tools.StringToInt(values[values.Length - 2]);
var entryID = Tools.StringToInt(values[values.Length - 1]);
}
DialogueEntry entry = DialogueManager.masterDatabase.GetDialogueEntry(conversationID, entryID);
// Check if any of its children are currently valid:
foreach (Link link in entry.outgoingLinks)
{
DialogueEntry entry = DialogueManager.masterDatabase.GetDialogueEntry(link);
if (Lua.IsTrue(entry.conditionsString)) return true;
}
// Otherwise no new entries are available:
return false;
}