I have been using RPG Maker for several years and I recently started using Gdevelop because it allows me to develop much better.
Only I have hit a wall, this problem is saving and loading.
I explain my project:
I want to achieve a Dating Sim/Visual Novel where the player can choose between being a man or a woman and can travel through a city with a multitude of places (until then, no problem).
The problem arises when I make the save variables. I would like to get something similar to what Renpy does where the player saves and saves everything he has done in the world and when he loads it, he goes to the same place where he stopped playing.
I have seen countless tutorials from both independent creators and Gdevelop itself, but I can’t get any progress, I can’t even get the money that the protagonist has to be saved.
I have used all kinds of variables from global to scene but I don’t think I understand what I’m doing wrong.
Can someone help me please?
No problem if you explain very specifically, I consider myself a total newbie at this so I would really appreciate any help.
Thank you so much!
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
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
Thank you, I will try that method that you have explained to me.
Also, thank you for explaining it to me in such detail, that has helped me a lot. Being an artist, I know little about programming.
One more question if you allow me:
When I save, I would like the player to go to the map where they stopped playing when they click “Continue”.
What is important here is that at beginning of the scene condition
And action change TEXT of global variable Resetter set to CurrentSceneName()
It needs to be text variable
So as soon as i get to that scene i go back to scene from which i came from
So it is ultra easy way to reset your scene
BUT if you think about saving that global variable
And then loading it
Then changing scene from menu by clicking continue would get you to last visited scene automatically
So it would be last town dungeon forest or whatever