Hello to all
I would swear that an instruction existed to restart all the game (not to change to the given scene or to restart it)
Have i dreamt?
Thanks by advance to give your advise.
Xierra54
Hello to all
I would swear that an instruction existed to restart all the game (not to change to the given scene or to restart it)
Have i dreamt?
Thanks by advance to give your advise.
Xierra54
I only know about the quit game action.
If there was a restart action that would be extra useful
You generally would just choose the change scene action and choose the current scnee again.
Unfortunally, go to a scene is not exactly a same to restart a game!
There is some differences (i see that in my actual game)
By example, the global variables are not reinitialized but there are certainly others changes.
Curious there is not this fonction āRestart a gameā
Global variables are persistant throughout the running of the application. There isnāt any sort of ādefaultā for globals stored in memory unless you yourself make one.
This is true in any engine Iām familiar with (defold, unity, unreal), so I imagine the process would remain the same:
Reset your globals manually (usually by overwriting them with a separate āDefaultsā variable you have stored), then change to the initial scene in your gane. Many games forcibly set the globals to a set of stored defaults when the player starts a new game.
Hello!
I understand of course but Itās a little hit on a fly with a hammer, no!
In Fusion, this possibility exists and in Game Maker (old version) too.
A+
Xierra54
Iām glad you found examples, but unfortunately the answer remains the same as mentioned above.
Much like Unity, Unreal, and other current engines, you will need to track whatever you want as defaults for global variables, and re-apply them as you need.
Luckily, if youāre tracking your game state variables in the proper way for saving (i.e. you have a structure variable and all of your game state variables are children of that structure), then you can simply copy that global structure variable top level in the IDE, and rename it as defaults. At that point reapplying the defaults is as simple as using the āLoad JSON to Global Variableā action and using that defaults structure in a ToJSon() expression.
Basically one additional action in whatever event you want to restart the game with.
The only use case I need for restarting the game is for resetting data (Scores, configs, etcā¦)
I donāt think it is very necessary