Access variable name

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.

Any advice would be appreciated!

1 Like

I can see you’ve had a good attempt at explaining this, but I’m still not quite clear.

Let’s say someone is poisoned. Each turn, the integer ( for the turn ) goes down 1.

And the poison effect is, say, a random number between 0 and 1?

Something like that?