Save file not loading

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Save file not loading

Post by SealDev »

I have a "Play" button on the main menu. Most times it will load my save file. But occasionally it won't leading to a save file loss, unless I do a reset. Restarting the game does not work.

I have a button (img '1 button') that triggers OnUse dialogue trigger (img '2 trigger') as in the screenshots below. The trigger enables this "LOAD" gameobject (img '3 load').

Any clue what could cause the save file to not be loaded sometimes? Is it a corrupt save file?
Attachments
3 load.png
3 load.png (41.62 KiB) Viewed 453 times
2 trigger.png
2 trigger.png (40.77 KiB) Viewed 453 times
1 button.png
1 button.png (20.9 KiB) Viewed 453 times
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save file not loading

Post by Tony Li »

Hi,

I'm not quite sure what's going on there, but it looks like you're going through these steps to do a fade when loading a save file.

What about using the save system's built-in fade transition instead? The easiest way to do this is to download and import the Save System Prefabs from the Dialogue System Extras page. Then:

1. Drop the Save System prefab into your scene (e.g., main menu scene).

2. Add the Loading Screen scene to your build settings. You can customize its appearance later.

3. Remove the Save System components (SaveSystem, DataSerializer, SavedGameDataStorer) from whatever other GameObject it's on (typically the Dialogue Manager).


If you don't want to use the prefabs, you can add a StandardSceneTransitionManager component to the GameObject that has the SaveSystem component. Add the SceneFaderCanvas prefab as a child. Assign the SceneFaderCanvas instance to the StandardSceneTransitionManager's Leave and Enter Scene Transition sections. Set the Leave section's Trigger to "Show" and durations to 1 and 1. Set the Enter section's Trigger to "Hide" and leave the durations at 0.

Then just call SaveSystemMethods.LoadOrRestart without having to use all those sequencer commands and Dialogue System Triggers.
SealDev
Posts: 85
Joined: Thu Jun 24, 2021 5:45 am

Re: Save file not loading

Post by SealDev »

I kept the fade on the dialogue trigger, but added LoadOnRestart on button click to place it directly at the source. Is this likely to fix it?
User avatar
Tony Li
Posts: 22149
Joined: Thu Jul 18, 2013 1:27 pm

Re: Save file not loading

Post by Tony Li »

Hi,

You might not always get the visual effect you're waiting for, but from what you describe it should fix the save/load issue. This is because the fade will happen in parallel with the scene load. If you use a Standard Scene Transition Manager, it will fade first and then load the scene.
Post Reply