How to Modify JSON file without Exiting game in GODOT 4.2.1

Godot Version

GODOT VERSION 4.2.1

Question

Hi, I have been trying to make a save system where the Data is saved inside JSON.


I used this weird way to ask question because godot forum doesn’t allow new devs to include multiple pictures in a post.

The issue is that When I Click Save (NEXT to TOGGLE), the program saves the file correctly with the correct information. But it wont display until you reload the file again after closing and reopening the game window.

How Can I Reload the file in game so that the user didn’t have to close and reload the file again and again for every change???
Please Help…How can I skip the manual reload process and reload the file in game only without closing and repoening the file???

Code Link HERE…

Your code seems to be a fragment, so it’s hard to know. I see a var stri that is not defined.

What might help you is where you save the json file. If you save to “res://” then Godot will keep picking it up as changed. Have a look at “user://”

hth

1 Like

Actually my code contains a lot many things. The code which I uploaded on github is only the selected part of the main code. So while selecting variables I forgot to add stri(short of string) one too.

Its nothing just this: (Updated in Github too)

var stri = "True"

So, saving the file in user:// in place of res:// will solve it??