Topic was automatically imported from the old Question2Answer platform.
Asked By
Leonardo José Conson
Old Version
Published before Godot 3 was released.
There is a task in the Godot roadmap and some commits related to an Editor Plugin API. Is this API, as the name says, intended only for extending the editor itself, with some custom GUIs or something like that, or is it also planned to allow extended game/runtime functionality, like nodes that expose access to some custom hardware or system calls ? If the latter is false, is there some other existing or planned way I can create new node types in C++, in a way I can add/redistribute it without recompiling the whole application ?
Sorry for possible bad English and thanks in advance.
You can extend the engine through C++ by writing your own custom modules:
With the custom modules you should be able do do anything, including system calls and full access to 3rd party libraries (I haven’t tried this myself yet). The downside with writing modules in C++, is that you have to compile the engine every time you make some changes.
I don’t know much about the new plugin IDE which is being developed, but I think its targetted for those who don’t want to extend the engine with C++, but rather use the Godot script system instead. I haven’t seen any information about being able to access 3rd party libraries outside the Godot engine with this IDE though.
Thanks for answering.
Yes, I saw the wiki about custom modules, and this is almost what I’m looking for. But the downside of having to recompile the engine means that I’ll have to keep a separate engine branch to develop a project that uses my module (at least as long as it’s not merged upstream).
I’m looking for a way to extend game functionality like in the new plugin API, just droping the addon inside a folder, but being able to use C++ libraries and calls not available through GDScript.
The plugin API is currently worked on by Juan. It is already working in current developement builds.
The plugin API will have some really nice features. You can on the one hand create editor plugins. That are meant to modify content. But you will also be able to write importer, or even custom node types as you asked.
Currently the workflow is as following. Create an “addons” folder in your project and in that folder you create a subfolder with the plugin. When you write a plugin you have to inherit from the EditorPlugin Node. Which lets you than use some Editor specific functions like for example create new custom nodes, or get selected objects and many more.
A link to the article has already been posted.
And here is a link to some sample plugins to see how the structure looks like.