If I call a general function and I calculate one of its parameters using a function that has a comma inside of parentheses, ie:
%NumberAsText[ %objects%.Children(Objects,On).s_OnMeans(under).Count ]%
ADRIFT will recognise that the comma is nested inside a second set of brackets and is NOT the end of the parameter.
It evaluates %objects%.Children(Objects,On).s_OnMeans(under).Count as an item function before looking for the "," or "]" that ends the parameter.
BUT if I do exactly the same thing with a USER function, then what actually happens is that ADRIFT simply scans from the "[" until it finds a "," and assumes that is the end of the parameter.
So instead of evaluating the item function it just sends the string "%objects%.Children(Objects" to the user function.
If you put a space after the , when making the User function, does it then work? I've been struggling with this bug too and felt that I had someone gotten around this once, though I still have issues figuring out why some of them fail.