Sending Text Through A Message

I did it once again, the “Impossible” (meaning people haven’t tried hard enough yet). It’s actually a really simple system that took me about an hour to figure out (could have been faster but I discovered a bug).


In the Messaging Object

Explanation of what it is doing

So what’s happening is that the text is getting Split so it can go into a List Each (The Text Case is just there to make it all uppercase if I wanted to complete the list I would add lowercase, numbers, etc to it). That then goes into a Text List “Find” input to see what letter it was. That then goes into an expression where I add 100 to make each word 3 numbers long (A = 101, Z = 126, this is the key to this system), that expression then gets added to a Text behavior to store those values. It then goes into a List Each (Would have done Text to Number but that created a bug) where it was then sent to the object that reads those values via a Message (Wow).


In the object getting the Message

Explanation of what it is doing

So when this gets the values it adds them to a Number List and all of it is then outputted from a timer set to 0 for a 1 frame delay. Once the list is outputted it goes into a List Each which outputs all the values into a Router set to “Always Increment” (It automatically gets 2 inputs so it starts at 1, unneeded but it looks better). When outputs 2 and 3 are activated they are added to a Text, and when output 1 is activated outputs those values into a To Number which goes into a filter (only needed because the repeater activates 1 at the start), that then goes into One input on a Text List, which then gets added to a Text. And when the List Each is done it puts the Text into a Label. (after each time 1 is activated it resets the stored values)

And then boom! You have an incredible CodeAlpaca trademarked system that turns Text into Numbers and back to Text!


@Samuel_Tomé_PixelPizza in case you wanted an in-depth explanation of how the system works.

If anyone sees any flaws please tell me so I can fix them (Besides having to send a lot of messages because I’m using a List Each in the Messaging object. I would have used a To Number and just converted it in the object getting the message but Flowlab doesn’t like long numbers I guess :confused:

I also discovered this bug so the system is not as clean as I would like.

2 Likes

I would create my own “Bundle Library” for these systems I make, but I’m a little short on games

cough* not having indie, I’m sorry I’m poor (cheap), otherwise, I would support Flowlab more

2 Likes

wait so what is the problem exactly? it looks like it should work to me

2 Likes

It works fine, but it’s not as clean as I would like. (I would prefer to send one message instead of a ton through a List Each)

2 Likes

as in, sometimes it isn’t the right text? or it takes too long
Edit: nvm

2 Likes

It takes a single frame to do it and it gets everything correct, but idk if having a lot of messages sent to it at once could mess it up. I tested it with over 100 letters and it worked fine, it’s just that I want the code itself to be cleaner

2 Likes

so if you wanted to send the whole list as a single number, you would have to designate something to separate each index. For example, if you designate 9:

List: [103,101,111,105]
Number: 103910191119105

The receiver can set it as a text and then split on 9’s
The only problem is that there would be numbers that include 9 like 9,19,29,etc.
One solution I can think of is to just not have any letters on these indexes in the “alphabet” list. Basically create an empty space on every index that would have a 9. That way you will only have a 9 in the sending number to separate indexes.
It’s kind of a stupid work around but it’s the only way to combine a list into a single number that I know of.

3 Likes

I know how to do all that, the problem was when I was sending a large number of numbers over (30) it outputted 1.0311510410510112e+29, and for some reason, I can add that to a Number List/Number behavior and it doesn’t output the numbers but it literally outputs 1.0311510410510112e+29

2 Likes

ohhhhh I get it now.
Welp I don’t think there is any other way to send a whole list through one message…
The best way to do it is how you did it basically, so as long as it works I wouldn’t worry

2 Likes

@JR01 sorry to ping you, but just wondering if you notice any flaws with this system. It works fine when I tested it, but in case you know of any problems that can happen if there are multiple messages that are being sent that would be nice to know.

That’s really cool, though the code seems a lot more complicated than it needs to be

1 Like

You’re limited to the 32bit integer limit,
for sending text specifically, it would be better to use a list global.

3 Likes

List Globals were what I was using before (for the Label bundle).
The problem is that the Globals aren’t directed to individual objects. @JR01

3 Likes

I’m using a List Each because flowlab doesn’t allow me to send a long string of numbers.

The code isn’t more complicated than it needs to be, it’s pretty simple (I had to work around a bug so it’s slightly bigger than I would like). I also only spent about an hour on it so there may be an extra behavior or 2, but not much.

Also, Samuel does this help with your problem?

(responding to multiple people in one post, accidentally clicked reply on your post JR, meant to just click the reply button)

2 Likes

Alright . . . I guess what I mean is there’s a simpler way . . .

For example

Flowlab Game Creator - Send Text Via Message

2 Likes

The system was originally designed for only having to message the object once, otherwise if I knew that flowlab didn’t like large numbers I probably would have just made a system similar to yours.

2 Likes