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.
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.