Using a single conversation for a linear story dialogue?
Posted: Sun Feb 26, 2023 11:21 am
by farazk86
Hi,
I bought this asset last year, but started using it only today.
I'm following along the documentation and tutorials but have a question which I wanted some clarification for please.
Im developing a a game that has a linear story. Its a conversation between two or three people. At the end of every mission the map scene is loaded and this is where I want the story to continue.
There are about 80 missions and there is dialogue before and after each mission. There are no NPC's and no interaction, the only interaction from the player would be clicking the "next button" to continue the story/text.
For my case, in the dialogue editor should I have one massive conversation which has about 80 - 100 nodes? I see that each node has a unique ID. Can I continue the conversation based on this ID? For example, before the first mission 6 nodes were shown to the player, then when the player returns from the mission, it should continue the story from node 7.
Or should I have a different conversation for each mission, this will make it about 80 - 100 conversations in the database.
In way of an example, I want to have an interface such as the ones shown in 0:05 or 0:12 in the Showcase video I know I would have to have a custom Dialogue UI for that, but to create something like this, should I follow the documentation for cutscenes?
I dont know what the right approach will be here? sorry if this is a silly question.
Thanks
Re: Using a single conversation for a linear story dialogue?
Posted: Sun Feb 26, 2023 3:04 pm
by Tony Li
Hi,
You can base your custom dialogue UI off of the Scrolling Dialogue UI prefab (for the UI shown at 0:05) or the Basic Standard Dialogue UI prefab (for the UI shown at 0:12).
I recommend making separate conversations, with two conversations for each mission -- one before the mission, one after the mission. Then set up your Dialogue System Triggers to play the appropriate conversation, or use DialogueManager.StartConversation() in C# if you prefer. For example, if say you have conversations titled "Mission Start 1", "Mission End 1", "Mission Start 2", "Mission End 2", etc. And you have a variable missionNumber. Then you could start the conversations in C# like this:
// Play mission start conversation:
DialogueManager.StartConversation("Mission Start " + missionNumber);
For each conversation, assign all nodes to the "NPC" actor. And easy way to assign the same actor to a new node is to hold down Shift when right-clicking on a node and selecting "Create Child Node".
Inspect the Dialogue Manager GameObject, Set Display Settings > Subtitle Settings > Continue Button to Always.
Re: Using a single conversation for a linear story dialogue?
You can base your custom dialogue UI off of the Scrolling Dialogue UI prefab (for the UI shown at 0:05) or the Basic Standard Dialogue UI prefab (for the UI shown at 0:12).
I recommend making separate conversations, with two conversations for each mission -- one before the mission, one after the mission. Then set up your Dialogue System Triggers to play the appropriate conversation, or use DialogueManager.StartConversation() in C# if you prefer. For example, if say you have conversations titled "Mission Start 1", "Mission End 1", "Mission Start 2", "Mission End 2", etc. And you have a variable missionNumber. Then you could start the conversations in C# like this:
// Play mission start conversation:
DialogueManager.StartConversation("Mission Start " + missionNumber);
For each conversation, assign all nodes to the "NPC" actor. And easy way to assign the same actor to a new node is to hold down Shift when right-clicking on a node and selecting "Create Child Node".
Inspect the Dialogue Manager GameObject, Set Display Settings > Subtitle Settings > Continue Button to Always.
Many thanks Tony, thats very helpful. I'll do as advised
Re: Using a single conversation for a linear story dialogue?
Posted: Sun Feb 26, 2023 6:12 pm
by Tony Li
Glad to help!
Re: Using a single conversation for a linear story dialogue?
Posted: Sat Mar 04, 2023 9:55 am
by farazk86
Hi,
I was able to create the conversation look I was going for but how do I sometimes give response options to my player character?
As mentioned above, my conversation is between two characters that is played before each mission. Every dialogue of the main character was being displayed as a response option, which I did not want.
So I disabled "isPlayer" for that actor and then the dialogue was being shown as expected.
But I want to have some nodes in the conversation that are displayed as a response option. How do I do that? Like some nodes, show as normal via the "continue button" but some dialogue nodes for the actor display as a response option and then based on the response a next node is selected?
Also, on the last node of the dialogue I want to load the mission, do I do that? Would I assign a scene script and function to the "OnExecute()" of the last node, but that would load the scene as the node is executed? I want that on the last node is displayed the continue button changes text to "Go" or "Attack" and then on clicking that the mission is loaded.
Thank you
Re: Using a single conversation for a linear story dialogue?
Many thanks. I decided to go the ``OnExecute()`` route as I wanted to execute other commands as well before loading the level.
Also, in order to change the colour of the attack button on the last dialogue before scene is changed, I used OnExecute() again on the second last node and in that changed the colour and text of the Continue button.
I would have to do this for 90 other conversations. In hope of finding a quicker solution, just like there is a way to copy notes and retain speakers, is there a way to copy conversations? And then I wont have to change the last two nodes every time and I can just change the conversation content.
Thank you
Re: Using a single conversation for a linear story dialogue?
Posted: Wed Mar 08, 2023 7:58 pm
by Tony Li
Hi,
Select Menu > Duplicate Conversation. Note that copying a node with an OnExecute() event copies a reference to the same event; it doesn't duplicate the event.
If you're going to be copying things and want separate events, you might want to call a C# method from the node's Script field instead by registering it with Lua.
Or you could use OnConversationLine and/or OnConversationResponseMenu special script methods in a script on the Dialogue Manager.
Re: Using a single conversation for a linear story dialogue?
Posted: Thu Mar 09, 2023 7:16 am
by farazk86
Many thanks
Sorry, but can you please explain what you mean by "Note that copying a node with an OnExecute() event copies a reference to the same event; it doesn't duplicate the event."
My OnExecute() is calling a function in my Manager class. Will the copied conversation nodes not call the same function?
Re: Using a single conversation for a linear story dialogue?