I want to run a specific Dialogue Entry ID.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
swang
Posts: 19
Joined: Sat May 13, 2023 10:28 pm

I want to run a specific Dialogue Entry ID.

Post by swang »

![image](https://github.com/kaYeonTan/OhMyHonor_ ... a56753d169)

I want to start the conversation from the designated node instead of the first node in the script.
Please let me know if there is a way. Thank you.
User avatar
Tony Li
Posts: 20678
Joined: Thu Jul 18, 2013 1:27 pm

Re: I want to run a specific Dialogue Entry ID.

Post by Tony Li »

Hi,

Use DialogueManager.StartConversation("title", actorTransform, conversantTransform, entryID).

For example, to start a conversation named "New Conversation 1" at entry ID 42:

Code: Select all

DialogueManager.StartConversation("New Conversation 1", actor.transform, conversant.transform, 42);
To start a conversation at the dialogue entry whose title is "Alternate Entry":

Code: Select all

Conversation conversation = DialogueManager.masterDatabase.GetConversation("New Conversation 1");
DialogueEntry entry = conversation.GetDialogueEntry(42);
DialogueManager.StartConversation("New Conversation 1", actor.transform, conversant.transform, entry.id);
AoAb
Posts: 8
Joined: Wed Apr 17, 2024 4:05 pm

Re: I want to run a specific Dialogue Entry ID.

Post by AoAb »

we are obliged to inform the actor and the speaker transform ?
This doesn't seem to work without (null).
User avatar
Tony Li
Posts: 20678
Joined: Thu Jul 18, 2013 1:27 pm

Re: I want to run a specific Dialogue Entry ID.

Post by Tony Li »

You can pass null as the actor and/or conversant. If they are null, the Dialogue System follows these rules: Character GameObject Assignments
AoAb
Posts: 8
Joined: Wed Apr 17, 2024 4:05 pm

Re: I want to run a specific Dialogue Entry ID.

Post by AoAb »

Ok thanks ! The other problem was that we need to stop conversation before be able to use DialogueManager.StartConversation().
User avatar
Tony Li
Posts: 20678
Joined: Thu Jul 18, 2013 1:27 pm

Re: I want to run a specific Dialogue Entry ID.

Post by Tony Li »

You may have already found this, but you can use DialogueManager.StopConversation() to stop the active conversation, or DialogueManager.StopAllConversations() if you've configured the Dialogue Manager's Other Settings to allow multiple simultaneous conversations.
AoAb
Posts: 8
Joined: Wed Apr 17, 2024 4:05 pm

Re: I want to run a specific Dialogue Entry ID.

Post by AoAb »

Yeah thanks i found this in an other post.

And precisely I had to activate the option to allow multiple simultaneous conversations + not stop the conversation to keep the previous subtitles of the dialogues.
Post Reply