You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
Long story short I had to use Kaitai Struct in my project and have chosen C#, which means GDScript and C# interopt. I found out that I cannot refer to my wrapper class(for tying KS into the Godot-land) by its class name. This forced me to use load()/preload(). I then discover that, from GDScript, Godot does not know about any methods I have defined in my C# script. This means no autocompletion from the GDScript side at all. This makes GDScript/non-GDScript language interopt a huge pain.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allowing GDScript codes to refer to non-GDScript classes by name obviously makes using multiple languages a lot smoother. for example, you can define a C# class:
publicclass MyNode : Node
And refer to them by name in GDScript without having to use load() or preload(), with full autocompletions
varnode:=MyNode.new()
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I don't know how Godot's internals work, but since there are ways to register classes in C++(ClassDB), that could probably be used to register non-GDScript classes just like with C++.
If this enhancement will not be used often, can it be worked around with a few lines of script?
As far as I know, there are no way to register non-GDScript classes from any language other than C++. Even with C++, I don't even know if it's possible to scan C# classes.
Is there a reason why this should be core and not an add-on in the asset library?
See above
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
N/A
Describe the problem or limitation you are having in your project
Long story short I had to use Kaitai Struct in my project and have chosen C#, which means GDScript and C# interopt. I found out that I cannot refer to my wrapper class(for tying KS into the Godot-land) by its class name. This forced me to use
load()
/preload()
. I then discover that, from GDScript, Godot does not know about any methods I have defined in my C# script. This means no autocompletion from the GDScript side at all. This makes GDScript/non-GDScript language interopt a huge pain.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Allowing GDScript codes to refer to non-GDScript classes by name obviously makes using multiple languages a lot smoother. for example, you can define a C# class:
And refer to them by name in GDScript without having to use
load()
orpreload()
, with full autocompletionsDescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I don't know how Godot's internals work, but since there are ways to register classes in C++(ClassDB), that could probably be used to register non-GDScript classes just like with C++.
If this enhancement will not be used often, can it be worked around with a few lines of script?
As far as I know, there are no way to register non-GDScript classes from any language other than C++. Even with C++, I don't even know if it's possible to scan C# classes.
Is there a reason why this should be core and not an add-on in the asset library?
See above
The text was updated successfully, but these errors were encountered: