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"

Random item generation design pattern


I'm working on a (loot) game and want to generate random loots like in Diablo, POE, etc...

I'm currently struggling with the "good" design pattern to adopt to achieve this in blueprints, I almost get it working but I don't think my design choices are that good.

Here is what I've done so far:

  • Actor Blueprint: BP_Item (base item configuration)

  • Actor Blueprint: BP_Weapon (inherit from BP_Item) (base weapon item configuration)

  • Blueprint function library: LIB_Loots (functions to generate random loots)

  • DataTable: DT_ItemsTypes (one handed weapon, potion, shield...)

  • DataTable: DT_ItemsQualities (common, rare, magic...)

  • DataTable: DT_Items (Sword, Great Axe, Health Potion...)

So in my "GenerateLoot" function (from LIB_Loots) I do some stuff to "choose" the loot and then I get the "Blueprint Class" I have to create (BP_Weapon for exemple) and here my problem (for now)

Based on the class's name, I don't know how to Instantiate the objet (don't need to spawn it) I first look at "Create Object" node, but it seems to work only for blueprint inherited from Object class (and I read that you can't use a construct in it ? oO) and my blueprints are inheriting from Actor (here is maybe a mess to start with)

Then I tried to use "Spawn Actor From Class" node, but it seems that I can't use it in my "LIB_Loots" (blueprint function library), either in my Blueprint actors

To "solve" my problem I need Blueprints acting like Object (but with a construct, as I will generate the random attributes in it) but I don't know how to do it.

Finally, maybe my "setup" is in the wrong way (and that's ok), if so do you have any suggestion ?

Thank you for reading !

Product Version: UE 4.12
more ▼

asked Jul 22 '16 at 03:17 PM in Blueprint Scripting

avatar image

1 1 1

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

0 answers: sort voted first
Be the first one to answer this question
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