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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Slot based inventory that does NOT depend on a whole bunch of widgets and umg elements?

Hey all I'm trying to make a slot based inventory that would allow the player to have options on what to do with items when you select them.

Problem; every inventory system tutorial I find wants to either use really specific numbers to make things work or use a fuckton of widgets. I'd rather just have all inventory functions centered in one hud and one bp.

So from what I can find it seems like this is something I have to figure out myself, so if anyone could point me in the right direction to any of the problems I will list below that would be amazing.

Allow actors to pick up an object(which is just getting added to inventory)

Actually have items get added to the inventory with stacking, weight, proper quantity etc..

Have a menu pop up on mouse location when you click the object in your inventory.

Functionalities such as, ability to move objects slots with mouse, and functions to fill the menu pop up. (Remove item, equip, use, etc...)

If anyone could point em in the right direction to get this setup that would be great! I already have an idea of how to do a lot of this but me being super fucking new, I'm more then sure it's gonna be tedious and full of errors ant not very efficient.

Thanc.

All the tuts I find usually want to make an inventory hud, then the slot widgets, then add them based if they have something. I'd rather just have the inventory and slots already there and just show info if they are full. That is where I'm running into problems cause any problem I have isn't fixable by looking at the tut since they are doing it different from me.

Product Version: UE 4.21
Tags:
more ▼

asked Apr 24 '19 at 05:12 PM in Blueprint Scripting

avatar image

PerCat
30 1 3 7

avatar image lkav Apr 24 '19 at 05:52 PM

what you need is an inventory widget with a grid and the buttons you need and a second widget (subwidget) which is basically your items. I think with those two you got what you need. The subwidget can be used for all kind of items.

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

1 answer: sort voted first

Slot based inventory that does NOT depend on a whole bunch of widgets and umg elements?

Just to save you time researching. It cannot be done and should not be done. Using custom widgets is the most powerful feature of the UMG, by trying to cram everything into a single blueprint you'll be shooting yourself in the foot. Modularity and code reusability are key. It's also about performance, user experience, overcoming UMG's limitations (not talking about Slate here) and, most important of all, maintenance.

Admittedly, inventories are far from easy to code so:

me being super fucking new

...is a valid reason for struggle. Perhaps you should consider breaking it into small elements and work on them one-by-one, as you go.

I'd rather just have the inventory and slots already there and just show info if they are full. That is where I'm running into problems cause any problem I have isn't fixable by looking at the tut since they are doing it different from me.

Interestingly enough, this is the way to do it, actually - your way. Notice how you said you want the slots to be already there, indicating you need more widgets (slots) rather than less widgets; pretty much negating what you stated in the topic.


TL;DR - unfortunately, you will need bunches of widgets to pull it off. A fully-featured moderately complex inventory is a rat's nest of wires, Event Dispatchers and Interfaces all spread unevenly across multiple blueprints (some of them cannot even be widgets since they do not Tick offscreen and are prone to Garbage Collection and also get destroyed when transitioning from level to level.

more ▼

answered Apr 25 '19 at 06:46 AM

avatar image

Everynone
14.7k 76 25 61

(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