Discuss Scratch

Adn1936
Scratcher
100+ posts

Is clone block

I know there are workarounds but that just clutters up the variables list.
when I receive [Notification v]
if <not <Is clone? :: control>> then
set [NotifBroadcast v] to (NotifContent)
create clone of [myself v]
end
when this sprite clicked
if <Is clone? :: control> then
broadcast (NotifBroadcast)
end
blablablahello
Scratcher
1000+ posts

Is clone block

1st of all, dupe (but im not gonna go into this partt as im bad at finding dupes and is too lazy to do so)

secondly, the workaround only takes up 2 variables, and can be useful for way more stuff, not to mention there is a simple workaround that doesn't require a single variable, that is, the “when I start as a clone” block exists, while only the original sprite would run the “when green flag clicked” block
medians
Scratcher
1000+ posts

Is clone block

If you think this takes up variables..

yeah i had to create all of those LOL

Last edited by medians (Jan. 13, 2023 22:29:09)

Xcvfdd
Scratcher
500+ posts

Is clone block

(No support)
The workaround is simple. Create a local variable called “is clone” and every time a clone is created, have the clone set the variable to “true” or “1”.
In scratch blocks:
when green flag clicked
set [ is clone?] to [false] //make sure this variable is set to “this sprite only”
Do stuff
when I start as a clone
set [is clone?] to [true]
Do stuff

Last edited by Xcvfdd (Jan. 13, 2023 22:33:37)

Adn1936
Scratcher
100+ posts

Is clone block

I already know the workaround. I'd just prefer a dedicated block
_Icicle-Cube_
Scratcher
500+ posts

Is clone block

Adn1936 wrote:

I already know the workaround. I'd just prefer a dedicated block
why tho
-Valtren-
Scratcher
1000+ posts

Is clone block

_Icicle-Cube_ wrote:

Adn1936 wrote:

I already know the workaround. I'd just prefer a dedicated block
why tho
clones can get glitchy. while this is unlikely to happen, there is a 0.001% chance that it could register as false instead of true for whatever reason, lag or something.
PkmnQ
Scratcher
1000+ posts

Is clone block

No support, I'd go for a clone id block instead.
medians
Scratcher
1000+ posts

Is clone block

1 variable honestly isn't a lot.

PkmnQ wrote:

No support, I'd go for a clone id block instead.
Anyway, this suggestion, and a clone id would be a duplicate.
I could find this:
https://scratch.mit.edu/discuss/topic/267136 (there was def something before this but..)
k0d3rrr
Scratcher
1000+ posts

Is clone block

There is a simple way to do this!
when green flag clicked
set [Am I a clone? v] to [0] // Make sure this variable is 'for this sprite only', otherwise this won't work.
create clone of [myself v]
broadcast [broadcast that only works for clones v]

when I start as a clone
set [Am I a clone? v] to [1]

when I receive [broadcast that only works for clones v]
if <(Am I a clone?) = [1]> then
say [I am a clone!] for (2) secs
end

Powered by DjangoBB