You said you were often getting the error “array piece can’t expand to more than one value”. This is the problem I was having. So I’m going to show you what someone showed me. It really helped in writing future expressions.
Your second piece of code:
temp = wiggle(10,50);
[temp,temp]
the “wiggle(10,50)” is returning 2 values. A scale value for x and a scale value for y. But your array can’t have more than one value in each piece. What it needs is [1 value, 1 value]. You gave it [2 values, 2 values] or [x & y, x & y]. That’s why it couldn’t work.
So with Dan’s solution:
temp = wiggle(10,50);
[temp[0],temp[0]]
Those zeros in brackets are telling the array that for the variable “temp”, only take the x value. If you wanted it to always take the y scale value for both you could write:
temp = wiggle(10,50);
[temp[1],temp[1]]
[0] is for the x value, [1] for y & [2] for z. So you could also apply this same idea to your other expression as:
[ 100,100, [100+wiggle(0.5,200)[2]] ]
Now the way Dan wrote it is cleaner and easier to work with. But just to illustrate that buy added the [2] to that piece of the array, you are no longer giving it 3 values for one piece of the array. The [2] tells it to use only the z value of what is returned.
Hope this helps.
-S