Pickable Items, the best solution

Hey all!

Thank you for clicking, I am new to unreal engine but I am learning fast, and really enjoying it. I have a question regarding pickable items (Meaning items the player can pick up)

I have an inventory system working and have created an actor that can be picked up and used by the player to affect their health status/Mana status. All of the details for this actor are able to be modified in the details panel within the editor (Static mesh, inventory image, examine info/pickup text/action text, and variables created for the amount of health or mana to add) etc.

For making other items with similar effects (Other consumable items), would it make sense to create another actor for each, or use the same base item but change the inventory image, static mesh, examine info and variables etc within the editor? (For instance a meat item and a mana potion from the same actor, but modified variables in the editor for each instance so that one restores health and one restores mana)

If anyone answers, could you please also include “why” one way is better?

Thanks in advance,
.

What you ask can be done in many ways, the way i would personally do it is by making a base item with all the functions and variables for everything pickable, than i would make a new class derived from the base one for consumables and do more specific functions like drinking or eating.

This way you would have more control over your items without breaking too much later on.

So the hierarchy would look something like this:



PickableItem_BP - Consumables_BP  - Food_BP
                                  - Drink_BP
                                  - Potions_BP
                - Weapons_BP      - Sword_BP
                                  - Mace_BP
                                  - Axe_BP


What I was asking was more in regards to each specific items. That post was helpful though, thanks a lot!

For clarification, my Food BP item, would I make a new item based off that for EACH DIFFERENT food item? Or would I use the same Food_BP and modify the mesh/inventory image ETC within the editor for each instance in my world?

Many thanks

You should create a new blueprint child of Food_BP called Steak, for example, change the variables how ever you like, icons, values, etc and place how many you wish in the world.

No, in reply to your second comment just a moment ago. You would not need to if you provided ample support.

The base item may define an event for using the item, the inheriting items would overwrite that and do additional work. A food item would have different variables than a mana item, but steak would be the same item as pork.

If you have a small amount of different items, like let’s say you only have steak, pork, and potatoes as foods and no more, then it would be fine to make a new item for each, to make placing them simpler. Even if you have 300 food items you can still do this, but there’s a point where the amount of assets you’re using may become high enough that the game takes a long time to load, and require more resources. If you hit that point you may consider using a base item and modifying properties.

Depending on the type of game, for example survival-style, you could have an object for Raw_Meat_BP, Cooked_Meat_BP, Raw_Vegi_BP, Cooked_Vegi_BP, etc. Then you’d have more options to choose from, which automatically fill in some of the information you’d need to manually.

Thanks to you both, you’ve been a great help :slight_smile: