I don’t know if the question exemplifies it well, but i will try to explain it the better i can.
I am trying to make an inventory system, just to learn how to do it. But in a game is commom to have different types of items, with different data. A weapon for example, must have ammo, that must be stored for each weapon instance in your inventory, so if it had 30 initial ammo, and you shot 15 bullets, it needs to update and store 15 ammo instead of 30.
So i tried doing it with structs, and i made this struct:
All items shoud have these information, but a weapon, for example, should also have ammo . But if i make a map variable to store the item structures, like this one:
It will only accept ST_Item structs. So i don’t know how to store different types of items with different data in this inventory.
If there was a way to store a generic struct reference, like you can make with class, that will accept any class, it would solve my problem, but i don’t know how to do it
yep basically like you’ve posted, i should warn you massive structs are quite buggy in BP when you try to add/remove new elements. just backup your project and exit/reload if you do.
otherwise InstancedStruct works in BP, thats basically what its for since in C++ you can have struct inheritance already