–1 vote

hello people!

im tying to read a array[] and store it for adding content with .append

savegame.open("res://saveData/" + nombre + ".save", File.READ)
cadena = savegame.get_var()
savegame.close()

savegame.open("res://saveData/" + nombre + ".save", File.WRITE)
cadena.append(datos)

after declare cadena = savegame.get_var() I cant gett acces to ,append()
the debuf say "Invalid call. Nonexistent function 'append' in base 'Nil'."

even trying to get the items in te array give me the same debug report, I can add the savegame.get_var() wit append() but i need the array not a array inside other ...

any idea?
thanks for all!

in Engine by (11 points)
edited by

what is your problem exactly?
and save data should be under "user://" not "res://"

after declare cadena = savegame.get_var() I cant gett acces to ,append()
the debuf say "Invalid call. Nonexistent function 'append' in base 'Nil'."

and thanks for the "user//" but im developing for android and i think it doest work, but i'll check

if you are developing android game, you should use "user://" for saving something.
"res://" actually points inside apk that you can't create, delete or modify.

get_var() can't be executed properly because of error according to the error message.
it could be an empty file, or format doesn't match.
how did you save .save file?

I just fix it ...
i feel so dumb , i was tying to store it in writing mode ... -.-"

thanks for the help and sorry for being such a newbie

Mark as solved if it's solved...

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 Frequently asked questions and 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 [email protected] with your username.