Error message when played


This isn’t really for anything important but it’s kinda weird (or maybe I just overlooked something). I get an error every time I play this project and I can’t figure out why.
What I do know

If I remove the custom block from the custom block, it works.
If I remove the equation from the if statement (inside the custom block) it works.

7 Likes

maybe the check statement is never true, causing a never ending loop

1 Like

Yeah I think it is the reason. Same error if I change the if statement to 0 = 7. If I change it to 7 = 7 it works. Thanks :blush:! Didn’t know that would cause an error.

3 Likes

How do u add a link to the title like that?

2 Likes

I’m actually not too sure how I did that. This is the first topic I created. I think I just copy and pasted the link into the title or something…

2 Likes

Actually I copy and pasted the link into the title and then deleted it and typed in a new title. Hope that helps?

2 Likes

Actually I can check by editing, won’t actually edit

2 Likes


Try adding a wait seconds (0) above the circled block

2 Likes

Huh… well that works. Do you happen to know why? (Just curious)

2 Likes

Starting the execution of the ability without a set variable takes zero frames.

The check itself also takes zero frames, so it loops endlessly.

1 Like

But Hopscotch can support endless loops though, right? They have the repeat forever loop… So why does this cause an error?

2 Likes

Because it’s a loop that doesn’t let rest of the code continue.

Most blocks in HS execute at 1 per frame. About 60 times a second the Player goes through every object and plays one block from every rule (When) that’s running. But some blocks don’t count and the Player immediately goes on the next block in the same rule. Conditional If blocks are like that. The player immediately goes to the first block in the path, either in the If or the Else. When that first block is the custom ability that itself starts with the Conditional, the loop immediately and endlessly repeats. No other blocks ever get executed after that.

When you add the Wait 0, this is a normal block that takes one frame so the Player continues on to the rest of the objects/rules and doesn’t loop the custom ability until the next frame.

3 Likes

It’s a thing the forum does automatically if your topic contains a link. It works most of the time at least!

4 Likes

The title or actual topic??

4 Likes

The link is being added automatically under the topic title when you paste it. Sorry, I’m a bit confused about what you mean-

3 Likes

dragon girl means is the link under the topic added when there is a link in the title of the topic or just in the topic itself

2 Likes

Yess this <

2 Likes

I think either one should work, but idk :neutral_face:.

2 Likes

Look what happens when you cut the top one out for starters

1 Like