Hi all, so I set up a whole status effect system for a turn based game using integer variables (duration) to track who has what status. It checks on turn start if duration > 0 and does something, with me hard coding the effect name as a function input for each (poison, burn, etc…) to direct it to the right path.
Problem is, I now need a function which gets a random active effect. So I would make an array with any status integer variables >0 and pull one at random, but then it needs to know which status it is for any subsequent effect. I see how I could make a hacky workaround using a ton of local string variables, but surely there’s a way to tell UE “If this integer variable name (as a string/name) = X, do this, if it is Y, do that” etc… I just can’t for the life of me find it via Google.
Apologies for the comically slow response, some irl things got in my way. I’m circling back to this.
To take another stab at explaining it: I have a bunch of status effects. To determine whether a status is applied I run a function which takes a name (the status to be applied) and does various things to see if the status application was successful. If it succeeds it flips a bool variable. The variable has the name of the status (Burn = TRUE etc…)
I want to then return TRUE if it succeeded. I could go and stick a return node on every single switch item, but what would be easier (and this has come up in other contexts for me as well, hence my wanting to figure this out) would be to say “I have this NAME. Find the variable whose variable name = NAME. If that variable is a bool and is TRUE, then return TRUE.”
Basically the bool variable is a bool, but it also has a name. I want to access the name part of the variable and compare it to a name object.