Using a single conversation for a linear story dialogue?

Announcements, support questions, and discussion for the Dialogue System.
farazk86
Posts: 26
Joined: Sun Feb 26, 2023 9:13 am

Using a single conversation for a linear story dialogue?

Post 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
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a single conversation for a linear story dialogue?

Post 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:

Code: Select all

// 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.
farazk86
Posts: 26
Joined: Sun Feb 26, 2023 9:13 am

Re: Using a single conversation for a linear story dialogue?

Post by farazk86 »

Tony Li wrote: Sun Feb 26, 2023 3:04 pm 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:

Code: Select all

// 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 :)
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a single conversation for a linear story dialogue?

Post by Tony Li »

Glad to help!
farazk86
Posts: 26
Joined: Sun Feb 26, 2023 9:13 am

Re: Using a single conversation for a linear story dialogue?

Post 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
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a single conversation for a linear story dialogue?

Post by Tony Li »

Hi,

Tick the player actor's Is Player checkbox again. Then please see:
How To: Bypass Response Menu When Player Has One Choice

To do something on the last node, you could use a sequencer command or OnExecute() event.

If you use OnExecute(), add a blank node at the end, and set its Sequence to: Continue()

If you use a sequencer command (which is probably easier), you don't need to add a blank node. Instead, set the Sequence field to something like:

Code: Select all

required LoadLevel(sceneName)@Message(Continued)
farazk86
Posts: 26
Joined: Sun Feb 26, 2023 9:13 am

Re: Using a single conversation for a linear story dialogue?

Post by farazk86 »

Tony Li wrote: Sat Mar 04, 2023 11:28 am Hi,

Tick the player actor's Is Player checkbox again. Then please see:
How To: Bypass Response Menu When Player Has One Choice

To do something on the last node, you could use a sequencer command or OnExecute() event.

If you use OnExecute(), add a blank node at the end, and set its Sequence to: Continue()

If you use a sequencer command (which is probably easier), you don't need to add a blank node. Instead, set the Sequence field to something like:

Code: Select all

required LoadLevel(sceneName)@Message(Continued)

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 :)
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using a single conversation for a linear story dialogue?

Post 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.
farazk86
Posts: 26
Joined: Sun Feb 26, 2023 9:13 am

Re: Using a single conversation for a linear story dialogue?

Post 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?
farazk86
Posts: 26
Joined: Sun Feb 26, 2023 9:13 am

Re: Using a single conversation for a linear story dialogue?

Post by farazk86 »

Tony Li wrote: Wed Mar 08, 2023 7:58 pm Hi,

Note that copying a node with an OnExecute() event copies a reference to the same event; it doesn't duplicate the event.

Right, I think I know what you mean.

If my event takes a variable as an input, then copying the node will refer to the same event.

But in my case my event does not accept any variables and is just a function call. I think then I can safely copy the conversations.

If I ever do have events that accept variables then I'll follow the guidance you mentioned with Lua or the special script methods.

Many thanks for your help and I'll stop bothering you for now :)
Post Reply