Custom subtitle panel not used on scene change

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jonathancarroll
Posts: 8
Joined: Tue Jan 23, 2024 6:26 am

Custom subtitle panel not used on scene change

Post by jonathancarroll »

Hi Tony, I'm using custom subtitle and menu panels for my characters based on your Bubble Subtitle Example. When I change scenes using LoadLevel() via the sequence, the dialogue manager reverts to using the Basic Standard UI defined in the DialogueSystemController, not the custom panels of the characters in the new scene.
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom subtitle panel not used on scene change

Post by Tony Li »

Hi,

Are your actors represented by GameObjects in each scene?

If so, do they have Dialogue Actor components? And, if so, do those Dialogue Actor components point to custom subtitle panels that are prefabs in the Project view, or panels that are children of the actor GameObjects, or something else?

If they point to subtitle panels in the Dialogue Manager's hierarchy but the actors don't survive scene changes the way the Dialogue Manager does, you'll need to remove that connection and handle it a different way, similarly to this article: How To: Manage Player Controls and Scene Changes
jonathancarroll
Posts: 8
Joined: Tue Jan 23, 2024 6:26 am

Re: Custom subtitle panel not used on scene change

Post by jonathancarroll »

Sorry for my late reply to your helpful suggestions.

My actors are represented by gameobjects, and their custom subtitles are contained as children within the actor gameobject.
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom subtitle panel not used on scene change

Post by Tony Li »

Hi,

Temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. (See Logging & Debugging for more info.) Then reproduce the issue. Look for the "Dialogue System: Starting conversation" line. Are the correct GameObjects being used for the actor and conversant? If so, then the conversation should be using their Dialogue Actor configurations -- that is, their custom subtitle panels.
jonathancarroll
Posts: 8
Joined: Tue Jan 23, 2024 6:26 am

Re: Custom subtitle panel not used on scene change

Post by jonathancarroll »

I'm using LoadLevel() sequence in mid conversation, could that be the problem?
If so, should I use LoadLevel() at the end of a conversation, then trigger the next convo from within the next scene?
Thanks as always
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom subtitle panel not used on scene change

Post by Tony Li »

Hi,

It would be easiest to do that, but if you want to change levels mid-conversation you can do that with a bit of scripting.

The issue is that when a conversation starts, it caches its character info so it doesn't have to keeping looking it up repeatedly with every single subtitle or response menu. When you change scenes, you'll need to update the character info cache by calling DialogueManager.conversationModel.OverrideCharacterInfo(actorID, actor). Pass it the actor ID of a character and the transform that has its DialogueActor component. For example, you could put a script with this method on a character's GameObject:

Code: Select all

void Start()
{
    if (!DialogueManager.isConversationActive) return; // No active conversation, so we can end here.
    var dialogueActor = GetComponent<DialogueActor>();
    if (dialogueActor == null) return; // No DialogueActor, so we can end here.
    var actor = DialogueManager.masterDatabase.GetActor(dialogueActor.actor);
    if (actor == null) return; // No actor, so we can end here.
    DialogueManager.conversationModel.OverrideCharacterInfo(actor.id, this.transform);
}
jonathancarroll
Posts: 8
Joined: Tue Jan 23, 2024 6:26 am

Re: Custom subtitle panel not used on scene change

Post by jonathancarroll »

Thank you for the code, I have attached it to a script on my dialogue actor gameobject, but still getting the same results, ie the custom dialogue panels are not being used.
I've checked to make sure the OverrideCharacterInfo is being triggered and it is.
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Custom subtitle panel not used on scene change

Post by Tony Li »

Hi,

Is that script running for the actors involved in the conversation?

At any time, please feel free to send a reproduction project to tony (at) pixelcrushers.com
Post Reply