DialogueNodes icon indicating copy to clipboard operation
DialogueNodes copied to clipboard

C# Support

Open MusinxFate opened this issue 1 year ago • 6 comments

There's C# support for this plugin? I'm trying to call C# variables, do I need to write the whole conversion call (to call C# variables in GDScript) in the Condition Node to make it work like it's in godot documentation?

There's any C# example that I can follow?

MusinxFate avatar Dec 17 '23 07:12 MusinxFate

I'm sorry I haven't tested the plugin with C# and I don't have any experience working with C# as well.

nagidev avatar Dec 18 '23 19:12 nagidev

For what it's worth I've made a very scrappy integration that parses the .tres resources - making them easier to work with in C#. But I've not got as far as variables yet.

Code example ^ Sorry, bad separation of concerns here - mixed in with my game specific code, but the parsing bit might be a useful headstart.

callumlawson avatar Dec 19 '23 12:12 callumlawson

If I get the time to finish and cover all the node types I'll clean it up and share it properly!

callumlawson avatar Dec 19 '23 13:12 callumlawson

I've made a C# version of this plugin in a way that the editor plugin (still in GDScript) writes to C# objects instead of .gd files and then I use a port of dialogue_box.gd and some other objects like the custom RichTextEffects.. that way, in-game, I don't do any cross language communication.. I tried that at the beginning but I was getting weird editor-related bugs... I can post a fork if you are interested, but I need to fix some glitches on the Demo scene first.

With this, you could do what you want by just adding your variable to the variables dictionary before executing the dialogue

germanbv avatar Jan 13 '24 07:01 germanbv

@germanbv posting a fork would be great

nagidev avatar Jan 14 '24 08:01 nagidev

There's C# support for this plugin? I'm trying to call C# variables, do I need to write the whole conversion call (to call C# variables in GDScript) in the Condition Node to make it work like it's in godot documentation?

There's any C# example that I can follow?

You can find the port here: https://github.com/germanbv/DialogueNodesForCSharp I've added external variables support in a way that the dialogue manager reads the public fields of an external class I still need to update the README file to explain how it works

germanbv avatar Mar 01 '24 06:03 germanbv