x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to remove item from inventory when used?

Hi there!

Can't figure out how to remove item from inventory based on item IDs when pressing key. When 0 is pressed, its getting away ID1, but when I press 1, just my ID2 is turning to ID1. Hope someone can help me out..

https://youtu.be/Cpfhq-wrMqo

Thanks a lot! alt text

Product Version: UE 4.21
Tags:
bp-inv-1.png (219.9 kB)
bp-tps.png (140.7 kB)
more ▼

asked Jan 19 '19 at 12:39 AM in Blueprint Scripting

avatar image

emotivarts
3 2 5

avatar image dabs863 Jan 19 '19 at 12:49 AM

Try deleting the item 2 with a different key press just to see if it's delete correctly

avatar image emotivarts Jan 19 '19 at 09:42 AM

Tried, not working :(

avatar image Nebula Games Inc Jan 19 '19 at 03:50 AM

This code is weird. You have a "select" node hooked up to "inventory 1" which you then use to choose which brush texture you have. So by that logic you must have inventory 1 = 2 before you get the "Mana" brush. At inventory 1 = 0 you get a blank brush which would explain why the first time you pick up any item it doesn't register. **notice the first red ball you collect doesn't go to your inventory (no brush is set) Only when you collect the second red ball does an item appear in the inventory. Same thing happens when you clear the inventory of "health" brushes (and presumably inventory 1 then = 0) the first blue ball you pick up doesn't go to inventory because the brush is set based on the inventory 1 item value. This is a really bad way to do you inventory. You need a separate integer variable for your select node. This variable should be set based on the item picked up, "health" sets the variable to 1, "mana" to 2 etc. This code is really bad I am sorry.

avatar image emotivarts Jan 19 '19 at 09:46 AM

Thanks for the feedback, trying a different one!

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hello,

The code you are showing has no mistake. The problem is the way you add and remove item in your inventory. With the code you shown, it is impossible to help you to fix your issue.

more ▼

answered Jan 19 '19 at 01:03 AM

avatar image

bstt
111 1 3 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question