Hello,
I am trying to setup a way to instantiate DialogueSystemTrigger component runtime and set its DialogueDatabase and Conversation via my custom ScriptableObject.
1. What are the good method or variables to set DialogueSystemTrigger component's DialogueDatabase and Conversation in code?
2. In my custom ScriptableObject, what is a good way to set Conversation from a specific DialogueDatabase that I've selected? So I can set it to DialogueSystemTrigger later in runtime.
Instantiating DialogueSytstemTrigger and setting its values in code
Re: Instantiating DialogueSytstemTrigger and setting its values in code
Hi,
You don't have to set the database. It's only used for the inspector to populate the conversation dropdown list. It's not used at runtime.
To specify the conversation, set DialogueSystemTrigger.conversation. Example:
BTW, if you're doing things from script, you don't have to use DialogueSystemTrigger. You can start a conversation manually using DialogueManager.StartConversation(). Example:
You don't have to set the database. It's only used for the inspector to populate the conversation dropdown list. It's not used at runtime.
To specify the conversation, set DialogueSystemTrigger.conversation. Example:
Code: Select all
GetComponent<DialogueSystemTrigger>().conversation = "New Conversation 1";
Code: Select all
DialogueManager.StartConversation("New Conversation 1");
Re: Instantiating DialogueSytstemTrigger and setting its values in code
Hi,
So, if I have multiple DialogueDatabase, what should I do? or the conversation string need to be unique across all different DialogueDatabase?
I need to specifically set it as DialogueSystemTrigger since I am setting a scene with a specific dialogue/conversation.
Player will be starting the conversation on their demand rather than it starts right away.
So, if I have multiple DialogueDatabase, what should I do? or the conversation string need to be unique across all different DialogueDatabase?
I need to specifically set it as DialogueSystemTrigger since I am setting a scene with a specific dialogue/conversation.
Player will be starting the conversation on their demand rather than it starts right away.
Re: Instantiating DialogueSytstemTrigger and setting its values in code
Conversation titles (and all internal IDs, too) must be unique across any databases that are loaded into memory at the same time. See: Working With Multiple Databases.