Typewriter effect continues to play after StopConversation()

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

Typewriter effect continues to play after StopConversation()

Post by devalus »

Hi Tony!

I came across a bug in my game I haven't been able to solve so I'm hoping you can help direct me to the right place.

I'm using the Textline extra and added the typewriter effect to NPC and Player subtitles.
On top of that I also included a smooth scrolling script during JumpToBottom() so the transition occurs smoothly instead of instantly.

The problem I'm having is that when I exit the dialogue scene (while the text is still being generated & typewriter still in effect) to the title scene (calling StopConversation() and LoadScene()), I get multiple warnings of "cannot play a disabled audio source" and error from my smooth scrolling script: "Coroutine couldn't be started because the game object 'Scroll Rect' is inactive!"

Is there a way to disable the typewriter effect, or have it complete instantly when stopping the conversation?

Please let me know if you need me to include any scripts or information. Thank you as always :)

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

Re: Typewriter effect continues to play after StopConversation()

Post by Tony Li »

Hi Amy,

I'll be publishing a patch today that adds a "Stop On Conversation End" checkbox to the typewriter effect. The change will also be in the next full release (2.0.3). If you'd like to download the patch and don't yet have access to the Pixel Crushers customer download site, please PM me your Unity Asset Store invoice number.
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: Typewriter effect continues to play after StopConversation()

Post by Tony Li »

The patch is available on the customer download site. After backing up your project and importing the patch, inspect the subtitle text elements. On the typewriter effect, you should see a new checkbox that you can tick called Stop On Conversation End. If that doesn't resolve the issue, let me know.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Typewriter effect continues to play after StopConversation()

Post by devalus »

Thanks Tony,

So I''m in the process of updating my Dialogue System to V2 (and also the new Textline addon) so I can try out the patch, but I'm running into a bug. Note on top of Textline I'm also using the process you helped me with a while back to load the next conversation:

Textline_LobbyExample_2018-03-04.unitypackage from viewtopic.php?f=3&t=1290&start=10

This is so that the player can navigate to logs of past conversations and come back to the live one. This was working well before I updated. However now when I navigate to past conversations then back to live, it will show all the past conversations PLUS the most recent one.

In other words what I want is:
[convo1 btn] -> convo1
[convo2 btn] -> convo2
[convo3 btn] -> convo3

But instead I'm getting:
[convo1 btn] -> convo1
[convo2 btn] -> convo1 + convo2
[convo3 btn] -> convo1 + convo2 + convo3

Did the new TextlineDialogueUI.cs include a change that could have caused this effect?

Sorry for all the problems, thanks for your ongoing help :)

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

Re: Typewriter effect continues to play after StopConversation()

Post by Tony Li »

Hi Amy,

I dropped the lobby example from the new Textline. I'll need to update it.

I don't think anything should have changed that behavior, but the new TextlineDialogueUI did change pretty significantly. It's not based on the Standard Dialogue UI system, not Unity UI Dialogue UI.

I'll check this out when I investigate the other issue.
User avatar
Tony Li
Posts: 22058
Joined: Thu Jul 18, 2013 1:27 pm

Re: Typewriter effect continues to play after StopConversation()

Post by Tony Li »

Hi Amy,

Sorry that took so long! You can download the 2018-07-26 version from the Extras page or right here.

Please also import the menu framework version 2018-07-20 if you haven't already.

At the bottom of the Textline documentation, I included the steps I used to set up a lobby scene in a test project.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Typewriter effect continues to play after StopConversation()

Post by devalus »

Hi Tony,

Not a problem, thanks for the patch :)
This solved the "WaitForMessage(Forever)" issue and I can now include sequences on the same entry!

Regarding the dialogue accumulation problem, it's solved for the most part except for a bug I was able to continuously reproduce. I can't explain it well so I made a recording of the effect, it starts to happen from 00:24 onwards:


The dialogue line seems to duplicate when you navigate back and forth from different conversations. It shows up more consistently when you change conversations while one is still running... I think? I''m also getting a warning when I switch convos, but this doesn't happen in my main game so not sure what's causing it.

Here's a package of the Lobby example I made i the demo, just in case the problem lies with my set up:
https://drive.google.com/open?id=1zT_kk ... M6iVHB6cyo

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

Re: Typewriter effect continues to play after StopConversation()

Post by Tony Li »

Hi Amy,

I think we're just having some version issues. Would you be willing to use the latest versions of the Dialogue System, Menu Framework, and Textline, and set up the Dialogue Manager GameObject to use the latest scripts? If so, I'll send you an example lobby scene that's set up for those versions. The latest Textline now uses SaveSystem instead of GameSaver, and AutoSaveLoad moved into the PixelCrushers namespace (not PixelCrushers.DialogueSystem).

Otherwise, I think these steps might work:

1. Import any Dialogue System 2.x, Menu Framework 2018-07-20, and Textline 2018-07-26.

2. Edit LobbyMenuButtons.cs and replace this line:

Code: Select all

dialogue.GetComponent<AutoSaveLoad>().DeleteSavedGame();
with this:

Code: Select all

PlayerPrefs.DeleteKey("savedgame_0");
I'll go ahead and put together a lobby example in the hope that you'll be able to use it.
devalus
Posts: 52
Joined: Tue Feb 20, 2018 5:09 pm

Re: Typewriter effect continues to play after StopConversation()

Post by devalus »

Hey Tony,

I am on Dialogue System 2.0.2 with latest versions of Menu Framework and Textline.
However I didn't realize there's a new SaveSystem so I updated my set up to the new configuration, the bug is still present though:
01-min.jpg
01-min.jpg (238.27 KiB) Viewed 998 times
This is what I'm using to navigate between conversations:
public void LoadNewConvo(string convo) {
var dialogue = FindObjectOfType<DialogueSystemController>();
dialogue.GetComponent<SaveSystem>().SaveGameToSlot(0);
dialogue.StopConversation();
DialogueLua.SetVariable("Conversation", convo);
dialogue.GetComponent<LevelManager>().LoadLevel(1);
}

Let me know if there's something wrong with it, or if I should upload my new package.

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

Re: Typewriter effect continues to play after StopConversation()

Post by Tony Li »

Hi Amy,

Okay, I appears to be handled properly now. This is the latest: Textline_2018-07-27.unitypackage

These are the steps I used:

1. Created a new Unity 2017.1 project.

2. Imported Dialogue System 2.0.2.

3. Imported Menu Framework 2018-07-20.

4. Imported Textline 2018-07-27 (link in this post).

5. Imported your LobbyExampleBugDemo_2018-07-27.unitypackage

6. Added "0 Lobby" and "1 Gameplay" to the project's build settings.

7. Edited LobbyMenuButtons.cs:

Code: Select all

        //dialogue.GetComponent<AutoSaveLoad>().DeleteSavedGame();
        PlayerPrefs.DeleteKey("savedgame0");
8. Opened the "0 Lobby" scene.

9. On the Dialogue Manager, removed the missing component.

10. Added a SaveSystem component and a DialogueSystemSaver component.

When I followed these steps above using Textline 2018-07-26, I was able to reproduce the bug. Using 2018-07-27, I wasn't able to reproduce the bug.
Post Reply