Skip to content

Required virtual method ScriptLanguageExtension::_reload_scripts must be overidden #95770

Description

@Naros

Tested versions

4.3.stable

System information

Windows 11

Issue description

When a custom ScriptLanguageExtension is implemented and a hot-reload of scripts is triggered within the Godot editor, Godot will report the error:

ERROR: Required virtual method MyCustomScriptLanguage::_reload_scripts must be overridden before calling.
   at: _gdvirtual__reload_scripts_call (./core/object/script_language_extension.h:589)

This is because the _reload_scripts virtual method was added in the editor, but was never marked to be exposed to concrete implementations, which leads to this error since concrete implementations are unable to override it otherwise.

Steps to reproduce

  1. Create a custom ScriptLanguageExtension implementation and register it with Godot
  2. Start game with a simple scene with a GDScript script attached to a node
  3. While game is running, modify the GDScript and save, triggering a hot-reload of scripts
  4. Godot reports error because godot-cpp implementation cannot override _reload_scripts(Array,bool).

Minimal reproduction project (MRP)

N/A

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions