The Coder's Mindset

This guide will hopefully show you how to think when designing code. Not following a guide, but making your own code.

So first, you’ll need extensive knowledge of all the devices. You’ll probably want to know about common device systems like player counters. You don’t have to know these though. It just speeds your journey up by not having to scroll through the devices menu each time you need a device that does something. You will also have to know lots of concepts like the back of your hand to get very advanced.

Define and Find a Core Idea

First, you have to define your goal and find different ways to get to the goal. Here is my process for my voting system:

First I want the player to be able to go at their own rate through people. There isn’t a way to display everyone, so I’ll use popups to do it one at a time. So now, I need a way for the system to loop through the players. So we give each player a number and loop through the numbers. This is called using a player id.

Put Padding to Support the Core Idea

So this is the core concept of my guide: Use player ids to loop through the server. Now we need a way to actually implement it. Right now, this is just a sentence, not a device system. So now we need this to convert it into devices. But where do I start? It seems that I can’t do everything at once. Its just very overwhelming. This brings us to the next part:

Start With Slices

So I just started with a system that assumes that we have already have the name finder. Basically, I just made it update the popup. This seems pretty easy, but you’ll see how hard that is at the end.

Fill in The Rest

Next, we have now have to loop through the server. So we’ll now need a player scoped property to see which person the player is currently viewing. I put a block that checks if the player that was broadcast to was really the player we need. If that was the player, then they will set a global property to their name and broadcast on a channel to alert the system that the player has been found. This will update the popup. After this, voting seems pretty easy.

Consider Possible Bugs

This is a very important step! You might have noticed that if 2 people click at the same time, then the properties get mixed up and it all comes crashing down. So that’s why I went back and added a huge block to see if anyone was there.

Consider Ways to Make This more Efficient

So I found a lot of inefficiencies with my system, but at that point, I was too annoyed with the system to actually go in and change it. So here’s some ways to get more efficient systems:

  1. Congruence Cutdown (This is a big one)
    So there are a few characteristics to a channel: Time of broadcast and scope. So if you have a preexisting channel that has the same exact time of broadcast and scope, then you don’t need a new channel. The same is true with triggers and other devices. Triggers have these characteristics: Scope and Function. The function part is not what it is supposed to do. It is what blocks it has, what those do, and what it broadcasts on. If it is exactly the same, then you don’t need an extra of that. (I’m guilty of this).
    There is an extra one for more advanced gims. So say you want to filter out the people that don’t have something. You go into blocks and put if this = this then do this. Well… you can also do this since this also serves the same purpose. This will save you 6 blocks inside the block. So, you can use the activation of the device instead of the if statement. The 2 are congruent as long as the device does not do anything else.

  2. Recommendations please!

12 Likes

Can you add some pictures to the guide to help illustrate? I feel as though this would need pictures because some people get lost without pictures.
(I know, it’s not used to help people code something)

Sorry. Pictures aren’t applicable for this.

1 Like

Nice guide @getrithekd!

1 Like

Thanks!

1 Like

Great job, @getrithekd!

4 Likes

90% of coding is problem solving
9% is pain
1% is actual coding
0% is the how often code works first try

14 Likes

That is so true.

3 Likes

This is a good guide! Nice!

1 Like

What about debugging? Or does that deserve a separate topic in itself?

1 Like

That’s part of the pain. Let’s get back on topic.

2 Likes

@VALUEX, this isn’t blocks either.

1 Like

This is about blocks…kinda. Ok I understand here lol. I’ll remove it.

1 Like

Wow! burmp

1 Like

Bu-Bump

it might be flagged… but I won’t.

What do you mean?

2 Likes

If this hasnt been flagged and has existed a few months it shouldnt be flagged at all X-X
Edit: And why would it be flagged anyway?

3 Likes

I didn’t bump the guide to start people flagging it. It’s a great guide that shouldn’t be flagged at all.

3 Likes

PICTURES ARE veRY POWeRFUL