+2 votes

I would like to know the the most minimal way to open up a fresh project and write a script that will create and save helloWorldStuff to a file that will appear in my project res:// folder that I can immediately open (either with godots script editor or an external text editor) and validate with my own two eyes that yes it indeed wrote exactly what I told it to write in the file.

Reason:
I have prior knowledge of c++ and glm and I have been working in blender for a few years so I decided that it might be time to try and get into 3d game designing. I have been spending the last few weeks reading about GDScript and ive been scripting simple helloworldish scripts to get used to handling dictionaries and seeing if arrays behave like I remember them and now I'm at a point where I'm trying to figure out how to generate a file from a script (for example say I need to make a dictionary with 125 entries. instead of writing all of them it would be useful if I could write a script that generates them and saves it as a file.) My problem is I have no idea how to do this in godot and the google searches are leaving me frustrated because they try to cover more than what I am trying to learn at the moment.

in Engine by (14 points)

1 Answer

0 votes

Have you seen the documentation, the system for saving files showed there is pretty much a basic one.
https://docs.godotengine.org/en/3.1/tutorials/io/saving_games.html

And remember that you should not save in res:// because that is the game data virtual filesystem, save your files on user:// or any other place where the game will have read and write permissions.

by (7,860 points)

thank you very much on warning me about saving in res:// but the issue with user is that I use linux and all the places people suggest it to be are windows and osx directories, I've checked my user folder which would more likely have write permissions aside from my root folder. I've tried searching my file name too and nothing comes up. (I have not tried launching godot is sudo mode yet though) I really don't know where it is saving to because I can't find any path settings in godot project settings and when I try to designate a specific path to in the script it never shows up there either :/

and yes I have consulted the documentation.

can't plus one on a comment, but I'd like to know the answer to this too

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.