add func to check if project is exported #4711
azur-wolve
started this conversation in
Scripting
Replies: 1 comment
-
Isn't this what feature tags are for? https://docs.godotengine.org/en/stable/tutorials/export/feature_tags.html |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
is_project_exported() -> bool
Having it to check at run-time if the project is an exported one, or not (in-editor debug), could be useful for conditional code execution.
(code that works in editor but not in exported and the reversal, and also for stuff that only should be accessible on "dev mode")
Recently stumbled with a problem:
after exporting a project, it doesn't has the directories, so when checking if a file exists at a give path (which works well on editor) will suppose a run-time crash on an exported one.
In the editor this works well:
But it wont work when the project its exported because.
(the directories and all the stuff are packed in the
.pck
file, and don't know how to access them to know if some file or dir exists, how load something from there, etc)Otherwise, if change the
make_dir_recursive()
line to:Now it works when the project is exported, but not on the editor.
Unless I'm missing or doing something wrong, the ability to branch it using any hypothetical
is_project_exported()
would solve it easily.Beta Was this translation helpful? Give feedback.
All reactions