Forum rules - please read before posting.

[BUG] Problem with skipping dialogues in Action list that is called by On start Action list.

Hello,

So I am using Unity 2018.2.15f1. On start of a scene I run action list. In that Action list I am checking if player finished board game. When he did then Run cutscene (asset file). When ever I try to skip the cutscene the game stops at the next line end freezes. Console says that it cannot skip line [text token] because it is not background speech but the gamestate is not Cutscene.

When I put breakpoints on key lines of the conversation I can see that it stops at the last break point (33) and then when I press skip (End cutscene) it runs the On start action list again but doesn't finish the cutscene that it created, but it instead it creates a new instance and completes that one. You can tell it creates another instance of the BoardGameComplete custcene object and doesn't finish the previous one from this image https://i.imgur.com/3dx2wWL.png.

Also after skipping the On start action, the On start action lists are always run twice (any scene).

Both of the asset lists have options:

  • When running - Pause Gameplay
  • Is Skippable? - Checked (true)
  • Unfreeze 'pause' Menus? - Checked (true)

When I don't run the cutscene action list from On start action list but copy the whole content inside it and change it to skip, see https://imgur.com/xXEAFyh, then it works OK but this is getting messy and lets just say is not a good solution.

Is there a fast fix to this ?

Comments

  • Welcome to the community, @haha. Can you confirm your AC version and platform?

    If the "starting point" of a cutscene was not the currently-running ActionList, then the ActionList is killed and the sequence re-run from the beginning instantly. This is as intended to avoid differing behaviour when skipping at different points, so that the Console is reporting different names should be safe to ignore.

    What I will need are steps to recreate the problem itself - which, if I'm understanding correctly, is that the game freezes? Please provide uncropped screenshots of your ActionList sequences so that I can understand exactly what it is that you're doing.

    What would be ideal, however, is to see a separate chain of Actions/ActionLists that are stripped down to only the Actions necessary to recreate the problem.

    Know that skipping speech text and skipping Cutscenes are two separate operations in AC. Skipping a Cutscene will also skip any displayed speech, but the Console message you've mentioned should only display when the user skips a speech line itself by way of running the SkipSpeech input or clicking the mouse (depending on your Speech Manager settings). The more detail you can provide to help me reproduce this issue on my end, the more accurately I can provide a solution.

  • Hi thanks for quick reply,

    • AC version is 1.64.5 BUT i also tested it with the newest one 1.67.2 and the it is the same.
    • Platform is windows.

    This is what conversations looks like: https://i.imgur.com/drLNIpI.png
    and now when I press space (EndCutscene input) the conversations goes to next line and the game "freezes" (cannot click on hotspot or anything): https://i.imgur.com/BgGDhIo.png

    So how to recreate:
    1. Create action list with dialogues like this (I will use name ShowCase) that looks like this: https://i.imgur.com/e33EqiT.png
    2. Create action list (SceneOnStartAction) and use action for Variables check. If its true run cutscene - in this case ShowCase. https://imgur.com/9K93Sn9
    3. Put the SceneOnStartAction to scene on start as Asset file.
    4. Then skip the dialogue and the game should "freeze". https://i.imgur.com/iZWHaWs.png. You can see that we ended the OnStart action because of the cursor.

    Now when I change the Run cutscene to continue and copy the actions from ShowCase (https://i.imgur.com/eN9O8ZT.png) the skip works no problem.

  • Thanks for the clear steps - I shall follow them and see how things go.

  • Issue recreated. I believe I've got a fix, but would appreciate some testing/feedback.

    If you can, please open up /AdventureCreator/Scripts/Managers/ActionListManager.cs, and replace the EndCutscene () function (starting around line 80) with the following:

    public void EndCutscene ()
    {
        if (!IsInSkippableCutscene ())
        {
            return;
        }
    
        if (AdvGame.GetReferences ().settingsManager.blackOutWhenSkipping)
        {
            KickStarter.mainCamera.HideScene ();
        }
    
        // Stop all non-looping sound
        Sound[] sounds = FindObjectsOfType (typeof (Sound)) as Sound[];
        foreach (Sound sound in sounds)
        {
            if (sound.GetComponent <AudioSource>())
            {
                if (sound.soundType != SoundType.Music && !sound.GetComponent <AudioSource>().loop)
                {
                    sound.Stop ();
                }
            }
        }
    
        // Set correct Player prefab before skipping
        if (KickStarter.settingsManager.playerSwitching == PlayerSwitching.Allow)
        {
            if (KickStarter.player != null && !noPlayerOnStartQueue && playerIDOnStartQueue != KickStarter.player.ID && playerIDOnStartQueue >= 0)
            {
                Player playerToRevertTo = KickStarter.settingsManager.GetPlayer (playerIDOnStartQueue);
                KickStarter.ResetPlayer (playerToRevertTo, playerIDOnStartQueue, true, Quaternion.identity, false, true);
            }
            else if (KickStarter.player != null && noPlayerOnStartQueue)
            {
                KickStarter.ResetPlayer (null, KickStarter.settingsManager.GetEmptyPlayerID (), true, Quaternion.identity, false, true);
            }
            else if (KickStarter.player == null && !noPlayerOnStartQueue && playerIDOnStartQueue >= 0)
            {
                Player playerToRevertTo = KickStarter.settingsManager.GetPlayer (playerIDOnStartQueue);
                KickStarter.ResetPlayer (playerToRevertTo, playerIDOnStartQueue, true, Quaternion.identity, false, true);
            }
        }
    
        List<ActiveList> listsToSkip = new List<ActiveList>();
        List<ActiveList> listsToReset = new List<ActiveList>();
    
        foreach (ActiveList activeList in activeLists)
        {
            if (!activeList.inSkipQueue && activeList.actionList.IsSkippable ())
            {
                listsToReset.Add (activeList);
            }
            else
            {
                listsToSkip.Add (activeList);
            }
        }
    
        foreach (ActiveList activeList in KickStarter.actionListAssetManager.activeLists)
        {
            if (!activeList.inSkipQueue && activeList.actionList.IsSkippable ())
            {
                listsToReset.Add (activeList);
            }
            else
            {
                listsToSkip.Add (activeList);
            }
        }
    
        foreach (ActiveList listToReset in listsToReset)
        {
            // Kill, but do isolated, to bypass setting GameState etc
            listToReset.Reset (true);
        }
    
        foreach (ActiveList listToSkip in listsToSkip)
        {
            listToSkip.Skip ();
        }
    }
    

    Does skipping the cutscene then work as expected?

  • I tested it and it works!
    If you need to test more or something specific just tell me.

    Will you include this fix in next build/version?

    (oh I just found out that I put the question into wrong category.)

    Keep up the good work!

  • Will you include this fix in next build/version?

    That's the plan, though I'd like to get some more testing in beforehand. v1.68 will have a beta test soon.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.