Conversation Selection Drop Down
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Conversation Selection Drop Down
Hey I was just wondering if there's an easy way to add one of those conversation selection drop downs to my own components. I currently enter the conversation name by hand, and I just realized it might be better to select from a drop down.
I'm guessing not since Dialogue System Trigger has you entering the string too, but figured I should ask.
I'm guessing not since Dialogue System Trigger has you entering the string too, but figured I should ask.
Re: Conversation Selection Drop Down
What do you mean that the Dialogue System Trigger has you enter the string? Don't you see a dropdown?
In your own scripts, use the [ConversationPopup] attribute:
Or, if you want to be able to specify a dialogue database:
In your own scripts, use the [ConversationPopup] attribute:
Code: Select all
[ConversationPopup] public string conversation;
Code: Select all
[ConversationPopup(true)]
public string conversation;
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Re: Conversation Selection Drop Down
Oh fantastic! Yeah for me it doesn't show a dropdown. Cool, I'm excited to use this!
Re: Conversation Selection Drop Down
If it can't find a dialogue database in the scene -- either from the Dialogue Manager's Initial Database or a database assigned to the Dialogue System Trigger itself -- it will show a text input field.
The same applies to the [ConversationPopup(true)] attribute.
The same applies to the [ConversationPopup(true)] attribute.
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Re: Conversation Selection Drop Down
I was just wondering, is it possible to start a conversation by ID? I'd like to be able to use this dropdown and then rename a conversation without breaking the link.
Re: Conversation Selection Drop Down
The built-in components such as Dialogue System Trigger go by title, but your own code can start a conversation by ID. Example:
Code: Select all
int ID = 42;
var conversation = DialogueManager.masterDatabase.GetConversation(ID);
DialogueManager.StartConversation(conversation.Title);
-
- Posts: 222
- Joined: Wed Jan 22, 2020 10:48 pm
Re: Conversation Selection Drop Down
Ah gotcha, thanks! I actually just found that method. Looking at the code, I don't see a cache for ID -> conversation. Is the Find method just as fast when it's comparing ints? Do you think I'm safe using that to start every conversation? I guess that obviously depends on the number of conversations. Ignore me.
Re: Conversation Selection Drop Down
You could always cache the conversations into a dictionary or something at start.