Download

Call random function from a pool

Hello community,

right now I am struggling in resolving my issue. I want to call a random function from a pool of declared functions. For example I have RandomFunction1(), RandomFunction2() and RandomFunction3() declared, so when I enter testrandom in console, one of those three functions should be called randomly. What I thought of is creating a string array, putting the function names in there and get a random int value with Rand(array.length) and finally call it from threre, unfortunately the engine doesnt like to convert array strings into function names. Hope you can help me guys.

PS.: Im looking for a solution to work with unreal engine 2 and 3.

settimer(0.001, false, name(functionstring)); ??

You could also generate a random int, then make a switch statement that calls your functions.

thx, this really helped me. sometimes you think too complicated :3