This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-07-12 13:57:05

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

INSASANE?!?!.. this will go down on your permanent record!!?!

I don't remember my v1.4 Scratch working like this but I have double checked and.. well.. my mind is kinda blown. Why haven't I seen this mentioned anywhere?!

Currently, Scratch is remembering my variable and list data not only between pressing the red and green buttons, not only between closing and restarting Scratch, but even between completely shutting down and re-booting my pc.

1) I have no idea where this data is being written to but doesn't this basically mean that all this information is accumulating somewhere on my hard drive? Does it ever get freed up to be over-written or is my drive space shrinking a tiny bit every time I use Scratch? Isn't this similar to a memory leak?

2) Wait a minute!?!? If Scratch is supposed to work this way, why didn't I notice it before?? One of my biggest dreams is that in future Scratch versions you could do just this!! Albeit with more functionality like being able to view and more easily edit saved data lol.

Anyone else know what this is all about? I'm like mad and happy all at the same time.  roll


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#2 2010-07-12 14:08:13

icypenguinis
New Scratcher
Registered: 2010-06-22
Posts: 9

Re: INSASANE?!?!.. this will go down on your permanent record!!?!

If you don't reset the variables to 0 or clear the lists at the start of every run of the program, all the data will remain saved along with your project  smile

Offline

 

#3 2010-07-12 14:19:48

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: INSASANE?!?!.. this will go down on your permanent record!!?!

So for an app like my Pacman that uses a big (1008) item list, I could simply write the list, save the app without erasing it, then delete the script block that writes the list and now all that data is permanently stored in my Pacman project file?


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#4 2010-07-12 14:21:44

Wolfie1996
Retired Community Moderator
Registered: 2009-07-08
Posts: 1000+

Re: INSASANE?!?!.. this will go down on your permanent record!!?!

Locomule wrote:

So for an app like my Pacman that uses a big (1008) item list, I could simply write the list, save the app without erasing it, then delete the script block that writes the list and now all that data is permanently stored in my Pacman project file?

Yep - that would work! Unless the list got erased at the end of the script, of course  smile


"...Jargon - the practice of never calling a spade a spade, when you might instead call it a manual earth-restructing implement..." - Bill Bryson, Mother Tongue

Offline

 

#5 2010-07-12 14:35:56

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: INSASANE?!?!.. this will go down on your permanent record!!?!

Whoa.. thanks! Now there will be no "loading" time, and I can't wait to see how much it speeds up my processing cycle by getting rid of that monster chunk of script!! Although I bet that has blown some minds then, people going through other's projects and finding list data being used from a list that is "never made." Hmm, wonder if the list name shows up anyway, guess so.


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#6 2010-07-12 14:54:28

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: INSASANE?!?!.. this will go down on your permanent record!!?!

Yep, the only way it ever disappears is if you don't save it or if you use a script to delete it.
You can just click the (+) next to where it says the length of the script to add a new item, then click on it to write and change it, without a script.

Offline

 

#7 2010-07-12 17:17:08

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: INSASANE?!?!.. this will go down on your permanent record!!?!

That is how things work - it's how many of my projects, such as Scape, work - the level data is stored in a list.

Of course, if the lists end up changing while the project is running, you'll still have to reset it at the end of the script. However, you can make the 1008-item list populate itself faster by duplicating the blocks inside the loop - because the loops actually slow down the project. For example:

change x by 1
change x by 1

will run faster than

repeat 2
  change x by 1
end repeat

That was a key idea in my Pathing AI.

Offline

 

#8 2010-07-12 17:48:14

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: INSASANE?!?!.. this will go down on your permanent record!!?!

Very interesting. I had considered doing some testing cause there are practically endless variations on "is it faster to do it this way or that way" but that is definitely a major tip on the looping. In my case, the map data really only has to be programmed once. Knowing what I know now, it is and will forever more be prefigured and saved into the project so yay that massive program script is deleted and my project is already getting easier to edit, but I'll save that for the right post  smile
Thanks again, I'm learning all kinds of stuff today!


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

Board footer