Page 1 of 1

Randomized and fast paced dialogue flow

Posted: Tue Jun 20, 2023 2:36 pm
by Spacepiratehacker54
Hello, everyone!
I am currently working on a project for uni where I have to simulate a heated conversation.

1.First of all I need dialogue text to disappear and skip ahead on its own after a while (best would be if I can specifiy the time for each text box) and without the player being able to skip ahead manually (can this be turned off/on?).

2.Second of all I'd like the answer prompts to appear on random positions on the screen and make the dialogue continue after a certain amount of specified time has passed. If the player didn't manage to choose anything, a given conversations path meant for that scenario is to be taken.

3.Lastly I would like that a random next textbox out of several availbale options is chosen. So if I am in a textbox currently and I connect three other textboxes to it in the conversations editor I would like a random one of the three to be chosen as the next.

I know this is quite a lot to ask, especially for a beginner at the Dialogue System, but any help would be greatly appreciated. :D

Re: Randomized and fast paced dialogue flow

Posted: Tue Jun 20, 2023 4:56 pm
by Tony Li
Hi,

If you haven't gone through the basic tutorials yet, I recommend doing them first to get a better understanding of my suggestions below. A good set of tutorials to watch are Quick Start, Conversation Conditions, Interaction, and Dialogue UI (parts 1 & 2).
Spacepiratehacker54 wrote: Tue Jun 20, 2023 2:36 pm1.First of all I need dialogue text to disappear and skip ahead on its own after a while (best would be if I can specifiy the time for each text box) and without the player being able to skip ahead manually (can this be turned off/on?).
As long as you keep the Dialogue Manager GameObject's Display Settings > Subtitle Settings > Continue Button dropdown set to its default value of Never, the Dialogue System won't show a continue button, and dialogue text will skip ahead on its own after a duration based on text length.

However, you'll also want to set the Dialogue Manager's Display Settings > Input Settings > Cancel Subtitle Input > Key and Cancel Conversation Input > Key to None. They default to the Escape key. These inputs are like an additional escape hatch to skip out of conversations. You can turn it off by setting them to None.
Spacepiratehacker54 wrote: Tue Jun 20, 2023 2:36 pm2.Second of all I'd like the answer prompts to appear on random positions on the screen and make the dialogue continue after a certain amount of specified time has passed. If the player didn't manage to choose anything, a given conversations path meant for that scenario is to be taken.
You can either do this in script, or by setting up multiple response menu panels. In script, you can just position the menu panel and/or its individual buttons wherever you want. You could do this in an OnConversationResponseMenu() method.

If you want to use multiple response menu panels, create multiple menu panels and position them around the screen. Assign each menu panel to the Standard Dialogue UI component's Conversation UI Elements > Menu Panels list, where they'll be numbered (0, 1, 2, etc.). Then use the SetMenuPanel() sequencer command in the preceding dialogue entry node's Sequence field to tell the next menu to use a specific panel. You can enter the numbers yourself or, to truly randomize it, set a Dialogue System variable to a random value and use it in the SetMenuPanel() command. I can explain this in more detail, but you might find it satisfactory to enter the numbers yourself.
Spacepiratehacker54 wrote: Tue Jun 20, 2023 2:36 pm3.Lastly I would like that a random next textbox out of several availbale options is chosen. So if I am in a textbox currently and I connect three other textboxes to it in the conversations editor I would like a random one of the three to be chosen as the next.
By textbox I assume you mean a dialogue entry node in the conversation tree. If so, set the dialogue entry node's Script field to: RandomizeNextEntry()

This will choose randomly from the 3 dialogue entry nodes that this node links to.

Re: Randomized and fast paced dialogue flow

Posted: Sat Jul 01, 2023 10:48 am
by Spacepiratehacker54
Hi Tony,
thank you so much for your help!

I am currently studying the documentation and I am wondering how I can set "responseTimeout" of the current DialogueSystemController in the Conversations Script (to dynamically set the timeout time of an upcoming choice). I know I can access the variables of a Dialogue Database with for example:
Variable["foo"] = 10
But how would I do this with setting values of the current DialogueSystemController?

Kind regards, Kevin

Re: Randomized and fast paced dialogue flow

Posted: Sat Jul 01, 2023 11:34 am
by Tony Li
Hi Kevin,

In the dialogue entry node before the player response nodes, use the SetTimeout() sequencer command.

For example, set the node's Sequence to:

Code: Select all

{{default}};
SetTimeout(5)
This will play the Dialogue Manager's Default Sequence (which typically just waits for a duration based on the text length) and also sets the response timeout to 5 seconds.

In a node after the response menu, set the timeout value back to zero:

Code: Select all

{{default}};
SetTimeout(0)