Forum rules - please read before posting.

Skipping Through ActionList

I have a question, is there a button to skip though actionlists?

To explain, lets say I have wait 1 second> the dialogue> then wait 4 seconds> then dialogue> animate> and so on

I have large cutscene filled with over 160 actions and testing it is time consuming.

I know you can skip dialogue with a button. End Cutscene skips to the last action. What if I want to skip to the next action.

Comments

  • The skip system is not appropriate on a per-Action basis, because it would create playback issues. Skipping one Action and not others would have knock-on problems with Actions depending on one another not syncing correctly as they would normally.

    What you can do, however, is break up your Cutscene into smaller Cutscenes which themselves can be skipped individually.

    Normally, skipping a Cutscene will skip all connected Cutscenes as though they were one (as intended). However, through script, you can prevent this by making AC "forget" about any preceding Cutscenes that ran before the one in which you initiated the skip:

    AC.KickStarter.actionListManager.ResetSkippableData ();
    

    This is definitely a case of "use with caution", however. You could try hooking into the OnBeginActionList event to have it run whenever a new Cutscene begins:

    using UnityEngine;
    using System.Collections;
    using AC;
    
    public class SkipLoneActionLists : MonoBehaviour
    {
        private void OnEnable ()
        {
            EventManager.OnBeginActionList += OnBeginActionList;
        }
    
        private void OnDisable ()
        {
            EventManager.OnBeginActionList -= OnBeginActionList;
        }
    
        private void OnBeginActionList (ActionList actionList, ActionListAsset actionListAsset, int startingIndex, bool isSkipping)
        {
            AC.KickStarter.actionListManager.ResetSkippableData ();
        }
    }
    
  • Hi,

    Im confused. How am I supposed to use that exactly.

  • Paste it into a C# script named SkipLoneActionLists and attach it to a new GameObject in your scene.

  • edited June 2023

    @ChrisIceBox
    I tried the code above, but it doesn't call the last node ActionList: Run in a sub-cutscene so it never calls the next sub-cutscene in the list.

    I tried the following, but it doesn't have effect, meaning it goes to the next sub-cutscene but in skip mode:


    if(actionList != null && actionList is Cutscene && actionList.isSkippable && isSkipping) {
    Debug.Log("reset");
    AC.KickStarter.actionListManager.ResetSkippableData();
    }

    What I want to achieve is to skip the current cut-scene but don't passover the reset state to the ActionList: Run at the end of the current cut-scene.

  • Here's how I solved it. First I created an unskippable asset action list that only has one action which is to run action.

    Whenever I want to run action list without passing over the skip, I use the unskippable asset action.
    But then there's one problem, the new called cutscene becomes unskippable even if it's skippable because it was called from the unskippable action list asset.

    I sloved that with the following modification to the above code.

    private void OnBeginActionList(ActionList actionList, ActionListAsset actionListAsset, int startingIndex, bool isSkipping)
    {
    if(actionListAsset != null && actionListAsset.name == "NotSkippable") {

            Debug.Log("reset");
            AC.KickStarter.actionListManager.ResetSkippableData();
        }
    }
    

    I am sorry about the code forma, I am not sure what's wrong.

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.