Load variables from Slot

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Kamotachi
Posts: 44
Joined: Fri Nov 29, 2019 9:03 pm

Load variables from Slot

Post 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?
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Load variables from Slot

Post 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.)
Post Reply