The text content in external files

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By DimitriyPS

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?!!

:bust_in_silhouette: Reply From: rolfpancake

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.

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”…

DimitriyPS | 2018-02-02 15:39

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

rolfpancake | 2018-02-03 16:48

:bust_in_silhouette: Reply From: DimitriyPS

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”