Hi, I’ve got this set up but nothing gets added to the player inventory, I used print strings to figure out exactly what the issue is, and it’s only with the ‘Adds to inventory if you already have one and the item is stackable’ part. The event goes through all the way to the destroy actor node, but if I pick an item up which I don’t have in my inventory, say a medkit, that gets added fine, then I try and pick another one up, that also works fine, so it’s all going through correctly, then I tested it with the item ‘Assault Rifle Ammo’ and it picked it up fine the first time, then the second time when I had it in my inventory the print string read the item as ‘None’. I figured this was because the name had spaces maybe, so I tried it with the item ‘metal’ and it worked fine just like the medkit, then I tried it with ‘Pistol Ammo’ and exactly the same as Assault Rifle Ammo it came up as ‘None’.
I just tested it again and I picked up 3 ‘Assault Rifle Ammo’, the first was added to my inventory, the next two came back as ‘None’ and didn’t get added, then I went over and picked up 3 ‘Metal’, the first one added as ‘Metal’, but the next two came up as ‘Assault Rifle Ammo’, so I tried it again with Pistol Ammo and Medkits and the same thing happened.
Now I just tested it again and I got 3 of each item without spaces in the name, and every one of them behaved like the ones with spaces were, working for the first one but coming up as ‘None’, so it can’t be the names having spaces being the issue, but it’s definitely an issue with the 'Adds to inventory if you already have one and the item is stackable.
Can anyone help please? I don’t understand what’s happening. Bearing in mind I didn’t edit the code at all between tests.
Also I don’t think the ‘Adds a new copy of an item if you have one already and it’s not stackable’ part works either because Maps can only have one row with that name so it can’t add another one with the same item name, I don’t know how to test that though as I don’t know how to use the map variable for the inventory that’s in the character BP, all of this function is in the lootable item BP, and the inventory display would have to be in a widget, so I don’t know how to add all the items from the Map variable to the visible inventory.
Edit: I’ve added a video showing what’s happening, pay attention to the print strings, the quantity in the inventories and what’s happening to the items when you pick them up.
Edit 2: I forgot to link the video, my bad Inventory Help - YouTube