Automating switch on int nodes input

Hi everybody, I usually try to refrain from asking questions unless I’ve spent hours trying to find a solution myself, but this time I’m helpless because I’ve tried several solutions, but they do not seem rational, so I’m asking for your help.

I’m working on an educational project which includes an interactive dictionary of 350+ entries. So, for each of these 350+ int values I need to return a particular string value and render it using “set text”.
I could do it manually, but it doesn’t seem to be a rational way at all. In the attachment you can see what I came up with, and it already is bulky.

I tried using enums, but then again I had to manually connect all the nodes.

Is it possible, using just blueprints, to automate this process and merge two, so to say, table columns where each value from the first column corresponds to a value from the second column?

Phil

Store your strings in an Array and then just remember the index for each string. For instance, here is a table I have where each index’s position corresponds to it’s stored Vector on the map:

So I know if I am pulling 0, it is on the South Pole, and if I pull 9 it is on the North Pole.

Alternatively, you can just store bytes in the array and still make use of some Enums. There are quite a few ways you can use Arrays and switches.

Thanks for the answer, I started studying arrays and their use in blueprints, but I still can’t understand which array functions I should use to assign an index value to a string value?

Set Array Elem is how you say “I want this exact index to have this exact string” and it overwrites whatever was there previously.

Add puts the string at the end of the array.

Insert puts it wherever you want it but bumps the rest of the items in the array behind it down the line( at least I think it does this, I haven’t had a use for it yet so haven’t tested).

Thanks for your reply - figures out that I was asking an incorrect question in the first place - I didn’t really need to set array elements using events - I did it manually while creating these arrays. I just needed to get values out of them and compare them with a dynamically changing integer, so now it works! Just in case there is somebody as ignorant about main programming terms as me, I attached a screenshot of my blueprint. :slight_smile: