How to link another conversation with another character speaking

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
VillVarh
Posts: 23
Joined: Mon Nov 06, 2023 5:19 am

How to link another conversation with another character speaking

Post by VillVarh »

Hello. I have two players and if I choose one of them, the other one becomes my assistant. When I finish my dialogue with NPCs, I want my assistant to comment something afterwards. I want only the assistant to be alone in this conversation. I have booleans for choosing player 1 or player 2. Now I want the assistant to comment something after the NPC conversation. (if i chose player1 as the player the assistant is player 2)

Oh and I want also to make conversations where Player says something to NPC then players assistant says something like "good choice" and then player keeps talking to NPC where the conversation left of. :D
Last edited by VillVarh on Thu Nov 23, 2023 4:28 am, edited 1 time in total.
VillVarh
Posts: 23
Joined: Mon Nov 06, 2023 5:19 am

Re: How to link another conversation with another character speaking

Post by VillVarh »

I can start a new conversation with the link and go back to a certain part of the conversation with the link, but when I link the conversation, I can't get the npc out of the conversation. How to link to a new conversation with only one speaker and no listeners. Also when I link back to the conversation the actor is now the assistant and not the player?
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to link another conversation with another character speaking

Post by Tony Li »

Hi,

I'll put together an example conversation and send it to you by tomorrow.
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to link another conversation with another character speaking

Post by Tony Li »

Hi,

As I read through your post, I came up with some alternative ideas. What if in your dialogue database there is always one Player actor and one Assistant actor?

playerAssistantActors.png
playerAssistantActors.png (15.1 KiB) Viewed 399 times

When the player chooses whether to be Player 1 or Player 2, you can set the Player actor's Display Name. For example, if the choices are Romulus and Remus, and if the player chooses Romulus, then in Lua:

Code: Select all

Actor["Player"].Display_Name = "Romulus"
Or in C#:

Code: Select all

DialogueLua.SetActorField("Player", "Display Name", "Romulus");
In your scene(s), set up versions of Romulus and Remus as the Player and versions as the Assistant. In the screenshot below, the Player versions are inactive and grouped under a GameObject named Players:

romulus.png
romulus.png (54.4 KiB) Viewed 399 times

A Dialogue System Trigger set to OnStart on the Players GameObject will activate the correct child based on the player's choice (e.g., store the choice in a variable). The child that becomes active will register itself as the Player.

Then do the same for the Assistants GameObject.

When interacting with NPCs, as long as you leave the Dialogue System Trigger's Conversation Actor field unassigned, it will use the active player GameObject.

This will make your conversations very easy to write, since you can always use the same Player and Assistant actor regardless of what character the player has chosen.

playerAssistantConversation.png
playerAssistantConversation.png (12.88 KiB) Viewed 399 times
VillVarh
Posts: 23
Joined: Mon Nov 06, 2023 5:19 am

Re: How to link another conversation with another character speaking

Post by VillVarh »

Hello! Thank you very much I think this will make many things much easier! How do I set the correct portaits? Both my players had different portaits for different parts of conversation example when talking or when angry etc. Ty. in advance :D
User avatar
Tony Li
Posts: 22112
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to link another conversation with another character speaking

Post by Tony Li »

In that case, define 3 player actors, such as "Player", "Player 1", and "Player 2" -- or, using the example above: Player, Romulus, and Remus.
  • Assign Romulus' portraits to the Romulus actor.
  • Assign Remus' portraits to the Remus actor.
  • Write your conversations using the Player actor.
  • Set the Romulus GameObject's Dialogue Actor to the Romulus actor.
  • Set the Remus GameObject's Dialogue Actor to the Remus actor.
  • If you start a conversation using C#, pass the player-chosen GameObject (Romulus or Remus) to it as the second parameter.
  • If you start a conversation using a Dialogue System Trigger, set that trigger to OnUse, OnTriggerEnter, or OnCollisionEnter. When the trigger is set to these modes, the conversation will use the GameObject that interacted with the trigger. (More info: Character GameObject Assignments)
Post Reply