So I'm trying to add a save/load system to my game so that the highscore doesn't reset between two game sessions. I followed the tutorial in this link (https://kidscancode.org/godot_recipes/4.x/basics/file_io/index.html), but I'm not sure if the code I now have can actually load/save files since I don't think I'm ever calling the load_score/save_score functions. Do I need to add some more code so that it will work, or is that all there is to it? This is the entire script of my singleton that stores highscore/score values during the game sessions
#save and load game
6 messages · Page 1 of 1 (latest)
You have to call them. Whenever the player dies you can call save and whenever the game starts (_ready func on main script) you call load
Nice, it works now, though now the score saves even in between testing sessions. Is there a way to undo that for specific scenarios while keeping it for others? Like, for example in a rpg when I want to keep my items and level between the one testing session and the other, but then at some point reset the entire thing and start the game in the test from the beginning?
If you want to reset the save info just delete the file
How can I find this file?
The user:// path is explained here:
Godot Engine documentation
This page explains how file paths work inside Godot projects. You will learn how to access paths in your projects using the res:// and user:// notations, and where Godot stores project and editor f...