Page 1 of 1
How to show two different subtitle panel images?
Posted: Thu Jul 23, 2020 4:55 pm
by jlhacode
I would like to switch occasionally switch to a jagged dialogue image for my subtitle panel to make it seem like a character is yelling. I was thinking of using a show_jagged_box variable in my dialogue, and looking the DialogueEntry up in a helper class to apply the image when it’s displayed. I’m not sure if this is the best way to do this, and would like some input.
I was also wondering if there was any functionality built in to Dialogue System that would allow me to repeat a bark indefinitely, while also giving me the ability to disable the repetition with an event.
Re: How to show two different subtitle panel images?
Posted: Thu Jul 23, 2020 5:10 pm
by Tony Li
Hi,
jlhacode wrote: ↑Thu Jul 23, 2020 4:55 pmI would like to switch occasionally switch to a jagged dialogue image for my subtitle panel to make it seem like a character is yelling. I was thinking of using a show_jagged_box variable in my dialogue, and looking the DialogueEntry up in a helper class to apply the image when it’s displayed. I’m not sure if this is the best way to do this, and would like some input.
Switch to a different subtitle panel. Let's say you have panels 0, 1, and 2. The character's subtitles normally show up in panel 0. To make an individual subtitle show up in panel 2, include [panel=2] in the Dialogue Text:
- Dialogue Text: "[panel=2]I'M NOT YELLING! YOU'RE YELLING!!!"
jlhacode wrote: ↑Thu Jul 23, 2020 4:55 pmI was also wondering if there was any functionality built in to Dialogue System that would allow me to repeat a bark indefinitely, while also giving me the ability to disable the repetition with an event.
Yes. Use a Bark On Idle component. You can set the frequency, and specify a conversation to pull bark lines from. If the conversation has more than one node linked from <START>, it can play them in random order or sequentially.
Re: How to show two different subtitle panel images?
Posted: Thu Jul 23, 2020 6:35 pm
by jlhacode
Hi Tony,
Is there a way I can append
[panel=1] at runtime? I tried using the follow code on a DIalogueSystemEvents.OnConversationLine() event, but it didn't work.
Code: Select all
public void AddPanel1ToBeginningOfSubtitle() {
GetCurrentSubtitle().formattedText.text = GetCurrentSubtitle().formattedText.text.Insert(0, "[panel=1]");
}
I ask because adding the
panel=1 tag would be bothersome in terms of localization, and I would much rather have a DialogueEntry variable flag to handle it.
Re: How to show two different subtitle panel images?
Posted: Thu Jul 23, 2020 8:46 pm
by Tony Li
Hi,
In OnConversationLine, set subtitle.formattedText.subtitlePanelNumber. Example:
Code: Select all
void OnConversationLine(Subtitle subtitle)
{
var entry = subtitle.dialogueEntry;
if (Field.FieldExists(entry.fields, "Override Panel"))
{
subtitle.formattedText.subtitlePanelNumber = Field.LookupInt(entry.fields, "Override Panel");
}
}
When OnConversation is called, the formatting codes in the original dialogue text have already been processed. (Hence the subtitle.formattedText property.)