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"

Creating a SLOT SPECIFIC INVENTORY!!

Hello Everyone,

I have been trying to make this inventory for over two weeks now and want to give up but im dying to get past this stage so I can move on to better aspects of my game.

What I am trying to make is an inventory where I: - Walk to an Item and press a button to pick it up - The item adds to my inventory - The Item changes an Icon on my widget to show it is now active - When I click that newly active button it will attach an item to the socket - When i click a different button that is active it will swap the previos actor placed to the new one

SO let me be specific. I have 4 types of items (Hats, Eyes, Mouths, and Shirts). These Items have 4 different Tabs that the player can select through and click the desired style of Hat, Eyes, Mouths, or Shirts.

Essentially it is similar to how World of Warcraft has their Transmogrification system. The player clicks the active button and gets that item added to the character. If they want a different Hat they click the next one and it then replaces the current one.

My issue is that system. Everything I look up about inventory systems in UE4 always has a "next slot available" system. I have specific buttons I want to be changed as the rest will have blacked silhouettes until the player picks up that item.

I have tried so many ways to get this and nothing has worked. I have a working pick up system that uses a line Trace alt text alt text alt text

This is what I have my inventory widget looking like and how it has tabs and how it looks when something is picked up. The blacked out item is how it looks when nothing has been picked up for that slot. At the moment I have it just reading the inventory and if the String (Name) is equal to the name i typed then it changes the style. It works and im happy buuuuuuutttttttttt... alt text

I cant get anything to spawn and attach to the character socket when a specific button is pressed. Every tutorial I have watched has a button widget that fills the "inventory vertical box." I dont want that. I want to have the buttons placed like I have and say "if you press the tophat button and its active, spawn the tophat on the head socket and if you want to take that off press again." or "if you want to switch this hat for another, press the active button hat you want and it switches them."

So far its taken way too long to get this myself and as a 3D Environment Artist, I am surprised I have gotten this far. I have also placed below a picture of my Base Item BP with the tags for name, and such.

alt text

This inventory isnt really an inventory, its rather a collection system for your character to wear. A WARDROBE one might say.

I Hope this is clear enough for anyone to help me. I know this is a lot to ask but Im so confused on how to get this to work.

Product Version: UE 4.19
Tags:
itempickup.jpg (35.8 kB)
itemtrace.jpg (135.0 kB)
bp-item.jpg (130.0 kB)
inv-active-min.jpg (16.4 kB)
more ▼

asked Mar 17 '18 at 02:27 AM in Blueprint Scripting

avatar image

MarcQuaglia
2 1 2 4

avatar image Nebula Games Inc Mar 17 '18 at 03:42 AM

Hey, so I am a bit confused on which part of this complex system isn't working. Is it just the spawning that's the problem or getting inventory items to be located at specific buttons? Like is the pick up system working exactly how you want? When a top hat is collected it makes button 3 available when a shirt is collected that goes to button 1 etc? Like the buttons are static which is what you want and the issue is that you can't "spawn" the actor after pressing the appropriate button? Or are you having trouble getting the inventory to add a top hat to say slot 3 if slot 1 and 2 haven't been filled?

avatar image Quags Mar 21 '18 at 06:01 PM

I have the button changing already for when the item is picked up. The issue is having it spawn an actor that attaches to my character. When the actor attaches such as the tophat, and you click say - the sombrero, itll switch them. its like a wardrobe. you can change outfits but keep the items. I cant figure out how to get the button actor to attach and then switch. and say you don't want to have the hat, if you click the tophat again it will remove it to nothing..

This is Marc by the way lol

avatar image Nebula Games Inc Mar 21 '18 at 06:45 PM

I think I get it, and I can probably figure out a way to get that functionality for you but might not get back to you till tomorrow or so.

avatar image Quags Mar 21 '18 at 07:51 PM

anything helps. been trying to get this working for weeks lol I appreciate anything you can provide. Also just so you know. each Item blueprint has info like: Text, Thumbnail, Class, and what not. if any of that helps at all

avatar image Nebula Games Inc Mar 22 '18 at 02:41 AM

I made an inventory and I showcase its functionality here. It is very crude but you can get the idea. If this is what you are looking for let me know and I can try and figure out a way to show you how I did it.

https://youtu.be/Jm_XoH27Ex4

avatar image MarcQuaglia Mar 22 '18 at 01:04 PM

Yes that is what im looking for! if you could so kindly help me get that I would really appreciate it!

avatar image Nebula Games Inc Mar 26 '18 at 01:06 AM

So just looking at the first image I can see why you get a second object, you keep creating the widget over and over each time you "open" the widget. So instead of "creating" the widget just toggle the visibility.

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

2 answers: sort voted first

Here is how I did it

https://youtu.be/YxmsMXTphUs

Let me know if anything is confusing.

more ▼

answered Mar 22 '18 at 10:25 PM

avatar image

Nebula Games Inc
5.4k 28 9 15

avatar image MarcQuaglia Mar 25 '18 at 10:27 PM

Hey sorry for the late response. Not sure if you tried but clicking the button once when the i open the inventory works but when i close the inventory and then reopen it and click, it adds a second item to the socket.

I know you made an inventory that is always open but ideally it would be nice to have it open on an input. sorry if this sounds picky..

avatar image Nebula Games Inc Mar 25 '18 at 11:09 PM

Not at all, that's an easy thing to do. I thought I demonstrated in the video but maybe not. My inventory actually opened and closed with a keyboard input. I can show you how to do that in a little bit. Also not sure why it adds 2 items...it should delete the previous one. Post your code and I'll take a look

avatar image MarcQuaglia Mar 26 '18 at 12:27 AM

So these are some of the blueprints i have. I set them up to be like yours almost to the nail ( i have a few details i added myself.) Also not sure why but when the update buttons is called it isnt reading the item i pick up. it gives me this error "Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item2 from function: 'UpdateButtons' from node: Set Is Enabled in graph: UpdateButtons in object: UI_Inventory with description: Accessed None trying to read property CallFunc_Array_Get_Item2"

I have the print strings for debugging but they seem to work so not sure why when the inventory closes and i click a button, instead of destroying the item or replacing it, it addes another. Its like when the inventory closes it forgets my last inventory int or something

alt text alt text alt text alt text alt text

pickupitem.jpg (123.5 kB)
update.jpg (121.8 kB)
avatar image Nebula Games Inc Mar 26 '18 at 01:41 AM

So I am thinking the error is occurring because as I said in the other comment, you are using "Create Widget" each time you open the inventory. So what is happening is you are actually making a new widget each time you "open" the inventory and trying to remove the same "created" widget off the TRUE pathway but you are mixing execution pathways as I show below, this is almost guaranteed to cause errors because you are using an object reference from one pathway as the input object in a separate pathway. Only one of these pathways execute at a time thus you will ALWAYS get an error anytime the "TRUE" pathway is executed as it is dependent on getting a reference from the "FALSE" pathway which was NOT executed. So it will always be null/void and you will get the error you are experiencing.

alt text

inventory-error.jpg (181.2 kB)
avatar image MarcQuaglia Mar 26 '18 at 01:08 PM

AWESOME! that worked. Now the last issue im having is that error message: "Blueprint Runtime Error: Accessed None trying to read property CallFunc_Array_Get_Item2 from function: 'UpdateButtons' from node: Set Is Enabled in graph: UpdateButtons in object: UI_Inventory with description: Accessed None trying to read property CallFunc_Array_Get_Item2"

This appears once i pick up and item and inside the update function. not sure if it cant understand the item index or something..

avatar image Nebula Games Inc Mar 26 '18 at 06:19 PM

Did you change your script to toggle visibility of the widget when you open/ close it instead of creating a new widget? You should create the widget once in begin play or something and save the output as a reference variable. Then when you call "input action inventory" have that set visibility to visible or hidden for the reference widget. That should clear up errors about not finding the right objects for the update button function.

avatar image Nebula Games Inc Mar 26 '18 at 06:23 PM

Post screen shots of how you add your items to the array part of it I think is cut off in the snow pics. You have some extra stuff in your code that I didn't have and something in there may be causing the error. Can you post updated pics and show also the item BP itself and how it communicates with the widget to let it know it got picked up?

avatar image Quags Mar 26 '18 at 08:20 PM

as soon as i get home ill post images of the item BP. I appreciate all the help

avatar image Nebula Games Inc Mar 26 '18 at 08:36 PM

Haha no problem man glad to be of help

avatar image MarcQuaglia Mar 27 '18 at 02:08 AM

Okay so i made a new intractable and just put the same code you got. The other code i had was for highlighting the best intractable i was looking at. Anyways, Im confused how the update function is working if it isnt being called in the UI blueprint. I didnt see it connected anywhere in your video. I know the actor blueprint is sending an event response into it but does that activate it? Heres the item blueprint I have and the update blueprint is the same as yours in the video yet i still get an issue when i interact with the item.. It says the issue is with the SET ENABLE in the update button. I have the widget button i placed set as enable but in the graph it changes to not enabled like you setup. so not sure what the error is trying to say

alt text

bp-itembase.jpg (104.8 kB)
avatar image Nebula Games Inc Mar 27 '18 at 02:23 AM

I am still not clear if you changed the script from creating multiple widgets first. That is why I wanted to see the screen shots of the code like you had before. You gave me like 5 pics in your other post, I wanted to see those again with your new set-up and this item thing.

avatar image Quags Mar 27 '18 at 11:20 PM

There are no other widgets being made... The other code had nothing to do with widgets. it was for highlighting the model with a material using post process volume, which i dont want anymore as overlapping and destroying the item works just fine. The only widgets that exist in my game are HUD and Inventory..

avatar image Nebula Games Inc Mar 27 '18 at 11:45 PM

So if you watch the video @21:45 I talk about how the "Update Buttons" function works. Since all the inventory buttons are default set to "Disabled" when you collect an item is the only time an inventory button may become "Enabled" hence why it is not "called" from the UI. It exists IN the UI but it is "called" from the master item when the player "collects" the item. It has a hard coded index value that is added to the collected items array, that collected items array is what tells the "Update Button" function which buttons should be enabled. So the error you are getting is because you are likely reading a null value for a button. Double check that the array actually contains something when you collect an item and then make sure all your items are properly indexed (that integer variable I created in the master BP MUST be changed in each CHILD BP, you can't leave it at -1 this will cause a null value to be added to the collected item array) Let me know if any of those could be the potential issues.

avatar image MarcQuaglia Mar 28 '18 at 01:46 PM

I GOT IT WORKING! So my issue wasnt the child blueprints or even the widget buttons or anything. What the issue was is that I was creating my inventory widget only when I pressed the key. I had it being made on my character begin play but wasnt calling to the viewport and hiding it. Thats what my issue was because everytime I started the game you would have to open the inventory to get the buttons to even register on the construct. I changed my setup to the same FlipFlop method you had rather than my is inventory open method. Sorry for all this confusion and THANK YOU SO MUCH! for all the help! you are literally a time saver :D

avatar image Nebula Games Inc Mar 28 '18 at 07:37 PM

Haha yea that will do it. Otherwise you are calling a function for a widget that doesn't exist yet. You have to create it before you start collecting anything. Glad it's working as expected now! Let me know if you need help with anything else.

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

TO ALL WHO SEE THIS POST. The video that Nebula Games posted does work!!!!!

Here is the link in case you miss it: https://youtu.be/YxmsMXTphUs

more ▼

answered Mar 28 '18 at 01:47 PM

avatar image

MarcQuaglia
2 1 2 4

(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