Open dploeger opened 3 years ago
Has some connection to https://github.com/godotengine/godot-proposals/issues/2628
while this isnt be approved, there's a workaround:
then you need to have a singleton at the game start which will get:
tools #has to enable tools in order to execute at start
func _ready():
for cmd in OS.get_cmdline_args():
match:
"--enable-plugin speedy_gonzales":
get_editor_interface().set_plugin_enabled(<plugin_folder_name_here>,true) # will enable the plugin which has the folder name
"--enable-plugin egoventure":
get_editor_interface().set_plugin_enabled(<plugin_folder_name_here>,true) # will enable the plugin which has the folder name
PS: Keep all plugins disabled by default in project settings
I'm not sure if we use the "multiple repeated options" pattern anywhere in the command line argument parsing yet, so we may want to use a comma-separated list of plugins to enable instead.
Also, should using --enable-plugin
implicitly disable all plugins that aren't mentioned on the list?
Optimally, this should also create an empty project in the current directory (though we could just provide a mostly empty file before)
See https://github.com/godotengine/godot-proposals/issues/78.
while this isnt be approved, there's a workaround:
- There's a function called OS.get_cmdline_args()
then you need to have a singleton at the game start which will get:
func _ready(): for cmd in OS.get_cmdline_args(): match: "--enable-plugin speedy_gonzales": #TODO: Enable plugin here "--enable-plugin egoventure": #TODO: Enable plugin here
PS: Keep all plugins disabled by default in project settings
That doesn't fix this, but still very interesting. That should be a nice addition to the gdscript-docs-maker for selecting the path for the documented resources. Thanks for the tip!
I'm not sure if we use the "multiple repeated options" pattern anywhere in the command line argument parsing yet, so we may want to use a comma-separated list of plugins to enable instead.
Yes, that will work fine.
See https://github.com/godotengine/godot-proposals/issues/78.
Interesting. That'd be the solution to my included additional request for new projects.
Describe the project you are working on
EgoVenture - a 1st person adventure game framework Escoria - a 2nd/3rd person adventure game framework
Describe the problem or limitation you are having in your project
Frameworks consist of multiple addons, which form a complete functionality in Godot.
For example, EgoVenture, a 1st person adventure framework for Godot consists of the EgoVenture core addon (egoventure) and two specialized addons for specific functions: Parrot (dialog system), Speedy Gonzales (custom mouse cursors).
These three addons are separately developed and released, because Parrot and Speedy Gonzales have their own lifecycle because they could be used without EgoVenture at all.
They all get together for the example game, which acts as a reference-implementation of Godot and is used to develop and test the EgoVenture framework and the game template which is the starter template for games made with EgoVenture.
Our workflow is: Develop/Test new features in the example game, then fan out the changes to the individual repositories.
The different addon repositories only contain the addon sources and no game project, because that would duplicate the example game and the game template and create more maintenance work.
We automatically create an API documentation based on gdscript-docs-maker, which needs a project thought.
So to automate this using Github Actions, we'd like to dynamically create a simple Godot plugin, which just has the required addons enabled, so gdscript-docs-maker can create the API docs on every push.
We created a kinda hacky way to do this using an empty project and an already-enabled "pluginsenabler" addon.
This waits for the EditorFilesystem scan to complete and - on a second call - enables the plugins. (see the github actions workflow for it)
This works, but isn't really an optimal solution and subject to changes in Godot obviously.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
To optimize that, it would help if the Godot cli has a parameter, which enables plugins after the filesystem scan has been done and also works together with the
-q
parameter, so it quits Godot afterwards.Optimally, this should also create an empty project in the current directory (though we could just provide a mostly empty file before)
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
A suggestion would be:
--enable-plugin
would wait for the filesystem scan to complete and then enable the specified plugin.--quit
would wait for the filesystem scan and enabling of the plugins and then quit after the first iteration.If this enhancement will not be used often, can it be worked around with a few lines of script?
It can (as described above), but it is merely a hack around the current limitation and probably not very stable for future versions.
Is there a reason why this should be core and not an add-on in the asset library?
The Godot CLI is part of the core.