Can't save resource (through script) after exporting

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

I’m using ResourceSaver.save() to save scenes in my script for example:
ResourceSaver.save(“res://Scenes/19.tscn”, packed_scene2)

And it works fine in the engine, but after exporting I get the pleasantly vague message;
Error: Cannot save file ‘res://Scenes/19.tscn’.
At: scene/resources/resource____format____text.cpp:1470

I’ve used print(packed_scene2) to make sure that it’s not an issue with the variable, but that doesn’t seem to be the case.

So I’m realizing now that I probably can’t save files at “res://” after exporting and that any resource files created after exporting will have to be seperate from the executable. Can someone confirm this?
And in that case I should probably use .scn files instead of .tscn?

MOSN | 2020-04-15 19:07