Discuss Scratch

Invisible_Factory
Scratcher
500+ posts

Forever loop only repeats once

My browser / operating system: Windows NT 10.0, Chrome 51.0.2704.79, Flash 23.0 (release 0)

Sometimes I will go to other people's projects and check them out. One thing, though is that it isn't working properly. But the owner can't find the glitch and thinks everything is normal.

So, I click “See inside” to see what was wrong. You know how if a script running and is in progress it glows? Well, I saw a script with a forever loop that didn't glow. Now according to logic, forever goes forever, and it will never stop running. So I wonder, why isn't it glowing? How is the forever loop finished?

This means that the forever loop turned into a
repeatx. . .
(x being undefined, not knowing how many times it repeated)

which defies the purpose of the forever loop. However, it occurs rarely, maybe once a week, and it has never happened on my own project. I have seen this happen twice.

Also, I tried to manually click on the forever loop to make it run, which made the glow appear but disappear just as quickly. I also tried to reload the page, but it didn't do anything. Does anyone know how to fix this glitch/bug?
drmcw
Scratcher
1000+ posts

Forever loop only repeats once

Forever loops can be stopped.
ChatUser2
Scratcher
100+ posts

Forever loop only repeats once

How about this?
forever. . .if...thenstopthis script stops forever loop. . .
stickfiregames
Scratcher
1000+ posts

Forever loop only repeats once

Which project are you talking about?
Invisible_Factory
Scratcher
500+ posts

Forever loop only repeats once

drmcw wrote:

Forever loops can be stopped.
how? I know for a fact putting a “if then” statement that is false inside the forever loop will stop it from functioning, but that was not the case in either of the projects. But
foreverifthen
still should glow because the statement can be made true anytime.

So how can you stop forever loops, without clicking on the stop button or manually stopping it after clicking see inside?
Invisible_Factory
Scratcher
500+ posts

Forever loop only repeats once

stickfiregames wrote:

Which project are you talking about?
I actually don't remember either of their names or links, but the next time I see one I will put it in the OP.
drmcw
Scratcher
1000+ posts

Forever loop only repeats once

Invisible_Factory wrote:

drmcw wrote:

Forever loops can be stopped.
how? I know for a fact putting a “if then” statement that is false inside the forever loop will stop it from functioning, but that was not the case in either of the projects. But
foreverifthen
still should glow because the statement can be made true anytime.

So how can you stop forever loops, without clicking on the stop button or manually stopping it after clicking see inside?
It's what the stop blocks do
stopthis scriptstopallstopother scripts in sprite

There are also other ways dependent upon the hat block that starts the script, the forever block is in.

Last edited by drmcw (Dec. 11, 2016 15:34:52)

Invisible_Factory
Scratcher
500+ posts

Forever loop only repeats once

drmcw wrote:

Invisible_Factory wrote:

drmcw wrote:

Forever loops can be stopped.
how? I know for a fact putting a “if then” statement that is false inside the forever loop will stop it from functioning, but that was not the case in either of the projects. But
foreverifthen
still should glow because the statement can be made true anytime.

So how can you stop forever loops, without clicking on the stop button or manually stopping it after clicking see inside?
It's what the stop blocks do
stopthis scriptstopallstopother scripts in sprite

There are also other ways dependent upon the hat block that starts the script, the forever block is in.
oh. Well, if I find it again I will check.
midknightking
Scratcher
1 post

Forever loop only repeats once

I have the same problem. I can't get my sprite to go on forever.#in python you use for i in range
Morimop
Scratcher
1000+ posts

Forever loop only repeats once

midknightking wrote:

I have the same problem. I can't get my sprite to go on forever.#in python you use for i in range
Don't necropost please.
Peashooter10000
Scratcher
12 posts

Forever loop only repeats once

I have a similar problem in my project, where the if-then-else block always reads false if it reads false once. My code is:
whenclickedforeverifZombie Yscontainsyposition?thenJumpUprepeatuntilnotZombie Yscontainsyposition?ShootelseIdleAbout

Last edited by Peashooter10000 (Oct. 16, 2023 16:57:21)

Peashooter10000
Scratcher
12 posts

Forever loop only repeats once

Turns out my code had a forever block in one of the custom blocks. Oops.
CaptainTrooper
Scratcher
100+ posts

Forever loop only repeats once

Peashooter10000 wrote:

Turns out my code had a forever block in one of the custom blocks. Oops.

Peashooter10000 wrote:

I have a similar problem in my project, where the if-then-else block always reads false if it reads false once. My code is:
whenclickedforeverifZombie Yscontainsyposition?thenJumpUprepeatuntilnotZombie Yscontainsyposition?ShootelseIdleAbout
This forum post was in 2016. Please check the dates next time so you dont necropost by accident.
Also, make a topic separate from others if you have a glitch with scratch and its different from other glitches.

Last edited by CaptainTrooper (Oct. 17, 2023 00:14:11)

Powered by DjangoBB