Discuss Scratch

3XAY
Scratcher
28 posts

Weird Cloning Issues...

Hi. I have a project called cash clicker. I am making a highscore section just like my stats section but for some reason when I clone the sprite, it switches back to the highscore icon, even though I coded it to NOT do that. Here is the link. (Go to the highscore sprite and join the events together to the closest stack of orphaned blocks.) Also look at stats sprite to see what I did before. Thank you.

Last edited by 3XAY (May 30, 2021 21:31:07)

The_Imaginarium
Scratcher
1000+ posts

Weird Cloning Issues...

You forgot to provide the link…
3XAY
Scratcher
28 posts

Weird Cloning Issues...

The_Imaginarium wrote:

You forgot to provide the link…
Should be fixed now!
-Kryptonite-
Scratcher
1000+ posts

Weird Cloning Issues...

3XAY wrote:

The_Imaginarium wrote:

You forgot to provide the link…
Should be fixed now!

I'll check tomorrow and see, the code's a lot, and I don't have time right now, goin to sleep XD, but yeah I think you could have it that its boradcasting at the wrong time or something. SInce the icon shows up when there is a broadcast, that could be why. You arent broadcasting the close highscore, OR the hitboxes overlap.
3XAY
Scratcher
28 posts

Weird Cloning Issues...

-Kryptonite- wrote:

3XAY wrote:

The_Imaginarium wrote:

You forgot to provide the link…
Should be fixed now!

I'll check tomorrow and see, the code's a lot, and I don't have time right now, goin to sleep XD, but yeah I think you could have it that its boradcasting at the wrong time or something. SInce the icon shows up when there is a broadcast, that could be why. You arent broadcasting the close highscore, OR the hitboxes overlap.
There aren't any hit boxes. Plus there is a forever loop that runs making sure the costume switches back to the correct one. And there is a variable that deals with “broadcasting the close highscore”.
1010101O1jr
Scratcher
27 posts

Weird Cloning Issues...

You probably forgot to when I start as a clone switch costume to stats
3XAY
Scratcher
28 posts

Weird Cloning Issues...

1010101O1jr wrote:

You probably forgot to when I start as a clone switch costume to stats
nope, I did that! (Check inside my project). Plus the problem is with the HIGHSCORE.
RobotChickens
Scratcher
500+ posts

Weird Cloning Issues...

I found the problem. Under the “High score sprite”
when I receive [tick v]
if <(Low Quality) = [1]> then
switch costume to [High score v]
else
switch costume to [High score_low v]
end
This script is running so fast that the sprite is constantly changing to the “High score” trophy costume. So when it makes a clone and it tries to switch to the correct costume it can't because its changing to the “High score” costume.

I suggest changing all these scripts:

if <(Low Quality) = [1]> then   
switch costume to [... v]
else
switch costume to [..._low v]
end

To these:

when I receive [LQ v]
switch costume to [... v]
when I receive [HQ v]
switch costume to [..._low v]

And add broadcasters for these messages in the “Low Detail” sprite to prevent this problem.
Or, remove the Low Detail option altogether because this project doesn't seem big enough to need it…

Hope this helps!
3XAY
Scratcher
28 posts

Weird Cloning Issues...

RobotChickens wrote:

I found the problem. Under the “High score sprite”
when I receive [tick v]
if <(Low Quality) = [1]> then
switch costume to [High score v]
else
switch costume to [High score_low v]
end
This script is running so fast that the sprite is constantly changing to the “High score” trophy costume. So when it makes a clone and it tries to switch to the correct costume it can't because its changing to the “High score” costume.

I suggest changing all these scripts:

if <(Low Quality) = [1]> then   
switch costume to [... v]
else
switch costume to [..._low v]
end

To these:

when I receive [LQ v]
switch costume to [... v]
when I receive [HQ v]
switch costume to [..._low v]

And add broadcasters for these messages in the “Low Detail” sprite to prevent this problem.
Or, remove the Low Detail option altogether because this project doesn't seem big enough to need it…

Hope this helps!
But if you look at my stats sprite, I did the EXACT same thing but it works…

Powered by DjangoBB