Godot version
v4.1.1.stable.official [bd6af8e]
System information
Godot v4.1.1.stable - Fedora Linux 38 (Workstation Edition) - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (nvidia; 535.54.03) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)
Issue description
When starting a project that utilizes ScriptExtension with the editor, the following error occurs:
E 0:00:00:0703 _gdvirtual__get_language_call: Required virtual method ScriptExtension::_get_language must be overridden before calling.
<C++ Source> ./core/object/script_language_extension.h:106 @ _gdvirtual__get_language_call()
even though the method is implemented and registered.
From my debugging, I believe this is the condition under which the error happens:
- Project starts from editor.
- Godot attempts to load a script.
- When the
Script is constructed, Wrapped's constructor creates the Godot-side object, postinitialize_handler is called from the Godot side, and NOTIFICATION_POSTINITIALIZE is fired.
Script's notification handler fires, which attempts to call get_language.
- The virtual call attempts to find the
Script's corresponding extension. It cannot find it, so the call fails and the error is printed.
postinitialize_handler is called on the GDExtension side and the Script's extension is finally set.
- Virtual calls outside of
postinitialize_handler are successful.
I'm not 100% sure this is correct, but it seems fairly likely.
Steps to reproduce
- Install any extension that utilizes
ScriptExtension.
- Create a script.
- Run the project from the editor.
Minimal reproduction project
MRP_ScriptExtension_virtual.zip
I've attached binaries from my implementation as I don't think a different extension will produce a different result. You can verify that get_language is implemented here.
Usage:
- Unzip the archive and start the editor.
- The editor will crash on import due to an unrelated issue.
- Open the editor again.
- Start the main scene.
Godot version
v4.1.1.stable.official [bd6af8e]
System information
Godot v4.1.1.stable - Fedora Linux 38 (Workstation Edition) - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (nvidia; 535.54.03) - AMD Ryzen 7 3700X 8-Core Processor (16 Threads)
Issue description
When starting a project that utilizes
ScriptExtensionwith the editor, the following error occurs:even though the method is implemented and registered.
From my debugging, I believe this is the condition under which the error happens:
Scriptis constructed,Wrapped's constructor creates the Godot-side object,postinitialize_handleris called from the Godot side, andNOTIFICATION_POSTINITIALIZEis fired.Script's notification handler fires, which attempts to callget_language.Script's corresponding extension. It cannot find it, so the call fails and the error is printed.postinitialize_handleris called on the GDExtension side and theScript's extension is finally set.postinitialize_handlerare successful.I'm not 100% sure this is correct, but it seems fairly likely.
Steps to reproduce
ScriptExtension.Minimal reproduction project
MRP_ScriptExtension_virtual.zip
I've attached binaries from my implementation as I don't think a different extension will produce a different result. You can verify that
get_languageis implemented here.Usage: