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

Play Scene passes an extra cmdline arg. #44750

Closed
zaevi opened this issue Dec 28, 2020 · 2 comments · Fixed by #63624
Closed

Play Scene passes an extra cmdline arg. #44750

zaevi opened this issue Dec 28, 2020 · 2 comments · Fixed by #63624

Comments

@zaevi
Copy link
Contributor

zaevi commented Dec 28, 2020

Godot version:
3.2.4.beta

OS/device including version:
Win10

Issue description:
When using Play Scene in Editor, it will pass an extra arg (the scene's path) in OS.get_cmdline_args().
I don't know if it's feature or bug.

Steps to reproduce:
Create a scene with script:

func _ready():
    for arg in OS.get_cmdline_args():
        print(arg)

Run scene using Play and Play Scene

Minimal reproduction project:
arg-test.zip

@akien-mga
Copy link
Member

That's a feature, passing arguments is how the engine knows whether to run the editor, the project manager, the project (main scene) or a specific scene.

$ godot --help
Godot Engine v3.2.3.stable.mageia - https://godotengine.org
Free and open source software under the terms of the MIT license.
(c) 2007-2020 Juan Linietsky, Ariel Manzur.
(c) 2014-2020 Godot Engine contributors.

Usage: godot [options] [path to scene or 'project.godot' file]

@zaevi
Copy link
Contributor Author

zaevi commented Dec 28, 2020

I mean, the editor shouldn't expose this argument to project.

Running: C:/Dev/Godot/dev/godot.windows.opt.tools.64.mono.exe --path C:/Users/zaevi/source/Godot/arg-test --remote-debug 127.0.0.1:6007 --allow_focus_steal_pid 31500 --position 448,240 res://Main.tscn

The previous arguments are "hidden" (which I could not get them by OS.get_cmdline_args() in my project), except for the scene path.
This argument is handled by engine, not my project, so I think it should hide as same.

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

Successfully merging a pull request may close this issue.

3 participants