Discuss Scratch

crstalgem228
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

hey, I need help figuring out how this block works.

let's say I have 2 sprites, with one that has a variable for this sprite only. (activated)
the other sprite needs to run a script where it can only run if the second sprites variable equals true. this is where I think this block might come into use, but for some reason, it doesn't work

first sprite:

whenclickedforeverifactivatedofSprite 2=truethenrunscripts

second sprite with activated variable set to this sprite only:

whenIstartasaclonesetactivatedtofalseforeveriftouchingmouse pointer?andmousedown?thensetactivatedtotrue

Last edited by crstalgem228 (April 18, 2023 18:16:34)

greentreebee
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

try instead of mouse down?, try this:
iffalse=falsethen

but i dunno

or try the custom block removed

Last edited by greentreebee (April 18, 2023 18:14:12)

medians
Scratcher
1000+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

Uhm, why specifically those 2 options?
Also, can you send the link to the project, explain what it’s meant to do, and what it’s actually doing?
crstalgem228
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

medians wrote:

Uhm, why specifically those 2 options?
Also, can you send the link to the project, explain what it’s meant to do, and what it’s actually doing?
okay! wait, I edited the original post to be more correct about what I was trying to do. hold on let me share my project real quick so you can see
crstalgem228
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

medians wrote:

Uhm, why specifically those 2 options?
Also, can you send the link to the project, explain what it’s meant to do, and what it’s actually doing?
here is the link: https://scratch.mit.edu/projects/815972815
to see the problem, go to the sprites crop pot, and crops. there should be a comment where the problem is
crstalgem228
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

medians wrote:

Uhm, why specifically those 2 options?
Also, can you send the link to the project, explain what it’s meant to do, and what it’s actually doing?
oh, and what it's meant to do is have the seeds grow when the pot is watered. the pot needs to be a clone so you can buy more of them
10data10
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

It looks like you want to test the value of a local variable of a clone (the crop pot).

The Scratch Team does not let you use something like
wateredofClone of Sprite1

I keep asking people to support a suggestion to let this work but it’s not drawing much attention.

However, for your project, do you care if just one crop pot gets watered or all of them? If they all get watered at the same time then maybe just make the watered variable be global.
09878901234321
Scratcher
500+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

10data10 wrote:

It looks like you want to test the value of a local variable of a clone (the crop pot).

The Scratch Team does not let you use something like
wateredofClone of Sprite1

I keep asking people to support a suggestion to let this work but it’s not drawing much attention.

However, for your project, do you care if just one crop pot gets watered or all of them? If they all get watered at the same time then maybe just make the watered variable be global.
They would likely have to add a new block for this.

You can get the value of a clones variable with a broadcast and a variable.
setclone fetchto5example clone idbroadcastget activatedwhenireceiveget activatedifcloneid=clonefetchthensetclone is activatedtoactivated
10data10
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

09878901234321 wrote:

They would likely have to add a new block for this.
Yes, thanks for asking. The block would be
createcloneofcrop potnamedcrop pot1
and the suggestion is here https://scratch.mit.edu/discuss/topic/7455
Just in case you wanted to take a look. But we don’t have that so …

09878901234321 wrote:

You can get the value of a clones variable with a broadcast and a variable.
Yes, but you can’t have all of the radish clones making the same broadcast in the same frame.


But in this case it might be easier to just make it so if one crop pot is watered then they all get watered and make the watered variable be global.
Otherwise you will need to keep track of which radishes are growing in which crop pots and have some way to serialize the next cycle broadcast because you can’t have all of the radish clones making the same broadcast to all of the crop pots clones to individually answer the “watered” question in the same frame using a global variable. Or you can create a list for the crop pots and keep each separate watered status in list elements.

And then your next issue is know what crop pots your player put the radishes into.

You can’t have a radish clone do something like:
setCrop pot to test fortojoincrop pot1iftouching Crop pot to test for?thensetPlacedtoTrue

I suggest numbering the crop pot clones and just asking the player using an ask block to indicate which crop pot clone to use for planting each radish clone. However, there is one program by a scratch member that sort of shows how to know which specific clone is being touched by another clone but it’s a little involved and iffy: https://scratch.mit.edu/projects/664601726

Last edited by 10data10 (April 19, 2023 13:53:37)

medians
Scratcher
1000+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

medians wrote:

Uhm, why specifically those 2 options?
Also, can you send the link to the project, explain what it’s meant to do, and what it’s actually doing?
oh my god
Default in 2.0 when there are no sprites:

Default in 3.0 when there are no sprites:

Default in 2.0 when there are sprites:

(it's the most recently created one)
Default in 3.0 when there are sprites:

Last edited by medians (April 18, 2023 21:22:11)

10data10
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

crstalgem228 wrote:

to see the problem, go to the sprites crop pot, and crops. there should be a comment where the problem is
I don’t think we gave you any real help with the problem you mentioned inside of your project.

Your artwork is really good and it is a good project idea but it looks like you had a intuitive need to make one clone access the local variables of another clone and also to know when one clone is touching another clone. People do that but it’s not that straightforward.

One thing I didn’t think of until the forums were down for hours was the more common workaround of doing more with cloning. If you merge the pot clones and and the radishes clone then it becomes easy to tell when the seeds should become radishes; you could combine the costumes: An empty crop pot, a pot costume with a seed, then another crop pot costume with grown radishes.

Good luck with your project.
iiDk__
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

10data10 wrote:

It looks like you want to test the value of a local variable of a clone (the crop pot).

The Scratch Team does not let you use something like
wateredofClone of Sprite1

I keep asking people to support a suggestion to let this work but it’s not drawing much attention.

However, for your project, do you care if just one crop pot gets watered or all of them? If they all get watered at the same time then maybe just make the watered variable be global.
can't u like
wateredofjoinSprite1
10data10
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

iiDk__ wrote:

can't u like
wateredofjoinSprite1
That does not return the value of a local variable of a clone of the crop pot sprite - which is what I believe the author was intuitively trying to do.

Last edited by 10data10 (April 20, 2023 14:29:09)

crstalgem228
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

I have fixed the problem, everyone! thank you. what I did to fix it is to have the pot create a clone of another sprite that goes to the pot that's watered. and then I can use the other sprite to grow the seed when the seed touches it. this will also help with pot collisions when placing down more pots so you cant put them on top of each other. this does use more clones, but the clones for the watered pot detection don't use forever loops so it should be fine

I hope this made sense
loganthabear
Scratcher
58 posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

loganthabear
Scratcher
58 posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

loganthabear
Scratcher
58 posts

the "[backdrop #] of [stage]" block with for this sprite only variables.






HogwartsTeacherSnape
Scratcher
100+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

medians wrote:

Uhm, why specifically those 2 options?
Also, can you send the link to the project, explain what it’s meant to do, and what it’s actually doing?
Yeah I was thinking both those same things.
loganthabear
Scratcher
58 posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

medians
Scratcher
1000+ posts

the "[backdrop #] of [stage]" block with for this sprite only variables.

This topic is from a while ago by the way.

HogwartsTeacherSnape wrote:

medians wrote:

Uhm, why specifically those 2 options?
Also, can you send the link to the project, explain what it’s meant to do, and what it’s actually doing?
Yeah I was thinking both those same things.
Yea, I figured out that backdrop # and stage are the default options for that block in 3.0, which is why the original poster picked those options in the title.

iiDk__ wrote:

can't u like
wateredofjoinSprite1
Doesn't work, that block just returns the value for the main sprite.

Last edited by medians (Jan. 24, 2024 00:06:48)

Powered by DjangoBB