String Data

Is there an expected date for ‘String’ data types?

E.g. I’m able to update a label with numeric values through the messaging system (message/mailbox), but I’ve found no way to send ‘char/string’ data for GUI output. Maybe i’m missing something obvious…

2020.06.27-21.08

You can make String data for the numbers, but not for letters.
It has to be a number to go through the strings/cables/wires to the next behavior block

Yeah, that’s why I was asking. I would like to use one label for onscreen dialogue, in the same way you could use one label as an onscreen counter.

I think an alternative would be to stack each needed label, and hide all but one with the Alpha setting. I have not tested this, because it feels/sounds clunky and excessive.

1 Like

Yeah, you cant make strings with letters.
The best you could do its add strings of numbers and output the integer into the label.
Like “22” + “22” = 2222

Here’s an unfinished example I started on and never finished, but its shows how to make values into string by using the expression: https://flowlab.io/game/play/1323533

You technically could make a typing machine using 10 to 36 codes for each letter and divide the output into 2 integers in strings with each making a letter… but thats gets very complicated…

@4d5452 “I think an alternative would be to stack each needed label, and hide all but one with the Alpha setting. I have not tested this, because it feels/sounds clunky and excessive.”

I have tested this and it is indeed clumsy and excessive. I have some examples at the end of the first level of Gator Panic https://flowlab.io/game/play/1359018. (it’s in test mode with no collisions right now, so you can coast through the level). I’m slowly refining it into something functional and simple for my games, but it’s been a slog. I’ll probably get it right, just as Grazer drops a “dialog” block. Lol!

JR 01 & todorrobot, thanks for the feedback. I’ll continue to wait :slight_smile:

I remember that @Wizardry had a go at it using animations. But as you said, it gets nasty.
Have a look at his games list, there are several variations. Here is one:
https://flowlab.io/game/play/939947

Life would be so much easier if we could import sprite sheets … sigh

I actually like it the way the Pixly App does it, is quite flexible:
Sprite Sheet import

Speaking of Wizardry’s typing game @TinkerSmit, I took one of hos text examples and coded player controls. https://flowlab.io/game/play/936837

https://youtu.be/c7dtM5TmWxo

Nice @“JR 01” … even with automatic line break :slight_smile: WHOOP WHOOP

Would it have saved filters if you put all characters into one animation and just use the ‘goto’?
Otherwise, love it :slight_smile:

Reminds me @“JR 01” … do you think it would help to have a keyboard behavior option that just outputs the ASCII code every time a key is pressed? Could be an option in the existing one, instead of defining a key …

On occasion it could save a lot of filters :slight_smile:

You would still need the filters to recognize the key press to the object animations

Ah yes @“JR 01” , just realized that the link was not the video, LOL.
For sure you need them for the keyboard input. Brings me back to my ASCII output, a case for @grazer?

BUT, i noticed that in @Wizardry’s demo the text was encoded into a list. Well done, smart, but cumbersome to create it.
If one only needs a text output routine, the text can be decoded itself quite easily, try this:

extract Text

The code used in the expression is:
"ABCDEFGHI".charCodeAt(A)
For sure you replace “ABCDEF…” with whatever text you want. If you subtract 64 from this you get the same character index he was using.
Can be done in the same line for sure:
"MY TEXT HELLO".charCodeAt(A)-64
But I would not do it … don’t forget the special characters, like [Space] = 32 …

Makes sense? Helps? Basically the same @Wizardry did with his list with direct use of the text. Much easier to manage and read I think.

So all you need now are smart blocks that show the character (can now be used as an animation index) and spawn the next letter if needed.

And for each dialog option you only create a new expression block :slight_smile:
Easy Peasy cough

@“JR 01” , that’s neat how the expression block uses “var text = […]”. Is that a form of injection to the back-end code? Wondering what else could be interrupted through the expression block… Also, I guess that brings out another topic; array’s.

Hi @4d5452
All it is is some basic Javascript, the expression block processes it in a very basic manner. Not sure if you can call it ‘injecting’. The Math functions it uses are Javascript ones, I guess that’s why.
But every variable is local to that expression block only (sadly). So as in the Text example you can store lists within it if needed. Here it was as an text array, I used it somewhere else to save level layouts.
It also allows you to create your own IF/THEN equations, search the forum for '‘ternary operator’.

String update … Yeah , I made it to ‘L’ before I lost patience, LOL
game

The text lookup function I mentioned earlier works quite niceley. I added a timer because I like the typewriter effect, see here:
Dialog Test

The single characters are lined up in an animation … what a pain without sprite sheet import … that’s why I had it for today :slight_smile:
The character block itself has not much to do.
char_routine
It shows the relevant letter and drum roll it adds that characters width to the position counter.
YES, CHARACTER KERNING WHOOP WHOOP

For sure not complete yet, is just my test layout. Next steps will be dialog selection, line feed, special characters, etc … ufff
But I like the look of it so far :slight_smile:

whew… got my letters sorted …
Line Feed sorted, now to the rest

If anyone wants to have a play:
https://flowlab.io/game/play/1449156

It types the whole alphabet from A to Z !UPPER CASE
/ is used for a new line
special characters so far only the .

AND if you change the text make sure you keep the
“HOWDY FOLKS./HOW IS LIVE/OUT THERE”.charCodeAt(A)-64 at the end!!!

Whoa! Top notch!

Thanks @todorrobot :slight_smile:
Sad thing, will be obselete once @grazer adds strings and a better message/dialog to Flowlab.

BUT … check it out again, I just added a simple animation, I think it looks even more fun :slight_smile:
So easy to do now, you could make them pulsating, color changing, vibrating, oh the options WHOOP WHOOP
Could be triggered by special symbols in the text.

I still need to clean up the dialog routine, as you might have noticed I pulled the text expression out of it for ease of use.
Any improvement suggestions, please let me know.
And if you have use for the routine, let me know too :slight_smile:

We could have an interactive comic challenge MUAHAHA

Nice
2020.06.27-12.28