How would I Create an Inventory System with Blueprints?
I'm a complete noob when it comes to programming or game design.
I intend to create an inventory system in the vein of the STALKER series, it will be limited by weight and item size.
From what little I do understand I will need to create an array then add to it and remove items as well then eventually tie it all to a UI. But I want to get the logic down before I get into that.
I guess my questions are:
1 - Put the inventory in a different class (or Blueprint) of its own. Blueprints are technically equivalent to C++ classes in UE4, so the same Object-Oriented design rules apply here as well.
2 - Your array should contain "inventory items". This will, again, be a new class, which specific items will inherit from.
3 - Hundreds is nowhere near big enough to start considering databases. If you have tens or hundreds of thousands, it might be a different story though.
4 - Create an inventory variable in your player class (that is, a variable of the inventory type you defined in 1). Redirect interactions with objects to that inventory object.
End of the day, what you're asking here is: "how do I handle this or that object"? The answer to that question has been the subject of much debate in the field of object-oriented computer programming. I would strongly recommend against attempting anything too big with Blueprints if you're not familiar (at least to some extent) with Object-Oriented programming. I'd recommend you to learn a bit about it first. Even if you don't want to do that, keep this one rule in mind: your code must represent, as closely as possible, real world objects and their interactions, including their different functionalities.
answered Apr 20 '14 at 08:12 AM
I'm not sure if anyone has linked this yet, but a fellow by the name of Tom Looman has released a two part tutorial on object interaction/basic inventory system. Very much worth the time it takes to walk through it. Hope this helps!
answered Jun 24 '14 at 04:03 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here