Question about "speaker" and "listener" in Articy

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Raidenthequick
Posts: 34
Joined: Mon Jul 02, 2018 5:00 pm

Question about "speaker" and "listener" in Articy

Post by Raidenthequick »

Hey Tony,

If I use "Play Sequence" directly from a Dialogue System Trigger, "speaker" and "listener" have reasonable defaults, I have no qualms with how that works.

However, I tried to turn some "Play Sequence" actions into "Start Conversation" actions, so that I could use articy:draft imports. Since they're just PURELY sequences, I left the conversation text empty, and put my sequence text into the "Stage Directions" field. Both my Actor and Conversant fields are blank. Here's what I tried:

Code: Select all

SetContinueMode(false);
SetTimeScale(0);
Fade(stay, 1);
SendMessage(StartCombat, listener)@1.0;
Continue()@1.0;
SetContinueMode(true)@1.0;
The fade is still going, so the sequence is definitely being played. However, now that it's a conversation, the SendMessage is no longer sending to the proper object (or maybe not at all). I can only assume it's because "listener" is no longer set to the correct object -- in my case, I wanted it to send to the very object that the trigger is attached to. This works perfectly with a direct "Play Sequence", but can't seem to get it working on the "Start Conversation". Not sure if it's purely because of conversation or if articy is messing with this in any way. Any tips?
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about "speaker" and "listener" in Articy

Post by Tony Li »

Hi,

The SendMessage() sequencer command's second parameter is the argument that's sent to StartCombat. Try changing this:

Code: Select all

SendMessage(StartCombat, listener)@1.0;
to this:

Code: Select all

SendMessage(StartCombat, , listener)@1.0;
The former tries to run StartCombat("listener") on the speaker.

The latter runs StartCombat() on the listener.

That may fix the issue. If it doesn't, please read on:

Are you using a Dialogue System Trigger to start the conversation? If so, what is the Conversation Conversant field set to? If it's unassigned, it will default to the Dialogue System Trigger's GameObject.

Image

If the Dialogue System Trigger is set to OnUse or OnTriggerEnter, the Conversation Actor field will default to the GameObject that set off the trigger (typically the Player).


In articy, are any entities assigned to the Dialogue?

Image

or this Dialogue Fragment?

Image

In the images above, the conversation's primary actor will be the green guy (Player), and the primary conversant will be the red guy (NPC). When the NPC is speaking, its GameObject will be the sequence's 'speaker'. The Player GameObject will be the 'listener'.


One way to get to the bottom of this is to temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. This will log a lot of info to the Console window / output log file.

Look for a line like this:

Code: Select all

Dialogue System: Starting conversation 'Private Hart', actor=Player (UnityEngine.Transform), conversant=Private Hart (UnityEngine.Transform).
It will report the conversation's primary actor and conversant.

Further down, look for a line like this:

Code: Select all

Dialogue System: Sequencer: SendMessage(StartCombat, , Private Hart)
(Note the two commas between StartCombat and Private Hart, indicating that StartCombat() takes no argument.)
Raidenthequick
Posts: 34
Joined: Mon Jul 02, 2018 5:00 pm

Re: Question about "speaker" and "listener" in Articy

Post by Raidenthequick »

Thanks for the response Tony!

I went ahead and tried using the (StartCombat, , listener) syntax but have not had any luck. However, I did go ahead and enable the Info logging and found something interesting. Basically, it seems Dialogue System is correctly interpreting the actor/conversant. Since we're not explicitly assigning them in either Articy (our nodes have no entities within them) or the Dialogue System Trigger, the expectation is that the actor will be the GameObject that triggered the conversation, and the conversant will be the GameObject with the Dialogue System Trigger component. This seems to be working fine:

Dialogue System: Starting conversation 'Generic/StartBattle', actor=EnemyBounding (UnityEngine.Transform), conversant=encounter (UnityEngine.Transform).

EnemyBounding is our player, and encounter is our trigger object. All seems well here!

However, it seems to entirely disregard the "listener" command in our sequence:

Dialogue System: Sequencer.Play( SendMessage(StartCombat, , listener)@1 )
Dialogue System: Sequencer: SendMessage(StartCombat, , EnemyBounding (UnityEngine.Transform), )

It's sending the message to the actor instead of the conversant. To make matters stranger, if I set the actor in the Dialogue System Trigger component to be "encounter", the sequence works. It seems to be referencing the actor no matter what. Perhaps it would be different if we explicitly set actor/conversant in the articy nodes, but the nature of this trigger is dynamic. Therefore, we cannot do that.

I hope this provides more info on our issue. I really appreciate all the help!
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about "speaker" and "listener" in Articy

Post by Tony Li »

Hi,

Open your dialogue database in the Dialogue Editor window. Go to the Conversations page, select the conversation from the dropdown, and click on the node in question. Verify that the Actor and Conversant look correct. For example, in the screenshot below, the Actor (speaker) is Private Hart, and the Conversant (listener) is Player:

Image

It's possible that the speaker and listener both got set to the same articy entity.

It occurs to me that articy may have set the entire conversation's Actor & Conversant to the same entity since none were assigned in articy. Please click on blank canvas space to check the conversation, too, while you're at it:

Image

If this is the case, you may need to create two entities in articy: one for the player and one for non-player entities. Then assign them to the Dialogue.
Raidenthequick
Posts: 34
Joined: Mon Jul 02, 2018 5:00 pm

Re: Question about "speaker" and "listener" in Articy

Post by Raidenthequick »

Thanks for the follow up!

While we've specifically opted to not reference articy entities within the dialogue and dialogue fragment I could see how this could result in some odd behavior. Our goal was to use articy as a means to store our dynamic sequences, but we're reconsidering our strategy. What we'd like is for the sequence to dynamically reference the GameObject which triggers the sequence (actor), and the GameObject which runs it (conversant). If we explicitly set an actor/conversant entity in articy, we move away from this functionality... or so I'd think. Regardless of our decision, it seems articy is assigning entities to the conversation. Per your directions I looked at the conversation in Dialogue System and saw it assigned "Player" as the actor and "Ian-Thinking" as another, which is an entity we've used in a different dialogue... I think it because it was left blank, it picked the first option in the list of entities, as Ian-Thinking has a [1] next to it.

Still, when running the sequence with info debugging enabled, it correctly states that our actor is "EnemyBounding" and conversant as "encounter". That might only be relevant to starting the conversation, while within the conversation node it's trying to reference Ian-Thinking which doesn't exist in this context and as a result defaults to actor. Not entirely sure! Still, it may be that we can't store our dynamic sequences this way, which is fine. Alternatively, we could manually set the actor/conversant in the trigger component, but we might avoid doing this altogether.

Thanks again for your quick support!
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about "speaker" and "listener" in Articy

Post by Tony Li »

Hi,

Don't go changing anything yet. I'll look into this a bit just to make sure nothing funny is going on. BTW, Ian-Thinking may have been assigned as a default participant not in articy itself but in the Dialogue System's articy import window. If you open that window and click Review, you can look at the entity assignments for each Dialogue. [EDIT: I remembered wrong. There are no entity assignments for each Dialogue. That's the Neverwinter Nights importer. :oops: ]
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about "speaker" and "listener" in Articy

Post by Tony Li »

You could assign the Player entity and a non-player entity to the Dialogue, and leave the individual Dialogue Fragments unassigned. To shorten my typing, let's say the non-player entity is named "NPC". In this case, in the Dialogue System the conversation's Actor will be the Player, and the Conversant will NPC. The conversation nodes' Actor (speaker) will be the Player, and Conversant (listener) will be NPC. You could switch the order of the entities assigned to the Dialogue if you want all of the nodes to be assigned to the NPC instead of the Player.

As long as you don't have a GameObject named "NPC", or a Dialogue Actor whose actor name dropdown is set to "NPC", then the listener will be the GameObject that has the Dialogue System Trigger.

I realize this is kind of a compromise. You still need to assign two entities to the Dialogue. But you don't need to assign anything to the individual Dialogue Fragments. And it doesn't matter which entity you assign as the non-player, as long as there's no GameObject/Dialogue Actor with the same name.
Raidenthequick
Posts: 34
Joined: Mon Jul 02, 2018 5:00 pm

Re: Question about "speaker" and "listener" in Articy

Post by Raidenthequick »

Thanks for the response again, Tony.

For this particular problem, I chose to just assign the "Sequence Listener" field in Unity to the very object itself, and with that contained in a prefab, it doesn't add any extra work for me. But your solution may come in handy for future and is great to know about.
User avatar
Tony Li
Posts: 21079
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about "speaker" and "listener" in Articy

Post by Tony Li »

Thanks for the update. Glad it's working now. :-)
Post Reply