Saving a save file after deleting a game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By CyberSlava

(Sorry for the broken English, I’m using a translator) I’m working on an android project where I would like to save. In general, they are already ready, and they save correctly, but after deleting the game, all data is lost, despite the checkboxes “save user data” when exporting. Below is my code that I use for the saves themselves

var saves_file = ProjectSettings.globalize_path(OS.get_user_data_dir().plus_file(“GENERAL.save”))

func load_save():
var f = File.new()
if f.file_exists(saves_file):
if f.open(saves_file, File.READ) == OK:
items_inventory = f.get_var()
f.close()
is_saves_load = true
else:
save_save()
is_saves_load = true

func save_save():
var f = File.new()
if f.open(saves_file, File.WRITE) == OK:
f.store_var(items_inventory)
f.close()

:bust_in_silhouette: Reply From: ShatteredReality

Check “retain data on uninstall”… although I’m not sure if you did check that and you just translated it from another language?