Hi,
Welcome to the Dialogue System! There's no need to deal with Lua for this. And for the purpose you describe, I don't think you need to worry about IDs, either. The conversation titles will almost certainly be local to the client.
I prefer to keep my logic in one place. Since conversation nodes are already making decisions on where to branch, I'll usually create a primary starting conversation for each NPC. The NPC's Conversation Trigger (or Dialogue System Trigger) will always start this conversation. This conversation will contain cross-conversation links to the NPC's real conversations. By setting
Conditions fields, you can specify which link to follow based on the current game state.
To add a cross-conversation link, inspect the originating link. In the Inspector's
Link To: dropdown, select "Another Conversation".
BTW, take advantage of using "/" in conversation titles. This will group them in submenus in the Dialogue Editor menu and in dropdowns in the Inspector. For example:
- Banquo/_Start
- Banquo/Haunting
- Banquo/Soliloquy
- Weird Sisters/_Start
- Weird Sisters/Cauldron
- Weird Sisters/Macbeth
- Weird Sisters/Woods
So I don't leave your original question unanswered, to get a conversation's ID from its title:
Code: Select all
var id = DialogueManager.MasterDatabase.GetConversation("title").id;
To get a conversation's title from its ID:
Code: Select all
var title = DialogueManager.MasterDatabase.GetConversation(id).Title;