Use "Boolean to (0,1)". You can put it inside the loop or outside converting whole Boolean array in numeric array
Bool to (0,1) takes care of the Boolean to 0,1 conversion.
Building an array in a while loop can be done in several ways, depending on your needs.
1) If the array is needed when the loop is done, wire the scalar Boolean through the while loop. Right click the terminal and set tunnel mode to indexing. The output of the loop will be an array.
2) If you require previous array elements in new loop iterations, create a shift register with an empty array constant wired to it. Use Build Array to prepend or append elements to it.