Discuss Scratch

SMSARVER
Scratcher
14 posts

Large Lists NOT SAVING!!! i am in need of help

I have been having trouble uploading a large list. The .txt file is 1 megabyte. All i need to do is upload this txt file. The number of list items doesent matter. I have tried many number of list items including: 172800, 864, 480, 360, and 200 but scratch failed to save. I even tried on many different wifi networks and on different computers.

I have been wondering… Does Scratch have a character limit for lists? If anyone knows if there is a limit or how to fix the problem, please tell me.

Thanks,
@SMSARVER

Last edited by SMSARVER (Dec. 9, 2016 00:55:01)

asivi
Scratcher
1000+ posts

Large Lists NOT SAVING!!! i am in need of help

Hi, try with this large text strip
It takes a big text and add every separated word to an item into a list.
I've tried with a big .txt file (~700kb) and it does the job, press the green flag and wait a few seconds until the list is populated.

Last edited by asivi (Dec. 9, 2016 06:34:22)

footsocktoe
Scratcher
1000+ posts

Large Lists NOT SAVING!!! i am in need of help

SMSARVER wrote:

I have been having trouble uploading a large list. The .txt file is 1 megabyte. All i need to do is upload this txt file. The number of list items doesent matter. I have tried many number of list items including: 172800, 864, 480, 360, and 200 but scratch failed to save. I even tried on many different wifi networks and on different computers.

I have been wondering… Does Scratch have a character limit for lists? If anyone knows if there is a limit or how to fix the problem, please tell me.

Thanks,
@SMSARVER


The problem could be your internet connection, or maybe I should say Scratch's internet connection. I have a related issue with large animated GIF files. If they have 20 frames, they upload reliably. If they have 100 frames, they only upload on the first try about half the time. Keep adding frames and it becomes more and more likely that the internet connection will not hold steady long enough to complete the upload. So I never even try to do more than 100 frames at a time.

Why does the 1 meg file have to be uploaded all at once? Could you do it as four 250k files?
TheLogFather
Scratcher
1000+ posts

Large Lists NOT SAVING!!! i am in need of help

Yes, there's a character limit for the script data and it is only about 2.5MBytes – and that includes all variable & list contents.

Unfortunately, there's also a Scratch glitch which means list data gets placed into the script data twice when saved.
(See https://github.com/LLK/scratch-flash/issues/591)

To work around this, I would recommend you place the data into a variable instead, and then have a script which recreates the list contents from that variable when the project is first run.

Oh, but the only way to put so much data into a variable is by first putting it into a list, and then setting the variable to the list. You then must ensure the list is cleared before any time the project saves, so that you don't hit the above limit.

Yeah… it's a bit annoying…

Last edited by TheLogFather (Aug. 21, 2018 18:16:06)

SMSARVER
Scratcher
14 posts

Large Lists NOT SAVING!!! i am in need of help

TheLogFather wrote:

Yes, there's a character limit for the script data and it is only about 2.5MBytes – and that includes all variable & list contents.

Unfortunately, there's also a Scratch glitch which means list data gets placed into the script data twice when saved.
(See https://github.com/LLK/scratch-flash/issues/591)

To work around this, I would recommend you place the data into a variable instead, and then have a script which recreates the list contents from that variable when the project is first run.

Oh, but the only way to put so much data into a variable is by first putting it into a list, and then setting the variable to the list. You then must ensure the list is cleared before any time the project saves, so that you don't hit the above limit.

Yeah… it's a bit annoying…


Thank you so much!
I will try that.
24aniketht
Scratcher
8 posts

Large Lists NOT SAVING!!! i am in need of help

Yeah I have a problem like this too, where I scan pen gifs. 6 frames? You're good. 20 frames? Ifish. 34 frames? Not a chance. I am currently writing a workaround that requires much less data, but I would like to know if there is a workaround. I think the variable I am storing everything in has like 3 million indexes
asivi
Scratcher
1000+ posts

Large Lists NOT SAVING!!! i am in need of help

24aniketht wrote:

Yeah I have a problem like this too, where I scan pen gifs. 6 frames? You're good. 20 frames? Ifish. 34 frames? Not a chance. I am currently writing a workaround that requires much less data, but I would like to know if there is a workaround. I think the variable I am storing everything in has like 3 million indexes

Please do not revive old topics. Thanks.
TheLogFather
Scratcher
1000+ posts

Large Lists NOT SAVING!!! i am in need of help

24aniketht wrote:

Yeah I have a problem like this too, where I scan pen gifs. 6 frames? You're good. 20 frames? Ifish. 34 frames? Not a chance. I am currently writing a workaround that requires much less data, but I would like to know if there is a workaround. I think the variable I am storing everything in has like 3 million indexes
Three million characters in even a single variable is too much (let alone indexes in a list) since the JSON limit is 2.5MBytes.

See my explanation above.

Also, see my workaround above. (You have to encode & compress all your data into a variable, and then expand & extract it from there into your list(s) when the project first starts.)

asivi wrote:

Please do not revive old topics. Thanks.
TBH, I don't think the topic is *that* old (just a month)**, and this remains a serious limitiation with Scratch that is not hard to run into. Also, this thread already contains relevant information about the limitation, as well as how to try to work around it, so it feels like it's useful to have it be more visible when someone else comes across the problem.

–Perhaps it could be moved to Bugs & Glitches, though? (OTOH, it's fairly likely there is already such a thread in there somewhere…?)

EDIT: ** Oh, oops – looks like I'm still stuck in 2017…

Last edited by TheLogFather (Jan. 7, 2018 12:46:10)

asivi
Scratcher
1000+ posts

Large Lists NOT SAVING!!! i am in need of help

LOL! I want to be one year younger too!

If @24aniketht had added something relevant to the subject I would not have said anything.
Greetings.
matthewparkerstas
Scratcher
65 posts

Large Lists NOT SAVING!!! i am in need of help

There is no limit to the length of an item or the amount of items a list can hold, apart from an amount sufficient to crash Scratch. However, you may not be able to save a project online if your list takes too long to upload, because Scratch will return a network error after about 30 seconds. Few lists need to contain that amount of information, but a dictionary of 350,000 English words may fail to save when 250,000 words would succeed. This is due to the list being stored twice in the JSON source.- Scratch Wiki

Powered by DjangoBB