Start Conversation by ID

Announcements, support questions, and discussion for the Dialogue System.
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: Start Conversation by ID

Post by nicmar »

Hey, I had the same question, and I have a related question.
In the inspector where i choose a conversation, I have this:

Code: Select all

[ConversationPopup(true)]
[SerializeField] private  string conversation; // Shown WITH database selection field.
This lets me pick from the list of dialogues, but how would I change this so it saves the dialog by id instead in my component, and still allows me to use the dialogue picker?

I'd like this, cause i sometimes rename conversations, and then it breaks.

So also when I'd like to start a conversation by ID, do I need to convert it to a title using:

Code: Select all

var title = DialogueManager.MasterDatabase.GetConversation(id).Title;
Or is there some command to start the dialogue by ID right away?

Thanks :)
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
User avatar
Tony Li
Posts: 22104
Joined: Thu Jul 18, 2013 1:27 pm

Re: Start Conversation by ID

Post by Tony Li »

Hi Niclas,
nicmar wrote: Thu Mar 04, 2021 1:53 amIn the inspector where i choose a conversation, I have this:

Code: Select all

[ConversationPopup(true)]
[SerializeField] private  string conversation; // Shown WITH database selection field.
This lets me pick from the list of dialogues, but how would I change this so it saves the dialog by id instead in my
You'd have to write a custom picker script similar to the one used for [ConversationPopup]. It's not already built into the Dialogue System.
nicmar wrote: Thu Mar 04, 2021 1:53 amOr is there some command to start the dialogue by ID right away?
No; keep using that technique.

Depending on your workflow, conversation titles may be more stable than internal conversation IDs. If you're importing from an external source such as articy:draft or maybe even JLC or Yarn in the future, it's possible that the importer will assign different internal IDs each time you import. Also, if you end up using multiple databases (most devs don't), the Unique ID Tool will very likely change internal IDs to ensure they're unique across all databases.

The Dialogue System has a Renamer tool that currently renames variables across all scenes and assets.

In the next update, the plan is to add the ability to rename conversations, quest names, and actor names. Quest and actor names usually aren't too big a deal because you can leave them untouched and rename the Display Name instead.
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: Start Conversation by ID

Post by nicmar »

Great, I will keep the dialogue selection by title for now, and see what the future has to offer :)
Good to know about the renamer tool!
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
Post Reply