Dialogue Replace option with script

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Fearinhell
Posts: 44
Joined: Sun Feb 20, 2022 5:53 pm

Dialogue Replace option with script

Post by Fearinhell »

So I see in the triggers the Replace option, but how would I get replace to work while in C# code? My line I want is
DialogueManager.StartConversation("AlliBaby"+AlliBabyC);
Any help would be appreciated.
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue Replace option with script

Post by Tony Li »

The Replace option stops any active conversations before starting the Dialogue System Trigger's conversation.

You can use DialogueManager.StopAllConversations() in C#:

Code: Select all

// Replace any active conversations with the conversation "AlliBaby"+AlliBabyC:
DialogueManager.StopAllConversations();
DialogueManager.StartConversation("AlliBaby"+AlliBabyC);
Fearinhell
Posts: 44
Joined: Sun Feb 20, 2022 5:53 pm

Re: Dialogue Replace option with script

Post by Fearinhell »

I get a DialogueManager does not containt a definition for StopAllConversations.
Fearinhell
Posts: 44
Joined: Sun Feb 20, 2022 5:53 pm

Re: Dialogue Replace option with script

Post by Fearinhell »

I havent updated it in a few months, was this recently added?
Fearinhell
Posts: 44
Joined: Sun Feb 20, 2022 5:53 pm

Re: Dialogue Replace option with script

Post by Fearinhell »

Ok I see I have .24 and this was added in .25. I do not have an option to update I just have download and start over?
Fearinhell
Posts: 44
Joined: Sun Feb 20, 2022 5:53 pm

Re: Dialogue Replace option with script

Post by Fearinhell »

I think I got it.
User avatar
Tony Li
Posts: 22145
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue Replace option with script

Post by Tony Li »

Great! Yes, you're correct; just download and import the update on top of your existing Dialogue System. So you should be in good shape now.

In the future, I recommend backing up your project before updating the Dialogue System in case you've directly modified some Dialogue System files. I also recommend not directly modifying Dialogue System files. Instead, use the provided hooks for script customizations, and use prefab variants or duplicates for prefab customizations.
Post Reply