Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration with GDScript #31

Open
dogboydog opened this issue Jan 3, 2024 · 0 comments
Open

Integration with GDScript #31

dogboydog opened this issue Jan 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@dogboydog
Copy link
Collaborator

dogboydog commented Jan 3, 2024

Several users have expressed an interest in primarily using GDScript in their projects using YarnSpinner-Godot

Goals:

  • Provide examples for interactions that already work out of the box, such accessing methods and fields on the DialogueRunner.
  • Support creation of custom views via GDScript, by providing a C# adapter class which forwards the method calls from DialogueViewBase methods to your GDScript node instance.
  • Similarly, support creation of custom variable storage via GDScript.
  • Reasonably match conventions for GDScript related APIs
  • Provide the ability to register commands and functions purely via GDScript (I found this is possible using a combination of get_method_list and a Callable for the command handler, but it has some complications that have to be smoothed out)
  • Make sure that some version of VariableStorage TryGetValue is callable from GDScript, test the other functionality of variable storage as well

Challenges:

  • In some testing, I found that when passing a LocalizedLine from C# to GDScript, MarkupParseResult fields such as TextWithoutCharacterName were inaccessible. The C# view adapter should likely convert LocalizedLine to an object that will be more readily consumed from GDScript, such as a Dictionary with a set of known keys.

It's worth noting that these changes will still require the user to install the version of the engine that supports C# - it will just reduce the amount that you have to use C# in order to use the plugin.

@dogboydog dogboydog added the enhancement New feature or request label Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant