Problem using listener

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
dasjlm
Posts: 11
Joined: Wed Nov 22, 2017 12:12 pm

Problem using listener

Post by dasjlm »

I'm new to product and having a bit of trouble getting started.

I'm trying to do a simple dialogue but having trouble getting camera closeups to work using the speaker, listener keywords.

I just wanted to have the NPC to display text and have camera zoom in on the NPC.
That part seems to work fine with the speaker keyword, but when I add Camera(Closeup,listener,2) that step doesn't work.
If I use the char name it does work.

ie: The camera changes but no char is displayed. Seems like the listener is not picked up.

I call the conversation from Adventure Creator so perhaps that is causing confusion.
dasjlm
Posts: 11
Joined: Wed Nov 22, 2017 12:12 pm

Re: Problem using listener

Post by dasjlm »

The following doesn't work unless I put in char name instead of listener.


LookAt(listener,speaker); LookAt(speaker,listener); Camera(Medium); Camera(Closeup,speaker,1)@0.1; require Camera(Closeup,
listener)@2
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problem using listener

Post by Tony Li »

Hi,

The speaker will be the GameObject assigned to the ThirdParty: Dialogue System Conversation action's Actor field, or the default player if the Actor field is unassigned.

The listener will be the GameObject assign to the Conversant field.

To verify that these are being set the way you want, temporarily set the Dialogue Manager's Debug Level to Info. This will log a lot of information to the Console window. Look for a line like:

Code: Select all

Dialogue System: Starting conversation 'title' with actor=AAA and conversant=BBB
Make sure that "AAA" and "BBB" are the characters you want to use as the speaker and listener.

BTW, you can use "LookAt()" as a shortcut for "LookAt(listener,speaker); LookAt(speaker,listener)". It saves some typing. :-)
dasjlm
Posts: 11
Joined: Wed Nov 22, 2017 12:12 pm

Re: Problem using listener

Post by dasjlm »

It seems the actor and conversant are picked up ok.

Dialogue System: Starting conversation 'Police Station1', actor=SamField (UnityEngine.Transform), conversant=Desk_Sergeant (UnityEngine.Transform).

The NPC does first
Can I help you?
This sequence seems to work ok.
LookAt(listener,speaker); LookAt(speaker,listener); Camera(Medium); Camera(Closeup)@0.1; SALSA(Speech/wilcox456);

But the response sequence does not work unless I change the listener to SamField
Camera(Closeup,listener,0);SALSA(Speech/wilcox456,listener);
If I do use SamField instead the closeup works, plus the Salsa speech animation.


I did notice that I get following error with the listener keyword so it seems the listener must be disable during the response sequence???
Can not play a disabled audio source
UnityEngine.AudioSource:Play()
CrazyMinnow.SALSA.Salsa3D:Play()


Suspect I missing something silly as works perfect when I use SamField.
dasjlm
Posts: 11
Joined: Wed Nov 22, 2017 12:12 pm

Re: Problem using listener

Post by dasjlm »

Should mention how I call from AC.

I set the actor as SamField and the Conversant as the Desk_Sergeant when I start the conversation even though the conversation starts with the NPC as the speaker as it speaks first ie: Can I help you?

Perhaps I'm doing that wrong. I did try switching but seemed worse.
But that might be why I having trouble?
dasjlm
Posts: 11
Joined: Wed Nov 22, 2017 12:12 pm

Re: Problem using listener

Post by dasjlm »

Think I might have fixed problem.
I removed SamField from the AC conversation start request. Left it blank to default.
Now seems to work ok.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problem using listener

Post by Tony Li »

Thanks for letting me know. I'm glad it's working now. If you had assigned the player prefab from the Project view, that might have been the reason. If there's not an instance of the player in the scene, AC will instantiate a new copy of the player from the prefab. In this case, the correct thing to do is to leave the Actor field blank just as you did.
Post Reply