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

ResourceLoader fails to load nested resources saved in .tres files when a value is passed through the _init of such nested resource. #70783

Closed
Sirosky opened this issue Dec 31, 2022 · 1 comment

Comments

@Sirosky
Copy link

Sirosky commented Dec 31, 2022

Godot version

Godot_v4.0-beta10_win64

System information

Windows 11, Vulkan, Intel integrated graphics

Issue description

I've been using resources to serve as a savegame, and resources nested within the Save resource to represent data from the game (e.g., player stats, inventory). However, it appears that when there are variables passed through the _init() function of the nested resources, SubResource, Godot doesn't deserialize the nested resource properly.

For example, you won't be able to access the hp value of the nested resource here.

image

Steps to reproduce

Minimal Reproduction Project

  1. Run project, click save button.
  2. Save button will create a new .tres save resource, and pass a variable through _init() of the nested subresource.
  3. Click load button.
  4. Load button will attempt to read the subresource's hp value, at which point Godot throws an error.

Minimal reproduction project

ResourceFormatLoaderText Bug.zip

@Sirosky Sirosky changed the title ResourceLoader fails to load nested resources saved in .tres files when a value is passed through the _init of such subresource. ResourceLoader fails to load nested resources saved in .tres files when a value is passed through the _init of such nested resource. Dec 31, 2022
@Calinou
Copy link
Member

Calinou commented Dec 31, 2022

Duplicate of #67059, #15866 and/or #30572 (same cause).

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Dec 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants