Create a child gdscript class from C# class?

Godot Version

4.4.stable.mono

Question

I wrote a class that I want to make into an Asset Later, that connects to streamer.bot. I have written it in C#, because I know the language.
Now I stumbled over the problem, that if people want to derive from my class to make your own functionality, you have to do so in C# as well.

How do I get to derive from a C# abstract class with a gdscript?

And since the answer is probably gonna be “You can’t”, how did the Godot devs manage to have all the godot classes be available for C# and gdscript and how can I do that too?

the key term here is bindings, and unfortunately that is something I’m not to familiar with. i would love to know if you find something though.

The engine is written in C++, and most engine API calls are exposed to both GDScript and C#. It’s not that they “translate” gdscript into C# or vice versa, but rather that both C# and GDScript have their own implementation for everything, every class, every function etc…

did some more research and it turns out that your best bet is probably to wrap a GDScript class around your c# class, for example:
var class: Node = get_child(0)
var hello: String = “”
get():
return class.Hello
set(value):
class.Hello = value
(this is sudo code)

I kind of expected that (because C# functions sometimes are written differently). But won’t it throw an error if I make the same class with the same name twice?

Because i’d totally would go for writing my class again in gdscript.

OH! And also. If you select a Node type, and then write a script based on that type, does that mean it will change that Node to use the Class in the same language of your script?

Mono allows the use of C# and GDScript, so if you want compatibility, you should just be able to write it in GDScript and it’ll work for both languages.

That’s a very convoluted question so I’m not sure what you are asking. But if you give a node class name in GDScript, it will use that class name because it’s now an inherited class. In C# you have to give it a new name.