I've found the accumulate text function and the included templates that use it, but I can't get to work what I want for my game:
All text from all speakers should be accumulated together, so I can scroll through it. Like so:
Player: Hey, how are you?
Josh: I'm fine thank you.
Player: Hey, can I ask a question?
...
The WRPG template does that. However, it does it by having only one portrait, etc. I want them split, like in the basic or the VN template, to get this visuals:
As you can see, my current attempt only shows one side of the conversation, because it's based on the VN template which has seperate subtitle panels for each participant, and that they point to the same text doesn't make it accumulate together.
How can I achieve my desired effect? (I also have a 2nd NPC subtitle panel, not visible here, just in case that makes a difference)
Accumulate text in one place, but seperate portraits
-
- Posts: 150
- Joined: Mon Nov 23, 2020 6:35 am
Re: Accumulate text in one place, but seperate portraits
Hi,
You can use a small subclass of StandardUISubtitlePanel to keep the text in sync. Here's an example scene:
DS_SharedSubtitleTextExample_2020-11-25.unitypackage
It's made in Unity 2020.1. The dialogue UI is based on the WRPG prefab.
And here's the script that's in the example package:
SharedTextSubtitlePanel.cs
You can use a small subclass of StandardUISubtitlePanel to keep the text in sync. Here's an example scene:
DS_SharedSubtitleTextExample_2020-11-25.unitypackage
It's made in Unity 2020.1. The dialogue UI is based on the WRPG prefab.
And here's the script that's in the example package:
SharedTextSubtitlePanel.cs
Code: Select all
using PixelCrushers.DialogueSystem;
public class SharedTextSubtitlePanel : StandardUISubtitlePanel
{
private StandardDialogueUI ui;
protected override void Awake()
{
base.Awake();
ui = GetComponentInParent<StandardDialogueUI>();
}
public override void SetContent(Subtitle subtitle)
{
base.SetContent(subtitle);
foreach (var panel in ui.conversationUIElements.subtitlePanels)
{
panel.accumulatedText = accumulatedText;
}
}
}
-
- Posts: 150
- Joined: Mon Nov 23, 2020 6:35 am
Re: Accumulate text in one place, but seperate portraits
brilliant, I'll give that a try. Thanks!
-
- Posts: 150
- Joined: Mon Nov 23, 2020 6:35 am
Re: Accumulate text in one place, but seperate portraits
This almost works, but when the player is speaking, the NPC portrait is replaced with the player portrait (and the player portrait remains as well). Probably a small hickup in the code somewhere. I'll see if I can find it myself.
-
- Posts: 150
- Joined: Mon Nov 23, 2020 6:35 am
Re: Accumulate text in one place, but seperate portraits
Got it. The "PC Image" of the Response Panel was set up wrongly, pointing to the NPC image.
Re: Accumulate text in one place, but seperate portraits
Thanks for catching that. I totally forgot to reassign the portrait image to the response panel. I just updated the example scene my previous reply so future readers will have a corrected version.