+1 vote

I am generating a .gd file with the data of the world which I store in an array, what I want to do is that through code I can access this array at any time, I would use the autoload option but since the file does not exist before run the project I do not know what to do, also the script is not atached to any node so I can not use it through one.

in Engine by (13 points)

There surely is a way to solve this, but why this complicated. Why doesn't it exist just empty. And why does it have to be a .gd file and not just a text file (like json)? Think that would be easier.

Also: Autoloads are just scripts being saved in nodes as child of the root node. So you can just add ones like these in game and attach you script as already explained for this question.

Good luck.

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.