Forum rules - please read before posting.

Auto-saving ActionLists. This feature can be amended or disabled in Unity's Project Settings.

budbud
edited July 2022 in Technical Q&A

In the Console, this message suddenly starts coming a lot of times.
What does this mean, and how to deal with it?
AC version 1.75.4 if that matters.

Also a few other questions:
1. How do I set the game in pause mode using Code ?
2. Is there a way to detect if a game load is in progress ?

Comments

  • What does this mean, and how to deal with it?

    It means that scene-based ActionLists are being backed up, so that they can be restored in the event of data loss. You are free to ignore it, but you can set the delay between autosaves (or disable it) from the "Adventure Creator" section of Unity's Project Settings window.

    How do I set the game in pause mode using Code ?

    This can be done with the EnforcePauseMode property:

    AC.KickStarter.stateHandler.EnforcePauseMode = true;
    

    Is there a way to detect if a game load is in progress ?

    The OnBeforeLoading and OnFinishLoading custom events are called sequentially as part of the save file-loading process. You can hook into these events to keep track of this process:

    using UnityEngine;
    using AC;
    
    public class LoadEventsExample : MonoBehaviour
    {
    
        private bool gameIsLoading;
    
        private void OnEnable ()
        {
            EventManager.OnBeforeLoading += OnBeforeLoading;
            EventManager.OnFinishLoading += OnFinishLoading;
        }
    
        private void OnDisable ()
        {
            EventManager.OnFinishLoading -= OnFinishLoading;
            EventManager.OnBeforeLoading -= OnBeforeLoading;
        }
    
        private void OnBeforeLoading (SaveFile saveFile)
        {
            Debug.Log ("Start loading process.");
            gameIsLoading = true;
        }
    
        private void OnFinishLoading ()
        {
            Debug.Log ("Finish loading process.");
            gameIsLoading = false;
        }
    
    }
    

    See the Manual's "Save scripting" chapter for more details on save file-related events.

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.