Before thinking of any inventory system, I searched a bit on how to store my weapons in UE4.
There was actually at least three possibilities:
- Classes: The more obvious, but it was impossible to get variables out of it without actually spawning them into an actual object.
- Actors Objects: The easiest, but making them impossible to fill in an array beforehand, has to be done at runtime, so useless for an Item Spawner.
- Structs: The most complicated with all the breaking/making stuff, but worked fine… Except that it doesn’t accept Meshes or Textures yet.
My other problem, is that I didn’t wanted to have all those weapons floating in my Content Folders as independent blueprints, I wanted all of them inside arrays for an easier overview.
I actually ended up proceeding this way, as it was required for other things. But in my early prototype everything was stored inside a single Struct containing more Structs. Structception.
This is a very user-friendly method, far more intelligible than the traditional Object/Class blueprints as it involve no CastTo, but way less versatile. Quite nice for a very fast prototyping!