Discuss Scratch

CAA14
Scratcher
500+ posts

What's this? Clone responding to scripts for the original?

Hi,

I am trying to make the final episode of mind blowing math, but i have a problem.
To save space(and just as i did with the engine center), i decided that the logo and the start button where going to be the the same sprite, along with the difficulty level and the instructions. Well, i have my clone(the start button) broadcast a “to next menu stat” thing. The problem? The clone responds to it! Even though clones have never responded to stuff like this before! The clone has no variable being set for it, it just does what the main one does, and i've never seen this. Please help.

Engine Center! Check it out! 6 Engine's to jump start your project! - Jumper! Collect Gold in style! - Birds the arcade game! - Mind blowing math challenge!
CAA14
Scratcher
500+ posts

What's this? Clone responding to scripts for the original?

Still is responding to a none clone script… : /

Engine Center! Check it out! 6 Engine's to jump start your project! - Jumper! Collect Gold in style! - Birds the arcade game! - Mind blowing math challenge!
CAA14
Scratcher
500+ posts

What's this? Clone responding to scripts for the original?

Please help, i cannot move forward in my project until this is fixed… Scratch just got a bug???

Engine Center! Check it out! 6 Engine's to jump start your project! - Jumper! Collect Gold in style! - Birds the arcade game! - Mind blowing math challenge!
ErnieParke
Scratcher
1000+ posts

What's this? Clone responding to scripts for the original?

CAA14 wrote:

Please help, i cannot move forward in my project until this is fixed… Scratch just got a bug???
Nope, it's not a bug. Hopefully not the cold either.

Anyway, when a clone is created, it also receives a copy of all code in the original sprite (aka. parent sprite). The only change that's made to them is that every script then gets flipped to the “off position”, well except for the “when I start as a clone” scripts, which is slightly obvious. Still, that doesn't mean other scripts can't be triggered later on, which is what you're facing.

Your situation is that you have a broadcast, and you don't want it to be used by your clones. Fine, it can be worked around. First, you'll need to create a local variable called (broadcast?), or some name like that. Then, you'll need to set it to 1 in a “when gf clicked” hat block, but also set it to 0 in a “when I start as a clone” block. Finally, in your broadcast, just add in an if checking (broadcast?), and if it equals 1, then you can go ahead with your scripts.

Does this all make sense?

With respects,

ErnieParke

CAA14
Scratcher
500+ posts

What's this? Clone responding to scripts for the original?

ErnieParke wrote:

CAA14 wrote:

Please help, i cannot move forward in my project until this is fixed… Scratch just got a bug???
Nope, it's not a bug. Hopefully not the cold either.

Anyway, when a clone is created, it also receives a copy of all code in the original sprite (aka. parent sprite). The only change that's made to them is that every script then gets flipped to the “off position”, well except for the “when I start as a clone” scripts, which is slightly obvious. Still, that doesn't mean other scripts can't be triggered later on, which is what you're facing.

Your situation is that you have a broadcast, and you don't want it to be used by your clones. Fine, it can be worked around. First, you'll need to create a local variable called (broadcast?), or some name like that. Then, you'll need to set it to 1 in a “when gf clicked” hat block, but also set it to 0 in a “when I start as a clone” block. Finally, in your broadcast, just add in an if checking (broadcast?), and if it equals 1, then you can go ahead with your scripts.

Does this all make sense?

With respects,

ErnieParke

Absolutely.

I tried that, but it didn't work right… I will try again soon. Thanks, as i didn't know about the copied script thing…

Engine Center! Check it out! 6 Engine's to jump start your project! - Jumper! Collect Gold in style! - Birds the arcade game! - Mind blowing math challenge!
CAA14
Scratcher
500+ posts

What's this? Clone responding to scripts for the original?

Okay, it works now.

Engine Center! Check it out! 6 Engine's to jump start your project! - Jumper! Collect Gold in style! - Birds the arcade game! - Mind blowing math challenge!
ErnieParke
Scratcher
1000+ posts

What's this? Clone responding to scripts for the original?

CAA14 wrote:

Okay, it works now.
That's always good to hear, and you did learn something new. ;)

With regards,

ErnieParke

Last edited by ErnieParke (July 2, 2013 20:23:53)


Powered by DjangoBB