How to show two different subtitle panel images?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jlhacode
Posts: 77
Joined: Fri Jul 03, 2020 6:23 am

How to show two different subtitle panel images?

Post 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.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to show two different subtitle panel images?

Post 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.
jlhacode
Posts: 77
Joined: Fri Jul 03, 2020 6:23 am

Re: How to show two different subtitle panel images?

Post 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.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to show two different subtitle panel images?

Post 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.)
Post Reply