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 can I remove an icon from my HUD when it is removed from my Inventory?

I'm doing a inventory and I have it working with it collecting and selecting items via buttons and dropping them. but at the moment I'm trying to figure out the best way to remove the items icon out of the inventory HUD after the item is dropped.alt text

this is my dropped blueprint and it works. but at the moment I'm not sure on how to remove the items Icon from the inventory and HUD. because at the moment the inventory is empty but the texture is still in the inventory and displays in the HUD when toggled.

alt text this is the HUD blueprint. to toggle the inventory and show what is selected. is there a way to remove the icon from HUD when item is removed.

Product Version: Not Selected
Tags:
more ▼

asked Jul 28 '14 at 07:21 AM in Blueprint Scripting

avatar image

seandennis
106 18 27 31

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

3 answers: sort voted first

If you use the "event receive draw hud" it should fire every frame. Like that all items will be drawn new every frame which means that as soon as you remove something from the inventory array it shouldn't be drawn inside of your HUD anymore.

What exactly did you try so far and what exactly isn't working?

more ▼

answered Jul 28 '14 at 09:12 PM

avatar image

Erasio
5.9k 291 86 293

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

I've tried to reset the texture for HUD when dropped and it worked but when the item is picked back up or another item it will not show the icon back in the HUD

alt text This the the full HUD Event Graph

alt text This is the Character Event Graph. you can see at the end of the Blueprint I have tried to set the texture2D to remove it. but when the item is picked back up it will not show the icon again in the HUD. Event if I set it in the pickup and add item to Inventory.

At the moment I'm still learning blueprints, and once I get this working my next step is to draw texture simple and add a array of hit boxes and placing the icons in the hit boxes the being able to select from hitbox and drop selected item from inventory.

more ▼

answered Jul 29 '14 at 01:28 AM

avatar image

seandennis
106 18 27 31

avatar image Erasio Jul 29 '14 at 07:07 AM

Oh you shouldn't just set the texture to "none". You should remove the index from your array since you don't check if a texture is none. This will just resolve in one empty field in your inventory which you can't use. Technically an invisible item.

Just give yourself, whatever you need in your inventory class, in the pickup class and add that to the inventory array again.

This will probably fix this problem since I would think it's rather hard to find the slot which you cleared before in this function as you don't save it anywhere.

You can later on add something like position in the inventory (position in the array) or have an array with a fixed size and check which fields are clear and just don't display anything there (minecraft type inventory).

avatar image seandennis Jul 29 '14 at 08:47 AM

I've never played minecraft. I did try remove index but because I have a inventory already set with 50 slots it didn't change. I'll work it out. I have done this so far without any help I'll work it out eventually. thanks for your input

avatar image Erasio Jul 29 '14 at 09:19 AM

Alright. If you use the HUD class and use the "even draw hud" or however it is called exactly, it will be called every frame. Try to keep that in mind and if nothing else helps the "print string" helped me quite often simply outputting some data real quick.

Good luck!

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

I finally got the inventory working. Using Savai Kun tutorial with the Inventory Display with hitboxes. I found that to get the item to be dropped and spawned in World the Item needs to be in Inventory Index 1. Then when I press drop it spawns Item and removes it from Inventory. the only problem that I have now is that after a minute of the items being in Inventory It clears it and there is nothing in the inventory. How Would I stop the Inventory clearing everything out.

alt text Items can be moved to other hitboxes using Savai Kun tutorial.

alt text Item moved to Inventory Index 1 and button pressed to spawn item In world

more ▼

answered Jul 31 '14 at 05:54 AM

avatar image

seandennis
106 18 27 31

(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