Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't read text file from res:// in exported game #17095

Closed
LinuxUserGD opened this issue Feb 27, 2018 · 2 comments
Closed

Can't read text file from res:// in exported game #17095

LinuxUserGD opened this issue Feb 27, 2018 · 2 comments
Labels

Comments

@LinuxUserGD
Copy link
Contributor

Godot version:
master

OS/device including version:
Linux (Solus Budgie)

Issue description:
I use this function to open a file saved in my project structure
file: res://dialog/dialog
https://github.com/HugeGameArtGD/Solus-Stunts/blob/master/source/dialog/dialog

func read(dir):
	var file = File.new()
	if file.file_exists(dir):
		file.open(dir, File.READ)
		var input = file.get_as_text()
		var array = input.split("\n")
		print("file read")
		return array
	else:
		return

However the text doesn't show up in the exported game.

Minimal reproduction project:
https://github.com/HugeGameArtGD/Solus-Stunts/tree/master/source/dialog

@akien-mga
Copy link
Member

Only resources are exported by default, as specified in https://github.com/HugeGameArtGD/Solus-Stunts/blob/master/source/export_presets.cfg#L7

You need to add that file to the filter of non-resources that should be exported too, or chose to export everything.

@LinuxUserGD
Copy link
Contributor Author

LinuxUserGD commented Feb 28, 2018

Thank you, I've renamed the text file to dialog.res, now it works on the exported project and the file also shows up in the Godot File Explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants