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

Both Built-in and Manual saving/loading system bug #1560

Closed
non-nattawut opened this issue May 18, 2023 · 6 comments · Fixed by #1561
Closed

Both Built-in and Manual saving/loading system bug #1560

non-nattawut opened this issue May 18, 2023 · 6 comments · Fixed by #1561
Assignees
Labels
Approved This can be added, but is not on any roadmap yet Bug 🐞 Something isn't working Critical 💩

Comments

@non-nattawut
Copy link

non-nattawut commented May 18, 2023

Built-in loading got error , Manual loading got bug

For Manual Saving-Loading

Describe the bug
If load a save from manual saving variable it will only load a text state.
The Character Join , Background , Music will not load.

To Reproduce
Steps to reproduce the behavior:

  1. I create a button to save-load
    image
  2. hit save , working OK
  3. hit load , loading text only but Character Join , Background , Music will not load.

Solutions

Workaround

I tried to edit load_full_state function but got stuck on "how to join portrait inline of code"
image
image

Possible fixes

in DialogicGameHandler.gd

  1. I think it is because start_timeline from event index just execute on event index that input in function
    image

  2. but their is something strange for me
    image
    image
    variable in red rectangle will empty after load by manual

For Built-in Saving-Loading

Describe the bug
saving got an error from godot engine
image

To Reproduce
Steps to reproduce the behavior:

  1. I create a button to save-load
    image
  2. hit save , working OK
  3. hit load got error

Solutions

Workaround&Possible fixes

I tried to look in godot repository issue
godotengine/godot#67056
godotengine/godot#68666

System (please complete the following information):

  • OS: Windwos
  • Godot Version: 4.0.2.stable
  • Dialogic Version: Dialogic 2.0 Alpha 7 (for godot 4.0.2 stable)

PS. you can use my project to test
https://github.com/non-nattawut/Phantom-Stars

@Jowan-Spooner
Copy link
Collaborator

Jowan-Spooner commented May 18, 2023

For manual save/load:

Can somewhat confirm. Can you try what effect this change has for you:
In DialogicGameHandler script in the get_full_state() method change:
return current_state_info
to
return current_state_info.duplicate(true)
It seems to be passed by reference and thus cleared afterwards.

I never saw this before because I was expecting the data to be saved in a file and loaded again inbetween saving and loading. That would obviously have created a new dictionary. Good catch.
Let me know if this helps or not!

Still investigating the error for built-in save/load

@Jowan-Spooner
Copy link
Collaborator

For built-in save/load:

The built in save/load DialogicCharacter error seems to be fixed by this changed (for me):
In addons/Events/Save/subsystem_save.gd script around line 80 the end of the save_file method change
file.store_var(data, true) to file.store_var(data, false)
Let me know if it helps you!

@Jowan-Spooner
Copy link
Collaborator

Sorry misclicked closing. Shame on me...

@Jowan-Spooner Jowan-Spooner added Bug 🐞 Something isn't working Critical 💩 Approved This can be added, but is not on any roadmap yet labels May 18, 2023
@Jowan-Spooner Jowan-Spooner self-assigned this May 18, 2023
@non-nattawut
Copy link
Author

Thank a lot for working hard!

For Manual Save/Load

almost everything seem working fine now, but if load state by load_full_state the Name of the character will disappear
image
image

in history is still know character name
image

For Built-in Save/Load

yeah I can load a save now, but got the same result as Manual Save/Load the Name of character is disappear

workaround

so I think it might be my mistake, then I tried this 2 method

  1. I tried to replace dialogic addons file to older one into my project
  2. I tried to use preset mode for styles and add my saving node to it

the character Name still disappear after loading

@Jowan-Spooner
Copy link
Collaborator

Thanks for the response! I will look into the name label going missing!

Jowan-Spooner added a commit that referenced this issue May 18, 2023
Fixes for #1560 as described there
Jowan-Spooner added a commit that referenced this issue May 18, 2023
* Fixes for saving/loading

Fixes for #1560 as described there

* Save/Load fixes & improvements

Makes sure the name label reappears when loading.

Also splits the Dialogic.start() functionality into to parts (which are both still done by start(). This allows adding the layout node without starting a timeline. This is useful before a load() call, to make sure the game can be displayed.
@Jowan-Spooner
Copy link
Collaborator

I've pushed all my fixes to main. Maybe you retry with that version. The dissappearing label should be fixed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved This can be added, but is not on any roadmap yet Bug 🐞 Something isn't working Critical 💩
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants