Discuss Scratch

kooqle
Scratcher
74 posts

Clones responding to messages

Hi everyone! I'm making a game where clones have to respond to messages. Is this possible (the clones already have a clone ID. Thank you

Cloud Inc.
Here at Cloud Inc. We believe that that the sky's the limit! We've been here on scratch for a long time, with multiple different shop posts. No matter how many people quit, no matter how much things might suck, we always come back. That's what true service is.

-Cloud Inc. Team ☁

JASON2811
Scratcher
2 posts

Clones responding to messages

ok
Jaim_animation
Scratcher
77 posts

Clones responding to messages

This Is Possible. Just Use The
when I receive [ Any Massage v]
block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end

Last edited by Jaim_animation (March 23, 2024 08:18:21)


Hope It Helps!

—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection

scratch blue infection! try to prevent it, but how?
kooqle
Scratcher
74 posts

Clones responding to messages

Jaim_animation wrote:

This Is Possible. Just Use The
when I receive [ Any Massage v]
block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
Thanks, but anything not under the
when I start as a clone
block will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.
say [Thanks for your reply!]

Cloud Inc.
Here at Cloud Inc. We believe that that the sky's the limit! We've been here on scratch for a long time, with multiple different shop posts. No matter how many people quit, no matter how much things might suck, we always come back. That's what true service is.

-Cloud Inc. Team ☁

TheUltimateHoodie
Scratcher
1000+ posts

Clones responding to messages

kooqle wrote:

Jaim_animation wrote:

This Is Possible. Just Use The
when I receive [ Any Massage v]
block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
Thanks, but anything not under the
when I start as a clone
block will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.
say [Thanks for your reply!]
when green flag clicked
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
end
had to edit this multiple times because scratchblocks kept breaking

Last edited by TheUltimateHoodie (March 23, 2024 09:49:16)


can somebody give me something to put in my signature
kooqle
Scratcher
74 posts

Clones responding to messages

Thank you!

Cloud Inc.
Here at Cloud Inc. We believe that that the sky's the limit! We've been here on scratch for a long time, with multiple different shop posts. No matter how many people quit, no matter how much things might suck, we always come back. That's what true service is.

-Cloud Inc. Team ☁

kooqle
Scratcher
74 posts

Clones responding to messages

TheUltimateHoodie wrote:

kooqle wrote:

Jaim_animation wrote:

This Is Possible. Just Use The
when I receive [ Any Message v]
block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Message v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
Thanks, but anything not under the
when I start as a clone
block will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.
say [Thanks for your reply!]
when green flag clicked
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
end
had to edit this multiple times because scratchblocks kept breaking
Sadly I tried your method and it didn't work, but I asked a friend (@_HelloWorld54) and he came up with this…
when green flag clicked
set [Clonemessage v] to [0]
when I receive [ v]
change [Clonemessage v] by (1)
when I start as a clone
wait until <><(foo) = [1]>
And do whatever it needs to do!

Cloud Inc.
Here at Cloud Inc. We believe that that the sky's the limit! We've been here on scratch for a long time, with multiple different shop posts. No matter how many people quit, no matter how much things might suck, we always come back. That's what true service is.

-Cloud Inc. Team ☁

Jaim_animation
Scratcher
77 posts

Clones responding to messages

kooqle wrote:

TheUltimateHoodie wrote:

kooqle wrote:

Jaim_animation wrote:

This Is Possible. Just Use The
when I receive [ Any Message v]
block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Message v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
Thanks, but anything not under the
when I start as a clone
block will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.
say [Thanks for your reply!]
when green flag clicked
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
end
had to edit this multiple times because scratchblocks kept breaking
Sadly I tried your method and it didn't work, but I asked a friend (@_HelloWorld54) and he came up with this…
when green flag clicked
set [Clonemessage v] to [0]
when I receive [ v]
change [Clonemessage v] by (1)
when I start as a clone
wait until <><(foo) = [1]>
And do whatever it needs to do!
This Topic Is For Broadcasting, Not For Another Way Which Works The Same, You Could Tell Us Using Variables Instead Is Also Ok

Hope It Helps!

—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection

scratch blue infection! try to prevent it, but how?
Jaim_animation
Scratcher
77 posts

Clones responding to messages

kooqle wrote:

Jaim_animation wrote:

This Is Possible. Just Use The
when I receive [ Any Massage v]
block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
Thanks, but anything not under the
when I start as a clone
block will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.
say [Thanks for your reply!]
Wait, Then How Do
when I receive [Anything v]
delete this clone
Deletes All Of The Clones Of The Sprite? Wait I Got It- The First Method I Described Does Not Works, But Second Method Works!
May Be The Method That Actually Works Is-

when I receive [ Any Massage v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
[/scratchblocks]
[/quote]

Last edited by Jaim_animation (March 24, 2024 07:24:23)


Hope It Helps!

—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection

scratch blue infection! try to prevent it, but how?
TheUltimateHoodie
Scratcher
1000+ posts

Clones responding to messages

kooqle wrote:

TheUltimateHoodie wrote:

kooqle wrote:

Jaim_animation wrote:

This Is Possible. Just Use The
when I receive [ Any Message v]
block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Message v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
Thanks, but anything not under the
when I start as a clone
block will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.
say [Thanks for your reply!]
when green flag clicked
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
end
had to edit this multiple times because scratchblocks kept breaking
Sadly I tried your method and it didn't work, but I asked a friend (@_HelloWorld54) and he came up with this…
when green flag clicked
set [Clonemessage v] to [0]
when I receive [ v]
change [Clonemessage v] by (1)
when I start as a clone
wait until <><(foo) = [1]>
And do whatever it needs to do!
I don't know why my method didn't work; I have used it numerous times.
Anyway, your friend's solution still have the same concept.

can somebody give me something to put in my signature
Jaim_animation
Scratcher
77 posts

Clones responding to messages

TheUltimateHoodie wrote:

kooqle wrote:

TheUltimateHoodie wrote:

kooqle wrote:

Jaim_animation wrote:

This Is Possible. Just Use The
when I receive [ Any Message v]
block and freely put blocks under it, every clone will perform it (yes, clones automatically recieves broadcasts) really really easy! If You Want Clones Do Seperate Things, Simply-
when I receive [ Any Message v]
if <(cloneID) = (1)> then
//do something
end
if <(cloneID) = (2)>
//do something
//these if continues, as many as you need
end
Thanks, but anything not under the
when I start as a clone
block will not be ran as a clone, the sprite itself will do it, and there lies my problem. Thank you for your reply, however.
say [Thanks for your reply!]
when green flag clicked
set [am i a clone? v] to [no]
when I start as a clone
set [am i a clone? v] to [yes]
when I receive [something only clones should do v]
if <(am i a clone?) = [yes]> then
do the thing
end
when I receive [something only main sprite should do v]
if <(am i a clone?) = [no]> then
do the thing
end
had to edit this multiple times because scratchblocks kept breaking
Sadly I tried your method and it didn't work, but I asked a friend (@_HelloWorld54) and he came up with this…
when green flag clicked
set [Clonemessage v] to [0]
when I receive [ v]
change [Clonemessage v] by (1)
when I start as a clone
wait until <><(foo) = [1]>
And do whatever it needs to do!
I don't know why my method didn't work; I have used it numerous times.
Anyway, your friend's solution still have the same concept.
Guys What's Going On There? The Problem Is Solved! PLEASE CLOSE THIS TOPIC!

Hope It Helps!

—-Hi! I Am Jaim, A 9 Years Old Bangladeshi Boy! I like To Code In Javascript,HTML, Css Aaand Scratch!—
I Like To Make Appel Levels!
My Appel Level Collections-
Desert Appel Collection

scratch blue infection! try to prevent it, but how?

Powered by DjangoBB