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

Scripted resources unable to serialize/deserialize aka save/load data successfully. #43904

Closed
willnationsdev opened this issue Nov 27, 2020 · 3 comments

Comments

@willnationsdev
Copy link
Contributor

willnationsdev commented Nov 27, 2020

Godot version:
master (ed2f847)

OS/device including version:
Windows 10 Home Edition

Issue description:
Scripted resource's properties don't save. You can create and edit them, but if you attempt to actually save the file, the properties will reset to default values. This does not appear to happen with built-in properties (tested with a GradientTexture resource and it worked fine).

Steps to reproduce:

  1. Create a data.gd Resource-extending script.
# data.gd
extends Resource
@export var count: int
@export var ratio: float
  1. Create a new basic Resource in the Inspector using the new file icon.
  2. Drag and Drop data.gd onto the resource's script property.
  3. Set the count value to 42 and the ratio value to 3.14.
  4. Perform any save operation. The data will reset to 0 / 0.0 respectively.
@willnationsdev
Copy link
Contributor Author

Also note that there are still a huge variety of export types that simply don't work properly yet (not generating the proper Inspector editor for the property). But that's a separate batch of issues.

@mbrlabs
Copy link
Contributor

mbrlabs commented Nov 27, 2020

The same issue applies to non-resource scripts. See #41690.

@willnationsdev
Copy link
Contributor Author

@mbrlabs Oh, then this is probably a duplicate then. Should probably be closed. Thanks!

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

4 participants