For a bit of context:
I’ve created a base class for all of the items in my game. The items can be put in an inventory or dropped on the ground.
I’ve defined all of the properties of the individual items in a UTableData via JSON file.
Each row of the table represent a different item and it’s properties like the spawnable class, inventory item texture, ItemWeight, IsEdible, e.t.c…
My question is this… What is the best time and the best way for the Item actor to pull it’s info from the UDataTable so that it can still be spawnable through through C++ code, and via blueprint, and by click and drag from the editor interface?
Should I put a listener on an “ItemId” property on the item Actor and reinitialize the item whenever that property changes? Or is there a way to pass the id through the constructor and still have it spawnable through the editor interface?
What other options are there? Or what is the recommended way of doing this?
Also, is it possible to have a dropdown of possible item ids from the UTableData so I don’t have to hardcode them on each object instantiated through the editor?