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"

Best Way To Make (1) Template Item For Many Unique Items In Game?

I am curious on best way of creating a (1) template item to be picked up in a game, but this item would have many unique meshes and settings? So I could easily drop this template item many times in the level, but then change its mesh and settings so it could be a total different item, but with the same core functionality to be picked up.

Would I use enumerations? Even though their may be 100's of items or is there another way that may be more preferred?


Product Version: Not Selected
more ▼

asked Jul 03 '14 at 02:48 AM in Blueprint Scripting

avatar image

146 32 48 54

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

1 answer: sort voted first

You're talking about Blueprint Inheritance: https://docs.unrealengine.com/latest/INT/Resources/ContentExamples/Blueprints_Advanced/2_5/

Here's the gist of it.

Create a blueprint called BP_Pickup or BP_Item or something generic like that. Put all your item functionality inside that, like inventory handling, score, whatever. Make the generic values like "Score" or "Gold Cost" or "Weight" public variables while you're in there. Give it a blank static mesh component.

Now create a new blueprint that's called like BP_Sword or something. In it's class settings set it's parent class to BP_Item:

alt text

After you've done that, hit compile. Now set the static mesh component to your sword mesh. In the Class Settings you'll have variables for Score, Gold Cost, Weight, etc that you made in BP_Item.

Do the same for BP_TreasureBag, BP_Pistol, BP_Mushroom and the rest of your items. If you need specific behavior for an item (like BP_Mushroom changes psychedelic colors until it's picked up) you can put that in the specific item, otherwise put all generic behavior in BP_Item.

As you master Blueprint Inheritance, you might make children like BP_ShortSword, BP_LaserSword, BP_WoodenSword that all have their own custom behaviors and are all children of BP_Sword (which has the common sword code in it) which is a child of BP_Item (which has the common item code in it).

arent.png (46.9 kB)
more ▼

answered Oct 11 '17 at 01:40 AM

avatar image

151 4 10 11

(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