Feature Request: Create Clone With Data [data]

A few days I was messing around with clones, and thought about a more straightforward solution for sending information to clones.

This would work similarly to how the broadcast/receive and scene blocks work, where the send (create clone) block would have an option to send data and the receiving (when i start as a clone) block would have an option to receive data.

I made a mockup of this idea in Google Draw, so here's an image of that.


The category should be #feature-requests:snap-features, not #feature-requests:forum-requests.

A current workaround is to use tell and new clone.

This actually works, now!
untitled script pic (73)
You should be able to import this by dragging it. The set block is the primitive you can find in the normal menu, and to get the "my" variables, you can follow what ego-lay said - select it in the dropdown menu.

I got this when I tried it

That's because you have to actually select it in the dropdown menu


I'm confused -are you saying that @pajamaclaws21 script works for you?

It doesn't, but my solution works, well kind of. It works for regular sprites, but not for clones.

The reason just typing in the text "my name" doesn't work, is because the value that's selected from the dropdown is a special value

Special values are surrounded by brackets when you split by blocks. The only way to programmatically set the "my name" special value without manually selecting it from the menu, is by using join.

oh oops, sorry

Oh, thanks! didn't know about that!

Ahhhh, I made an error in the var-set-block, one second.
EDIT: Alright, perfect. All the errors ego-lay found should be fixed now.

I don't think that works either unfortunately :frowning:

On my setup, it alters the name of the sprite itself, not the clone

As a minor issue - I don't think it's a good idea to label your custom set block to look nearly identical to the standard set block - I'd suggest maybe calling it set var or set variable (or something else) so that it's easy for someone to see that its not the standard block

I... think I fixed it. Does it work now?

Works fine :slight_smile:

It was definitely an issue with my custom blocks, sadly.

Wow. Never thought of how useful that'd be.

Custom Block making is fun. Infinite possibilities.

Just a note - if you try and set something like the name at creation time, it isn't set straight away

If you test this out, you'll see that the name isn't set when the clone is started - it takes some (small) time before it is

Just something to be aware of in trying to pass data at clone startup

It might be because the when I start as a clone script having higher priority than the tell script, making it run first. Of course I don't actually know this, I'm just making an educated guess, so don't take my word for it.

That was my guess.

We might have to do some experiments to say for sure. Guess time will tell.
If its true, we'll have to find another way.

You don't need to find another way - you can just wait until a value changes from its default

You can use name,as per my example, or you can use a variable - set a sprite local var (say _default) to something like (uninitialized) and then under clone start hat, just wait for it to change like I wait for the name to change