Several Players

Announcements, support questions, and discussion for the Dialogue System.
Arturicon
Posts: 22
Joined: Mon Mar 11, 2024 2:52 pm

Several Players

Post by Arturicon »

Hello, everyone. I have a question. I want several characters whom player can control. Each of them should have a personal name and portrait. So I created a second actor and gave him Portrait Sprite, Name and set IsPlayer = true. Now i have two actors with IsPlayer = true. But when i use the second one in conversation the program shows me the portrait and the name the first one. So how can get what i want?
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several Players

Post by Tony Li »

Hi,

Make sure to assign the appropriate player actor to each dialogue entry node. It will also help to add a Dialogue Actor component to each player character's GameObject and set the Actor dropdown to the player actor. See also: Character GameObject Assignments.
Arturicon
Posts: 22
Joined: Mon Mar 11, 2024 2:52 pm

Re: Several Players

Post by Arturicon »

Thanks for the answer. I created two gameObject with dialog actor components and set actor in dropdown as you advised, and i left Conversation actor and conversant fields in dialogue system trigger, which launch dialog, empty. So now in Conversation settings (where title, description, etc) when I set actor drop down to first one player in dialog i see the first one, when second - i see second. But problem is that if i want two players in the same dialog it is impossible, because it doesn't matter witch player i set as actor in specific dialog entry, the program will show only the actor from conversation settings.
Is it possible to have two players in one conversation at the same time?
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several Players

Post by Tony Li »

Hi,

There are various scenarios (see Character GameObject Assignments for details) but I think for your case this setup will work best:
  • Create three player characters: one named Player, and two others for your actual player characters.
  • When you create a conversation, set the conversation Actor to Player and the conversant to an NPC.
  • When a line is spoken by a specific player character, inspect its dialogue entry and set the Actor dropdown to that player character. The node will show the player character's name and the text, separated by a colon ( : ). This indicates that the node isn't using the conversation's primary actor or conversant.
  • In your Dialogue System Trigger, you should be able to leave the Conversation Actor field blank. If this doesn't work, let me know how your Dialogue System Trigger is set up (in particular the Trigger dropdown).
Arturicon
Posts: 22
Joined: Mon Mar 11, 2024 2:52 pm

Re: Several Players

Post by Arturicon »

I created three actors with IsPlayer=true. Two of them real players have their own gameObjects with dialogue actor component, the third one was set as actor in conversation settings. Then i did everything as you said. For each node i set up real player and it show at node "actor:phrase" form. But steel i can see portrait only one player.
If i creating gameObjects with dialogue actor for first "not real" player i would see only his portrait and name
I attach screenshot of my dialogue system trigger
Attachments
Снимок экрана 2024-11-30 160559.png
Снимок экрана 2024-11-30 160559.png (81.03 KiB) Viewed 3145 times
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several Players

Post by Tony Li »

Hi,

Would you please post a screenshot of an example conversation? If any lines can be spoken by either player (instead of a specific player), please mark that on the screenshot.
Arturicon
Posts: 22
Joined: Mon Mar 11, 2024 2:52 pm

Re: Several Players

Post by Arturicon »

If any lines can be spoken by either player (instead of a specific player), please mark that on the screenshot.
Not really understand what that means. In this situation all lines saying just Player, insted of player two and one
Attachments
Снимок экрана 2024-11-30 200528.png
Снимок экрана 2024-11-30 200528.png (36.06 KiB) Viewed 3126 times
Снимок экрана 2024-11-30 200420.png
Снимок экрана 2024-11-30 200420.png (86.27 KiB) Viewed 3126 times
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several Players

Post by Tony Li »

Arturicon wrote: Sat Nov 30, 2024 12:10 pmIn this situation all lines saying just Player, insted of player two and one
Where does it say just Player? (In the response menu? In subtitles?)
Arturicon
Posts: 22
Joined: Mon Mar 11, 2024 2:52 pm

Re: Several Players

Post by Arturicon »

Only responses. Blue nodes.
User avatar
Tony Li
Posts: 23252
Joined: Thu Jul 18, 2013 1:27 pm

Re: Several Players

Post by Tony Li »

Hi,

On your dialogue UI, if you tick the StandardDialogueUI component's Conversation UI Elements > Use First Response For Menu Portrait, then the response menu portrait image will use Player One or Player Two instead of Player.
Post Reply