extends BaseResource
class_name PlayerData
@export var username:String :
set(new_value):
if not username:
username = new_value
if not new_value == username:
username = new_value
emit_changed()
save_as_resource()
@export var item_bag:BagResource:
get:
if not item_bag:
item_bag = BagResource.new()
return item_bag
@export var equip_bag:EquipmentResource:
get:
if not equip_bag:
equip_bag = EquipmentResource.new()
return equip_bag
class_name BagItem extends Item
@export var amount: int
And this is my Item Script
extends Resource
class_name Item
@export var id: int
@export var icon: String
@export var name: String
@export var type: String
@export var info: String
@export var stuck_size: int
I don’t understand where it would lead to an error
the other thing it could be is that the .godot folder cache is now not aligned.
you could try running this script which should resave your files.
# script goes through project resaving files in editor resolving invalid UID issues
# open script in editor and run with right-click
@tool
extends EditorScript
var files: Array[String]
func _run() -> void:
files = []
add_files("res://")
for file in files:
print("fix_uid: ",file)
var res = load(file)
ResourceSaver.save(res)
func add_files(dir: String):
for file in DirAccess.get_files_at(dir):
if file.get_extension() == "tscn" or file.get_extension() == "tres" or file.get_extension() == "material":
files.append(dir.path_join(file))
for dr in DirAccess.get_directories_at(dir):
add_files(dir.path_join(dr))
The second option, you could also try deleting the .godot folder and restarting the editor.
Warning
if you do decide to try this option, it could cause you to have to reimport textures if they had custom import settings.