Block Segmentation

This guide will show you how to save memory by condensing block codes. Basically, instead of using 2 different blocks for 2 different things, you use the same block for 2 different things and set a property to run the right blockcode.

So to do this, make a number property and make it broadcast on a channel. The channel can be whatever you want, but I’ll call it “segment” to make this guide clearer. Next make a trigger or a block in any device. What matters is that the block runs on the channel “segment” (your channel name). Add this to the block. Remember to change the property name to the property you’re using.

Add as many else-ifs as cases as you need.

To use this, you need to set the property using counter arrays. The number specifies which portion runs.

11 Likes

i am ashamed to say that i never thought of this

3 Likes

Very useful! Also: miniguide/psa?

There really is no difference between miniguides and guides other than the length, which isn’t really that important to point out to other users.

1 Like

This seems like a quality of life addition to block code skills. Could you concatenate this, or would it depend on the interior of the If-then blocks?

You can also do this with the text block that joins text together
(I forgor the name :/)

What do you want to concatenate? And @JohanGim could you show me how you can use the create text block to make 1 block have multiple functions?

1 Like

I was thinking about concatenating the game checking for what the property is equal to, but that would also require a concatenated output (what the block code does after checking the properties amount).

What are you talking about man

You said that you could also use the create text with block, and I’m asking if that u how you can use that to make this.

1 Like

Oh Yeah,
you can use the broadcast on channel to do stuff like this to filter out channels:
Screenshot (2)

1 Like

I don’t get what you’re saying. Could you clarify it?

2 Likes

isn’t that what concatenation is?

Give me a few hours to get back home so I can take screenshots of my idea.

3 Likes

i have been doing this for a while

why are there no guides tho
people seem to do every possible guide