Discuss Scratch

RedDragonNinja
Scratcher
18 posts

Broadcasting messages across projects.

How would I broadcast a message to another project? Please help me.
scubajerry
Scratcher
1000+ posts

Broadcasting messages across projects.

broadcast [Something v] and wait
//in other project
when I receive [Something v]
RedDragonNinja
Scratcher
18 posts

Broadcasting messages across projects.

I tried that, but it doesn't work.

Would I need to use cloud variables as they are different projects?

Last edited by RedDragonNinja (March 2, 2014 12:20:25)

scubajerry
Scratcher
1000+ posts

Broadcasting messages across projects.

On you did say projects. Broadcast don't work across projects. You would need handshakes using cloud variables.

Handshake
one project waits for a cloud variable to be set in a loop

the other project sets it.
magpie5212
Scratcher
100+ posts

Broadcasting messages across projects.

You cannot share the cloud variable in DIFFERENT projects, only on two instances of the same project:

From http://wiki.scratch.mit.edu/wiki/Cloud_Data

"The only difference is that the value is truly global, and is reflected across all copies of the project being viewed on the Scratch Website. "
honeyr2
Scratcher
80 posts

Broadcasting messages across projects.

You can only broadcast between sprites. Here's an example:

//In obstacle's script:

when I start as a clone
wait until <(player dead?) = [1]>
hide
broadcast [end game v]
delete this clone

//In backdrop's script:

when I receive [end game v]
switch backdrop to [you lost v]
play sound [you died. v] until done
set [Player Score v] to (Score:)
show variable [Player Score v]
show variable [cloud World Highscore v]
if <(Player Score) > (cloud World Highscore)> then
set [cloud World Highsocre v] to (Player Score)
magpie5212
Scratcher
100+ posts

Broadcasting messages across projects.

magpie5212 wrote:

You cannot share the cloud variable in DIFFERENT projects, only on two instances of the same project:

From http://wiki.scratch.mit.edu/wiki/Cloud_Data

"The only difference is that the value is truly global, and is reflected across all copies of the project being viewed on the Scratch Website. "

You may also wish to note on the same page:

“They do not refresh instantly, however; they lag about 2 seconds between updates. ”
Beamy68
Scratcher
100+ posts

Broadcasting messages across projects.

when green flag clicked
think [hooiiii] for (2) secs
think [WAIT WHY ISNT THIS POSSIBLE :C] for (2) secs
set [☁ leave fourm] to [1]
deck26
Scratcher
1000+ posts

Broadcasting messages across projects.

Beamy68 wrote:

when green flag clicked
think [hooiiii] for (2) secs
think [WAIT WHY ISNT THIS POSSIBLE :C] for (2) secs
set [☁ leave fourm] to [1]
Please don't blockspam or necropost.
ImposterLuigi
Scratcher
33 posts

Broadcasting messages across projects.

broadcast [ v] to project [ name]

and

when I receive on channel
And 


(Data)


And also
when data recieved on channel [ channelname]



These blocks will not cause interference if multiple projects are broadcasting at the same time.

Last edited by ImposterLuigi (Jan. 8, 2022 09:39:05)

RIPMYACCOUNTAYYY
Scratcher
1 post

Broadcasting messages across projects.

broadcast () to project ()

if received () from project () then

Powered by DjangoBB