Hello,
I have a Structure.
I would like to get the names of it’s variables to create enum then with the exact same names.
Is it possible?
I believe it could make the workflow better for me.
Many thanks in advance.
Hello,
I have a Structure.
I would like to get the names of it’s variables to create enum then with the exact same names.
Is it possible?
I believe it could make the workflow better for me.
Many thanks in advance.
No, not really. What problem are you trying to solve? how would it make your workflow better?
The best that you could do would be to make an enumeration and instead of explicit member variables, your structure would have an array. Then you would index into that array using the enumeration. And because of some limitation with unreal and blueprint, in your case you’d need two structure. The first would be one that just contained your string->integer map. Then you’d have your structure that had an array of that structure that you’d index into with the enumeration.
Ok got it, thank you for the advice @MagForceSeven. Well, it could help in the future when the game becomes more complex, making it clearer and more obvious with the enum, for example in the case when you need to update a variable in the structure you could just select it from the list of the enum, you know. When there are 100 diffirent variables it would help a lot to be able to choose them from a list.
I wouldn’t be so concerned about that. First, when you access variables in blueprint you already get a list of variables for that when breaking structure pins or using the set member node. Second, if your object has 100’s of variables you should probably be considering how to break things down into smaller parts.
It really won’t be as much of a problem as you think and you should leverage the ways the engine already gives you to access data.
@Nawrot
Yeah, that is exactly what I’ve made,
I made a string - structure map.
Then Inside each structure I’ve made another string - structure map.
This way I’ve achived that functional which I needed. Now I can find each separate map by it’s name.
I believe this is what @MagForceSeven adviced.
Thank you guys.