[advice needed] How would you assign an actor a unique id?

I’m having trouble comparing two sets of arrays by the properties of array items. I think some of this has to do with my attempts at creating ids unique to the location and actor, but not a 100% unique id to the actor. For example, I want to have hex_R0T0 for ‘hex row 0 tile 0’ and not hexInstance01 because the latter will increment in a way I don’t want.

The BP/functions work like this:

  • Hover over a tile > get surrounding tiles location (designations of row and tile, not vector) and put into smallArray. The smallArray belongs to another BP so it is held and casted to outside of the function.
  • Upon Creation, those tiles are checked against largeArray of all tiles currently in the game. If they don’t exist, they are added to a tempArray which outputs to the creation ‘actorBP’ to spawn the BP.
  • If they do exist, they are removed from the smallArray.
  • Next hover over a tile clears the small array for a refresh.

Each created actorBP has been assigned an ‘actor_struct’ with a ‘RT_struct’ which is comprised of two integers used for tile placement. From here, I’ve added for each ‘actor_struct’ a unique ID which is essentially just a conversion of R#T# to the string. examples are R5T5 or R0T-1

During the comparison function, i do this:

ForLoop > small array > ForLoop > largeArray

In the second loop, I compare two strings:
smallArray > get actor_struct item (which is not an instanciated actor, but has a unique id string)
compare against every largeArray item’s property of uniqueID.

I’m unable to do Contains, because I’m comparing a property to a property of an actor.

Unfortunately this has created a situation where the loops quickly get out of hand and crash UE.

My goal here is ultimate to determine:

  • I have an object that I am ready to create at Row0,Tile0 (R0T0).
  • Is there already an actor there?
  • If Yes, remove from array of objects to create.
  • If No, create

.

I have tried making both arrays as a tile designate array, which works a little better. However I’d rather use the large array as an actor array so that in the future I can pluck elements and their properties with them.

Can anyone advise on a way to accomplish this challenge?