I need help creating saves and loads for a DatingSim/VisualNovel

You make your money global variable
BEST to put all crap you wanna save under structure variable
You hit project manager icon on the left and go to global variables
And hit add then choose structure and named it Saves for example
Now you add child variable name it Money and set it to 100

Now to call your money variable (for example to add more or subtract) you go with GlobalVariable(StructureName.ChildName)
Which in this case would be GlobalVariable(Saves.Money)

And you use this to save/load it

Idea of making it structure is that to save/load all childs of structure
You do not need to go on them 1 by 1

You just save your structure

So if you have
GlobalVariable(Saves.Money)
GlobalVariable(Saves.Gender)
GlobalVariable(Saves.Location)

You do not save of them all each by each separately
You just save global variable Saves and load global variable Saves

NOW there is a problem imagine you declare that variable Saves.Money is 100
BUT i 1st open your game i do not have any variables saved
SO it will load this variable with default value which is 0
So for me on 1st run i will start with 0 money instead of 100
And same goes for all variables you declared in global variables window
To prevent that you do this

You add condition to check if storage exist

And now it will only load if it was saved before
Meaning
By default when i 1st run your game i will have 100 money
Yet whatever is changed to money and i save it
Will be loaded on my next run of your game cause i already have some save

1 Like