godot-cpp
godot-cpp copied to clipboard
`Script` methods are not `virtual`
I'm currently looking at compiling the Visual Scripting support as a GDExtension module using godot-cpp. However all methods in the generated Script class are not marked as virtual making it impossible to have a custom Script class in a GDExtension. They are already marked as virtual: false in the extension_api.json that is used for the code generator. From a look into the generation of extension_api.json i figure this is because Script is marked as "core" method and is therefore never exported as virtual.
Is this something that could be adressed or are custom derived Script classes not a thing for GDExtensions?
@derkork see https://github.com/godotengine/godot-visual-script/pull/26 . My understanding is that to implement custom Scripts you need to implement:
- ScriptLanguageExtension
- Custom ScriptInstance via
GDNativeExtensionScriptInstanceInfoC struct directly. - ScriptExtension.
Note, for Script, you should use ScriptExtension instead:
https://github.com/godotengine/godot/blob/master/core/object/script_language_extension.h#L40
Ah i see, I'll try to make it work with these classes then. Thank you!
Closing, as Faless answered the question