0 votes

First, I have been trying to make a game recently, where a big part of it is reading from different books. The text inside these books is saved inside .txt files, I read them from my user:// directory but, of course that stops working on an exported game, since I'd have to export it with these textfiles and read them somehow. Sadly when I put the textfiles inside the main game directory they cant be loaded anymore,.

Now comes my question, is there any way to ship an exported version of a game with these .txt files and be able to read from them as if they were a regular .txt file or would I have to put the text from them in code?

Godot version 3.3.2
in Engine by (34 points)

1 Answer

+1 vote
Best answer

Store your text files in res:// folder (or any res:// subfolders) and add *.txt (or file extension you are using to store your text files) to export. Otherwise only default file types are exported (*.tscn, *.gd, etc).


by (1,650 points)
selected by
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.