Page 1 of 1

Load variables from Slot

Posted: Wed Oct 13, 2021 11:42 am
by Kamotachi
Hi there!

I've a gallery, and there are pictures/buttons that can be unlocked.

Each button is equivalent to a bool variable of the dialog system.
I manage to equal the variables in each button/picture in this way:

Picture [0] = DialogueLua.GetVariable ("Picture0"). AsBool;
...

The point is that before doing this, I need to load the game, so that the variables are loaded.

I save the game with the script "Save System Methods", using the function "SaveSlot (x)".

Well, I know I can load with "LoadFromSlot (x)", but that even brings me to the scene where I saved.

Is it possible to load only the variables of the dialog system?

Re: Load variables from Slot

Posted: Wed Oct 13, 2021 1:14 pm
by Tony Li
Hi,

If you don't want SaveSystem.LoadFromSlot(x) to load the scene that the game was saved in, you can untick the Save System component's 'Save Current Scene' checkbox. Or, if you only want to do it temporarily, in C# set SaveSystem.saveCurrentScene = false. (You can hook into the SaveSystem.savedDataApplied C# event to know when it's save to set it back.)