Actor/Conversant SetPortrait sequence

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NicoMozes
Posts: 24
Joined: Sun Jun 05, 2022 4:18 am

Actor/Conversant SetPortrait sequence

Post by NicoMozes »

Hi Toni!

I hope you are doing very well!

Currently using Dialogue System 2.2.35, and Im encountering an issue that I believe comes down more to my understanding of the SetPortrait() sequence.

The conversations has an Actor and a Conversant.
All dialogue entries also have the Actor and conversant, and this swap depending on who is speaking the line.

When I use SetPortrait([var=Actor], MC), like in the picture attached, who will be assigned the new sprite? The actor of the dialogue or the actor of the dialogue entry?

I keep having issues with this one, and sometimes it works fine, some times I end up with both characters having the same sprite.

Thanks for the help as always!
SetPortrait.png
SetPortrait.png (42.67 KiB) Viewed 2152 times
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Actor/Conversant SetPortrait sequence

Post by Tony Li »

Hi,

[var=Actor] will always be the display name of the conversation actor, not the individual dialogue entry's actor (speaker).
NicoMozes
Posts: 24
Joined: Sun Jun 05, 2022 4:18 am

Re: Actor/Conversant SetPortrait sequence

Post by NicoMozes »

Hi Toni,
Ok thanks for the reply! I just don't seem to get it working properly then. Is there any restriction on what actions I can have in the sequence?
I have this example:

Conversation where Actor is named Kyrian, the Conversant is named Edlyn.
Sprites.JPG
Sprites.JPG (32.65 KiB) Viewed 2135 times
For this example, in the last entry of a conversation I'm setting the actor’s portrait to your sprite pirate.
Sprites2.JPG
Sprites2.JPG (63.64 KiB) Viewed 2135 times
Then, I trigger the next conversation with the same character. The dialogue entry has Edlyn as the Actor, and Kyrian as the conversant. I use the Sequence line (SetPortrait(var=Actor, knight) to change the Actor portrait, which in this case should be Kyrian, right?
Sprites3.JPG
Sprites3.JPG (70.43 KiB) Viewed 2135 times
But the result I'm getting is that the Actor keeps the sprite from the previous conversation (the pirate), and then the conversant of the conversation, Edlyn, gets the knight sprite as a portrait.
Sprites4.JPG
Sprites4.JPG (228.66 KiB) Viewed 2135 times
What I'm trying to achieve is to start the new conversation with the new portraits, regardless of which portraits they used in the previous conversation.

How can I updated both portraits in the same first node? Regardless of who is the actor and who is the conversant?

Thanks,
Nico
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Actor/Conversant SetPortrait sequence

Post by Tony Li »

Hi,

Temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. Then replay those conversations, checking two things:

1. Look for lines like:

Dialogue Manager: Starting conversation 'Edlyn' with actor=Kyrian and conversant=Edlyn.

Make sure the correct actors are being used for both conversations. Maybe the assignments got flipped in the Dialogue System Trigger. (See Character GameObject Assignments)

2. Look for lines like:

Dialogue System: Sequencer: SetPortrait(Kyrian, pirate)

Make sure the correct actor name is being used in all SetPortrait() commands. Note that the Dialogue System will report two lines for each sequencer command. The first one is appears when the Dialogue System parses the command and adds it to the queue to be run. The second one appears when the Dialogue System actually runs the command.

Also, add Dialogue Actors components to Kyrian's and Edlyn's GameObjects (create empty GameObjects if they don't have any) and set the Actor dropdowns.
NicoMozes
Posts: 24
Joined: Sun Jun 05, 2022 4:18 am

Re: Actor/Conversant SetPortrait sequence

Post by NicoMozes »

Hi Tony!

Thanks for the advice. See below the log:
DM Debug.JPG
DM Debug.JPG (211.96 KiB) Viewed 2122 times
I cannot see that the roles have been swapped?

These are the Dialogue Actor components:
Actor.JPG
Actor.JPG (62.11 KiB) Viewed 2122 times
Conversant.JPG
Conversant.JPG (61.13 KiB) Viewed 2122 times

And for the next node, it is assigning the actor sprite correctly. The Sequence is SetPortrait([var=Actor], MC1), and the debug shoes Kyrian as the name and not var=Actor?
DM Debug 2.JPG
DM Debug 2.JPG (139.68 KiB) Viewed 2122 times
User avatar
Tony Li
Posts: 22093
Joined: Thu Jul 18, 2013 1:27 pm

Re: Actor/Conversant SetPortrait sequence

Post by Tony Li »

Hi,

In the Console log that you highlighted, it looks like the right square bracket is missing. Try changing this:

Code: Select all

SetPortrait([var=Actor, Knight)
to this:

Code: Select all

SetPortrait([var=Actor], Knight)
If you are using Display Names, use [var=ActorIndex] instead.

If neither of those ideas help, please feel free to send a reproduction project to tony (at) pixelcrushers.com along with the exact steps that I should follow to reproduce the issue, what I should expect to see currently, and what you would like to happen instead.
NicoMozes
Posts: 24
Joined: Sun Jun 05, 2022 4:18 am

Re: Actor/Conversant SetPortrait sequence

Post by NicoMozes »

Hi Toni,

Sadly it was not the square bracket missing.

I will see if I can get the reproduction project out your way.

Thanks,
Nico
Post Reply