Maps & keys, I’ll have to look into that.
As for an example : I have a datatable of 50 potential characters, for a game, with all their stats & caracteristics.
And I have structs on my main BP, one for each of the 12 characters that make my “active team”, containing their names, current health points, and inventory slots and what they have in it.
And the point I reach is : if I want to transfer 1 inventory item from team_member_8 to team_member_5, from a drag n drop operation located in 1 inventory item BP, and dropping onto team_member_5 widget portrait, it becomes a big mess.
Because I have to reach and cast almost everything, it seems ?
team_member_5 (let’s short it to TM_5) widget portrait can’t have a ref to TM_5 struct, to identify which “real struct” I have to test for inventory, when dropping an item on TM_5 portrait.
So I have to make a whole series of “is this equal ?” checks between “portrait’s display name” and my structs names, casting them all one by one, until I climb back up from TM_5 portrait to TM_5 struct.
(and then check for free inventory slots, to finally be able to transfer the item)
In another langage, I would just have to tell “get me “main BP struct” which variable name is equal to “current drop target portrait’s display name string””, and that would be it.
I wouldn’t have to cast and check the whole 20 structs of my active team members to compare them with portrait’s display name and find the right one.
I got various other cases like that, it’s not about “that one problem”, it’s about finding a better way to program stuff in UE, to avoid all those casting and checking for correspondances.
What I’d like is to understand how can I do that trick of “get this chunk of string to find something else, elsewhere, of another type” that works in other langages ?
Same goes for images, for example.
I used to be able to inject assets source paths like “./my_img_directory/”+character_name+“_”+current_situation+“.png” , in some langages.
Where character_name is just a string or struct name or whatever bits of string I get from somewhere, and “current_situation” might like a number I get from story context, and resulting in providing the angry face avatar of called character, or the smiling face avatar.
But it doesn’t seem possible, in UE5 BP system ?
I’d just like to be able to build names/paths/refs, using other bits, instead of having to cast and check stuff one by one.
As I said : I’m probably super dumb and there’s an easy way to do that, but I can’t seem to find it for now.
And it’s more about a global way of reaching/building stuff in UE5, that I don’t get.