godot: Could not find base class "_BASE_" when creating script_templates
Godot version
4.1.stable.mono
System information
EndeavourOS (Arch Linux) - Godot v4.1.stable.mono - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3070 Ti (nvidia; 535.54.03) - AMD Ryzen 7 5800X 8-Core Processor (16 Threads)
Issue description
Current Situation: Following the doc When trying to create/use script templates, gd language server returns
Failed parse script res://editor/script_templates/<Node>/default.gd
Could not find base class "_BASE_"
Expected: Godot to parse BASE correctly and register the script template
Steps to reproduce
- create script_template folder
- create Node folder
- create default.gd
- write a single line:
extends _BASE_
Minimal reproduction project
Additional note:
I dont think the C# version works either, that when i attempt to rewrite the same logic in C# its returning
The type or namespace name '_BINDINGS_NAMESPACE_' could not be found (are you missing a using directive or an assembly reference?)
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 1
- Comments: 17 (8 by maintainers)
I don’t think there’s any direct checks for the templates like that
See the note (which the addon you reference follows):
The script templates are probably not intended to be edited in the editor
Same with
_TS_
tokens. Perhaps, Godot shouldn’t parse files in theres://script_templates/**
location. Allow editing templates in the script editor, but don’t parse them at all.Ah its a different issue - this is specifically for GDScript. The C# part is a side note
I may be missing something but the user seems to be using GDScript. But if the issue is about C#, then it sounds like it would be a duplicate of:
But let me know if I misunderstood the issue.
ah in fact i’ve tested both locations in suspicion that the parser isn’t reading the correct location, but neither is working.
In the original project i’ve relocated the script_templates folder to
res://editor/script_templates
to test out if things are working or not; and in the minimum reproducible project i’ve kept it underres://script_templates
, and tested both importing the addon with concrete implementation & a single line. All scenario failed