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

#1 2010-03-12 03:07:45

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Mesh - how to get it, use it, and program with its features

Mesh is a way of making different Scratch programs interact - even if they're on different computers.

Before we start: Scratch Wiki links are here! Use them when you want to look something up.

Build Your Own Blocks (BYOB)
Panther
([ ] sensor value)
System Browser
Shift-clicking the R
Mesh (as if you need that article, a Mesh guide is right here and the article was based on this anyway)


Contents
How to get Mesh
How to host and join Mesh sessions
New features that Mesh gives you
Examples of programming with Mesh features
Panther's Mesh blocks


How to get Mesh

The easy way: Download Jens's and bharvey's Build your own blocks (BYOB) - it comes with Mesh, available nice and easily.
The hard way: You edit Scratch's System Browser to make Mesh available. Here's how (it's a bit complicated, so there are pictures):

1. Shift-click the upper part of the R in the Scratch logo. (Some people just say the R, but only the upper part works.)

http://img227.imageshack.us/img227/3852/344meshguidepicture1shi.png

2. Select "turn fill screen off".
3. You will now have a white area at the bottom and right side of the screen. Click on the white area and select "open...".
4. Now select "browser".
5. Now you've opened the System Browser! In this place you can edit Scratch (see here for more stuff with the System Browser). Anyway: Go to Scratch-UI-Panes - ScratchFrameMorph - menu/button actions - addServerCommandsTo: . (click for full size)

http://img294.imageshack.us/img294/3599/76meshguidepicture5thes.png

6. Look down, and edit the "t2 ← true" to "t2 ← false".

http://img19.imageshack.us/img19/4559/77meshguidepicture6true.png

7. Right-click and select "accept".
8. Enter in your initials (you can fake it, it doesn't matter) and click "accept".
9. Exit the System Browser.
10. Shift-click the R and select "turn fill screen on".

If you don't want to go through the process every time you want to use Mesh, you can save the System Browser so Mesh will stay available - Shift-click the R again and select "save image for end-user".

If you don't want Mesh anymore, just change the 'false' back to 'true'.


How to host and join Mesh sessions

(Note that Mesh sessions will only work between Scratch programs on a local network - for a larger range, use a program like Hamachi.)

A Scratch program that has Mesh available on it looks just like the un-edited Scratch program. But there's Mesh hidden somewhere!

• With modified Scratch, Shift-click Share to get the Mesh buttons.
• With BYOB, normally click Share to get the Mesh buttons.
• With Panther, simply click the Mesh 'tab' to get the Mesh buttons.

http://img11.imageshack.us/img11/5997/78meshguidepicture7host.png

Ooh! Mesh stuff!

• Host Mesh lets you host a Mesh session.
• Join Mesh lets you join a Mesh session.

To host a Mesh session:
1. Click Host Mesh.
2. Done! Your IP address will show up - you'll see why in a bit.

To join a Mesh session:
1. Click Join Mesh.
2. Enter in the IP address of the computer that is hosting the Mesh session.

What if you want to join a Mesh session, but the person hosting the Mesh session forgot to tell you the IP address, and he/she forgot what the IP address is? He/she Shift-clicks the Share button and selects "Show IP address". The IP address will pop up like before.

A Mesh session can have more than two Scratch programs connected at once - there's no limit! All Scratch programs have to connect to the same IP though.


New features that Mesh gives you

Programming things with Mesh is (almost) the same as with the ordinary Scratch program - after all, if you're not in a Mesh session it's the same, right? But when you're in a Mesh session, things get slightly different:
• Broadcasts are received on all Scratch programs.
• You can use each other's variables.

If you create a new broadcast on one Scratch program, it won't be made in the other. You have to make the broadcast on both Scratch programs.

To use variables from other Scratch programs, you don't find them at the Variables section - instead, you have to use the ([ ] sensor value) block. It's near the bottom in Sensing. To use it, simply select the variable from the drop-down menu - in a Mesh session, the variables from all connected Scratch programs will appear on the drop-down menu!

That's all that's different with programming in Mesh - program projects the same way, but design it for multiple people, and don't forget the broadcasts and variables!


Examples of programming with Mesh features
Programming with Mesh features can be simple for some, but tricky for others. Here are the basics of programming with Mesh features.

Communicating with broadcasts
This is so easy. Create a broadcast on all Scratch programs (it has to be the exact same name!). Have one Scratch program send the broadcast (use the [broadcast [ ]] block), and a different one wait for it to be received (use the [when I receive [ ]) block, but you can also use <[ ] received?> if you put it in the source code or are using Panther). It works! Use it for communicating between Scratch programs.
For example, in multiplayer battle games, the health bars must be the same on each Scratch program. Therefore, when a health bar changes on one Scratch program, it must send a broadcast to the other Scratch program telling it to change its health bars.

Communicating with variables
This is just as easy. Use the ([ ] sensor value) Sensing block (in a Mesh session it'll show all variables from all Scratch programs) and select the variable you want. Done! There's your variable. Use it as you normally do.
For example, in a multiplayer game: If you want to 'read' a score from a different Scratch program, you can just use that block mentioned above to get the score (if the score is in a variable).


Panther's Mesh blocks
sparks (one of Panther's developers) said that people often ask what Panther's Mesh blocks do... they look pretty straightforward to me, but I'll put it in here anyway.

• [host mesh] - Creates a Mesh session with its Panther program as the host. It does it for you!
• <hosting mesh?> - If its Panther program is hosting Mesh, it reports true; if it's not, it reports false.
• [join mesh [ ]] - Connects to a Mesh session that's being hosted by the given IP address. Of course, if the IP isn't hosting a Mesh session, the block won't work.
• [leave mesh] - If its Panther program is in a Mesh session, the block makes it leave.
• (mesh IP address) - Reports the IP address that people will use if they want to connect to a Mesh session that the block's Panther program is using.


Hope this helps you - and have fun with Mesh!
Jonathanpb

Last edited by Jonathanpb (2011-02-08 19:27:38)


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#2 2010-03-12 07:15:51

The-Whiz
Scratcher
Registered: 2007-07-09
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Really nice tutorial...

Offline

 

#3 2010-03-12 08:57:52

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

For some reason I don't get the "host" and "join" mesh options...


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#4 2010-03-12 09:20:25

Bopitman99
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Mesh - how to get it, use it, and program with its features

Thanks, this really helped  smile


http://img717.imageshack.us/img717/548/internetsimage.png
     http://internetometer.com/image/9678.png                                                               Don't Feed The Trolls!!!  big_smile

Offline

 

#5 2010-03-12 12:27:06

RicoSuave
Scratcher
Registered: 2009-10-06
Posts: 1

Re: Mesh - how to get it, use it, and program with its features

It just crashes

Offline

 

#6 2010-03-12 12:34:55

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Nice tutorial.  smile


I'm graduating HS this April and going to college in the Fall.

Offline

 

#7 2010-03-12 14:26:25

Bopitman99
Scratcher
Registered: 2008-12-15
Posts: 500+

Re: Mesh - how to get it, use it, and program with its features

juststickman wrote:

For some reason I don't get the "host" and "join" mesh options...

Did you hold shift while pressing 'share'? Cos I had this problem untill I realised I had to do that  tongue


http://img717.imageshack.us/img717/548/internetsimage.png
     http://internetometer.com/image/9678.png                                                               Don't Feed The Trolls!!!  big_smile

Offline

 

#8 2010-03-12 20:28:53

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

juststickman wrote:

For some reason I don't get the "host" and "join" mesh options...

You're supposed to Shift-click "Share". (That is in the guide - you probably missed it.  tongue )


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#9 2010-03-12 20:30:11

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

RicoSuave wrote:

It just crashes

What do you exactly mean? It doesn't crash for me...


Anyway: Thanks for your compliments everyone!  big_smile


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#10 2010-03-12 21:06:54

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Ooh, a hopeful sticky... mesh is a bit odd, so this helps.


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#11 2010-03-12 23:20:25

Vista4563
Scratcher
Registered: 2009-07-20
Posts: 500+

Re: Mesh - how to get it, use it, and program with its features

Thanks for the guide!

Will one person's actions show up on the other person's screen? I want to collaborate easily.


Team Vista | TBG Moderator | #stopKony #Kony2012 | http://ls.gd/icgrin http://is.gd/78GWUZ
http://is.gd/jEY5Ihttp://is.gd/Vl19zR http://i.imgur.com/L4HIs.png

Offline

 

#12 2010-03-12 23:47:42

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Vista4563 wrote:

Thanks for the guide!

big_smile

Vista4563 wrote:

Will one person's actions show up on the other person's screen? I want to collaborate easily.

The only interaction is that all Scratch programs receive the broadcasts, and that you can use the block ([slider] sensor value) to use a different Scratch program's variables. That's all you need, actually - it's quite weird, isn't it?  tongue

Last edited by Jonathanpb (2010-03-12 23:48:27)


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#13 2010-03-12 23:49:45

littletonkslover
Scratcher
Registered: 2008-12-12
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Does is have to be a game for people to join it?


http://www.coxlab.org/images/rat_banner.jpg
That's the dark nature of capitalism. ~ Wonder Showzen

Offline

 

#14 2010-03-12 23:52:43

adriangl
Scratcher
Registered: 2007-07-02
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Nice tutorial...say...*sly face*


Scratchin' since 2007

Offline

 

#15 2010-03-13 04:39:40

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

littletonkslover wrote:

Does is have to be a game for people to join it?

Mesh projects don't have to be games! They can be anything you want - just like normal Scratch projects.  smile


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#16 2010-03-13 04:44:14

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

somebody help me, please: http://scratch.mit.edu/forums/viewtopic.php?id=32091


-End Transmission-

Offline

 

#17 2010-03-13 04:50:20

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Sure!  smile


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#18 2010-03-13 04:51:44

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Jonathanpb wrote:

juststickman wrote:

For some reason I don't get the "host" and "join" mesh options...

You're supposed to Shift-click "Share". (That is in the guide - you probably missed it.  tongue )

Ohhhhh, SHIFT click.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#19 2010-03-13 13:48:14

dogdog
Scratcher
Registered: 2007-10-12
Posts: 70

Re: Mesh - how to get it, use it, and program with its features

Thanks! Now I can get Mesh working!

Offline

 

#20 2010-03-13 16:46:47

littletonkslover
Scratcher
Registered: 2008-12-12
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

Jonathanpb wrote:

littletonkslover wrote:

Does is have to be a game for people to join it?

Mesh projects don't have to be games! They can be anything you want - just like normal Scratch projects.  smile

Cool! ~ So can 2 people work on a project at once.......?


http://www.coxlab.org/images/rat_banner.jpg
That's the dark nature of capitalism. ~ Wonder Showzen

Offline

 

#21 2010-03-13 16:49:38

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

littletonkslover wrote:

Does is have to be a game for people to join it?

All mesh does is share broadcasts and variables.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#22 2010-03-13 17:28:27

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

littletonkslover wrote:

Jonathanpb wrote:

littletonkslover wrote:

Does is have to be a game for people to join it?

Mesh projects don't have to be games! They can be anything you want - just like normal Scratch projects.  smile

Cool! ~ So can 2 people work on a project at once.......?

Mesh doesn't do that - the only thing that goes across to other Scratch programs are broadcasts and variables (variables go across with the ([slider] sensor value) block).


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#23 2010-03-13 22:29:54

iCode-747
Scratcher
Registered: 2009-11-21
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

thanks. I'm making a Submarine Wars game, and I'm adding mesh capability.


-End Transmission-

Offline

 

#24 2010-03-14 08:06:44

Dazachi
Retired Community Moderator
Registered: 2009-09-12
Posts: 1000+

Re: Mesh - how to get it, use it, and program with its features

I think I am starting to understand programming with Mesh. Thanks!


Dazachi, Retired Community Moderator
May also know me as OJACheung.

Offline

 

#25 2010-03-14 10:20:16

Noah1991
Scratcher
Registered: 2009-12-22
Posts: 7

Re: Mesh - how to get it, use it, and program with its features

Hi, I'm using Ubuntu Linux 9.04 and every time I try to save after activating Mesh it freezes and I have to force quit Scratch! Any ideas?  sad

Offline

 

Board footer