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

Support Godot 4 #55

Open
lunarcloud opened this issue Jan 24, 2022 · 9 comments
Open

Support Godot 4 #55

lunarcloud opened this issue Jan 24, 2022 · 9 comments
Labels
enhancement New feature or request

Comments

@lunarcloud
Copy link

I know the 4.0 alpha is hot off the presses, but the inkGD plugin doesn't yet work with it, at least not on my autoconverted project, and the new text / font improvements make it really appealing for ink storytellers.

@lunarcloud
Copy link
Author

lunarcloud commented Jan 24, 2022

Looks like a lot of it is gdscript updates -

  • Need optional typing added to the top-of-file variables to catch every error better.
  • "@tool" and "@onready" instead of "tool" and "onready"
  • stricter whitespace enforcement (use only tabs or spaces for indentation, not both)
  • Changed signal syntax: now "obj.funcA.connect(funcB)"
  • "get_icon" renamed "get_theme_icon"
  • "OS.execute" rearranged the arguments
  • "PoolStringArray" doesn't exist, maybe replaced by "PackedStringArray"
  • "preload("").instance()" replaced by "preload("").instantiate()" ?
  • Something happened to the "focus_*" signals, maybe replaced by "text_changed" etc signals
  • "add_font_override(x)" has been changed
  • "continue" is a keyword now, and cannot be used as function name

@lunarcloud
Copy link
Author

Okay, that's probably all the investigation into what's changed I can do.
Yes, I know it's a lot.
Yes, I'm aware this'll need to be completely forked so there's a gd3 and gd4 version.

@ephread
Copy link
Owner

ephread commented Jan 25, 2022

Hey @lunarcloud, thanks for investigating this!

I'm going to create a PR to track what changes are needed for the migration. I don't plan to work on it before the first beta though, as I'm waiting for the feature freeze.

Need optional typing added to the top-of-file variables to catch every error better.

We need to be careful about that one. Some types are deliberately not enforced because GDScript doesn't support optionals. In particular, Array, String and Dictionary are not nullable while upstream often test for their nullability.

stricter whitespace enforcement (use only tabs or spaces for indentation, not both)

That's great if the editor warns about them! If there's still spaces lying around, they are the remnants of a bygone era.

@lunarcloud
Copy link
Author

Ah, with typing, where I can't add it, I leave a comment explaining why / what it should be for myself. I've also experienced moments where it's not ok, particularly Arrays.

@ephread ephread mentioned this issue Jan 25, 2022
16 tasks
@ephread
Copy link
Owner

ephread commented Jan 25, 2022

Progress tracked in #56, I've combined our findings!

@ephread ephread added the enhancement New feature or request label Jan 25, 2022
@AlexP-Coding
Copy link

AlexP-Coding commented Sep 16, 2023

Does the latest release (0.5.0 as of today) currently have Godot 4 support?
The issue is open (plus the releases I've browsed through don't mention Godot 4), but the PR is closed, so I'm unsure if there is support already.

Thanks in advance!

@francoisdlt
Copy link
Contributor

The godot4 branch supports Godot 4 and Ink 1.1.1
I'm currently working with it on a project and everything seems to be working !

@OldrichDlouhy
Copy link

Hello, unfortunately the branch Godot 4 seem to not work with Godot 4.2 for me.

Adding the Godot4 branch to new Godot 4.2 project results in following errors:

  res://addons/inkgd/ink_player.gd:862 - Parse Error: Identifier "Ink" not declared in the current scope.
  res://addons/inkgd/ink_player.gd:864 - Parse Error: Identifier "Ink" not declared in the current scope.
  res://addons/inkgd/ink_player.gd:864 - Parse Error: Identifier "Ink" not declared in the current scope.
  res://addons/inkgd/ink_player.gd:868 - Parse Error: Identifier "Ink" not declared in the current scope.
  res://addons/inkgd/ink_player.gd:870 - Parse Error: Identifier "Ink" not declared in the current scope.
  res://addons/inkgd/ink_player.gd:870 - Parse Error: Identifier "Ink" not declared in the current scope.
  modules/gdscript/gdscript.cpp:2775 - Failed to load script "res://addons/inkgd/ink_player.gd" with error "Parse error". (User)
  res://addons/inkgd/ink_player_factory.gd:35 - Invalid call. Nonexistent function 'new' in base 'GDScript'.
  res://addons/inkgd/editor/panel/preview/ink_preview_panel.gd:359 - Invalid call. Nonexistent function 'connect' in base 'Nil'.

The __InkRuntime is added to the project autoload by enabling the project, but trying to add InkPlayer node to scene results in following errors:

   Cannot get class ''.
  editor/editor_data.cpp:581 - Parameter "p_object" is null.
  editor/scene_tree_dock.cpp:2447 - Parameter "child" is null.

@francoisdlt
Copy link
Contributor

We've upgraded to Godot 4.2 and it works.
You might need to reload the project once upon enabling the plugin.

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

5 participants