Are there any tricks for arrays?

I am making an inventory system for an RPG. I have it setup that when you equip an item it adjusts your stats accordingly. Each items stats are stored into an array so that I can subtract those values if you pickup something else.

I have two pieces of inventory stored at array 0 and 1. For each item I have to use the GET function and then send it into my StoredStat Struct. Right now its pretty tedious because I have to pull each stat individually and type get.
If there was a way to pull all the stats at once and hit GET and get them all, that would speed things up. I plan on adding a few more slots of inventory so this will get even more tedious because I will have to do all of the stats each several times. Anyone have any advice on arrays? Is this just how it is? Or is there something else? Thanks!

Hey VigeoJames (cool name btw),

If I’m understanding your issue correctly you need to call the same function for each individual item to calculate stats accordingly. There is this super cool feature I mistakenly found when creating arrays. If you make a Class Blueprint into an array, and then pick from the array. You can actually call a function for that class for each item within the array. So in my example, I have agents that follow a leader around. I need to constantly updates the bots position. So to that, I call a command they all share called Update Position. Then this calls it for each agent within the array. Pretty neat function, and with some changes on your end. I think you can maximize the possibilities.

Let me know if this is what you’re looking for, if not I can continue to help till its resolved. :slight_smile:


Hey SilentX

What you have shown me is a neat trick but I am not sure if thats what I need to do. I have made a video for you so I can better explain what my issue is. Thanks again.