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"

Procedural Loot Generation

I Wanna add procedural loot generation into containers and into houses etc. I'm using the UMG Inventory tutorial assets. How can i get this done?

Product Version: Not Selected
more ▼

asked Jan 31 '15 at 02:18 AM in Blueprint Scripting

avatar image

222 48 62 79

avatar image dissonanceint Jan 31 '15 at 03:15 AM

That's quite a broad question you are asking. Try to dissect that into smaller bits or try to be more specific. With procedural you mean choosing random loot from a list every time or something more a la Borderlands with random pieces and stats?

avatar image gotgrassct Jan 31 '15 at 05:48 AM

Lets say i have these 'Containers" such as a chest, etc. And lets say i have items wich are INSIDE those "Containers" wich every time you open that container, it shows a list of items u can add to your inventory.

I'd like to know HOW to create these "Containers" that hold "items" wich u can add to your inventory. And on "Event begin play" i would like to RANDOMIZE those items.

Lets say sometimes there is items in those containers and sometimes theres not. Variation.

I'd appreciate if u can help me with this!

avatar image gotgrassct Jan 31 '15 at 05:50 AM

Also, i'm using the UMG Inventory from the "Inventory UI with UMG" tutorial. You can find that project on the launcher in the learn tab.

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

1 answer: sort voted first

I believe you have already asked about the container part so assuming you already have that part done, I'll get to the random loot part.

First, you would create an array variable holding all the classes of loot that can spawn into the container. Then, a bool such as "spawn loot?". In your blueprint graph, set " is spawned?" Using the "random bool" function.

Then, branch using that bool. If it's true, spawn an actor of class and get the class from the loot array using "random integer" as index.

more ▼

answered Jan 31 '15 at 01:00 PM

avatar image

1k 42 28 65

avatar image eXi Jan 31 '15 at 01:40 PM

The general idea is to create a widget that is similar to your inventory but based on the "Inventory" of that chest/container. It is like the container has his own Inventory, but without the Drop and Pickup functions.

I haven't watched the tutorial (no time sorry), but the same way the items are placed in your tutorial, you would spawn them in the Containers inventory.

As dissonanceint already said, you can create an array of classes that hold all your basic items that the chest can spawn. Creating such a bool to prevent the "random" thing to spawn 6 times the same item is optional. You could also count how many items from that specific kind where spawned and limit it to 3 or something.

avatar image gotgrassct Feb 05 '15 at 07:07 AM

You think u can give me a an example?

(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