0 votes

Godot 2.1.4
OS: Linux and Windows

I created a file for the text content of the game. I useit so:

    if vp_Fail.file_exists("res://0000.qwer"):
    vp_Fail.open("res://0000.qwer",File.READ)
    spisok_Teksti.parse_json(vp_Fail.get_line())
    vp_Fail.close()

When I start a game project in the editor - it works! When I export the game project - text content is lost!

What's wrong?!!

in Engine by (358 points)

2 Answers

0 votes

This is because the res://-path is read-only in exported games:

This file system is read-write only when running the project locally from the editor. When exported or when running on different devices (such as phones or consoles, or running from DVD), the file system will become read-only and writing will no longer be permitted.

You can use the user://-path instead.

by (1,032 points)

No, that's not it. I read files - not write. There is another problem. Godot after compilation does not take "unusual" file permissions... he either ignores (skips) when you serialize the game base.

I found a solution. The problem is solved in a simple way, a file to give permission: "*.tres"...

Could you please add your solution as answer and elaborate on it more? Would maybe help some guys in the future.

0 votes

Could you please add your solution as answer and elaborate on it more? Would maybe help some guys in the future.

Well I'll try. I'm sorry I don't speak English.

Text content of the game I do not keep in scripts. For text content I use "json" files. I'm uploading them to the "Dictionary". In scripts make references.

For personal convenience, I used non-typical permissions for files with text content. This worked when launched in the editor. After exporting, the texts were empty. I don't know why. Perhaps Godot ignores non-standard file permissions when exporting.

The problem was solved when I set the files to the standard resolution "*.tres"

by (358 points)
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.