Cmcginn
(Cmcginn)
September 14, 2020, 9:52pm
1901
harrism76:
Hello, i’m watching their migrating tutorial, does anyone know where the event or function is that reads the players inventory and fills the UI with it? I’m working on a crafting system, i can create a crafting inventory like the inventory component, that seems like the core of all inventory. Fill this crafting inventory with items from the players inventory, scan through it to see what i can build or craft. Then once an item is crafted the item is removed just like how when you right mouse click to use the item, removes from inventory. Seems like similar logic of using an item like eating an apple or bread.
So lets say 4 ferns crafts flour, then apple and flour craft apple fritter, or flour makes bread. I would have to read in the players inventory, add a field to inventory item or item information, for IsUnlocked? bool . Create a data table with an array of required items and the field is unlocked, think i’m almost there but i need to read in the players inventory.
Trying to integrate it with the Talent Tree Builder project.
to get player inventory array, get player controller, cast to inventory player controller, get inventory manager, get player inventory, get inventory. You can make a function in the interface to make it easier in future. Creation/refresh of UI is all done in Iventory manager, which has access to Inventory component which is where your inventory array is.
Hope that helps