Godot: Add an option to open files with exported games

Created on 16 Nov 2018  路  3Comments  路  Source: godotengine/godot

Feature request

OS I use : Windows 10
Hello,
When you export a game, you cannot open files with it
bug open

When you use a file path as an argument, godot tries to load the file, and if it is not a *.tscn or a "project.godot", it throws this error

ERROR: No loader found for resource: C:/Users/matth/Documents/Anglais/file.txt
   At: core/io/resource_loader.cpp:186

Then it quits without even loading the code

The problem is that Godot has an API to be used by command line

Usage: C:\Users\matth\Documents\Anglais\Cloze 0.2.exe [options] [path to scene or 'project.godot' file]

That is convenient to be used in the editor, but not so much for an exported project...
As the program closes, you don't have the opportunity to use OS.get_cmdline_args()

I think it might be a good thing to be able to override a little bit the command line API for exported projects.

archived

Most helpful comment

I think you can workaround this by specifying arguments with something like key=value but I can't find the doc for that...

Also this makes me wonder if that would not be a security hole? Like, take any game built with Godot, put a TSCN you made yourself next to it, call the executable of the game with that argument, and poof you can mine it and hack it with your own code.

All 3 comments

I think you can workaround this by specifying arguments with something like key=value but I can't find the doc for that...

Also this makes me wonder if that would not be a security hole? Like, take any game built with Godot, put a TSCN you made yourself next to it, call the executable of the game with that argument, and poof you can mine it and hack it with your own code.

Well, you can indeed send arguments to the game with the command line or by making a link (on windows at least).
You can get them by code with OS.get_cmdline_args()

raccourci

Sadly this is not user-friendly...

This issue seems to be a duplicate of #8721 (the underlying cause is the same), so I'll close this one. Thanks for reporting it :slightly_smiling_face:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

testman42 picture testman42  路  3Comments

mefihl picture mefihl  路  3Comments

gonzo191 picture gonzo191  路  3Comments

RayKoopa picture RayKoopa  路  3Comments

RebelliousX picture RebelliousX  路  3Comments