Hello again, haha, no that’s not it, I disconnected that node to plug in the second version to see if it would work that way, but it didn’t change anything, I put an imgur link to the full original function that you saw the other day
I’ve just tested it with prints at every point, and it’s definitely finding the right sub-inventory and item indexes and info, and finding the right path to follow based on if the item is found or not, and stackable or not, but nothing is changing in the ‘Slots’ array of the sub-inventory, so it’s the ‘Add’ and ‘Set Array Elem’ nodes that aren’t doing anything, but the function is still executing as a success.
Hi, I seem to be using a very similar inventory setup as you (I guess realistically it’s a pretty common way of doing it). Out of curiosity, within the section commented “Doesn’t have item, adds to inventory” why are you first getting an element from the inventory array there? Why don’t you just execute the Add node straight off the array there instead of using the GET > Break?
Alternatively, you can use “Set Array Elem” to set a particular element in the array and pass it whatever your item is.
Hi, I’m breaking it because my ‘Inventory’ variable is an array of ‘Sub-Inventory’ structures, rather than an array of items themselves, these sub-inventory structures have the array of ‘Item’ structures in them along with other sub-inventory specific variables. It’s for streamlining making the inventory UI mainly, I want my inventory to be split into categories, such as ‘Weapons’, ‘Equipment’, ‘Consumables’, etc…, and each one of them has a list of items pertaining to that sub-inventory. This way I can set limits on individual sub-inventories, like for example consumables I don’t want an inventory limit, but weapons I would limit to 8 for example, but yeah, in short it’s just because the item location is an array inside another array of structures
And as for the ‘Set Array Elem’, I used that node in the second attempt picture, but it changed nothing. It’s also being used in the part commented “Add quantity if item is stackable and player already has one”, and that one doesn’t do anything either.
I see. I wanted to have separate management of my different types of items as well, but I ended up making different inventories within my main inventory component for that, and it’s working pretty nicely (so, I have arrays for AmmoInventory, PrimaryWeaponInventory, SecondaryWeaponInventory, HealingInventory, etc. It sounds like a headache to manage but it’s not bad at all and I wanted it this way to have full flexibility to re-design the UI for each category any time I want to). My UI is fairly simple too.
Quick question, in that “Get” that you have there from the Inventory array, are you using Get Ref rather than Get Copy? If you’re using Get Copy, you might be adding to that “dummy copy”. Not sure if I’m right on that, just something to look at! https://docs.unrealengine.com/en-US/…opy/index.html
Good night I am new to unreal engine 4 and I made an autosave system and checkpoints in my first level but I go to level 2 I save I exit and load the game and it opens me in level 1 in a random location as I do for the system save and checkpoint work at both levels what steps should I follow