Discuss Scratch

ramenecho
Scratcher
100+ posts

Remove the ending on the “delete this clone” block

The delete this clone block
delete this clone
Is really annoying, for example lets say that i have a sprite that is intended to fill a field with a bunch of clones, and it often can trigger even when there are still clones on the field, normally you would have to do something like this:
when I receive [refill v]
if <[1] = [1]> then
delete this clone
end
All the rest of the code
It doesn’t seem like much, but having the delete this clone block have a bottom connector would allow for it only needing one block
when I receive [Refill v]
delete this clone+
All the rest of the code
I put a plus so that the forum blocks change it to what im trying to show, but it’s much simpler and much cleaner.
8to16
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

ramenecho wrote:

(#1)
I put a plus so that the forum blocks change it to what im trying to show, but it’s much simpler and much cleaner.
you can just
delete this clone::stack
which produces
delete this clone::stack
BigNate469
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

Just going to point out a few workarounds here:

when I receive [something v]
if <not <>> then // Works because an empty not block returns true
delete this clone
end
...
or
when I receive [something v]
...
when I receive [something v]
delete this clone
or
define delete clone
delete this clone

when I receive [something v]
delete clone
...
That said, adding this block would reduce redundant code and make programs more efficient, but it could also make it more confusing for some people new to clones, because they could be trying to do something like
when I start as a clone
...
delete this clone :: stack
move (10) steps
and get confused as to why their clone isn't moving 10 steps, but is being deleted instead.
cookieclickerer33
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

Support, you shouldn’t have to do this
repeat (1)
delete this clone
end
Za-Chary
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

BigNate469 wrote:

it could also make it more confusing for some people new to clones, because they could be trying to do something like
when I start as a clone
...
delete this clone :: stack
move (10) steps
and get confused as to why their clone isn't moving 10 steps, but is being deleted instead.
This is my understanding on the design choice as well. In basic settings, “delete this clone” is used to delete a clone entirely; it may be confusing to newer programmers as to why a clone could potentially run more scripts after being deleted. (We all know that it doesn't, but a new programmer doesn't know that.) For those not new to programming, their favorite workaround is simple enough.
cookieclickerer33
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

Za-Chary wrote:

BigNate469 wrote:

it could also make it more confusing for some people new to clones, because they could be trying to do something like
when I start as a clone
...
delete this clone :: stack
move (10) steps
and get confused as to why their clone isn't moving 10 steps, but is being deleted instead.
This is my understanding on the design choice as well. In basic settings, “delete this clone” is used to delete a clone entirely; it may be confusing to newer programmers as to why a clone could potentially run more scripts after being deleted. (We all know that it doesn't, but a new programmer doesn't know that.) For those not new to programming, their favorite workaround is simple enough.
Cap blocks as a convention don’t really make sense because of how few there are. And that the stop block doesn’t even have to be a cap

I say remove them completely, I see them cause more issues then they solve
iiucandyfloss
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

if a clone is deleted what code would you need it to run?
SpyCoderX
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

iiucandyfloss wrote:

(#7)
if a clone is deleted what code would you need it to run?
The main sprite.

For example, if you wanted to clear all the clones and reset the main sprite to some position, you have to do this:

when I receive [reset v]
delete this clone

when I receive [reset v]
go to x: (0) y: (0)

The suggestion wants to be able to combine these:
when I receive [reset v]
delete this clone ::stack
go to x: (0) y: (0)
rdococ
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

Beginners could be confused, and the workaround is pretty simple.

Last edited by rdococ (Dec. 17, 2024 18:49:54)

medians
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

SpyCoderX wrote:

iiucandyfloss wrote:

(#7)
if a clone is deleted what code would you need it to run?
The main sprite.

For example, if you wanted to clear all the clones and reset the main sprite to some position, you have to do this:

when I receive [reset v]
delete this clone

when I receive [reset v]
go to x: (0) y: (0)

The suggestion wants to be able to combine these:
when I receive [reset v]
delete this clone ::stack
go to x: (0) y: (0)
I mean, in that case, you could reverse the delete this clone and go to x: () y: () blocks
ramenecho
Scratcher
100+ posts

Remove the ending on the “delete this clone” block

medians wrote:

SpyCoderX wrote:

iiucandyfloss wrote:

(#7)
if a clone is deleted what code would you need it to run?
The main sprite.

For example, if you wanted to clear all the clones and reset the main sprite to some position, you have to do this:

when I receive [reset v]
delete this clone

when I receive [reset v]
go to x: (0) y: (0)

The suggestion wants to be able to combine these:
when I receive [reset v]
delete this clone ::stack
go to x: (0) y: (0)
I mean, in that case, you could reverse the delete this clone and go to x: () y: () blocks
I dont know why you guys are trying to think of examples to use this in, i gave an example in the main message.

RamenEcho wrote:

for example lets say that i have a sprite that is intended to fill a field with a bunch of clones, and it often can trigger even when there are still clones on the field
SpyCoderX
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

ramenecho wrote:

(#11)

medians wrote:

-snip-
I dont know why you guys are trying to think of examples to use this in, i gave an example in the main message.
I forgot you gave examples.
Dragon_hord
Scratcher
95 posts

Remove the ending on the “delete this clone” block

The block you are suggesting would break many projects because a clone can't do anything if it doesn't exist
medians
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

Dragon_hord wrote:

The block you are suggesting would break many projects because a clone can't do anything if it doesn't exist
Can you explain how exactly this would break projects? None of the code afterwards would run, and the block would act exactly the same but as a stack block. The actual functionality wouldn't change. This is more for things like broadcasts so you can run code afterwards, not just for clones.
bungamer07
Scratcher
100+ posts

Remove the ending on the “delete this clone” block

one* block workaround
define delete this clone
delete this clone
medians
Scratcher
1000+ posts

Remove the ending on the “delete this clone” block

bungamer07 wrote:

one* block workaround
define delete this clone
delete this clone
You would have to create a custom block though, if that workaround was used.

Last edited by medians (Dec. 18, 2024 18:28:34)

Powered by DjangoBB