Discuss Scratch

Little_Mittle12345
Scratcher
100+ posts

Scratch Workaround Guide VII

_nix wrote:

I added a workaround for “mouse dragging this sprite”! That's the name I use for what you guys have been calling “this sprite holding”

Since getting it to work with the “set drag mode: draggable” block from the Sensing category was kinda tricky, I tried a few different approaches before settling on one which was more complicated but (as far as I can tell) always works. If you wanna check out those other methods and all the details, I made a demo project showing them off: Drag detection methods

Thanks for the discussion about this block!
What?
I suggested a workaround for a different version of sprite clicked and I didn’t even get idea of mouse dragging sprite.

bfiwurbviubr vkjrnrgiorbgouebijernerjo
e, No Flash version detectededw, No Flash version detecteddw, No Flash version detectedda, No Flash version detected, No Flash version detectedd, No Flash version detectedwa, No Flash version detectedd, No Flash version detecteds, No Flash version detectedd, No Flash version detectedawd, No Flash version detectedwasw
move ()ewd steps
move (aw) steps
move (w) steps
move (dewd) steps
move () steps
move (wad) steps
move () steps
move () steps
move () steps
yavuz61035
Scratcher
500+ posts

Scratch Workaround Guide VII

here's a workaround for "broadcast for only " if you have that broadcast receivers on everything

...
set [broadcast sprite v] to [stage]
broadcast [message69 v]

// In the stage...

when i receive [message69 v]
if <(broadcast sprite) = [stage]> then
...
end
if you also want more than 1 specific broadcast at the same time use lists

when green flag clicked
delete all of [broadcast sprites v] :: list
...
add [stage] to [broadcast sprites v]
broadcast [message69 v]
wait (0) seconds :: control // dont know if this is needed
delete (item # of [stage] in [broadcast sprites v] :: list) of [broadcast sprites v]

// In the stage...

when i receive [message69 v]
if <[broadcast sprites v] contains [stage]> then
...
end

Last edited by yavuz61035 (Nov. 17, 2022 07:51:33)


i am yavuz61035!

i like birds (especially budgies) | my studio is here! | a project i was working on, mine game! | pronouns: he/him/they/blabla ok just use anything please stop reading this part | my 100th post! | be moist wet | musicROCKS013 predicts the future

fun fact: my pfp has pride month forever
a link

little social experiment corner:
increase gen thingy:
gen: 14
gen: 14
gen: 11
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

Little_Mittle12345 wrote:

_nix wrote:

I added a workaround for “mouse dragging this sprite”! That's the name I use for what you guys have been calling “this sprite holding” (snip)
Thanks for the discussion about this block!
What?
I suggested a workaround for a different version of sprite clicked and I didn’t even get idea of mouse dragging sprite.
I'm not interested in adding different versions of existing Scratch blocks—they don't need workarounds, they already exist. I adapted the idea of detecting if the mouse is on top of and clicking (pressing down) the sprite, and made it into what I feel is a more unique boolean block: “is the mouse dragging this sprite”.

(This thread is specifically for workarounds to suggested blocks. That's why it's a sticky in the Suggestions directory. If a block were already part of Scratch, then nobody is really going to suggest it, so people aren't going to be looking for - or needing - a workaround. To be clear, I think there is a lot of fun and value in coming up with workarounds to existing blocks—it teaches more about how those blocks work and helps you think outside the box to come up with new solutions to blocks we take for granted—but those just aren't a fit for the purpose of this sticky.)

(edit: PS, if you find me replying to someone else's post but not your own, it doesn't mean I've forgotten about your post, it just takes me time to make complete replies and I don't have a lot of free time outside work! I try to reply to everything, especially new workaround suggestions… but those are also what take me the longest, lol, since they take the most thinking-through to make sure I'm considering the workaround fully!)

Last edited by _nix (Nov. 17, 2022 10:49:02)


══ trans autistic lesbian enbydoggirls // 16 17 18 19 20 21, she/they
sparrows one word to the paragraph // <3 // ~(quasar) nebula
Little_Mittle12345
Scratcher
100+ posts

Scratch Workaround Guide VII

_nix wrote:

Little_Mittle12345 wrote:

_nix wrote:

I added a workaround for “mouse dragging this sprite”! That's the name I use for what you guys have been calling “this sprite holding” (snip)
Thanks for the discussion about this block!
What?
I suggested a workaround for a different version of sprite clicked and I didn’t even get idea of mouse dragging sprite.
I'm not interested in adding different versions of existing Scratch blocks—they don't need workarounds, they already exist. I adapted the idea of detecting if the mouse is on top of and clicking (pressing down) the sprite, and made it into what I feel is a more unique boolean block: “is the mouse dragging this sprite”.

(This thread is specifically for workarounds to suggested blocks. That's why it's a sticky in the Suggestions directory. If a block were already part of Scratch, then nobody is really going to suggest it, so people aren't going to be looking for - or needing - a workaround. To be clear, I think there is a lot of fun and value in coming up with workarounds to existing blocks—it teaches more about how those blocks work and helps you think outside the box to come up with new solutions to blocks we take for granted—but those just aren't a fit for the purpose of this sticky.)

(edit: PS, if you find me replying to someone else's post but not your own, it doesn't mean I've forgotten about your post, it just takes me time to make complete replies and I don't have a lot of free time outside work! I try to reply to everything, especially new workaround suggestions… but those are also what take me the longest, lol, since they take the most thinking-through to make sure I'm considering the workaround fully!)
It’s of a Boolean of <this sprite clicked>

Last edited by Little_Mittle12345 (Nov. 17, 2022 19:51:52)


bfiwurbviubr vkjrnrgiorbgouebijernerjo
e, No Flash version detectededw, No Flash version detecteddw, No Flash version detectedda, No Flash version detected, No Flash version detectedd, No Flash version detectedwa, No Flash version detectedd, No Flash version detecteds, No Flash version detectedd, No Flash version detectedawd, No Flash version detectedwasw
move ()ewd steps
move (aw) steps
move (w) steps
move (dewd) steps
move () steps
move (wad) steps
move () steps
move () steps
move () steps
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

Little_Mittle12345 wrote:

_nix wrote:

Little_Mittle12345 wrote:

_nix wrote:

I added a workaround for “mouse dragging this sprite”! That's the name I use for what you guys have been calling “this sprite holding” (snip)
Thanks for the discussion about this block!
What?
I suggested a workaround for a different version of sprite clicked and I didn’t even get idea of mouse dragging sprite.
I'm not interested in adding different versions of existing Scratch blocks—they don't need workarounds, they already exist. I adapted the idea of detecting if the mouse is on top of and clicking (pressing down) the sprite, and made it into what I feel is a more unique boolean block: “is the mouse dragging this sprite”.
It’s of a Boolean of <this sprite clicked>
Oh okay. I guess I didn't really think of uses for that, which is my bad! I'll add it.

══ trans autistic lesbian enbydoggirls // 16 17 18 19 20 21, she/they
sparrows one word to the paragraph // <3 // ~(quasar) nebula
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

1080GBA wrote:

<(a) is an integer?::operators>
Workaround:
<(a) = (round(a))>
This suggestion got kinda lost in the woods (I forgot about it). I added it now, thank you!

I also added a workaround for “decimal (fractional) part of x” at the same time. Those are both near the related “round to nearest 100 / round to decimal digits” workarounds!

══ trans autistic lesbian enbydoggirls // 16 17 18 19 20 21, she/they
sparrows one word to the paragraph // <3 // ~(quasar) nebula
medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

_nix wrote:

1080GBA wrote:

<(a) is an integer?::operators>
Workaround:
<(a) = (round(a))>
This suggestion got kinda lost in the woods (I forgot about it). I added it now, thank you!

I also added a workaround for “decimal (fractional) part of x” at the same time. Those are both near the related “round to nearest 100 / round to decimal digits” workarounds!
<(x) is a number? ::operators>
Workaround:
<((x) * (1)) = (x)>

Medians bamboozled by 3.0 (version 3.0): https://scratch-mit-edu.ezproxy.canberra.edu.au/projects/979822351/
hi875230163394: You're similar to valve in that you both hate a certain number…
Scratch 0.x, 1.x, 2.x, 3.x and LogoBlocks Archives
Bamboozlement: https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/33739789
Describe favorite topics: https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/35764610/
SP community won against Fandom :P
Years on internet: 16 (very close to 16)
medians: Oh god not this utc - 12 thing again..
Fun_Cupcake_i81: What, were you expecting not to see the utc - 12 thing again? THE UTC - 12 THIGN ALWAYS RETURNS. ALWAYS.
medians: I knew it would happen. I was the one who started it last year.
Fun_Cupcake_i81: Well then if you didn't want it back maybe you need to time travel to last year and fix that

Oh wait if you could time travel I think we all know exactly when you would go-
user1: That picture is from 2.0. Now he’s at my house and is my pet.
user2: But this is medians we're talking about, so “from 2.0” can mean the same thing as “from five seconds ago”.

Detect Scratch version here
My other accounts: @selfexplanatory @modesties @chaircard @fireflyhero @dividendyield @colloids @radians @skeuamorphism @dihectogon @anglebisector @aau- @EditBlockColors @AdamantOrb @MoongeistBeam @festively @Ampharos_ @straightforwardness @interchangeably
i trolled redcat LOL






if you see this
{what method did you use::control hat
answer on profile ::motion
} ::operators

;
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

yavuz61035 wrote:

here's a workaround for "broadcast for only " if you have that broadcast receivers on everything
Wow, this is pretty awesome! I think the second part needs some extra testing, ‘cuz Scratch’s execution order—which scripts it evaluates first if you activate two scripts (like “when I receive”) at the exact same time—is a little wonky, and would probably have an impact here. It's more reliable to just use multiple variables for each broadcast message.

I added the first approach (with credits) though, and included some extra details and methods which you might find interesting. Thanks for sharing!

══ trans autistic lesbian enbydoggirls // 16 17 18 19 20 21, she/they
sparrows one word to the paragraph // <3 // ~(quasar) nebula
yavuz61035
Scratcher
500+ posts

Scratch Workaround Guide VII

i found a workaround for “delete (…) in (…)”
goin through the suggestions directory oh yeah

define delete (deleting) in (text)
set [i v] to [1]
set [output v] to [ ]
if <not <(length of (deleting)) = [0]>> then
repeat until <(i) > (length of (text))>
set [searching v] to [ ]
set [i2 v] to [0]
repeat until <(i2) > ((length of (deleting)) - (1))>
set [searching v] to (join (searching) (letter ((i) + (i2)) of (text))
change [i2 v] by (1)
end
if <not <(searching) = (deleting)>> then
set [out v] to (join (out) (searching))
end
change [i v] by (length of (deleting))
end
else
set [output v] to (text)
end

Last edited by yavuz61035 (Nov. 18, 2022 13:19:25)


i am yavuz61035!

i like birds (especially budgies) | my studio is here! | a project i was working on, mine game! | pronouns: he/him/they/blabla ok just use anything please stop reading this part | my 100th post! | be moist wet | musicROCKS013 predicts the future

fun fact: my pfp has pride month forever
a link

little social experiment corner:
increase gen thingy:
gen: 14
gen: 14
gen: 11
dihectogon
Scratcher
45 posts

Scratch Workaround Guide VII

Workarounds for:
<(x) is a string? ::operators>
1.
define (x) is a string?
set [result v] to [false]
if <((x) * (1)) = (x)> then
stop [this script v]
end
set [result v] to [true]
2.
define (x) is a string?
set [result v] to [false]
if <(x) = []> then
set [result v] to [true]
stop [this script v]
end
if <<(x) > [0]> and <not <([abs v] of (x)) = [0]>>> then
stop [this script v]
else
if <(x) < [0]> then
stop [this script v]
else
if <(x) = [0]> then
stop [this script v]
end
end
end
set [result v] to [true]

Main: @medians
What is a @dihectogon?
A dihectogon is a 200-sided polygon. Pretty useless fact.
VG_JamesThe2nt
Scratcher
8 posts

Scratch Workaround Guide VII

woah these are cool
Little_Mittle12345
Scratcher
100+ posts

Scratch Workaround Guide VII

Workaround for win the unit of 10
repeat (unit)
repeat (Unit)
Do something
end
end

bfiwurbviubr vkjrnrgiorbgouebijernerjo
e, No Flash version detectededw, No Flash version detecteddw, No Flash version detectedda, No Flash version detected, No Flash version detectedd, No Flash version detectedwa, No Flash version detectedd, No Flash version detecteds, No Flash version detectedd, No Flash version detectedawd, No Flash version detectedwasw
move ()ewd steps
move (aw) steps
move (w) steps
move (dewd) steps
move () steps
move (wad) steps
move () steps
move () steps
move () steps
randomguy3513
Scratcher
1000+ posts

Scratch Workaround Guide VII

when this sprite clicked
if <Held down for (2) seconds :: sensing> then
...
end
when this sprite clicked
wait (2) secs
wait until <mouse down>
...


(Male) (He/Him) (2000+ posts) (5 Years)
Banner by depresso-boiyo, check him out!
Ctrl+shift+down to check out my projects!


Thanks for scrolling; if you like what I do, please follow me!
5_g
Scratcher
1000+ posts

Scratch Workaround Guide VII

Does anyone have a "rotate around (x) (y)" block?

Pro forumer, Scratch Empires I OG


IMPORTANT INFO ON SO2 FOR ANYONE WHO MISSED IT
cookieclickerer33
Scratcher
1000+ posts

Scratch Workaround Guide VII

Idk if this helps but you can put the
(item (1 v) of [list v] :: list)
Inside of operatior slots
if (item (1 v) of [list v] :: list) then

end
This may be because it’s reusing some code from
<[List v] contains [thing] ?>
And they forgot to remove the {is bool=true} part form the blocks code when adding it

Last edited by cookieclickerer33 (Dec. 20, 2022 19:38:38)


Just a silly little girly :3

Deltarune chapter 3 when
owlover2010
Scratcher
100+ posts

Scratch Workaround Guide VII

Where's the workarounds for these?

think [Hmmm...] when <mouse down?> :: looks
say [Hello] for (2) secs
show variable [Variable v]
when sprite (answer) clicked :: events hat
...
when backdrop switches to [hello v]
pen up
say [Hi!]
move (10) steps
say (costume #) and (size) and (backdrop name) :: looks
when this sprite clicked and <key [+ v] pressed?> :: events hat
if <key [z v] pressed?> then
pen up
change [(volume)(distance to [ v]) v] effect by (25) :: looks
ask [What's your name?] and wait
change [colour v] effect by (25) // Australian spelling
set size to (1000000) % without exceeding max size :: looks
when this sprite clicked
end scripts for this sprite :: control

Last edited by owlover2010 (Dec. 24, 2022 00:11:04)


Hello, I am @owlover2010 .
Generation 4: the first time you see this copy and paste it on top of your sig in the scratch forums and increase generation by 1. Social experiment.

mtech22 wrote:

aII toasters toast toast, but what happens when there are no longer toasters being produced? will their technology simply become obsolete, with humans moving onto bigger, better things? will toast become a distant memory, written in textbooks of the future as foods us simpler generations ate? who's to say! society is constantly moving, changing, evolving, ideas being built upon, improved upon, theories being proven or disproven. are we but a blip on the timeline? sure, our names may not be remembered, but that's not the point. you can make a change. you can make a difference. you can make the world better, even if you don't know yet. and the first step is to go for it. even if you are afraid of failure. going back to the example of toasters, do you know off the top of your head who invented them? no? have you used one? probably. so, even if you don't remember my name, if I was able to help awnser your question, that is enough. if I was able to help you, even in the slightest way, this could push you to continue with scratch and not give up after the program crashes, and maybe one day learn other programming languages and change the world. everything is a cause and effect reaction, new inventions lead to the technology of the future, and even as the generations of the past are slowly forgotten, their influence lives on to this day, affecting how the world eventually turned out and how it will be for generations to come.

and, without toasters, we wouldn't have toast.
-_RedGamer_-
Scratcher
52 posts

Scratch Workaround Guide VII

forever if <>
Workaround:
forever
if <> then

end
end

Highlight my signature then press shift + down arrow to see more
Red
I haven't always had this username, I contacted the scratch team to change my username and they did.
when green flag clicked
forever
if <(-_RedGamer_- ) = [Awesome]> then
go to [His profile]


else
set [-_RedGamer_-] to [Awesome]
end
end
forever
Imagine ::#0000ff
Program ::#bb00ff
Share ::#00ff00
end
You Can Follow Me Here
————————I am a gamer———————————–
here is the scratch wiki you need to click it Scratch Wiki





























Hi, if you see this, your cool
medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

owlover2010 wrote:

Where's the workarounds for these?

... ::grey
Some of those already exist.

owlover2010 wrote:

think [Hmmm...] when <mouse down?> :: looks
if <mouse down?> then
think [Hmmm...]
end

owlover2010 wrote:

when backdrop switches to [hello v]
...
say (costume #) and (size) and (backdrop name) :: looks
say (costume #) for (2) secs
say (size) for (2) secs
say (backdrop name) for (2) secs
when this sprite clicked and <key [+ v] pressed?> :: events hat
if <key [z v] pressed?> then
...
end
when this sprite clicked
end scripts for this sprite :: control //this is just stop other scripts in sprite..
when this sprite clicked
if <key (join [+] []) pressed?> then
...
end
set size to (1000000) % without exceeding max size :: looks
This wouldn't be allowed, and you can just swap costumes.

Medians bamboozled by 3.0 (version 3.0): https://scratch-mit-edu.ezproxy.canberra.edu.au/projects/979822351/
hi875230163394: You're similar to valve in that you both hate a certain number…
Scratch 0.x, 1.x, 2.x, 3.x and LogoBlocks Archives
Bamboozlement: https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/33739789
Describe favorite topics: https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/35764610/
SP community won against Fandom :P
Years on internet: 16 (very close to 16)
medians: Oh god not this utc - 12 thing again..
Fun_Cupcake_i81: What, were you expecting not to see the utc - 12 thing again? THE UTC - 12 THIGN ALWAYS RETURNS. ALWAYS.
medians: I knew it would happen. I was the one who started it last year.
Fun_Cupcake_i81: Well then if you didn't want it back maybe you need to time travel to last year and fix that

Oh wait if you could time travel I think we all know exactly when you would go-
user1: That picture is from 2.0. Now he’s at my house and is my pet.
user2: But this is medians we're talking about, so “from 2.0” can mean the same thing as “from five seconds ago”.

Detect Scratch version here
My other accounts: @selfexplanatory @modesties @chaircard @fireflyhero @dividendyield @colloids @radians @skeuamorphism @dihectogon @anglebisector @aau- @EditBlockColors @AdamantOrb @MoongeistBeam @festively @Ampharos_ @straightforwardness @interchangeably
i trolled redcat LOL






if you see this
{what method did you use::control hat
answer on profile ::motion
} ::operators

;
medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

Riles_mun12345 wrote:

forever if <> {

} ::control
Fixed the color so it looks like 1.x now.
And here are workarounds for # of costumes I came up with:

Medians bamboozled by 3.0 (version 3.0): https://scratch-mit-edu.ezproxy.canberra.edu.au/projects/979822351/
hi875230163394: You're similar to valve in that you both hate a certain number…
Scratch 0.x, 1.x, 2.x, 3.x and LogoBlocks Archives
Bamboozlement: https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/33739789
Describe favorite topics: https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/35764610/
SP community won against Fandom :P
Years on internet: 16 (very close to 16)
medians: Oh god not this utc - 12 thing again..
Fun_Cupcake_i81: What, were you expecting not to see the utc - 12 thing again? THE UTC - 12 THIGN ALWAYS RETURNS. ALWAYS.
medians: I knew it would happen. I was the one who started it last year.
Fun_Cupcake_i81: Well then if you didn't want it back maybe you need to time travel to last year and fix that

Oh wait if you could time travel I think we all know exactly when you would go-
user1: That picture is from 2.0. Now he’s at my house and is my pet.
user2: But this is medians we're talking about, so “from 2.0” can mean the same thing as “from five seconds ago”.

Detect Scratch version here
My other accounts: @selfexplanatory @modesties @chaircard @fireflyhero @dividendyield @colloids @radians @skeuamorphism @dihectogon @anglebisector @aau- @EditBlockColors @AdamantOrb @MoongeistBeam @festively @Ampharos_ @straightforwardness @interchangeably
i trolled redcat LOL






if you see this
{what method did you use::control hat
answer on profile ::motion
} ::operators

;
medians
Scratcher
1000+ posts

Scratch Workaround Guide VII

Roolfierblue15064 wrote:

when green flag clicked
say [scratch is weird] for (2) secs
If you want to test the scratchblocks plugin, go here.

medians wrote:

Riles_mun12345 wrote:

Fixed the color so it looks like 1.x now.
And here are workarounds for # of costumes I came up with:
(LARGE IMAGE ALERT)
Oh and, replace setting the # of backdrops var to 0 with the same thing but 1, and remove the + 1 thing.

Last edited by medians (Jan. 1, 2023 22:48:52)


Medians bamboozled by 3.0 (version 3.0): https://scratch-mit-edu.ezproxy.canberra.edu.au/projects/979822351/
hi875230163394: You're similar to valve in that you both hate a certain number…
Scratch 0.x, 1.x, 2.x, 3.x and LogoBlocks Archives
Bamboozlement: https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/33739789
Describe favorite topics: https://scratch-mit-edu.ezproxy.canberra.edu.au/studios/35764610/
SP community won against Fandom :P
Years on internet: 16 (very close to 16)
medians: Oh god not this utc - 12 thing again..
Fun_Cupcake_i81: What, were you expecting not to see the utc - 12 thing again? THE UTC - 12 THIGN ALWAYS RETURNS. ALWAYS.
medians: I knew it would happen. I was the one who started it last year.
Fun_Cupcake_i81: Well then if you didn't want it back maybe you need to time travel to last year and fix that

Oh wait if you could time travel I think we all know exactly when you would go-
user1: That picture is from 2.0. Now he’s at my house and is my pet.
user2: But this is medians we're talking about, so “from 2.0” can mean the same thing as “from five seconds ago”.

Detect Scratch version here
My other accounts: @selfexplanatory @modesties @chaircard @fireflyhero @dividendyield @colloids @radians @skeuamorphism @dihectogon @anglebisector @aau- @EditBlockColors @AdamantOrb @MoongeistBeam @festively @Ampharos_ @straightforwardness @interchangeably
i trolled redcat LOL






if you see this
{what method did you use::control hat
answer on profile ::motion
} ::operators

;

Powered by DjangoBB