Discuss Scratch

Little_Mittle12345
Scratcher
100+ posts

Scratch Workaround Guide VII

k0d3rrr wrote:

graham3078 wrote:

Could you add a workaround for “when stop sign clicked”
Such as?
-
There are two methods (with reset timer and without reset timer).

Method 1 (thanks to the Scratch Wiki)
when green flag clicked
forever
reset timer
end

when [timer v] > (0.1)
...

Method 2
when green flag clicked
forever
set [timer v] to (timer)
end

when [timer v] > (timer:: variables)
...
Method 3 (real workaround)
when green flag clicked
forever
reset timer
end
when [timer v] > (0.1)
do something :: #080808

when [timer v] > (0.1)
forever
reset timer
-ErrorPurpl_157
Scratcher
100+ posts

Scratch Workaround Guide VII

graham3078 wrote:

Could you add a workaround for “when stop sign clicked”

when green flag clicked
forever
set [Stop v] to ((Timer)+[1]) :: variables
end


when [Timer v] > (Stop)

Last edited by -ErrorPurpl_157 (Oct. 15, 2022 02:56:14)

Little_Mittle12345
Scratcher
100+ posts

Scratch Workaround Guide VII

workaround for
<this sprite holding?:: sensing
when this sprite clicked
set [l v] to [1]
wait until <not <mouse down?>
set [l v] to (0)
<(l) = (1)>// sprite holding?

Last edited by Little_Mittle12345 (Oct. 26, 2022 21:11:42)

randomguy3513
Scratcher
1000+ posts

Scratch Workaround Guide VII

Little_Mittle12345 wrote:

workaround for
<this sprite clicked?:: sensing
when this sprite clicked
set [l v] to [1]
wait until <mouse down?>
set [l v] to (0)
<(l) = (1)>// sprite clicked?
Actually, that doesn't work you need a Not <> boolean
Little_Mittle12345
Scratcher
100+ posts

Scratch Workaround Guide VII


Little_Mittle12345 wrote:

workaround for
<this sprite clicked?:: sensing
when this sprite clicked
set [l v] to [1]
wait (0) secs
set [l v] to (0)
<(l) = (1)>// sprite clicked?

Last edited by Little_Mittle12345 (Oct. 26, 2022 21:10:52)

modesties
Scratcher
100+ posts

Scratch Workaround Guide VII

(backdrop count ::looks)
Workaround:
define backdrop count
set [save v] to (backdrop [number v] ::looks)
switch backdrop to (join [0] []) //second input is blank
set [backdrops v] to (backdrop [number v] ::looks)
switch backdrop to (save)
Can do something similar if you want the number of costumes
1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

WindowsMeRules2000 wrote:

Can I make the 8th workaround guide?
i was competing for the 6th when a dude name Nezon took it and did nothing then gave it to this guy. the former guides' format was untidy and was triggering me as a perfectionist. Yeah. So i guess i will have to wait a year or two for the next takeover

modesties wrote:

(backdrop count ::looks)
Workaround:
define backdrop count
set [save v] to (backdrop [number v] ::looks)
switch backdrop to (join [0] []) //second input is blank
set [backdrops v] to (backdrop [number v] ::looks)
switch backdrop to (save)
Can do something similar if you want the number of costumes
i did that already

Last edited by 1080GBA (Nov. 8, 2022 15:23:53)

1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

Little_Mittle12345 wrote:

workaround for
<this sprite holding?:: sensing
when this sprite clicked
set [l v] to [1]
wait until <not <mouse down?>
set [l v] to (0)
<(l) = (1)>// sprite holding?
COME ON BRUH ITS NOT THAT COMPLICATED
<this sprite holding?::sensing>

<<touching [mouse-pointer v] ?> and <mouse down?>>
dont overthink it brooooooooo
1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

-ErrorPurpl_157 wrote:

graham3078 wrote:

Could you add a workaround for “when stop sign clicked”

when green flag clicked
forever
set [Stop v] to ((Timer)+[1]) :: variables
end


when [Timer v] > (Stop)
when [timer v] > (0)
reset timer //nothing is allowed to be attached below

when [timer v] > (0)
do something::#888888
Little_Mittle12345
Scratcher
100+ posts

Scratch Workaround Guide VII

1080GBA wrote:

Little_Mittle12345 wrote:

workaround for
<this sprite holding?:: sensing
when this sprite clicked
set [l v] to [1]
wait until <not <mouse down?>
set [l v] to (0)
<(l) = (1)>// sprite holding?
COME ON BRUH ITS NOT THAT COMPLICATED
<this sprite holding?::sensing>

<<touching [mouse-pointer v] ?> and <mouse down?>>
dont overthink it brooooooooo
actually most people think thats the workaround it doesent work perfectly
1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

k0d3rrr wrote:

graham3078 wrote:

Could you add a workaround for “when stop sign clicked”
Such as?
-
There are two methods (with reset timer and without reset timer).

Method 1 (thanks to the Scratch Wiki)
when green flag clicked
forever
reset timer
end

when [timer v] > (0.1)
...

Method 2
when green flag clicked
forever
set [timer v] to (timer)
end

when [timer v] > (timer:: variables)
...
wrong
your code will start as soon as the programme starts
you're basically doing
When project is running::events hat
1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

Little_Mittle12345 wrote:

1080GBA wrote:

Little_Mittle12345 wrote:

workaround for
<this sprite holding?:: sensing
when this sprite clicked
set [l v] to [1]
wait until <not <mouse down?>
set [l v] to (0)
<(l) = (1)>// sprite holding?
COME ON BRUH ITS NOT THAT COMPLICATED
<this sprite holding?::sensing>

<<touching [mouse-pointer v] ?> and <mouse down?>>
dont overthink it brooooooooo
actually most people think thats the workaround it doesent work perfectly
oh ‘this sprite ’ holding what
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

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!
1080GBA
Scratcher
500+ posts

Scratch Workaround Guide VII

sticky takeover when

_nix wrote:

!
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

1080GBA wrote:

sticky takeover when

_nix wrote:

!
What do you mean?
INSERT-USER_NAME
Scratcher
1000+ posts

Scratch Workaround Guide VII

I found a workaround for the nonexistent when <> block. I'm not sure where it would go, but I'm putting it here just in case. This is the workaround:

when [timer v] > ((timer) - <key [space v] pressed?>
yavuz61035
Scratcher
500+ posts

Scratch Workaround Guide VII

there needs to be a minor change here:

scratch workaround guide 6 wrote:

…Remember that some effects, like color, “loop” at a certain point - 100 is completely the opposite colors, 200 is back to normal, so 200 and 0 make the same result. You can use the “mod” operators block to keep the value within a specific range, as long as you know at what value it loops…

200 is actually red and 0 has no effect
you can see this by how white tints red slightly
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

yavuz61035 wrote:

there needs to be a minor change here:

scratch workaround guide 6 wrote:

…Remember that some effects, like color, “loop” at a certain point - 100 is completely the opposite colors, 200 is back to normal, so 200 and 0 make the same result. You can use the “mod” operators block to keep the value within a specific range, as long as you know at what value it loops…

200 is actually red and 0 has no effect
you can see this by how white tints red slightly
Oh wow, this is interesting—I never noticed before. I should have checked that! It looks like the “color” effect overall tints anything, including white, with the color specified. Zero is just the special “disable me” value: it WOULD be the same effect as 200, which you can see by how 200 = 400 = 600 (and 50 = 250 = 450 = 650) etc. I'll see if I can work a note about this in. Thanks!
_nix
Scratcher
1000+ posts

Scratch Workaround Guide VII

INSERT-USER_NAME wrote:

I found a workaround for the nonexistent when <> block. I'm not sure where it would go, but I'm putting it here just in case. This is the workaround:

when [timer v] > ((timer) - <key [space v] pressed?>
Okay, this is actually really cool. :D

I've added it, with credits, to the top of the Events & Control section! Since it's the first custom Events block. Thank you!
INSERT-USER_NAME
Scratcher
1000+ posts

Scratch Workaround Guide VII

_nix wrote:

INSERT-USER_NAME wrote:

I found a workaround for the nonexistent when <> block. I'm not sure where it would go, but I'm putting it here just in case. This is the workaround:

when [timer v] > ((timer) - <key [space v] pressed?>
Okay, this is actually really cool. :D

I've added it, with credits, to the top of the Events & Control section! Since it's the first custom Events block. Thank you!
Alright, you're welcome!

Last edited by INSERT-USER_NAME (Nov. 16, 2022 22:41:31)

Powered by DjangoBB