Discuss Scratch
- Discussion Forums
- » Bugs and Glitches
- » Something happened to a perfectly functional code
- PearlHikara
- Scratcher
26 posts
Something happened to a perfectly functional code
My browser / operating system: Windows NT 10.0, Chrome 102.0.0.0, No Flash versions detected
Basically, there's a variable which is linked to a sprite and when the value of the variable changes, the costume of the sprite changes.
It worked fine for months until yesterday night when I was testing the game from the beginning (it's quite big at around 50MB when downloaded) in the scratch player. It crashed my laptop, black screen, no cursor, but still on. And I rebooted my laptop to download the file. In the morning I converted the .sb3 file into a .HTML5 file to test run it again and noticed that this script wasn't working. Whenever the value of the variable would increase or decrease, the number would flicker but go back to it's default value and the costume wouldn't even change. It works fine when running the script individually, but when it's run by the click of the green flag it wouldn't work correctly. Also the script that sets it's default value:
Wouldn't work. It would go to some value when the green flag is pressed; but when the script is run it works fine.
I tested this with 3 versions (I download all versions when coding as a way to keep track): the most recent version didn't work, the version before that didn't work, the version that couldn't be related as it was from 2 weeks ago didn't work but a version from 2 months ago did. Did the crash cause some of my files to get partially corrupted or is this a glitch in the Scratch player itself? Either way I need some kind of answers as this is my game's main mechanism and it doesn't work the same without it. And it's not a problem with ScratchAddons as the same thing happens with it disabled.
Oh, and if you turn the variable into a slider, that works fine for some reason.
Basically, there's a variable which is linked to a sprite and when the value of the variable changes, the costume of the sprite changes.
forever(demonstration)
repeat <(costume #) = [variable]>
if <not <(costume #) = [variable]>> then
switch costume to [variable]
end
end
end
It worked fine for months until yesterday night when I was testing the game from the beginning (it's quite big at around 50MB when downloaded) in the scratch player. It crashed my laptop, black screen, no cursor, but still on. And I rebooted my laptop to download the file. In the morning I converted the .sb3 file into a .HTML5 file to test run it again and noticed that this script wasn't working. Whenever the value of the variable would increase or decrease, the number would flicker but go back to it's default value and the costume wouldn't even change. It works fine when running the script individually, but when it's run by the click of the green flag it wouldn't work correctly. Also the script that sets it's default value:
when green flag clicked(demonstration)
go to front
switch costume to [7]
set [variable] to [7]
Wouldn't work. It would go to some value when the green flag is pressed; but when the script is run it works fine.
I tested this with 3 versions (I download all versions when coding as a way to keep track): the most recent version didn't work, the version before that didn't work, the version that couldn't be related as it was from 2 weeks ago didn't work but a version from 2 months ago did. Did the crash cause some of my files to get partially corrupted or is this a glitch in the Scratch player itself? Either way I need some kind of answers as this is my game's main mechanism and it doesn't work the same without it. And it's not a problem with ScratchAddons as the same thing happens with it disabled.
Oh, and if you turn the variable into a slider, that works fine for some reason.
- PearlHikara
- Scratcher
26 posts
Something happened to a perfectly functional code
note the variables in the demonstration are actual variables not just the word “variable” (blog posts are confusing.)
(variable)
- RED-001-alt
- Scratcher
1000+ posts
Something happened to a perfectly functional code
bump
Please don't remove the automatic browser/OS info after making a new Bugs and Glitches forum post, that information really helps a lot!
(unless you are reporting from a different device, then you should specify what device, OS, and browser you have)
Join the Ohio Army!!
Scratch Etiquette
Sratch 2.0 player alternative: https://scratch.mit.edu/discuss/topic/633464/?page=1#post-6649811
Scratch 15th Birthday Celebration: https://youtube.com/watch?v=7Gd_b1mbrxM
Encore event: https://www.youtube.com/watch?v=gI4Gcf-T28g
Please help with this: https://scratch.mit.edu/discuss/topic/606203/
I am actually @RED-001 but I forgot my password, so this account was created
- PearlHikara
- Scratcher
26 posts
Something happened to a perfectly functional code
but the automatic info is there??
- RED-001-alt
- Scratcher
1000+ posts
Something happened to a perfectly functional code
Maybe the variable is going too fast for some reason?
Please don't remove the automatic browser/OS info after making a new Bugs and Glitches forum post, that information really helps a lot!
(unless you are reporting from a different device, then you should specify what device, OS, and browser you have)
Join the Ohio Army!!
Scratch Etiquette
Sratch 2.0 player alternative: https://scratch.mit.edu/discuss/topic/633464/?page=1#post-6649811
Scratch 15th Birthday Celebration: https://youtube.com/watch?v=7Gd_b1mbrxM
Encore event: https://www.youtube.com/watch?v=gI4Gcf-T28g
Please help with this: https://scratch.mit.edu/discuss/topic/606203/
I am actually @RED-001 but I forgot my password, so this account was created
- PearlHikara
- Scratcher
26 posts
Something happened to a perfectly functional code
it worked fine before, it's only now it isn't working in this specific project
- RED-001-alt
- Scratcher
1000+ posts
Something happened to a perfectly functional code
Maybe the other code is making it glitch and go faster, could you please share the project somehow (please do not use Google Drive)?
Please don't remove the automatic browser/OS info after making a new Bugs and Glitches forum post, that information really helps a lot!
(unless you are reporting from a different device, then you should specify what device, OS, and browser you have)
Join the Ohio Army!!
Scratch Etiquette
Sratch 2.0 player alternative: https://scratch.mit.edu/discuss/topic/633464/?page=1#post-6649811
Scratch 15th Birthday Celebration: https://youtube.com/watch?v=7Gd_b1mbrxM
Encore event: https://www.youtube.com/watch?v=gI4Gcf-T28g
Please help with this: https://scratch.mit.edu/discuss/topic/606203/
I am actually @RED-001 but I forgot my password, so this account was created
- PearlHikara
- Scratcher
26 posts
Something happened to a perfectly functional code
Newest version: https://www.mediafire.com/file/tpeiv1wjva49814/Roboska_beta_ver_asdf_2.0.sb3/file
The variable that's broken is called “REPUTATION (main variable)” and the script is in the sprite called “REPUTATION”
The variable that's broken is called “REPUTATION (main variable)” and the script is in the sprite called “REPUTATION”
- PearlHikara
- Scratcher
26 posts
Something happened to a perfectly functional code
so i updated my browser to the newest version and nothing changed. i looked through the scripts to see if i missplaced some code but no, there was no code telling it to keep switching the variable back. i just don't get what went wrong
- CST1229
- Scratcher
1000+ posts
Something happened to a perfectly functional code
(#4)That is RED-001-alt's forum signature, which appears below all their posts.
but the automatic info is there??
This is a signature. It's a piece of text that appears below every post I write. Click here to learn more, including how to make your own.
RIP assets image hosting. 2013?-2023
RIP assets image hosting. 2013?-2023
- PearlHikara
- Scratcher
26 posts
Something happened to a perfectly functional code
(#4)That is RED-001-alt's forum signature, which appears below all their posts.
but the automatic info is there??
yea i figured it out but this bug is really starting to annoy me as it's making test running much harder and i haven't got a definite solution yet
- Discussion Forums
- » Bugs and Glitches
- » Something happened to a perfectly functional code