Split a Conversation in chunks with diferents actors

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

Split a Conversation in chunks with diferents actors

Post by alfonso »

Hi Tony!

im having some troubles with a the message "OnConversationLine" i will try to explain what im doing first and the the trouble

What im doing
I use cinemaDirector to show the ingame cutscenes, so with the StartConversationEvent i set up the dialogue and the initalNode, with that i can put all the nodes in the same conversation and show when i want in the cinema Director timing, this work so well, recently i start passing the transform of the actor and npc to tell them when they need to speak or stay in idle, with the first StartConversation all work fine but with the second and other fail.
as Note: in each StartConversation i use different actors and transforms.

The trouble
for some reason i think that if you dont start a conversation in a start node something didnt set correctly and the speakerInfo and listenerInfo didnt set the transform well, making that "ConversationView.NotifyParticipantsOnConversationLine(subtitle)" dont send the messages to actor and conversation transform.

did you know how can i fix that?

Hope i explained correctly and as always thanks :)
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Split a Conversation in chunks with diferents actors

Post by Tony Li »

Hi Alfonso!

I'll investigate this today and reply back here.
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

Re: Split a Conversation in chunks with diferents actors

Post by alfonso »

Hi Tony! i think i found the problem

ConversationModel.cs

Line 116 : SetParticipant(conversation, actor, convesant);
this line update the references by the conversationID and transform passed in the StartConversation method

Line 367: public CharacterInfo GetCharacterInfo(int id, Transform character)
this method check if the id exist in the dictionary and return it or add and return a new one.

Line 121: FirstState = GetState(conversation.GetDialogueEntry(initialDialogueEntryID), true, stopAtFirstValid);
(i used this because my initialDialogueEntryID != -1)

Line 189: CharacterInfo actorInfo = GetCharacterInfo(entry.ActorID); inside call line 386: GetCharacterTransform(int id)
i call line 189 with the entryID and is different to ActorID so line 386 return a transform null. and make a subtible with a null transform.

In ConversationView.cs

Line 358 : bool validSpeakerTransform = CharacterInfoHasValidTransform(subtitle.speakerInfo);
will return false and dont send the message


i didnt know how to explain this so hope will be understandable
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Split a Conversation in chunks with diferents actors

Post by Tony Li »

Hi Alfonso,

I've looked into this, and the Cinema Director Start Conversation event appears to work correctly.

Can you send me a reproduction project? (If so, please also let me know what version of Unity and the Dialogue System to use.)

You can also temporarily set the Dialogue Manager's Debug Level to Info. When the Start Conversation event fires, you should see a line like this in the Console view:

Code: Select all

Dialogue System: Starting conversation 'Private Hart', actor=Player (UnityEngine.Transform), conversant=Private Hart (UnityEngine.Transform).
To test:
  1. Open the scene "Cinema Director Example In Scene".
  2. Set the Start Conversation event's Dialogue Entry to -1. Assign Private Hart's GameObject as the Conversant.
  3. Add another Set Conversation event that plays the "Private Hart" conversation at Dialogue Entry 20. Assigned Player & Private Hart GameObjects.
  4. Add Conversation Logger components to Player & Private Hart.
When I play this scene, it logs two copies of
Player: Haha, that never gets old.
and then two copies of
Player: We have orders. I'll handle you later.
one for Player and one for Private Hart, so we know both GameObjects received the OnConversationLine message.
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

Re: Split a Conversation in chunks with diferents actors

Post by alfonso »

mmm im using the version 1.5.8 in unity 5.1.3f1 i will try the demo scene them i will reply with the results :)

thanks
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Split a Conversation in chunks with diferents actors

Post by Tony Li »

Sounds good! If you notice any issues, please test the demo scene in Dialogue System 1.6.1.1 -- maybe in a new project if you don't want to update the Dialogue System in your main project.
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

Re: Split a Conversation in chunks with diferents actors

Post by alfonso »

Hi Tony first of all sorry for the delay in my response :(

i tested the scene with the last version of Dialogue System and CinemaDirector, and it confirm my issue, you only recibe the onConversantionLine message if the node's actor is the same at the conversation's actor (and the same with the conversant)

you can test it with a new conversation with 2 nodes, one of them with the same actor and conversant at the conversation and other node with a different conversant, in the second one, it will not recive a OnConversationLine Message.

dont know if is a bug or not

Thanks again :)
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Split a Conversation in chunks with diferents actors

Post by Tony Li »

Hi Alfonso,

Does the third character's GameObject have the same name as in the dialogue database?

Here's an example:

Let's say your database defines 3 actors in the Actors section:
  • Adam
  • Bob
  • Charlie
Your conversation's primary participants are Adam and Bob:
  • Conversation Title: "Introductions"
  • Actor: Adam
  • Conversant: Bob
The conversation includes dialogue entry nodes spoken by Adam, Bob, and Charlie:
  • START
    • Adam: "My name is Adam."
      • Bob: "My name is Bob."
        • Charlie: "My name is Charlie."
Let's say your scene has these GameObjects:

Hierarchy:
  • Adam_GO
  • Bob_GO
  • Charlie_GO
When you start a conversation, you can specify the GameObjects to use for the primary participants. For example:

Code: Select all

var actor = GameObject.Find("Adam_GO").transform;
var conversant = GameObject.Find("Bob_GO").transform;
DialogueManager.StartConversation("Introductions", actor, conversant);
When the conversation plays "My name is Adam," it will send OnConversationLine to Adam_GO.

However, when the conversation gets to "My name is Charlie," it will look for a GameObject named "Charlie". The GameObject name must match the actor name in the database. In our example, the GameObject is named "Charlie_GO", so the conversation can't find it. Since it can't find the GameObject, it doesn't send the OnConversationLine message.
alfonso
Posts: 104
Joined: Mon Jul 13, 2015 6:31 am

Re: Split a Conversation in chunks with diferents actors

Post by alfonso »

mmmm so "main" actor and conversant can be any gameobject that i assign as actor transform and conversant transform, but if i need a third conversant his gameObject must be the same as the actor is talking rigth?
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Split a Conversation in chunks with diferents actors

Post by Tony Li »

alfonso wrote:mmmm so "main" actor and conversant can be any gameobject that i assign as actor transform and conversant transform, but if i need a third conversant his gameObject must be the same as the actor is talking rigth?
Yes, currently. Later today, a patch is going up on the Pixel Crushers customer download site that actually addresses this by expanding the role of the Override Actor Name component. With the patch, you can add an Override Actor Name component to the Charlie_GO GameObject and set the Override Name field to "Charlie". Then conversations will automatically find the Charlie_GO GameObject when Charlie speaks a dialogue entry.

Also, I forgot to mention this before, but "OnConversationLine" is also broadcast to the Dialogue Manager GameObject and its children.
Post Reply