Question Regarding New Clones

I was testing setting the values of variables (both global and local) to a new clone of the sprite it is being used by. But it looks like the value of the variable is not the same as the value reported by the a new clone of reporter. Why is this happening?

did you share the project?

Yes, but looks like the URL is invalid. This is the correct one-


.

I looked at the project, and you made a mistake. The new clone reporter creates a new clone and reports that clone. The new clone is not the same as the clone in the variable. Here's what I mean

That is why initially thought but my question was what is different among them? And I did not notice (or expect) that the a new clone of block is creating a new clone; it is a reporter not a command block.

that is what I first thought too, but it's not the case.

I think the difference is that they're different objects.

:~) "A new clone" means what it says! Every time you call it, it makes a new clone.

That does not make any sense to me. If it is a reporter, why does it need to make a new clone, is not that what command blocks are for? Cannot it just check what will happen if a new clone was created?

If you just have a make a new clone command block, then its very tricky to get a reference to the cloned object

But its trivial when you can set var to a new clone

Oh, now I understand how you're thinking about it. You think of reporters as passive observers of the existing state.

But technically, the only necessary difference between a command and a reporter is that the reporter reports a value, whereas a command doesn't. Lots of reporters create new data, such as the NEW COSTUME reporter, which creates a costume; the LIST reporter, which creates a list; the SPLIT reporter, which also creates a list. A NEW CLONE is the same sort of thing; it creates and reports a new data structure, in this case a sprite.

In a perfect world, all blocks would be reporters. For example, we inherited from Scratch the command ASK AND WAIT with the associated reporter ANSWER. But if we were designing user interaction ourselves, we'd just have one block
preloaded libraries script pic
Among other virtues, that way if two scripts both ask questions at once, there couldn't be any confusion about which question's answer your script is handling, because the question text is right in the ANSWER block.

It seems strange to me that you use the wording "why does it need to make a new clone?" There's no "need to" about it; making a new clone is what that reporter is for! Yes, we could have another reporter called "most recently created clone" or something, which would report an existing clone instead of creating a new one. But why would you want to do that? Creating a clone seems much more useful, especially because you can say


letting the one reporter serve the two purposes at once, making a clone and letting you use that clone in your code.

Does that make sense?

Yes, that does make sense.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.