Description
When creating a language extension for godot, you need to create instances of your scripts. These are the actual objects that will run the code that your scripts define. For performance reasons, these are not normal godot classes, but instead a pointer to the instance and a vtable (struct of function pointers).
This means that if you want to use/create these instances, you currently need to do a lot of manual pointer casting and ffi-stuff. Generally through the method script_instance_create
and using the GDExtensionScriptInstanceInfo
struct directly.
Ideally there would be some abstraction, probably a trait or something that will let you easily create the instance, and a trait for the GDExtensionScriptInstanceInfo
struct, as it is effectively just an interface for what methods are supported.
Another issue is that this is almost entirely undocumented, as there is no godot documentation page (that i could find) that talks about this.