Problems with applying a definition to a block

Instead of using a single definition and having all the blocks run the script in a variable or wherever the definition may be stored, whenever I change a block definition, it also changes the script of all the blocks you want to apply throughout the entire project, making the process of applying a block's definition to large sprites incredibly slow.

Why is this the case, and why does this process run like that?

I can't figure out what you're saying. Could you post some code?

I've only had problems applying definitions with many clones, and that's it.

They mean pressing the apply button on the dialog box for editing a custom block creates a lot of lag when there are a lot of sprites.


I think this might make my explanation much harder but this might make some type of sense

There are six sprites. What I mean is that it lags whenever I apply a block where it exists in a large piece of code on a sprite.

Could you post either a link to the code or a script pic from which I can extract the code? Not a Photoshopped picture. Thanks.

he thinks its a secret loool

he means that if he adds an input to a custom block,because of the need of updating all instances of that block,his computer crashes

It's a secret because I don't want anyone to know about this project just yet because it hasn't been released.

slightly true.

Stop the project when saving it. Large amounts of clones create a lot of lag.
Or just split your custom blocks into custom blocks

There shouldn't be lots of instances, because the clones should inherit, not copy, blocks from the parent, and you shouldn't try to change the arity of a block while it's running!

We aren't talking about clones...

We're talking about how Snap updates each custom block's definition in the project instead of just having one definition and replace it from there. If it was, it could've been a big optimization fix.

This theory is stuck in my head where the definition duplicates itself everytime you place a custom block.

Correct me if I'm wrong

i dont think so, the xml doesnt have duplicates of the definition

You can change the blocks specs, so every place where you call custom block must be located&updated.
Just like "rename all...."

I'm confused. There is just one definition. Are you talking about places where the block is called?

yes