Discuss Scratch

qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

run for [clones only v]{...}:: control//the other options being "original sprite only" and "original sprite and clones"
this could be used for recieving broadcasts that you don't want clones to recieve
when I receive [move v]
run for [original sprite only v]{move (10) steps}:: control
or could be used for the same thing but for only clones
when I receive [move v]
run for [clones only v]{move (10) steps}:: control
or could be used for both when you need to run stuff for clones in a green flag script.
when green flag clicked
create clone of [myself v]
run for [original sprite and clones v]{move (10) steps}:: control
Another use:
when I start as a clone
...
run for [original sprite only v]{...}:: control//would run this for the original sprite and not clones even though it's in a clone script.
when green flag clicked
create clone of [myself v]
run for [clones only v]{move (10) steps}:: control//not as useful because of a hat block existing but would still work anyway

Q: But what about this? Would it make all clones run that script or just the clone that gets to that block?
when I start as a clone
if <...> then
run for [clones only v]{...}:: control
end
A: It would be all clones due to how it works in other hat blocks.
Q: Well what if we only want the clone that gets to the block to run it?
A: Simple, don't use the block, and the scripts will run only in that clone instead.

Last edited by qwerty_wasd_gone (Oct. 13, 2023 19:30:53)

blablablahello
Scratcher
1000+ posts

A c block for clones and for original sprite

There is a workaround, but unlike other suggestions, this workaround is constantly needed when working with clones, so even though the workaround is simple, it still becomes extremely annoying (especially since you have to add an additional 2-5 vairables PER sprite that uses clones)
qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

blablablahello wrote:

There is a workaround, but unlike other suggestions, this workaround is constantly needed when working with clones, so even though the workaround is simple, it still becomes extremely annoying (especially since you have to add an additional 2-5 vairables PER sprite that uses clones)
Is that support?
GIitchInTheMatrix
Scratcher
1000+ posts

A c block for clones and for original sprite

Given the fact the workaround is easy, I’d say, have a custom block spawn clones with a clone id, than sting the sprite to 0, there is a good workaround.
However, theres also a workaround to other blocks. And, while simple, th8is workaround is quite long.
However, again, the workaround is quite simple.
qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

GIitchInTheMatrix wrote:

-snip-
what is that workaround?
PsychicAura
Scratcher
100+ posts

A c block for clones and for original sprite

Sorry, no support. The workaround is pretty simple: Create a variable called “clone?” FOR THIS SPRITE ONLY. Make sure. Then:
when green flag clicked
set [clone? v] to (0)

when I start as a clone
set [clone? v] to (1)
...

when I receive [message1 v]
if <(clone?) = (1)> then
...
And if you want the code to specifically excecute for the original sprite only, then change the “1” to “0” in the boolean.

Last edited by PsychicAura (Nov. 3, 2022 23:35:47)

GIitchInTheMatrix
Scratcher
1000+ posts

A c block for clones and for original sprite

qwerty_wasd_gone wrote:

GIitchInTheMatrix wrote:

-snip-
what is that workaround?
define Clone (#)
set [Clone? v] to [1] //this sprite only
repeat (# :: custom)
create clone of [ v]
end

Hat block :: hat

if <(Clone?) = [1]> then
Do stuff
end
qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

PsychicAura wrote:

Sorry, no support. The workaround is pretty simple: Create a variable called “clone?” FOR THIS SPRITE ONLY. Make sure. Then:
when green flag clicked
set [clone? v] to (0)

when I start as a clone
set [clone? v] to (1)
...

when I receive [message1 v]
if <(clone?) = (1)> then
...
And if you want the code to specifically excecute for the original sprite only, then change the “1” to “0” in the boolean.

GIitchInTheMatrix wrote:

qwerty_wasd_gone wrote:

GIitchInTheMatrix wrote:

-snip-
what is that workaround?
define Clone (#)
set [Clone? v] to [1] //this sprite only
repeat (# :: custom)
create clone of [ v]
end

Hat block :: hat

if <(Clone?) = [1]> then
Do stuff
end

thank you for telling me

Last edited by qwerty_wasd_gone (Nov. 3, 2022 23:48:03)

Gamer_Logan819
Scratcher
1000+ posts

A c block for clones and for original sprite

PsychicAura wrote:

Sorry, no support. The workaround is pretty simple: Create a variable called “clone?” FOR THIS SPRITE ONLY. Make sure. Then:
when green flag clicked
set [clone? v] to (0)

when I start as a clone
set [clone? v] to (1)
...

when I receive [message1 v]
if <(clone?) = (1)> then
...
And if you want the code to specifically excecute for the original sprite only, then change the “1” to “0” in the boolean.

when green flag clicked
set [clone? v] to (0)

when I start as a clone
set [clone? v] to (1) //only identifies if clones exist, also would need multiple variables to do this in multiple sprites
...

when I receive [message1 v]
if <(clone?) = (1)> then //would not allow for original sprite and clones to run different scripts at same time
...

Full support due to other workarounds being too complicated.
qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

bump
-ErrorPurpl_157
Scratcher
100+ posts

A c block for clones and for original sprite

Support, but it could be
<I am a clone? :: control>

// uses
when I receive [broadcast v]
if <I am a clone? :: control> then {

} :: control
qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

bump again (why is it so low?)
qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

no bump
8bitrkt
Scratcher
500+ posts

A c block for clones and for original sprite

semi-support the work around is… simple enough, but i'm to lazy to make a variable for it. Although, I have a very obscure question:

drop down blocks can have stuff like this:
broadcast (join () ())
so what would this do?

run for (join () ()){
} :: control

again this is a very obscure question
PPPDUD
Scratcher
1000+ posts

A c block for clones and for original sprite

8bitrkt wrote:

semi-support the work around is… simple enough, but i'm to lazy to make a variable for it. Although, I have a very obscure question:

drop down blocks can have stuff like this:
broadcast (join () ())
so what would this do?

run for (join () ()){
} :: control

again this is a very obscure question
Repeating things for <invalid input here> always runs the script 0 times by default.
qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

8bitrkt wrote:

semi-support the work around is… simple enough, but i'm to lazy to make a variable for it. Although, I have a very obscure
so what would this do?

run for (join () ()){
} :: control

again this is a very obscure question
that's why it's a read-only dropdown
run for [clones only v]{}::control
and not
run for (clones only v){}::control
read-only dropdowns don't allow reporter blocks

Last edited by qwerty_wasd_gone (Oct. 11, 2023 17:17:21)

qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

PPPDUD wrote:

8bitrkt wrote:

-snip-
Repeating things for <invalid input here> always runs the script 0 times by default.
this is not a repeat block

Last edited by qwerty_wasd_gone (Nov. 9, 2022 02:00:01)

qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

-removed because old-

Last edited by qwerty_wasd_gone (Jan. 24, 2024 21:19:16)

qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

bump
qwerty_wasd_gone
Scratcher
1000+ posts

A c block for clones and for original sprite

bump again

Powered by DjangoBB