Discuss Scratch

freddyfearful
Scratcher
22 posts

clones wont spawn

basically I have (similar to) this code:

when I receive [something]
if <> then

else
delete this clone
end
code that makes around 260 clones

the problem is that the clones don't delete fast enough so they hit the cap of 300 clones with there being less than 260 in the next frame, BUT if I add a wait 0 seconds than every clone disapears for a frame which looks ugly for what I'm trying to do

Please help

Last edited by freddyfearful (Feb. 7, 2022 02:59:48)

CringeyCracker
Scratcher
34 posts

clones wont spawn

instead of the
when I receive [something v]
use
when I start as a clone

when I receive [Follower]
say [Yay!]
broadcast [Celebrate!]
freddyfearful
Scratcher
22 posts

clones wont spawn

I'm not that dumb D:

the problem is that the
code that makes around 260 clones
DOESN'T make 260 clones because of the previous 260 clones that can't seem to be deleted fast enough, but if I wait for them to delete it makes it look ugly

Last edited by freddyfearful (Feb. 7, 2022 03:16:29)

CringeyCracker
Scratcher
34 posts

clones wont spawn

oh then try a block without refresh

define something 
if <> then


else
delete this clone
end
broadcast [make clones v]

Last edited by CringeyCracker (Feb. 7, 2022 03:18:31)


when I receive [Follower]
say [Yay!]
broadcast [Celebrate!]
freddyfearful
Scratcher
22 posts

clones wont spawn

.

Last edited by freddyfearful (Feb. 7, 2022 04:02:20)

freddyfearful
Scratcher
22 posts

clones wont spawn

CringeyCracker wrote:

oh then try a block without refresh

define something 
if <> then


else
delete this clone
end
broadcast [make clones v]
doesn't work, it had no refresh in the first place
freddyfearful
Scratcher
22 posts

clones wont spawn

I solved it! ;D

when I receive [delete]
broadcast [something that create clones]
delete this clone

when I receive [something that create clones]
create hundreds of clone babies

Last edited by freddyfearful (Feb. 7, 2022 04:54:22)

deck26
Scratcher
1000+ posts

clones wont spawn

Even better, just do this

when I receive [ v]
if <(1) = (1)> then
delete this clone
end
code to do the rest and create new clones

Only the sprite will get past the if block since it can't delete itself.
freddyfearful
Scratcher
22 posts

clones wont spawn

deck26 wrote:

Even better, just do this

when I receive [ v]
if <(1) = (1)> then
delete this clone
end
code to do the rest and create new clones

Only the sprite will get past the if block since it can't delete itself.
actually I put a stop this script code in the if for if the clone shouldn't get deleted
if <(something) = (1)>
stop [this script]
else
delete this clone
end

Last edited by freddyfearful (Feb. 7, 2022 16:28:56)

freddyfearful
Scratcher
22 posts

clones wont spawn

deck26 wrote:

Even better, just do this

when I receive [ v]
if <(1) = (1)> then
delete this clone
end
code to do the rest and create new clones

Only the sprite will get past the if block since it can't delete itself.
KGSJIJFIASIOJ why does no one care to figure out or test what they're gonna post? the WHOLE problem was that THAT (above) doesn't work JIO:AJOFSOI (the reason why it didn't work (if you read u woulda known this) is because the clones stay just long enough to stay and keep the clone limit up preventing new ones spawning)

Last edited by freddyfearful (Feb. 7, 2022 16:52:33)

deck26
Scratcher
1000+ posts

clones wont spawn

freddyfearful wrote:

deck26 wrote:

Even better, just do this

when I receive [ v]
if <(1) = (1)> then
delete this clone
end
code to do the rest and create new clones

Only the sprite will get past the if block since it can't delete itself.
KGSJIJFIASIOJ why does no one care to figure out or test what they're gonna post? the WHOLE problem was that THAT (above) doesn't work JIO:AJOFSOI (the reason why it didn't work (if you read u woulda known this) is because the clones stay just long enough to stay and keep the clone limit up preventing new ones spawning)
So add a wait 0 secs before the code you want to run so all the clones have run the receiver and been deleted before the new ones are created.

Powered by DjangoBB