Discuss Scratch

goldfish678
Scratcher
1000+ posts

Creating a list automatically

Could someone link me to a project that has the capability of creating a list automatically? There's a few out there, but I can't seem to find one.
-PRO-
Scratcher
500+ posts

Creating a list automatically

You have to create the list. The sprite cannot create a whole new list.
Braeden5454
Scratcher
500+ posts

Creating a list automatically

Actually, you can make a script that creates a list, but it will be local to the sprite only.
derpmeup
Scratcher
1000+ posts

Creating a list automatically

Braeden5454 wrote:

Actually, you can make a script that creates a list, but it will be local to the sprite only.
Yeah, CodeLegend made a script that actually creates a list. It's in his Infinite Lists project.
-PRO-
Scratcher
500+ posts

Creating a list automatically

Oh. That's cool!
goldfish678
Scratcher
1000+ posts

Creating a list automatically

derpmeup wrote:

Braeden5454 wrote:

Actually, you can make a script that creates a list, but it will be local to the sprite only.
Yeah, CodeLegend made a script that actually creates a list. It's in his Infinite Lists project.
Okay, I'll take a look.
Braeden5454
Scratcher
500+ posts

Creating a list automatically

It takes advantage of the fact that when a list is called on that doesn't exist, scratch will create the var or list.
MoreGamesNow
Scratcher
100+ posts

Creating a list automatically

Braeden5454 wrote:

It takes advantage of the fact that when a list is called on that doesn't exist, scratch will create the var or list.
But you can't access a list with a variable's value, right? How would you do this?

I'm not sure why you'd want to do this, but you might consider making a list of lists (for instance, elements 1-100 are one list, 101-200 are another, etc.)
RPFluffy
Scratcher
1000+ posts

Creating a list automatically

Braeden5454 wrote:

Actually, you can make a script that creates a list, but it will be local to the sprite only.

Correct! It can't do it globally
Thepuzzlegame
Scratcher
1000+ posts

Creating a list automatically

Braeden5454 wrote:

Actually, you can make a script that creates a list, but it will be local to the sprite only.
Unless you put the script which creates the list in the background sprite. Then it becomes a global list.
goldfish678
Scratcher
1000+ posts

Creating a list automatically

The problem is solved here. Closing.

Powered by DjangoBB