Question about continue button and sequence

Announcements, support questions, and discussion for the Dialogue System.
hellwalker
Posts: 112
Joined: Tue Jan 19, 2016 11:37 pm

Question about continue button and sequence

Post by hellwalker »

Hello,

I can't seem to find setup for this kind of behavior. Basically my end goal is:
First time you hit space the typewrite animation effect skips and you see whole text
Second time you hit space you skip dialogue
If you don't press space at all, dialogue should proceed to next entry. So it flows automatically unless you have more then 1 responses.

So I used invisible continue button and it works like intended, the problem is I can't find which option sets up continue button with intended behavior. It either always asks you to click space to move conversation forward, or asks in some cases does not in others. Is there option that lets you skip convo in each case, but you are not required to press continue to move conversation forward?

Second is how do I most optimally launch conversations from independent sequence triggers and visa versa, launch sequence trigger from conversation?
Basically what I want to do is "Play Cinematic" when it ends "Launch Conversation" on certain responce "Play different cinematic".

Right now I have Sequence trigger and Dialogue Start Trigger, both set to trigger on use and I'm using Sequence commands like SendMessage(OnUse, ,DialogueStart)@11

Is there cleaner builtin way to do this?
Thanks in advance
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about continue button and sequence

Post by Tony Li »

Hi,
hellwalker wrote:I can't seem to find setup for this kind of behavior. Basically my end goal is:
First time you hit space the typewrite animation effect skips and you see whole text
Second time you hit space you skip dialogue
If you don't press space at all, dialogue should proceed to next entry. So it flows automatically unless you have more then 1 responses.

So I used invisible continue button and it works like intended, the problem is I can't find which option sets up continue button with intended behavior. It either always asks you to click space to move conversation forward, or asks in some cases does not in others. Is there option that lets you skip convo in each case, but you are not required to press continue to move conversation forward?
This isn't intuitive, but it does what you're looking for:

1. Set the Dialogue Manager's Subtitle Settings > Continue Button dropdown to Never.

2. Unassign the Unity UI Dialogue UI's NPC Subtitle > Continue Button field. Leave the Continue Button GameObject active.

This removes control of the continue button from the dialogue UI. Instead, the continue button is always available when the subtitle panel is active. (Make sure your continue button has a Continue Button Fast Forward component so it skips the typewriter ahead if it's still typing.)

And if the regular duration passes the conversation will move forward automatically. The next version's Continue Button dropdown will have an official "Optional" value so you'll be able to choose that instead of using the two steps above.
hellwalker wrote:Second is how do I most optimally launch conversations from independent sequence triggers and visa versa, launch sequence trigger from conversation?
Basically what I want to do is "Play Cinematic" when it ends "Launch Conversation" on certain responce "Play different cinematic".

Right now I have Sequence trigger and Dialogue Start Trigger, both set to trigger on use and I'm using Sequence commands like SendMessage(OnUse, ,DialogueStart)@11

Is there cleaner builtin way to do this?
It's difficult to provide a universally optimal solution that applies to every project's needs. However, the On Dialogue Event components should help you clean this scenario up. So let's say your desired order is:

1. Player enters a trigger collider, which starts a cutscene sequence.

2. At the end of the cutscene sequence, start a conversation.

3. At the end of the conversation, if the player has chosen a certain response, start another cutscene sequence.

Here's one way to set it up:

1. Add a Sequence Trigger component to the trigger collider. Set its Trigger dropdown to OnTriggerEnter. Set the trigger collider GameObject as the Speaker or Listener so it will receive an OnSequenceEnd message.

2. Add a Start Conversation On Dialogue Event component to the trigger collider. Set its Trigger dropdown to OnSequence. Add an element to the On End list, and assign the Speaker, Listener, and Conversation. In the conversation, set a Dialogue System variable based on the player's response.

3. Add a Start Sequence On Dialogue Event component to the Listener or Speaker, whichever you prefer. Set its Trigger dropdown to OnConversation. Add an element to the On End list. Set the element's Condition to check the Dialogue System variable and run a sequence if it's true.
hellwalker
Posts: 112
Joined: Tue Jan 19, 2016 11:37 pm

Re: Question about continue button and sequence

Post by hellwalker »

Hello,
Thank you for quick reply!

I can't seem to be able to make last part work
3. Add a Start Sequence On Dialogue Event component to the Listener or Speaker, whichever you prefer. Set its Trigger dropdown to OnConversation. Add an element to the On End list. Set the element's Condition to check the Dialogue System variable and run a sequence if it's true.
Do i have to setup listener/player as NPC/PC with a wizard? I did add their gameobject to Conversation Triggers as actor/listener but when conversation ends nothing happens.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about continue button and sequence

Post by Tony Li »

You don't need to use the wizard.

Try adding a Conversation Logger component to the same GameObject. Make sure the console reports that it's receiving OnConversationStart and OnConversationEnd messages.

You can also temporarily set the Dialogue Manager's Debug Level to Info. When the conversation starts, look for a line like this in the console:

Code: Select all

Dialogue Manager: Starting conversation 'ABC' with actor XXX and conversant YYY.
The Dialogue Manager, XXX, and YYY will receive the OnConversationEnd event that Start Sequence On Dialogue Event is waiting for.

Finally, make sure Start Sequence On Dialogue Event is configured correctly:
  • The Trigger is set to OnConversation.
  • The OnEnd section has an element.
  • The correct conversation is selected.
  • The Condition is empty, or the conditions are set so it will be true.
If that doesn't help, please feel free to send a reproduction project to tony (at) pixelcrushers.com.
hellwalker
Posts: 112
Joined: Tue Jan 19, 2016 11:37 pm

Re: Question about continue button and sequence

Post by hellwalker »

Thank you it worked!

I have another question, is there some built in method to create delays withing a text as it's typed with typewriter effect?
For example if character says something like "Umm....Well...I don't know".
So I could insert some sort of code maybe Umm...[wait(2)]...well[wait(1)]...I don't know?

If not, what approach would you suggest for me to custom write this?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about continue button and sequence

Post by Tony Li »

hellwalker wrote:I have another question, is there some built in method to create delays withing a text as it's typed with typewriter effect?
For example if character says something like "Umm....Well...I don't know".
So I could insert some sort of code maybe Umm...[wait(2)]...well[wait(1)]...I don't know?
Yes, you can use RPGMaker-style codes. For example:
  • Dialogue Text: "Umm...\, well...\. I don't know?"
hellwalker
Posts: 112
Joined: Tue Jan 19, 2016 11:37 pm

Re: Question about continue button and sequence

Post by hellwalker »

Fantastic! Thank you.

I have one question though, how do I stop response buttons from showing those codes?
I added Unity UI IGNORE PAUSE CODES component to button Text, and also button, but it's still showing.
Though this prevented text codes from showing in response subtitles. Is there a specific one I must use form buttons?
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about continue button and sequence

Post by Tony Li »

Hi,

Add Unity UI Ignore Pause Codes to the GameObject with the Text component, not the parent GameObject that has the Button component. If that doesn't do the trick, please let me know.
hellwalker
Posts: 112
Joined: Tue Jan 19, 2016 11:37 pm

Re: Question about continue button and sequence

Post by hellwalker »

Hi, I didn't get the problem correctly. It appears the UI IGNORE PAUSE CODES component works, but if you click Continue button a second time, while you are in response waiting menu. Both Responce texts and responce subtitle get "Updated/Redrawn" somehow and this time they show text codes.

In short, UI IGNORE PAUSE CODES breaks if you keep spamming continue button while response menu is shown.
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about continue button and sequence

Post by Tony Li »

Please import the updated Unity UI Support package from the Dialogue System Extras page. It's the first download button on the page. When importing any package, including this one, make a backup of your project first, just in case.

This updated package strips pause codes from response buttons without the need for a Unity UI Ignore Pause Codes component.

If the problem is with the Subtitle Reminder Line, inspect your Unity UI Dialogue UI. Make sure the checkbox Dialogue > Response Menu > Subtitle Reminder > Ignore Pause Codes is ticked.
Post Reply