expressobits / inventory-system

Modular inventory system for godot 4 with nodes, compatible with multiplayer, separate logic from the UI, Using items as separate resources.
MIT License
459 stars 31 forks source link

linked arrays(categories) and dictionaries(properties) in item resources #56

Closed Lodugh closed 10 months ago

Lodugh commented 1 year ago

Seems like the problem doesnt just come from newly created items. Its just super strange.. To reproduce it just open the demo reset all categories to none, reload the project and then all categories arrays should be linked. For me it looks like whenever a dictionary or array in the item editor is set to the global standard value of the custom resource(no idea why this even exists), it will be synchronized with it on the next load(reloading project). However this doesnt happen when you edit the resource directly in the inspector. I hope this makes sense to you but thats how I understand the issue.. Tried a ton of stuff like saving with certain flags or duplicating with "deep = true" but nothing actually changes that behaviour.

My last idea was that the issue might have to do something with the items being saved and edited inside of an array. I 'll keep looking into it but maybe you got an idea as well?

Lodugh commented 1 year ago

Should be fixed with this: https://github.com/expressobits/inventory-system/pull/57

scriptsengineer commented 1 year ago

I intend to fix this before checking this bug, it seems to me that things might be linked. #58

scriptsengineer commented 1 year ago

After looking it over I see that resolving your PR is what we need right now, I really believe there is a workaround for this issue in edits via editor and I also believe it has to do with the fact that array and dictionaries edits do not call the method" set" of the variable.

I'll add your PR to master, but at another time I intend to investigate this further.

scriptsengineer commented 10 months ago

Fixed