ephread / inkgd

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

Persistance of lists does not work #33

Open shrnjad opened 3 years ago

shrnjad commented 3 years ago

Describe the bug When adding an entry to a list, the change will not be persisted.

To Reproduce Start the attached project. Click on 'Add entry to list' -> Click on 'Save Ink' -> Close program and reopen -> Click on 'Load Ink' and observe the text in the label.

Expected behavior After the steps outline above, the label should say that the entry is contained in the list.

Ink files test.ink in attached project

Environment:

Additional context It can be fixed by _story._get_runtime().dont_save_default_values = false

Attached Godot project inkgd_issue.zip

ephread commented 2 years ago

@shrnjad thank you so much for reporting the issue and attaching a project.

Sorry it took so long to tackle this. I believe the issue is fixed in 0.4.0, would you be able to double check? The attached project seems to behave properly.

shrnjad commented 2 years ago

@ephread So sorry for the late reply. We are currently in the early stage of our current project (Hauma again). I would test it a bit later when I get around to implementing persistance if that is ok and we are not in a hurry.

shrnjad commented 2 years ago

So I tried to test with version 0.4.2 but could not get the test project to run. (I downloaded it from the link in this issue)

It is also not obvious what the problem is while debugging. The problem happens at this line:

grafik

It runs into some recursive error that happens at this place in ink_list.gd: grafik

Has the interface for lists changed? Or what could be broken?

ephread commented 2 years ago

It's my fault, types are broken, I was overzealous in adding them. Thanks for uncovering the issue! I wish GDscript would support optionals.

It runs into some recursive error that happens

The recursive error is misleading, it happens because the debugger keeps retrieving the value from the getter to display it in the inspector. I consider this a bug in Godot, but I've been too lazy to report it.

I'll fix it, publish a new version and keep you posted. Sorry for the inconvenience 😞

shrnjad commented 2 years ago

No worries, I am happy to support you! 💪

ephread commented 2 years ago

Thanks!

Note to self, the recursive problem with the debugger is fixed in Godot 4 alpha 1!

SuccessKid