Work with data file

I want to save game system data into a file. It looks like this

{ sound = "on" }

When user clicks sound icon, sound is “off” and set_group_gain to 0. But I don’t know how to handle it when user starts game. Do I have to load file and call set_group_gain in init when user starts game and call it again when user clicks sound icon? Are there any way I don’t have to call set_group_gain twice?

Yes, how else are you supposed to restore the saved state?

1 Like

@britzl I understand