Using Sequencer commands in generic conversations?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
goba
Posts: 2
Joined: Fri Jan 27, 2023 5:59 pm

Using Sequencer commands in generic conversations?

Post by goba »

It's easy and possible to start a conversation with any arbitrary actors as the Actor and the Conversant, but I'm curious how you effectively choreograph Sequence commands in a generic way.

I assumed that the 'speaker' Lua keyword would be automatically substituted for the Conversant supplied in the DialogueManager.StartConversation call, but it seems to only ever refer to the Conversant marked in the editor at design-time. For example, if I'm writing a conversation with "Generic_NPC_01" and I start the conversation with "Joey" as the Conversant, "Generic_NPC_01" is still displayed in the name section of the dialogue UI, and the 'speaker' Lua variable is still set to "Generic_NPC_01."

In the docs, the way to do this is said to be [var=Conversant], but that still refers to the design-time conversant (in the hypothetical, "Generic_NPC_01") and not the runtime conversant supplied by my StartConversation call. I've also tested with the built-in Dialogue Trigger component to verify I didn't make an error with the API.

Am I missing something obvious, here? Ultimately, I could assign a Lua variable with the name of the Conversant I actually want to refer to, but this doesn't solve the issue with the UI not reflecting the intended Conversant. From reading the docs, I don't think the issue I'm running into is intended behavior.

I can provide more details from my tests if necessary. I have two NPCs, one who is registered with CharacterInfo as "Joey," and one who is registered with CharacterInfo as "Generic_NPC_01." When I speak to Joey, and StartConversation is called with Joey's transform as the conversant, Generic_NPC_01 is the one who receives all sequencer commands targeting both "speaker" and "[var=Conversant]"

Apologies for the redundant explanations :P Just wanted to make things as clear as possible.

EDIT: Okay, it seems [var=Conversant] does work as expected, but for whatever reason (almost definitely user error) registering transforms with CharacterInfo wasn't working. When using the Dialogue Actor component, [var=Conversant] works perfectly.

However, this doesn't address the UI name not matching the name of the conversant. Is there any recommended way of doing this?
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Sequencer commands in generic conversations?

Post by Tony Li »

Hi,

[var=Actor] is the display name of the actor assigned to the main conversation properties' Actor dropdown -- but this can be overridden by specifying that a different actor act as the conversation actor. See: Character GameObject Assignments.

[var=Conversant] is the display name of the main conversation properties' Conversant dropdown (unless overridden).

Side note: [var=ActorIndex] and [var=ConversantIndex] are the indices into the Actor[] table, which may be different from the actor's Name (see Note About Table Indices) or Display Name.

---

The 'speaker' keyword refers to the GameObject that's acting as the speaker of the current dialogue entry node.

If that doesn't clear up your question, please let me know.
goba
Posts: 2
Joined: Fri Jan 27, 2023 5:59 pm

Re: Using Sequencer commands in generic conversations?

Post by goba »

Thank you Tony, that helps a lot!
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using Sequencer commands in generic conversations?

Post by Tony Li »

Glad to help!
Post Reply