get_as_text() works fine in editor but fails when exporting game

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Adham
:warning: Old Version Published before Godot 3 was released.

Somewhere in my game code I have this line:


where the file has the path ‘res://settings.cfg’. I am choosing not to save to user:// since this isn’t a game save but something only internal.

In the editor when playing the scene, it works just fine & loads the file with no errors.
However, when I build an .exe I get the error:

ERROR: _File::get_as_text: Condition ' !f ' is true. returned: String()
At: core\bind\core_bind.cpp:1582

I superstitiously tried changing everything! It won’t budge! Same error & I don’t understand C++ to know why.

:bust_in_silhouette: Reply From: supaiku

Just a guess, but is the settings.cfg exported? Try to add it to the resources export list in the Resources tab of the export dialog.

Yup fixed, thanks.

Adham | 2016-07-17 20:33