Data structure for multiple barrels in level

Hello,

What would be the best way to setup a system for this…

I have a barrel BP inside a level and it has 3 or 4 different meshes assigned to the main static mesh depending on the damage done to that barrel. So the player damages the barrel for a few seconds and it changes to the second mesh where the barrel is partially broken, and so forth until the barrel is a small broken piece (mesh) on the floor as the final state.

I have multiple barrel BP’s placed on the level and then the player breaks each one of them down to different levels (fully broken, partially broken, not broken). I want to be able to save those states for each barrel so that if the player saves the game and exits, then reloads the game the barrels are in the correct state(mesh) they were in when they exited the game. The barrel BP would have a begin play node that loads it’s number from that data table and sets its integer state to the correct number for that specific barrel.

I was thinking a data table or struct of some kind or maybe an array but I want to make sure I do it right the first time around.

Hope its not too confusing, Thanks!

I was able to figure this out but i had to make it simpler in design but it works perfectly.

I created a string array that would hold the object name of each box that was destroyed. So the player would break down the box until it had the integer count to 3 or 4 depending on the amount of meshes I placed into that box BP, and then the BP would add itself to the array list. When the game loads, the box BP would check to see on event begin play if the string array contains the name of itself (object name). If it does It would set the fully broken down mesh, if not it would stay the same. If I wanted I could also append other data about the box into the string with a special marker like “&” or “%” so then when I look into the array and find my object name inside there I can split the string up and determine the other values that way.

String Array [BoxObjectName1&xyzLocation%MeshCount, BoxObjectName2&xyzLocation%MeshCount,
etc…]