0 votes

hey guys again,

i have a problem.

this is my actually code:

    extends Node

var points = 0

var store = {
            'bought' : [true, false, false],
            'selected': 0
var save_store_path = 'res://save'

func save_store():
    var file = File.new()
    file.open(save_store_path, file.WRITE)

func load_store():
    var file = File.new()
    if not file.file_exists(save_store_path):
        return false
    file.open(save_store_path, file.READ)
    store = file.get_var()
    return true

and it works.

but when i change from:

var save_store_path = 'res://save'


var save_store_path = 'user://save'

it doesn't work.
also, when i open my project folder (Godot > Project > Open Project Data Folder) does it take me there:



does anyone knows what i can do?

Godot version v3.2.3
in Engine by (35 points)

Could you tell the exact error that you're seeing ?

there is no. it just don't save

What do you exactly mean by it's not working; is it not saving the store in save file? Because when I try your code it does not save anything in the file in either location.

i got it. i just forgot to call the func save & load ... xD

I knew that was the cause but in my case it doesn't save anything even after calling both funcs in _ready():. But glad you solved your problem. :)

Please log in or register to answer this question.

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.