To start, all of my work towards my inventory has been based on Ryan Laley’s youtube series the inventory system, and his weighted loot table videos. I have been trying to solve this issue for days but to no avail.
I am trying to create a system where loot randomly spawns inside a container. When I say loot I mean, items that are classes that include all of the information such as Thumbnail, name, isStackable, isConsumable etc. Basically, I want for this loot system to spawn over 1000’s of items in each container throughout the world on beginPlay. Think of Rust’s barrel system or Rust’s medical crates that spawn throughout the world. I also would like it to be highly optimized so I can keep adding items and easily add them to the loot table. Right now, I think I’m in a good spot, I’ve got everything done and all I’d have to do to insert a new item to the loot table is choose the items class, then give it the spawn percentage. This one bug is not allowing me to finish though.
Here is an imgur link to pretty much all of the functions/event graphs that involve this lootTable, if you need anything more such as another function please let me know! For me, I think the problem lies between the functions provided through the imgur link. But someone please double check that. I only say this because, for my inventory system, everything works as intended including picking up items, items showing in inventory with the quantity and thumbnail.
Basically, when I hit play, it will go through all of the print strings I set for development which include (Prep, Calc, Past Choose Loot, and Success) but once I walk over to the container and open its inventory, the inventory is completely empty. Despite being able to hit play and pick up that same item that I am trying to test spawn in the crate. It does show in the inventory as well when I pick it up.
P.S: Ignore the imgur “This is where my problem starts” I now have no clue where my problem is since Prep now works correctly. I have also tried moving around the event InsertLoot to before, after, and on the completed loop in that graph and still no avail. For those wondering, I am not getting any errors through any of my systems which include (Inventory Component, Loot Table, Container, or any blueprint in my game really)