Inventory shopkeeper

Hi guys! I’m new here and I’m a student, can u guys help me with my final year project which is I’ve got problem with Ryan Laley’s tutorial (https://youtu.be/VMOufIAE2q8?si=fHmuSUQjNFolaN8J).




When I buy equipment in the shopkeeper, the number does not increase in the inventory. I didn’t found any solution yet. Help me please. Thank you😫

When you add an item, change the quantity in the Inventory Map?
Add a print string to check.

If so, you need to either report the quantity change to the correct slot, or re-create the entire inventory widget (but this may cause performance issues).

Alternatively, you can create a delegate to which all cell widgets are bind to know when they need to update their data.


I don’t know what to fix :sob:, can you help me with the details? I’m a student and really need some help on this, thank you so much

Add a PrintString to the add item function:


already do it, but it is still not working :disappointed:. What can I do? Do you have any other solution?

This is necessary to see what is happening. Launch PIE and add items to your inventory (several items of the same type). There will be numbers in the upper left corner of the screen. Take a screenshot of these numbers. Do they change when you add items?

Yup, its change for each of the items. But still not appear when i click bought 3 items. The inventory does not increase, it stays at 0. Like this.

This is very strange, the number of items (first digit) does not increase.

Copy the text below and paste it into your blueprint. A new function will appear in it.
Set it instead of your AddToInventory function. Then run it and try to buy 3 items of one type, then 3 items other type. Take a screenshot.

Function.txt (95.5 KB)

I get this result for myself:

image

Do you mean I should remove my ‘AddToInventory’ functions? and replacing with your ‘AddToInventoryTest’? I’m so sorry, I’m still learning to use UE so I don’t know a lot and really really need help :sob:. If yes, Here’s mine.

The quantity does not change even though I already clicked it more than 1 times but is still the same at 0.

Oh, you just didn’t specify how many items you want to add. Can you take a screenshot of where you call the function?

It should be something like this:
image

OMG IT WORKS. THANK YOU SO MUCH PREDALIEN :sob: MAY GOD BLESS U ALWAYS!