0 votes


I'm using json dictionary to store save data. In general I use READ and WRITE to save or load several characters: Each line has keys of character stats.

Now I'm trying to upgrade stats one by one directly to and from the save file without loading the character nodes. I can use READWRITE to find a specific value and change it, but if I use storeline I only get new lines at the end of the save file.

How to replace a specific line in json file?

Bonus question: is json actually a good choice for saving game data for a relatively simple single-player game?

in Engine by (51 points)

1 Answer

+2 votes
Best answer

Consider using a ConfigFile instead. With JSON, you'd need to re-write the entire save-file even if you only changed one line.

by (10,267 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.