Discuss Scratch

heileen
Scratcher
3 posts

Buggy Code - Please Help - Thanks :)

I have a problem with my script in “Create a Character”.
At one point you can change the characters hair style.
Clicking the Left arrow will take you to a previous hair style and clicking the Right arrow will take you to the next hair style.
The script was working fine, but after adding another sprite, it stopped the script from working (even though no added coding was done to impact this).
Sometimes if I delete the script and simply add the same script back in it works for about 2 m ins and then stops working again.
What is happening?
DudmasterUltra
Scratcher
100+ posts

Buggy Code - Please Help - Thanks :)

Are you using variables or just next costume?

My Devices
Asus G750JX - 2TB / 16GB RAM / Intel i7 + GeForce GTX 770m / Windows 10
Galaxy S7 Edge - 32GB + 256GB / 4GB RAM / Snapdragon 820 / Android 6.0.1, Stock Unrooted
Galaxy Note 4 - 32GB + 32GB / 3GB RAM / Snapdragon 805 / Android 5.1.1, Stock Unrooted
Google Nexus 9 - 32GB / 2GB RAM / NVIDIA Tegra K1 / Android 6.0.1, Cyanogenmod 13 Rooted
Galaxy Tab S2 - 32GB / 3GB RAM / Exynos 5433 / Android 6.0.1, Stock Rooted + Xposed
Gear Live (Android Wear) - 4GB / 512MB RAM / Snapdragon 400 / Android 6.0.1, Stock Rooted
Fossil Q (Android Wear) - 4GB / 512MB RAM / Intel Atom / Android 6.0.1, Stock
Asus Zenfone 2 - 12GB / 2GB RAM / Intel x86 / Android 6.0.1, Cyanogenmod 13 Rooted
Moto G - 8GB / 1GB RAM / Snapdragon 400 / Android 5.0.2 Stock
(!) Kindle Fire HDX, HD - 32GB / 2GB RAM / Snapdragon 800 / Corrupted operating system
DudmasterUltra
Scratcher
100+ posts

Buggy Code - Please Help - Thanks :)

DudmasterUltra wrote:

Are you using variables or just next costume?

I didn't realize it was shared, sorry. I'm not sure what the problem is, It's working fine for me, no bugs.
My only suggestion is combine all of the arrow scripts into one sprite to clean up.

My Devices
Asus G750JX - 2TB / 16GB RAM / Intel i7 + GeForce GTX 770m / Windows 10
Galaxy S7 Edge - 32GB + 256GB / 4GB RAM / Snapdragon 820 / Android 6.0.1, Stock Unrooted
Galaxy Note 4 - 32GB + 32GB / 3GB RAM / Snapdragon 805 / Android 5.1.1, Stock Unrooted
Google Nexus 9 - 32GB / 2GB RAM / NVIDIA Tegra K1 / Android 6.0.1, Cyanogenmod 13 Rooted
Galaxy Tab S2 - 32GB / 3GB RAM / Exynos 5433 / Android 6.0.1, Stock Rooted + Xposed
Gear Live (Android Wear) - 4GB / 512MB RAM / Snapdragon 400 / Android 6.0.1, Stock Rooted
Fossil Q (Android Wear) - 4GB / 512MB RAM / Intel Atom / Android 6.0.1, Stock
Asus Zenfone 2 - 12GB / 2GB RAM / Intel x86 / Android 6.0.1, Cyanogenmod 13 Rooted
Moto G - 8GB / 1GB RAM / Snapdragon 400 / Android 5.0.2 Stock
(!) Kindle Fire HDX, HD - 32GB / 2GB RAM / Snapdragon 800 / Corrupted operating system
DadOfMrLog
Scratcher
1000+ posts

Buggy Code - Please Help - Thanks :)

Have you thought about the order that your scripts get executed, and how that might affect what happens? - In particular, the broadcast receive scripts in the different sprites.

Can you see what might happen if you have “Hair Selected” set to 1 at the point you broadcast “Hair”? (-as happens if you restart the project after you got past selecting the hair.)

Hint: consider what happens if “Sprite12” starts running its “Hair” receive script before “Button4” starts its “Hair” receive script…

Last edited by DadOfMrLog (April 2, 2014 13:30:14)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

Powered by DjangoBB