Skip to content

Allow export templates to run standalone scripts. #107350

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Jun 10, 2025

Fixes #107318

If --script argument is found and PCK / project.godot are not:

  • loading continues normally.
  • global script cache loading is skipped.
  • script loading error messages are duplicated as OS alerts.

@bruvzg bruvzg added this to the 4.x milestone Jun 10, 2025
@bruvzg bruvzg requested a review from a team as a code owner June 10, 2025 07:19
if (standalone_script && script_res.is_null()) {
OS::get_singleton()->alert(vformat("Can't load the script \"%s\".", script));
}
#endif
ERR_FAIL_COND_V_MSG(script_res.is_null(), EXIT_FAILURE, "Can't load script: " + script);
Copy link
Member

@Calinou Calinou Jun 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make the message identical to the alert:

Suggested change
ERR_FAIL_COND_V_MSG(script_res.is_null(), EXIT_FAILURE, "Can't load script: " + script);
ERR_FAIL_COND_V_MSG(script_res.is_null(), EXIT_FAILURE, vformat("Can't load the script \"%s\".", script));

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

Successfully merging this pull request may close these issues.

Standalone command line options --script and --main-loop can't be used in export templates without a PCK
2 participants