Issue autoloading save game

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jlhacode
Posts: 77
Joined: Fri Jul 03, 2020 6:23 am

Issue autoloading save game

Post by jlhacode »

This is the script I'm using to autoload my game from a splash screen.

Code: Select all

public class SplashScreenLogic : MonoBehaviour
{
    public string startScreen;
    public float splashScreenDuration;

    // Start is called before the first frame update
    void Start()
    {
        StartCoroutine(ShowSplashScreenForDurationThenLoad(splashScreenDuration));
    }

    private IEnumerator ShowSplashScreenForDurationThenLoad(float seconds) {
        yield return new WaitForSeconds(seconds);

        if (SaveSystem.HasSavedGameInSlot(0)) {
            SaveSystem.LoadFromSlot(0);
        } else {
            SceneManager.LoadScene(startScreen);
        }
    }
}
When the game gets loaded, I get this message:
Dialogue System: Lua code '{"bytes":[84,0,0,0,0,16,0,0,0,83,6,80,108,97,121,101,114,84,0,0,0,0,4,0,0,0,83,4,78,97,109,101,83,6,80,108,97,121,101,114,83,8,80,105,99,116,117,114,101,115,83,2,91,93,83,11,68,101,115,99,114,105,112,116,105,111,110,83,0,83,8,73,115,80,108,97,121....<truncated>
UnityEngine.Debug:LogError(Object)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:226)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:127)
PixelCrushers.DialogueSystem.DialogueSystemSaver:ApplyDataImmediate() (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Save System/DialogueSystemSaver.cs:57)
PixelCrushers.SaveSystem:ApplyDataImmediate() (at Assets/Plugins/Pixel Crushers/Common/Scripts/Save System/SaveSystem.cs:717)
PixelCrushers.<LoadSceneCoroutine>d__97:MoveNext() (at Assets/Plugins/Pixel Crushers/Common/Scripts/Save System/SaveSystem.cs:694)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
I shortened the "bytes" portion of the error is much longer for sanity.

It seems like there may be an issue with Lua running the DialogueSystemSaver data, but I'm not sure. I've attached my DialogueSystemSaver component & DialogueSystemController persistent settings for reference.
Attachments
Screen Shot 2020-09-22 at 6.11.13 PM.png
Screen Shot 2020-09-22 at 6.11.13 PM.png (101.27 KiB) Viewed 349 times
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issue autoloading save game

Post by Tony Li »

Hi,

There was a bug with Save Raw Data. You can either untick it or import a patch that I just put on the Dialogue System Extras page. It's in the "Updated for 2.2.11" foldout, but it works for any version of the Dialogue System.
jlhacode
Posts: 77
Joined: Fri Jul 03, 2020 6:23 am

Re: Issue autoloading save game

Post by jlhacode »

Hi Tony,

I'm now getting this error message after installing the patch. Prior to installing the 2.2.11 update, I was running 2.2.9
Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Save System/DialogueSystemSaver.cs(64,39): error CS0117: 'PersistentDataManager' does not contain a definition for 'ApplyLuaInternal'
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Issue autoloading save game

Post by Tony Li »

Can you update to version 2.2.11? I misspoke; I added an optimization in version 2.2.10. If you don't want to update, you can change that line in DialogueSystemSaver.cs to:

Code: Select all

Lua.Run(data, DialogueDebug.logInfo, false);
But I recommend updating to 2.2.11 so we're on the same page.
Post Reply