Godot Version
4.6.2
Question
Hello all,
I need to load a extension + pck during runtime.
The extension is not available at point of time the app starts.
The extension in cpp which works perfectly fine if it is available at startup in the first place.
I am using
GDExtensionManager.load_extension("res://my_extension.gdextension")
to load the extension.
This works and the return status is LOAD_STATUS_OK
For further checks I see my extension in the returned list of:
GDExtensionManager.get_loaded_extensions()
To check if the classes of the extension are available I check
ClassDB.get_class_list()
to contain my classes of the extension.
Additionally I check if it is possible to instantiate a object of it
ClassDB.can_instantiate("MyExtensionClass")
All this seems to be correct and the classes should be useable.
After the extension got loaded I load a additional pck and use a gdscript out of it which uses the class of the extension.
load("res://from_pck_loaded_script.gd")
I have the following observation:
I can do
ClassDB.instantiate("MyExtensionClass")
But I cannot do
extends MyExtensionClass
#or
MyExtensionClass.new()
and that’s the issue. It stops the app directly.
Also the following causes issue
var test:MyExtensionClass
test = ClassDB.instantiate("MyExtensionClass")
This produces a error during runtime but the app continues to run
write_assign_with_conversion: Compiler bug: unresolved assign.
I would like to use the extension classes without any limitations during development.
Can someone explain why it doesn’t work as expected and how to overcome it?
Thank you very much in advance