ephread / inkgd

Implementation of inkle's Ink in pure GDScript for Godot, with editor support.
MIT License
305 stars 33 forks source link

Support Godot 4 #55

Open lunarcloud opened 2 years ago

lunarcloud commented 2 years ago

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 commented 2 years ago

Looks like a lot of it is gdscript updates -

lunarcloud commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

AlexP-Coding commented 12 months ago

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 commented 11 months ago

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 commented 9 months ago

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 commented 9 months ago

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