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

4.2.2 GDScript Interop issue #90

Open
Bard09 opened this issue Apr 18, 2024 · 2 comments
Open

4.2.2 GDScript Interop issue #90

Bard09 opened this issue Apr 18, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Bard09
Copy link

Bard09 commented Apr 18, 2024

Describe the bug
After upgrading from 4.2 to 4.2.2 I am seeing several errors in my GDScript code that reference GodotInk C# methods via Interop. Here are two examples of the error:

res://Main.gd:303 - Parse Error: Too few arguments for "EvaluateFunction()" call. Expected at least 2 but received 1.
res://Main.gd:377 - Parse Error: Too few arguments for "BindExternalFunction()" call. Expected at least 3 but received 2.

GDScript references to C# methods appear to be binding now to the non-Interop C# methods in InkStory in GDScript rather than the Interop ones.

To Reproduce
Call C# methods successfully in GDScript via Interop in 4.2; upgrade to Godot 4.2.2, and there should be errors displayed on load of the 4.2 project.

As an example of the EvaluateFunction error above, here's what reproduces it in 4.2.2 with an Ink Story that has a function called "now":

var story: InkStory = preload("res://Story.ink")
var date: String = story.EvaluateFunction("now")

Environment

  • OS: Windows 11
  • Godot version: 4.2.2 mono
  • godot-ink version: 1.1.2

Additional context
This is the first time I've upgraded Godot, so if there's an implicit post-upgrade step I've missed, let me know :)

Could this 4.2.2 C# change be indicative that perhaps we may not need the Interop methods any more? (maybe I'm talking crazy!)

@Bard09 Bard09 added the bug Something isn't working label Apr 18, 2024
@Bard09 Bard09 changed the title 4.2.2 GDScript Interop/C# issue 4.2.2 GDScript Interop issue Apr 18, 2024
@paulloz
Copy link
Owner

paulloz commented Apr 20, 2024

Thank you for the report.

After a bunch of testing, this looks like a regression in Godot itself, and was reported as such1.
In the meantime, you should be able to call the long versions of those methods. E.g., calling story.EvaluateFunction("now") is the same thing as calling story.EvaluateFunction("now", []). The second arguments being the array of arguments you'd pass to the ink function (nothing).

Sorry for the inconvenience.

Footnotes

  1. Impossible to call overloaded methods between languages godotengine/godot#90946

@Bard09
Copy link
Author

Bard09 commented Aug 15, 2024

It looks like https://github.com/godotengine/godot/pull/90968 was fixed in the recent 4.3 release. I haven't had a chance to upgrade yet but looking forward to see if this resolves this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants