Code: Select all
Npc: Hello
Player: Quest is done!
Npc: Very well
*party gained 1147 gold*
*party recieved 358753 exp*
Player: Farewell
Code: Select all
Npc: Hello
Player: Quest is done!
Npc: Very well
*party gained 1147 gold*
*party recieved 358753 exp*
Player: Farewell
Code: Select all
// C# code to set gold amount:
DialogueLua.SetVariable("gold", 1147);
Code: Select all
var speakerInfo = DialogueManager.conversationModel.conversantInfo; // May want to use different CharacterInfo objects.
var listenerInfo = DialogueManager.conversationModel.actorInfo;
var subtitle = new Subtitle(speakerInfo, listenerInfo, FormattedText.Parse("*party gained 1147 gold*"), null, null, null);
var ui = DialogueManager.dialogueUI as StandardDialogueUI;
ui.conversationUIElements.defaultNPCSubtitlePanel.ShowSubtitle(subtitle);
Code: Select all
var ui = DialogueManager.dialogueUI as StandardDialogueUI;
var panel = ui.conversationUIElements.defaultNPCSubtitlePanel;
panel.accumulatedText += "*party gained 1147 gold*\n";
panel.subtitleText.text = panel.accumulatedText;
Great! All three ways are pretty good. I probably use solution 3, it is somehow simplier then 2.