I have 5 arrays created in a function. When I call that function I pass in a "type" with the call (it's the only parameter the function accepts). I want to grab one of the arrays based on that type which is passed in.
So, for example, say I call _get_random_message('closer')
I would want to get the pool_closer
array from within the function.
I have it working, at present, with a match statement (and it works fine) but it's a lot of extra code I'd rather not have in there if I don't have to!
I would like do something like (and I tried this and it didn't work):
var pool_to_use = get("pool_" + str(type))
I have searched and searched to no avail so I was hoping somebody here could help me out with how to get that array based on the passed in variable.
Thanks for any/all help!