Subtitle length

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Subtitle length

Post by devalus »

Hi Tony,

Sorry to bother you twice in a day but I have another question.

So I'm using the Textline addon, with the ability to navigate to past conversations and back. When doing so the conversation freezes on the last entry with sequence "WaitForMessage(Forever)".

However to navigate forward to the next conversation I need to show a button on the same dialogue entry. Originally I tried using sequences but found that it interfered with "WaitForMessage(Forever)". Any other sequence I added before that line will cause the conversation to freeze in the moment but will continue forward if I navigate away and back (say exiting the game and reloading or moving to another convo and back).

So I decided to show this "go next conversation" button with an event instead. This works fine but I'm having trouble passing through the correct delay to account for the typewriter effect. And because it's not a sequence I can't use {{end}} naturally.

I guess my question is, how do I call this delay in script (specifically subtitle length for the entry it's on) or am I going in a completely incorrect direction and there's a much simpler way to do this?

Thanks again for your help :)

Cheers,
Amy
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle length

Post by Tony Li »

Hi Amy,

If your button's GameObject has a unique name, you can use the SetActive() sequencer command.

For example, let's say the button's GameObject is named "Second Conversation Button". You could set the Sequence field of the last node in the first conversation to:

Code: Select all

SetActive(Second Conversation Button)@{{end}};
WaitForMessage(Forever)
The button will appear when the typewriter is done (assuming the typewriter's Characters Per Second is set to the same as the Dialogue Manager's Subtitle Settings > Subtitle Chars Per Second), and the node will wait there until you click the button or go to the menu.

The button's OnClick event could do 3 things:
  • Dialogue Manager's StopConversation() method.
  • Start a new conversation (e.g., use a Dialogue System Trigger, or call the Dialogue Manager's StartConversation() method).
  • Deactivate itself (the button).
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Subtitle length

Post by devalus »

Hi Tony,

I've tried the sequence but the same thing happens:
devalus wrote: Tue Jul 24, 2018 1:25 pm Originally I tried using sequences but found that it interfered with "WaitForMessage(Forever)". Any other sequence I added before that line will cause the conversation to freeze in the moment but will continue forward if I navigate away and back (say exiting the game and reloading or moving to another convo and back).
I loaded up a clean copy of Textline and tried it as well, similar problem. If I just have "WaitForMessage(Forever)" the conversation freezes fine when exiting to main menu and back. But if I use "SetActive(Second Conversation Button)@{{end}}; WaitForMessage(Forever)" then the conversation disappears when I navigate back.

Cheers,
Amy
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle length

Post by Tony Li »

Hi Amy,

Do these steps replicate the problem?

1. Load a clean copy of the Dialogue System and Textline into a new, empty project.

2. Add a UI button named "Second Conversation Button" to the Dialogue Manager's Canvas. Deactivate it.

3. Change the last dialogue entry node's Sequence to:

Code: Select all

SetActive(Second Conversation Button)@{{end}}; WaitForMessage(Forever)
4. Play the start scene.

5. Play through the conversation to the end.

6. Click the Menu button to return to the main menu.

7. Click the Continue button to return to the conversation. At this point, the conversation is not visible when it should be.

If the steps above replicate the problem, I'll set up the same thing here and test it out.

If the steps above don't replicate the problem, would you please reply with a set of steps that do replicate it?
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Subtitle length

Post by devalus »

Hi Tony!

Yes that is exactly what I did and precisely what happened.

Cheers,
Amy
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle length

Post by Tony Li »

Great! As soon as I get back into the office, I'll reproduce that and reply with a solution.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Subtitle length

Post by devalus »

Thank you so much :)
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle length

Post by Tony Li »

Hi Amy,

I have a fix for this. The TextlineDialogueUI was assuming that the final node's Sequence would be exactly "WaitForMessage(Forever)". It now lets you include other commands in the Sequence, too.

I just need to resolve the other issue with the conversations piling up, and I'll publish an updated version of the Textline package. I've run out of time today, but I'll get that done first thing in the morning.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Subtitle length

Post by devalus »

Thanks Tony! :D

Also with the other problem involving past convos accumulating, I was able to replicate the effect on a clean copy of Textline + Lobby set up.

Cheers,
Amy
Post Reply