Problem is that you can only use str_to_num(A_SG_Marines_3_val) in a function, and other problem is that you can only set an array size with a const.
That's why Bugsy took the problem in the other way, so you build the string from the const integer instead of retrieve the integer from the string.