Unfortunately there’s no way (that I know of) of filtering an Array without running through all array items with a loop and checking if a specific property of those items (Rune Name) matches the text your script has access to.
I say “there’s no way (that I know of)” because array objects don’t usually know how to interpret the items that are stored withing them. Some more complex type of object would be capable of doing so (like a Map), but arrays only know information about the array itself, like the number of items, the first and last item, etc.
Now, if you need to specifically filter something out of a collection with a specific value at hand I would consider using DataTables instead of arrays.
DataTables can be built on top of Structs and filtered based on a given key/row name. You could make the row name be the rune name itself and, whenever you need it, just get the whole struct out of the DataTable with the Key/Row Name information that would be equal to your rune name.
There’s this video from Unreal Fest that explains a lot about using DataTables in Unreal but they are very straight forward.
Hope this helps.
Thanks for the answer, but in this case datatables are not suitable for me, because their filling cannot be changed in the game, and I choose runes from my inventory, the content of which can be changed by the player himself, so I use a component with a variable of the array type of structures. It seems that there are no more options, except to iterate over each element of the array.
I made this variant of solution, but I want to print the only one example of each rune in my inventory. So is I will print it on foreach loop - it would printing every rune in my inventory, even if there are duplicates.
So the only one solution in this case I can see - to make a temporary array of name type and foreach iteration of my inventory runes - check if TempArray already contains this rune name. If it contains - skip iteration (do nothing), if not - add new rune name to temp array:
Sorry, that’s my mistake. I don’t need subcategories, I need rune names. I have four runes in my inventory: Nef, Sha, Aum, Nef. Rune Nef occurs here twice, accordingly, if I display the name of the rune on the screen at each iteration, then I will get the same four runes on the screen. and I need only unique rune names to be displayed, no duplicates. That is, the result should be as follows: Nef, Sha, Aum. In other words, runes with the same names should be combined into one.