Discuss Scratch

ajlim0403
Scratcher
54 posts

Script not working when run without screen refresh

Reposted on 2nd message because the message didn't work here

Last edited by ajlim0403 (Aug. 9, 2022 04:19:15)

ajlim0403
Scratcher
54 posts

Script not working when run without screen refresh

Okay for some reason the whole message is not showing above. Repost here:

Hey, all, I have a problem. I'm making a Pokedex project and want to add a “Search by Type” filter. The input is not added yet but is controlled by the variable “TypeSearch”. I made a script where it goes through the list “Showing Pokemon” and deletes Pokemon that don't have the type mentioned in “TypeSearch” (Types are all recorded in the list “Pokemon Types”. The script works perfectly, but when I turn on “run without screen refresh” the list doesn't change at all.

Link to project is https://scratch.mit.edu/projects/690925167/editor/. It takes a bit of time to load. The script is located at the sprite “List” and custom block is “Type Search”. I added a comment to the script so it is easier to find.

Thanks in advance

Last edited by ajlim0403 (Aug. 9, 2022 04:18:49)

ajlim0403
Scratcher
54 posts

Script not working when run without screen refresh

Bump
legendary34678
Scratcher
1000+ posts

Script not working when run without screen refresh

Oh, wow. I can't imagine how long it must have taken you to compile all of that data! Anyways, your problem. Sometimes Scratch has issues when running scripts that alter variables or lists without screen refresh (such as trying to use a clone ID and cloning without screen refresh). At least that's what I personally have experienced. Do you think your code will work without screen refresh?
deck26
Scratcher
1000+ posts

Script not working when run without screen refresh

Custom blocks with no screen refresh have to complete within a specified short time or will lag horribly. Perhaps your custom block is just taking too long to use the option. It can be worth trying to split large tasks up so, for example, instead of processing a list of 10000 items you handle 500 or 1000 items in each call and make multiple calls.
ajlim0403
Scratcher
54 posts

Script not working when run without screen refresh

Okay, thanks for the help. I'll try it out.

Powered by DjangoBB