How to reference name and value of the structure's child?

I’am added curse/bless mechanic in my game, and, to keep track of every curse I made an structure, where is listed every curse, and thier value. It works by changing “cursesprites” animation number by numbers of child of curse structure, and then applay that animation in the value of the “cursed_angel”, and then, when player accepting thier curses, it changes value of the said curse. However, I cannot reference curse name throughout values, so I have to make this awful “ifelse” parts.
Question being: how do I reference structure by it’s name, and how to pick random name from the structure, without dognail of the sprites.


I tried solution from this thread, but it didn’t worked out

I’am idiot, I misspelled “angel”. However, second question is still up

False unalarm
This crap IS NOT WORKING



CURSE IS CLAIMED, BUT VALUES DIDN’T CHANGE AT ALL

The ToString() isn’t needed. If you try to convert a string to a string it will fail and return 0.

If you’re trying to pick a random curse then you could create an array of curses. Then pick a random curse and use that value as the child name. Since you have a bless and curse then you might want to pick either bless or kiss first and then pick either from a different array or us that result to choose the array from a structure.

Alternatively, you could have an array of structures that contains a child that’s either curse or bless and child that’s its name.

I’m playing with the concept and I’ll post my version.

My variables.

My events

My results

NewText shows the values of the random structure. NewText2 shows the children of Data as Json. I used Data to combine the Curse and Bless lists.

If I understand your needs. This should get you started.

I didn’t clear the text object. So “text” was already there and isn’t a result .

Thank you very much, you a lifesaver!
Even though, I’ll probably stuck with my old random design
Big Hugs