Godot Version
4.4beta3 .Net C#
Question
I started getting this error: “ERROR: Script class can only be set together with base class name” when I upgraded from 4.4dev3 or dev4 and I can’t figure out where to even start looking to fix it. I found another forum post about constant references and I don’t use any constants. It was suggested to me that the problem is my C# public classes but was under the impression that C# public classes were allowed. I tried changing some public classes to Nodes and it didn’t affect the number of errors, though the number of errors does fluctuate.
All the file names are named the same as the classes, I believe, and since the error doesn’t mention a file or class name it is hard to track it down. The errors don’t seem to do anything either, so it isn’t like it is bugging out.
Any help tracking it down would be awesome. Thank you!
I started receiving this error log as well, at some point between the betas of version 4.4 .
This error log comes from the GD array class (godot/core/variant/array.cpp at 15ff450680a40391aabbffde0a57ead2cd84db56 · godotengine/godot · GitHub). I use C#, so I don’t know how to solve this for GDScript, but for me, I was doing something like:
ClassA.cs
public class ClassA {
[...]
private Array<EventType> _eventTypes;
}
BattleEvents.cs
public class BattleEvents {
[...]
}
public enum EventType {
[...]
}
The C++ code expected that my inner type (EventType
) to be placed in its own file (EventTypes.cs
). After I moved the enum to its own file, the error went away.
Ideally, the error log should’ve pointed to the faulty file/object.
Thanks for replying! I am also using C#, and I don’t have any inner types in any files because I didn’t even know you could do that! I messed with my Godot Arrays and Godot Dictionaries and nothing seemed to have any effect on the errors. Any other suggestions to possible help me track it down? Thanks!
I put in that bug report, and though it is nice to see that they may be improving the information in the error I couldn’t figure out how to fix the issue on my side even with the extra information provided by the commenter.