On Scene Reload, Some Scene Events Not Working
Posted: Fri Apr 19, 2024 3:02 am
Hello! I'm loving the dialogue system so far, but I'm having a problem with my dialogue scene events that I just cannot figure out no matter how much I investigate. Any help is greatly appreciated.
When I Save and Load my scene, The conversation states and dialogue variables load beautifully!
Everything seems to be working perfectly on reload except that about a quarter of my scene events are not being triggered by the dialogue. These events, otherwise, work perfectly if the scene is not reloaded.
I made sure to not use any scene-persisting GameObjects for the scene events so as to not lose any references.
I can not see a reason or a pattern for it. The events that get skipped seem to be totally random. Even when calling on the exact same scene reference, some events get called and some do not.
The only notable detail that I managed to notice is that it is not individual events that were skipped but that all events called on some individual dialogue nodes get skipped.
I'll try to add any info I can think of:
I am using Unity 2022.3.25 and I have just updated the Dialogue System to 2.2.4.5(and unfortunately, the problem persists!).
I am using Easy Save 3 to save and load the dialogue's data.
C# Saving code:
C# Loading code:
I have commented out the last line of the code as I was testing if maybe I was just saving using the wrong method. From what I could tell, both ways worked the same.
I'm sure I'm probably just missing something obvious but it's driving me crazy! Thanks for taking the time to read this. Have a good one!
When I Save and Load my scene, The conversation states and dialogue variables load beautifully!
Everything seems to be working perfectly on reload except that about a quarter of my scene events are not being triggered by the dialogue. These events, otherwise, work perfectly if the scene is not reloaded.
I made sure to not use any scene-persisting GameObjects for the scene events so as to not lose any references.
I can not see a reason or a pattern for it. The events that get skipped seem to be totally random. Even when calling on the exact same scene reference, some events get called and some do not.
The only notable detail that I managed to notice is that it is not individual events that were skipped but that all events called on some individual dialogue nodes get skipped.
I'll try to add any info I can think of:
I am using Unity 2022.3.25 and I have just updated the Dialogue System to 2.2.4.5(and unfortunately, the problem persists!).
I am using Easy Save 3 to save and load the dialogue's data.
C# Saving code:
Code: Select all
ES3.Save("Dialogue", SaveSystem.Serialize(SaveSystem.RecordSavedGameData()), _saveFile);
ES3.Save("PlayerConvo", _playerDialogueController.Conversation(), _saveFile);
ES3.Save("SigridConvo", _sigridNPC.Conversation(), _saveFile);
//ES3.Save("DialoguePer", PersistentDataManager.GetSaveData(), _saveFile);
Code: Select all
SaveSystem.ApplySavedGameData(SaveSystem.Deserialize<SavedGameData>(ES3.Load<string>("Dialogue", _saveFile)));
_playerDialogueController.SetConvo(ES3.Load<string>("PlayerConvo", _saveFile));
_sigridNPC.SetConversation(ES3.Load<string>("SigridConvo", _saveFile));
//PersistentDataManager.ApplySaveData(ES3.Load<string>("DialoguePer", _saveFile));
I'm sure I'm probably just missing something obvious but it's driving me crazy! Thanks for taking the time to read this. Have a good one!