Make Dialogic compatible with C# and add the examples on the documentation.
coppolaemilio opened this issue · 5 comments
I never used C# yet but it seems like a good time to try it out.
I tried making this one work, but using this guide https://docs.godotengine.org/en/stable/getting_started/scripting/cross_language_scripting.html I only got this far:
GDScript DialogicSharp = (GDScript) GD.Load("res://addons/dialogic/Other/dialogic_class.gd");
Godot.Object DialogicS = (Godot.Object) DialogicSharp.New();
var dia = DialogicS.Call("start", "example timeline");
If anyone actually knows C# and wants to contribute I would gladly help with testing, but can't really do much more at the moment.
Howdy, @coppolaemilio! We're working on a project in C# and your Dialogic has a ton of promise for what we're looking for.
I wanted to send you a comment before I do a bunch of work to see if you're interested in this angle. I've been working on a very simple C# wrapper for the Dialogic classes. Essentially all it is is the .Call()
method wrapped in a proper method signature and well-documented, so that once you've passed the reference, you can use any of the methods by simply calling them and getting proper IntelliSense aid for the parameters, etc (I love VSCode):
dialogic = (DialogicSharp)GetNode("/root/DialogicSharp"); var newDialog = dialogic.Start("Test"); AddChild(newDialog);
If you would like I can continue the work and submit a pull request once it's ready. My goal is to enable calling any of the public methods to build dialog dynamically in code rather than through the editor if that's what's desired—this is the use case that we'd need in our particular project.
My method of getting a reference to the DialogicSharp
wrapper class is to set it as an autoload. This one class will contain references to all the various classes in the plugin, organized by regions. Is that alright by you?
Thanks!
That sounds good! I'm still pretty new to the C# world so I would have to review that pull request closely. But I would be happy to provide C# users with the proper DialogicSharp class for them to use.
Thanks!
Just wanted to pop in to say that I am also interested in this C# wrapper. My studio is considering using Dialogic and we are also planning on using C# a lot more in our project in the near future. If there is anyway that I can be of assistance with this, feel free to reach out.
Hi! i write something like this for the first time but i have done this and it worked:
Script dialogic = ResourceLoader.Load("res://addons/dialogic/Other/DialogicClass.gd") as Script;
var dialog = (Node) dialogic.Call("start","timeline");
AddChild(dialog);