Page 1 of 1

Wrong portrait name displaying when multiple NPCs same conversation

Posted: Thu Jun 29, 2023 12:28 pm
by Ommadawn
Hello,

I have a conversation between 2 NPCs and the player. Lets call them A and B.
Everyone has a DialogueActor component used for Barks.

To launch the conversation the player can either talk to A or B. It will then call

Code: Select all

DialogueManager.StartConversation(conversationName, player.transform, npcTransform);
with npcTransform being A or B.

In database I have Actor = A and Conversant = B (I tried also the opposite and Player as Actor but same result)

If I talk to A, no problem. (example : A : "Hello" B : "Good Bye")
If I talk to B, all speaker info are replaced by B (example : B : "Hello" B : "Good Bye")

I looked some topics and maybe my problem is similar to this one but I can't find any solution.

I tried to call

Code: Select all

DialogueManager.StartConversation(conversationName, null, null);
which is working but then I would have another problem which is actor B not receiving events.

I need to use StartConversation if possible since I'm using some network code.

Thank you

Re: Wrong portrait name displaying when multiple NPCs same conversation

Posted: Thu Jun 29, 2023 3:17 pm
by Tony Li
Hi,

> If I talk to B, all speaker info are replaced by B (example : B : "Hello" B : "Good Bye")

Yes, that's by design. Please see: Character GameObject Assignments.

Re: Wrong portrait name displaying when multiple NPCs same conversation

Posted: Fri Jun 30, 2023 6:20 am
by Ommadawn
Hello,

Thank you for your response,

Yes thats what I understood by reading the documentation.

Is there a way to bypass this design and force the actor to be like the conversation in database ? (other than setting actors to null)

Re: Wrong portrait name displaying when multiple NPCs same conversation

Posted: Fri Jun 30, 2023 8:12 am
by Tony Li
You can use a character C for the conversation conversant, and add nodes for character B as an extra participant in the conversation that isn't the primary actor or primary conversant.

Re: Wrong portrait name displaying when multiple NPCs same conversation

Posted: Fri Jun 30, 2023 9:32 am
by Ommadawn
I tried but this does not change anything sadly :cry:

For now since our game is a prototype I will edit the method creating the character info so it will ignore dialogueActor and only pick from database.

Code: Select all

public CharacterInfo GetCharacterInfo(int id, Transform character)
I know its not very clean from me to do that since for the long term we will need to update the plugin... But I will probably bother you next time then :lol:

Re: Wrong portrait name displaying when multiple NPCs same conversation

Posted: Fri Jun 30, 2023 10:09 am
by Tony Li
Sounds good. We can revisit this later when you're ready, or we can look at it again now if you prefer. I misread your last message and gave you incorrect advice. I mixed it up with a similar recent thread that also had actors named A, B, and C.

If you want to look at it now, let me know if the conversation involves the player. If so, set the conversation's Actor to the Player actor. Set the conversation's Conversant to NPC A. So your conversation might look like this:

NPC_A_B_Example.png
NPC_A_B_Example.png (32.26 KiB) Viewed 247 times

On both A and B, assign A as to the Dialogue System Trigger's Conversation Conversant.

Here's an example scene:

DS_NPC_A_B_Example_2023-06-30.unitypackage

Re: Wrong portrait name displaying when multiple NPCs same conversation

Posted: Wed Jul 05, 2023 11:10 am
by Ommadawn
The conversation involves the player yes, but setting the conversation's Actor to the Player actor doesnt resolve my problem. So here is what I have done : I have set the conversation participants to A and B, edited the GetCharacterInfo method to pick portrait from database only. And finally, I redirected the conversation events from dialogue manager to player so every partipant gets their OnConversationStart / End events :mrgreen:

I will check your example scene.

For now the solution even if not perfect, works for our prototype... Fingers crossed lets hope we will be able to start the full game in a few months. I will then surely go back to you if we need to figure another solution ;)

Thanks for your help,

Ommadawn