http://flowlab.io/game/view/936837
Here’s a text demo that prints out “TEXT IN FLOWLAB TEST ABCDEFGHIJ” using an array of integers representing the letters of the alpahabet. Just hit enter and it will print.
This is the exact expression used:
var text = [20, 5, 24, 20, 27, 9, 14, 27, 6, 12, 15, 23, 12, 1, 2, 27, 20, 5, 19, 20, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 5, 24, 20, 27, 9, 14, 27, 6, 12, 15, 23, 12, 1, 2, 27, 20, 5, 19, 20, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 5, 24, 20, 27, 9, 14, 27, 6, 12, 15, 23, 12, 1, 2, 27, 20, 5, 19, 20, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 5, 24, 20, 27, 9, 14, 27, 6, 12, 15, 23, 12, 1, 2, 27, 20, 5, 19, 20, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 5, 24, 20, 27, 9, 14, 27, 6, 12, 15, 23, 12, 1, 2, 27, 20, 5, 19, 20, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 5, 24, 20, 27, 9, 14, 27, 6, 12, 15, 23, 12, 1, 2, 27, 20, 5, 19, 20, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 5, 24, 20, 27, 9, 14, 27, 6, 12, 15, 23, 12, 1, 2, 27, 20, 5, 19, 20, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 20, 5, 24, 20, 27, 9, 14, 27, 6, 12, 15, 23, 12, 1, 2, 27, 20, 5, 19, 20, 27, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; text[a];
var text = [x, x, x, …]; is the array ‘text’ containing integers representing letters of the alphabet.
text[a]; at the end will output the ‘a’ position of ‘text’.
Expressions in flowlab have ‘a’ and ‘b’ inputs, and an evaluation input. It starts with 0 being input to ‘a’, the 0 position of this array is integer “20”. This “20” is saved as “savetext” and a write message is sent to object “font”. font objects receives the write message and use proximity detection into an AND to filter “savetext” and display an animation representing that character, 1=A, 2=B, and so on. When this is done, the writer moved 32 pixels to the right, and does this all over again using incrementing [a] values. Also added linebreaks, when the writer reaches this part it will move start printing on the next line. You can see the second .gif showing a non-rectangular printing field with the linebreaks, it works just fine
What is cool about this is that arrays can hold massive amounts of information compared to everything else in flowlab, for this test I’m using 248 array elements and there’s room for a little more. The average sentence length has around 70 characters so 248 can fit quite a bit. I don’t think it’s very efficient creating and deleting the array with each evaluation, but for dialogue in rpgs or something like that and with a slower printing speed it is probably fine. Something I think will work good is having END triggers like “999” in the array which can tell the program to stop at that point, they can function like periods in sentences, so all you have to do is input the starting point of a particular dialogue and it will print until it reaches the 999.