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

#1 2011-03-28 20:56:41

Shin23
Scratcher
Registered: 2011-01-30
Posts: 100+

Variable lists

I'm wondering how to make those variable lists.. I pretty sure that's what they're called. In case their not called variable lists, what I am thinking of is when there are those red ones (not orange). The ones that say things like (add __ to [ ]) and (replace item { } of [ ] With __). I have seen them in projects, and I'm curious on how to make them, what they do, and everything. Thanks!


http://scratch.mit.edu/static/projects/Shin23/1957329_med.png New Super Mario Bros. Scratch! (beta)
PSN: shauthegreat23

Offline

 

#2 2011-03-28 20:58:54

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Variable lists

They are called lists.

It's like a lot of variables in one list, basically.

The blocks are straightforward.

Offline

 

#3 2011-03-28 20:59:33

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Variable lists

They are called Lists...and they are very useful!  Here's a tutorial I made a while back that might be helpful.

http://scratch.mit.edu/projects/Paddle2See/260208

Use the Java viewer or download.  The Flash viewer has some problems I need to look at.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#4 2011-03-28 21:03:22

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Variable lists

People just refer to them as lists.

Go to the variables section and select "Make a List".  Name it, then you have a blank one.

What it does is basically it works as a multi-data variable (a variable that can store more than one value).

A use for it could be having a list called Items, and say when the character is touching a piece of gold you can say "Add "Gold" to Items".  When you find a piece of silver you can add Silver to Items.  You now have two items in one list, which you can't do with a normal variable.
Now you can say "If list Items contains "Gold," then run a certain script.  See this script will only run if you've found gold, maybe it can be used as currency.

Obviously the above example is by no means NOT the only use for lists.  There are very, very many methods of use for them for many, many different purposes.

Last edited by Kileymeister (2011-03-28 21:03:34)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#5 2011-03-28 21:51:05

hdarken
Scratcher
Registered: 2008-06-26
Posts: 1000+

Re: Variable lists

Yeah, there lists. They are helpful and are used to make good projects.


http://i.imgur.com/VskBk.png
http://i.imgur.com/tgxVZ.jpg

Offline

 

#6 2011-03-28 21:52:56

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Variable lists

Here's a good example of a use of lists: http://scratch.mit.edu/projects/kayybee/1646610

Offline

 

#7 2011-03-28 23:40:09

silvershine
Scratcher
Registered: 2010-11-21
Posts: 500+

Re: Variable lists

I think lists can be really good for projects that use a lot of text, like my AI. (see link in sig)

Offline

 

#8 2011-03-29 07:42:17

Shin23
Scratcher
Registered: 2011-01-30
Posts: 100+

Re: Variable lists

Thanks, everyone! Special thanks to Paddle2See for the tutorial and Kileymeister for all the examples.


http://scratch.mit.edu/static/projects/Shin23/1957329_med.png New Super Mario Bros. Scratch! (beta)
PSN: shauthegreat23

Offline

 

#9 2011-03-29 08:15:39

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Variable lists

You can also read more about lists heresmile

Offline

 

#10 2011-03-30 21:13:52

Shin23
Scratcher
Registered: 2011-01-30
Posts: 100+

Re: Variable lists

scimonster wrote:

You can also read more about lists heresmile

Thanks  smile


http://scratch.mit.edu/static/projects/Shin23/1957329_med.png New Super Mario Bros. Scratch! (beta)
PSN: shauthegreat23

Offline

 

Board footer