#Help needed with inventory system
1 messages · Page 1 of 1 (latest)
Sure
So I've got a dictionary to just write down what initially is in inventory and how much (more detailed data is from json file)
2nd one is function to update slots visually and its being used only in that 3rd screenshot
function from 3rd screen is autoloaded
Which function(s) are being called when you open/close the inventory menu?
just that if im not wrong
i went ahead and looked at the github repo for that tutorial series to get a better idea of what's going on here, and as far as the duplicating items thing goes it looks like the inventory dictionary in PlayerInventory.gd might not be updating properly when you move stuff around, and so when you open/close the menu again it calls initialize_inventory again, which checks for the items listed in the PlayerInventory.gd script, which seemingly haven't changed, with the updated slots in the inventory menu not correcting themselves either.
if you click on "Remote" on the scene tree while the game is running you'll be able to see all of the nodes currently present in the game, and you can click on them to reveal their properties in the inspector. this should allow you to see whether or not the inventory dictionary in PlayerInventory.gd is actually updating correctly or not
I wouldnt strictly follow/suggest by the github repo because it is somewhat different from what he showed on the video's. So either he did changes between video's that he later didnt show, or he worked on a part 9 that never came out
I'll check on that
Btw that issue didnt occur before latest changes in code
I'll provide screenshots for that in a moment
Okay so I inspected the PlayerInventory node
and it seems to be updating equips dictionary instead of Inventory dictionary
so the problem must be there within the match:
because before recent changes in code it looked a little different and it worked fine
so to be clear
this was modified to add side slots for armor
and as far as I see there are no problems with the part that identifies if a item can fit into these slots
about that tho
something is messed up inside of those matches
so that it skips all the cases and goes straight up to the last, default one
it looked like this before
and for comparison again
and this is from Slot.gd script
do I not understand something about "match" there and how it works?
@ivory dawn Hey so may I still count on for some help with that one from you? Sorry to bother through pings