Custom trigger of conversation (How to get dropdown from database)
Posted: Thu Aug 29, 2019 6:59 am
I have a custom interaction system, where I have a reaction called DialogueReaction that shall start a conversation.
I could add a Dialogue System Trigger to the gameobject, set everything up there, and trigger the OnUse method, but to make it easier for my level designer, I'd like to keep it simple and only show a few options.
Is there a way to reference a database, and get some dropdowns, similar to the Dialogue System Trigger?
I got this far, but then I don't know how to get the strings from the database to show up:
I'm using Odin Serializer, which has some pretty neat features to make dropdowns, like above, but I need a method that returns the references, like this:
But I have no clue on how to read referenceDatabase from a method, and how to iterate through it to get the strings I need.
When I have that, I guess I can just:
Also, I'm a little worried/confused about the string references everywhere. Will dialogues break if I rename a conversation or an actor, or is there a way to prevent that from happening?
I could add a Dialogue System Trigger to the gameobject, set everything up there, and trigger the OnUse method, but to make it easier for my level designer, I'd like to keep it simple and only show a few options.
Is there a way to reference a database, and get some dropdowns, similar to the Dialogue System Trigger?
I got this far, but then I don't know how to get the strings from the database to show up:
Code: Select all
[SerializeField]
private DialogueDatabase referenceDatabase;
[ValueDropdown(nameof(GetConversations))]
[SerializeField]
private string conversationTitle;
Code: Select all
private IList<ValueDropdownItem<int>> GetConversations()
{
return new ValueDropdownList<int>
{
{ "The first option", 1 },
{ "The second option", 2 },
{ "The third option", 3 },
};
}
When I have that, I guess I can just:
Code: Select all
DialogueManager.StartConversation(conversationTitle);