Setting Dialogue Panels Per Character
Posted: Thu Mar 23, 2023 2:15 pm
I have created a separate dialogue panel for each NPC to make things a little simpler for portrait placements (since the character portraits are not all the same size and I wanted to position a few portraits differently than others when appearing).
Is there an easy way to assign a panel to a character in the database? That way I don't need to add code to the dialogue text to set the panel. I know you can use the Dialogue Actor component to set panels too, but this causes a few other issues in my game as noted below.
In my game, I make dialogue appear by using a dialogue system trigger using the OnUse trigger. In a scene, I might have several Dialogue System Triggers for the same character. Each Dialogue System Trigger will play a specific dialogue conversation. I use the OnConversationStart and End events on each of these dialogue system triggers to do various things in the scene.
The problem I have when adding a dialogue actor component to each dialogue system trigger is that there could be say 3 different dialogue system triggers each with the same dialogue actor component (with the same character selected).
This seems to cause bugs with the OnCovnersationStart and End events. They don't seem to be getting called consistently due to multiple gameobjects with the same character assigned.
It is my understanding, that this is because any gameobject with the dialogue actor component with the actor that is currently speaking will try to call the OnCovnersationStart and End unity events.
The simple solution I came up with was to not add the dialogue actor component to dialogue triggers. Instead, I just drag in the dialogue system trigger itself into the conversation Actor spot on the start conversation dialogue system trigger.
This all seems to work well. The OnConversationStart and end seem to be called consistently on each gameobject in the scene. The issue now is that I can't assign the dialogue panel for that character speaking.
What do you think? Is there something I missing above that is overcomplicating things? Or is there a simple way to assign a character to a specific panel in the dialogue database, so no need to assign the panel for the character in scenes?
Is there an easy way to assign a panel to a character in the database? That way I don't need to add code to the dialogue text to set the panel. I know you can use the Dialogue Actor component to set panels too, but this causes a few other issues in my game as noted below.
In my game, I make dialogue appear by using a dialogue system trigger using the OnUse trigger. In a scene, I might have several Dialogue System Triggers for the same character. Each Dialogue System Trigger will play a specific dialogue conversation. I use the OnConversationStart and End events on each of these dialogue system triggers to do various things in the scene.
The problem I have when adding a dialogue actor component to each dialogue system trigger is that there could be say 3 different dialogue system triggers each with the same dialogue actor component (with the same character selected).
This seems to cause bugs with the OnCovnersationStart and End events. They don't seem to be getting called consistently due to multiple gameobjects with the same character assigned.
It is my understanding, that this is because any gameobject with the dialogue actor component with the actor that is currently speaking will try to call the OnCovnersationStart and End unity events.
The simple solution I came up with was to not add the dialogue actor component to dialogue triggers. Instead, I just drag in the dialogue system trigger itself into the conversation Actor spot on the start conversation dialogue system trigger.
This all seems to work well. The OnConversationStart and end seem to be called consistently on each gameobject in the scene. The issue now is that I can't assign the dialogue panel for that character speaking.
What do you think? Is there something I missing above that is overcomplicating things? Or is there a simple way to assign a character to a specific panel in the dialogue database, so no need to assign the panel for the character in scenes?